Alex Suykov had do some work for this purpose, and my compile script was based on her patch.
Stepsstep 1:
Download Perl source code from Perl ' s official site, such as:
wget http://www.cpan.org/src/5.0/perl-5.20.2.tar.gz
Step 2:
Download the corresponding Perl cross compile patch from Alex Suykov ' s site.
wget https://raw.github.com/arsv/perl-cross/releases/perl-5.20.2-cross-0.9.7.tar.gz
Step 3:
Extract the source code to the some diretory.
Tar xvzf perl-5.20.2.tar.gz
Tar xvzf perl-5.20.2-cross-0.9.7.tar.gz
Step 4:
Edit the Configure script below to generate the Makefile, replace the paths to your own, such as:
/home/username/arm/gcc/bin
/home/username/arm/dist/lib
/home/username/arm/dist
...
Be careful! :
Don't add into your --target-tools-prefix=arm-none-linux-gnueabi-
configure arguments, otherwise you'll get some strange error during the Configure stage.
Installation script file:
unsetLd_library_path Library_path CPath C_include_path Pkg_config_path Cplus_include_path INCLUDEExportPATH=$PATH:/home/username/arm/gcc/binLdflags='-l/home/username/arm/dist/lib ' LD=/home/username/ARM/GCC/bin/arm-none-linux-gnueabi-ldAR=/home/username/ARM/GCC/bin/arm-none-linux-gnueabi-arRanlib=/home/username/ARM/GCC/bin/arm-none-linux-gnueabi-ranlibNM=/home/username/ARM/GCC/bin/arm-none-linux-gnueabi-nmreadelf=/home/username/ARM/GCC/bin/arm-none-linux-gnueabi-readelfOBJDUMP=/home/username/ARM/GCC/bin/arm-none-linux-gnueabi-objdumpCC=/home/username/ARM/GCC/bin/arm-none-linux-gnueabi-gccCXX=/home/username/ARM/GCC/bin/arm-none-linux-gnueabi-g++CFLAGS='--sysroot=/home/username/arm/gcc/arm-none-linux-gnueabi/sys-root './configure--target=arm-linux--host=arm-linux-gnueabi--prefix=/home/username/arm/dist
Step 3:
After the Configure stage finish successfully.
Run the Make command to start the Make stage:
Make-j4
Step 4:
After the make stage finish successfully.
Run the install command to start the install stage:
Make install
Step 5:
Copy the cross compile result to your device, and check the result by run of the Perl from console:
Perl–version
If u get the correct version info, u succeed!
REF:
1. http://arsv.github.io/perl-cross/index.html
2. http://www.cpan.org/src/5.0/perl-5.20.2.tar.gz
2. https://github.com/SynoCommunity/spksrc/issues/138
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Cross Compile Perl