1、下载apr-1.6.2 https://apr.apache.org/download.cgi
2、解压 tar xvf apr-1.6.2.tar.gz
3、cd apr-1.6.2
4、配置
#!/bin/sh
filePath=`pwd`
./configure --host=mips CC=mips-openwrt-linux-gcc --prefix=$filePath/libaprs --enable-so ac_cv_file__dev_zero=yes ac_cv_func_setpgrp_void=yes apr_cv_process_shared_works=yes apr_cv_mutex_robust_shared=yes apr_cv_tcp_nodelay_with_cork=yes ap_void_ptr_lt_long=no
5、编译
> make
6、安装
make install
Note:如果此时make执行编译,会报如下错误
In file included from ./include/apr_strings.h:52,
from passwd/apr_getpass.c:23:
./include/apr_want.h:95: error: redefinition of 'struct iovec'
make[1]: *** [passwd/apr_getpass.lo] Error 1
make[1]: Leaving directory `/work/src/apr-1.4.8'
make: *** [all-recursive] Error 1
修改include/apr_want.h,注释掉struct iovec的定义