- 论坛徽章:
- 0
|
理清思路其实交互编译就是把x.86下程序用arm版本的编译器重新编译。存在兼容问题所以之需要在原来x.86下可以通过的
代码重新使用arm gcc make 即可下面是大概的步骤
How to Apache Cross Compile
OS : CentOS
Kernel : 2.6
Machine : x.86
Target arm
OS : linux
Kernel : 2.4.18
Machine : arm (TS-7250)
#1. Download apache file at www.apache.org
version apache_1.3
#2. unzip software
[root@wc02 utils]# tar xvfz apache_1.3.33.tar.gz
#3. change to two version GCC files
[root@wc02 utils]# cp apache_1.3.33 host_apache_1.3.33 -a
#4.start 2 tty prepare compile
[root@wc02 utils]# cd host_apache_1.3.33/
[root@wc02 host_apache_1.3.33]# mkdir /usr/local/apache/
[root@wc02 host_apache_1.3.33]# ./configure --prefix=/usr/local/apache/
Configuring for Apache, Version 1.3.33
+ using installation path layout: Apache (config.layout)
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
+ configured for Linux platform
+ setting C compiler to gcc
+ setting C pre-processor to gcc -E
+ using "tr [a-z] [A-Z]" to uppercase
+ checking for system header files
+ adding selected modules
+ using system Expat
+ checking sizeof various data types
+ doing sanity check on compiler and options
Creating Makefile in src/support
Creating Makefile in src/regex
Creating Makefile in src/os/unix
Creating Makefile in src/ap
Creating Makefile in src/main
Creating Makefile in src/modules/standard
[root@wc02 host_apache_1.3.33]#
[root@wc02 host_apache_1.3.33]# make
这里是我们编译x.86版本的编译。肯定可以通过。注意我们不是要安装所以不需要
make install。把代码放到这里准备
#5. arm GCC configure
[root@wc02 src]# export CC=arm-linux-gcc
[root@wc02 src]# export CPP=arm-linux-gcc
[root@wc02 src]# export LD=arm-linux-ld
[root@wc02 src]# export STRIP=arm-linux-strip
[root@wc02 src]# export OBJCOPY=arm-linux-objcopy
[root@wc02 apache_1.3.33]# vi configure
##
## determine platform id
##
## PLATFORM="`$aux/GuessOS`"
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/17846/showart_515058.html |
|