Cross compile perl

Alex Suykov had do some work for this purpose, and my compile script is based on her patch.

Steps

Step 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 INCLUDE
export PATH=$PATH:/home/username/arm/gcc/bin

LDFLAGS=‘-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

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-12-23 00:21:50

Cross compile perl的相关文章

cross compile vlc 播放器

上一篇文章介绍了如何交叉编译 FFmpeg ,继续介绍  VLC播放器  交叉编译 . 首先下载 vlc 源码  我用的是 2.2.6  地址 : http://mirrors.neusoft.edu.cn/videolan/vlc/2.2.6/vlc-2.2.6.tar.xz  解压,进入目录. 然后  设置 ffmpeg路径  ,上一章把ffmpeg 装在了   --prefix=/exports/rfs/usr   对应得在 交叉工具 脚本 中添加 export PKG_CONFIG_PA

build-qt.sh(Cross compile in Linux for Windows)

#!/bin/bash set -e MINGW=${MINGW:-${ARCH:-x86_64}-w64-mingw32} PREFIX=${PREFIX:-usr} WORKSPACE=${WORKSPACE:-$(pwd)} TARGET=${TARGET:-${WORKSPACE}} WINREQ=${WINREQ:-${TARGET}/${PREFIX}} BUILD_NUMBER=${BUILD_NUMBER:-0} ARCH=${ARCH:-${MINGW%%-*}} BINDIR

cross compile the libusb and examples

[Author: Bo Shen <[email protected]>] Assume you have the cross toolchain installed on your Linux host, here I use ubuntu 12.04 with arm-linux-gnueabihf-gcc installed. (if not, here is the command) --->8--- For the SoC support hard float point $

[cross compile]cygwin和mingw

Unix下编译通过的C代码,在win32下编译是不能通过的 ,当然Unix 和win32的API都是符合标准C,也就是说,大多数函数调用在unix和win32下是相同的.但是,unix有自己一些独特的API(如fork,spawn,signals,select,sockets等),如果代码中使用了这些API,在win32下当然找不到对应的库.    但是,这些API的功能在win32中也能实现,也许你已经发现了一个能让window编译Unix风格代码的方法:    1.修改编译器,让window

static cross compile gtk-2.16.6+gtk-directfb+arm-linux (arm-linux-gcc-3.4.4+glib-2.3.5)

----------------------------------------------------------------------- In Ubuntu 10.4 Desktop and "root" login apt-get install build-essential libncurses5-dev apt-get install autoconf apt-get install libtool apt-get install gettext apt-get inst

Odroid cross compile setup

参考 http://odroid.com/dokuwiki/doku.php?id=en:xu3_building_kernel 1. 安装交叉编译工具 按照参考下载http://dn.odroid.com/ODROID-XU/compiler/arm-eabi-4.6.tar.gz #arm-eabi- gcc cannot execute binary file 查看文件是elf 64-bit ,Linux 是32bit的 [email protected]:/opt/arm-eabi-4.

am335x system upgrade rootfs for dhcpcd cross compile(十三)

dhcpcd移植 [目的] 移植dhcpcd的目是在AM335X开发板上使用dhcp功能,获取WAN口设备的IP,并且可以通过参数指定其matric,matric值越小,其优先级越高.如设备可以以太网,WIFI,4G上网时,可定制外网功能,以太网优先级最高,WIFI次之,4G优先级最低. [环境] 1.  Ubuntu 16.04发行版 2.  MC183平台 3.  交叉编译器arm-linux-gnueabihf-gcc-4.7.3 [步骤] 1.下载dhcpcd-6.7.1.tar.gz源

使用sh-x调试shell脚本

参考:http://blog.chinaunix.net/uid-20564848-id-73502.html 1. 通过sh -x 脚本名  #显示脚本执行过程2.脚本里set -x选项,轻松跟踪调试shell脚本 [以下字段转自:http://linux.chinaitlab.com/SHELL/727128_4.html]"-x"选项可用来跟踪脚本的执行,是调试shell脚本的强有力工具."-x"选项使shell在执行脚本的过程中把它实际执行的每一个命令行显示

Kernel compiling for Pi 2

https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=101188&p=807579&hilit=cross+compile+pi+source+code#p807579 by Seabug » Sat Feb 21, 2015 4:20 pm Hi, I am trying to compile the Raspbian kernel for my new Pi 2 ( I need support for ELO / E