Cross compile perl

來源:互聯網
上載者:User

標籤:perl   compile   

Alex Suykov had do some work for this purpose, and my compile script is 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! :
Do not add --target-tools-prefix=arm-none-linux-gnueabi- into you configure arguments, otherwise you will get some strange error during the configure stage.

Installation script file:

unset LD_LIBRARY_PATH LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDEexport PATH=$PATH:/home/username/arm/gcc/binLDFLAGS=‘-L/home/username/arm/dist/lib‘ LD=/home/username/arm/gcc/bin/arm-none-linux-gnueabi-ld AR=/home/username/arm/gcc/bin/arm-none-linux-gnueabi-ar RANLIB=/home/username/arm/gcc/bin/arm-none-linux-gnueabi-ranlib NM=/home/username/arm/gcc/bin/arm-none-linux-gnueabi-nm READELF=/home/username/arm/gcc/bin/arm-none-linux-gnueabi-readelf OBJDUMP=/home/username/arm/gcc/bin/arm-none-linux-gnueabi-objdump CC=/home/username/arm/gcc/bin/arm-none-linux-gnueabi-gcc CXX=/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 you device, and check the result by run 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

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

Cross compile perl

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.