Cross Compile Perl

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.