linuxarmcross-compilingghostscriptlibharu

Cross Compile GhostPDL for ARM9


I am trying to cross compile GhostPDL-9.06 (this and any higher version). I intend to use pcl6 on a MOXA arm9 linux computer. The provided tool chain compiles fine. However, the binary ends up running on the build machine instead of the target. It seems I am not doing something right with the arch.h file. There are cross compiling instructions at the bottom of the page http://ghostscript.com/FAQ.html. They are a bit vague for my level of experience. I have searched far and wide and found more instructions at the top of the page by jroo at http://ghostscript.com/irclogs/2014/03/12.html but I still get stuck.

My configure command is: ./configure CC=arm-linux-gcc CCLD=arm-linux-gcc CCAUX=gcc --host=arm-linux --target=arm-linux --without-x

the libtiff configuration errors but after the make, I still end up with a pcl6 binary that functions fine only on the ubuntu i686 machine.

I am stuck on the "manually generate arch.h"

Does someone have any details on cross compiling that provides a few more instructions?


Solution

  • I now have a pcl6 binary that was cross-compiled and runs on a MOXA ART ARM9 32-bit RISC CPU. At least the features I need are working.

    Here is the command line to create a password secured pdf file with 62 lines per page:

    ./pcl6 -J'@PJL SET FORMLINES=62' \
    -dNOPAUSE -sDEVICE=pdfwrite \
    -sOwnerPassword=yourpassword \
    -dEncryptionR=3 -dPermissions=-3884 \
    -sOutputFile=yourfile.pdf yourfile.pcl
    

    I am not completely sure why I got the cross-compiling to work, but it did and here is how I cross-compiled ghostpdl-9.14:

    As before, I still pass the configuration parameters:

    The main problem was creating the make files because the configuration would not complete. The libtiff configuration would error. I edited the shell script file "configure" in the top directory of the ghostpdl-9.14 folder. On line 5255, I replaced the "$SUBCONFIG_OPTS" with "

    CC=arm-linux-gcc CCLD=arm-linux-gcc CCAUX=gcc --host=arm-linux --target=arm-linux --without-x
    

    I did this because for some reason, the libtiff configuration would would not receive the parameters from the main configuration.

    After this edit, the libtiff configuration would finally start and run towards the end. But, there was still an error regarding the BIGENDIAN test. So I replaced the lines 5716 through 5719 with a message

    $as_echo "Ignore BIGENDIAN Test";
    

    As a result, the configuration completed and created the necessary make files.

    After making the two edits to the "configure" file, run the configuration command (from the top ghostpdl-9.14 directory):

    ./configure CC=arm-linux-gcc CCLD=arm-linux-gcc \
    CCAUX=gcc --host=arm-linux --target=arm-linux --without-x
    

    After the configuration completes, pass the cross-complile requirements with the make command:

    make CC=arm-linux-gcc CCLD=arm-linux-gcc CCAUX=gcc
    

    Maybe this isn't necessary, but since it worked, I am posting it.

    My first test was to see if the build computer ran the pcl6 binary. Once the message "cannot execute binary file", I knew that I had some partial success. After transferring it to the ARM9, and running pcl6 with no options, the terminal screen provided the help information which told me the binary was successfully compiled.

    After hours upon hours of searching and experimenting, perhaps this may help someone with the same goal.

    Cheers!