下载apache2 http://apache.fayea.com/apache-mirror//httpd/httpd-2.4.6.tar.bz2
1. tar jxvf httpd-2.4.6.tar.bz2
2. cd httpd-2.4.6
3. ./configure --host=arm-linux --prefix=/usr/local/arm/4.4.3 --with-apu=/usr/local/arm/4.4.3/ --with-apr-util=/usr/local/arm/4.4.3 --with-pcre=/usr/local/arm/4.4.3/ ap_cv_void_ptr_lt_long=no
注意这里实际不需要指定--with-apr-util和--with-apu,因为这样做比较麻烦,需要先交叉编译好apr和apr-util。可以下载最新的apr apr-util放到httpd/srclib中,一起交叉编译即可。
这里会报如下错误
./gen_test_char > test_char.h
/bin/bash: ./gen_test_char: cannot execute binary file
因为apache工程写的不好,编译生成的gen_test_char工具是ARM版本的,无法在当前PC上执行这个文件。
我们要想办法找到一个PC版本的gen_test_char
4. 重新解压httpd-2.4.6.tar.bz2到两外一个目录,假设为httpd-pc
5. cd httpd-pc
6. 把最晚版本的apr和apr-util解压到httpd-pc/srclib下,目录名不要带版本号
7. ./configure --prefix=/usr/local/ ap_cv_void_ptr_lt_long=no
8. make编译pc版的httpd,此时会生成server/gen_test_char,拷贝到arm版的httpd-2.4.6/server下
9 cd httpd-2.4.6
10 make
11 make install