Jul 20, 2009

How to cross compile Perl

Download Perl from www.perl.org and extract it into a folder
The go to that folder and type
sh ./Configure -des -Dusecrosscompile \
-Dtargethost=[ip of the target] \
-Dtargetdir=/cross/bin \
-Dtargetuser=[user to SSH to the target]
-Dtargetarch=arm-linux \
-Dcc=/opt/crosstool/gcc-3.4.1-glibc-2.3.3/arm-9tdmi-linux-gnu/bin/arm-9tdmi-linux-gnu-gcc \
-Dincpth=/opt/crosstool/gcc-3.4.1-glibc-2.3.3/arm-9tdmi-linux-gnu/include \
-Dusrinc=/opt/crosstool/gcc-3.4.1-glibc-2.3.3/arm-9tdmi-linux-gnu/include \
-Dlibpth=/opt/crosstool/gcc-3.4.1-glibc-2.3.3/arm-9tdmi-linux-gnu/lib  
And then type make to build the Perl

The other solution which is simpler is as following
Download the http://www.rootshell.be/~axs/perl/ and extract it into existing Perl source code (5.10.0)

Then configure and compile it:
./configure --target=$target --sysroot=/mnt/target
make
make DESTDIR=... install

Post a Comment