我正在尝试使用Ubuntu 14.04 32位虚拟机为ARM系统交叉编译Apache。我能够获得所有必需的库(PCRE,APR,APR-Util,Libtool)并且配置脚本可以正常运行。但是,当我运行make命令时,我收到以下错误。在这一点上,我完全失去了解决这个问题的方法。
util.c: In function ‘ap_parse_token_list_strict’:
util.c:1528:14: error: ‘T_HTTP_TOKEN_STOP’ undeclared (first use in this
function)
util.c:1528:14: note: each undeclared identifier is reported only once for
each function it appears in
util.c: In function ‘ap_scan_http_field_content’:
util.c:1602:14: error: ‘T_HTTP_CTRLS’ undeclared (first use in this
function)
util.c: In function ‘ap_scan_http_token’:
util.c:1612:14: error: ‘T_HTTP_TOKEN_STOP’ undeclared (first use in this
function)
util.c: In function ‘ap_scan_vchar_obstext’:
util.c:1622:13: error: ‘T_VCHAR_OBSTEXT’ undeclared (first use in this
function)
util.c: In function ‘ap_find_token’:
util.c:1683:22: error: ‘T_HTTP_TOKEN_STOP’ undeclared (first use in this
function)
util.c: In function ‘ap_escape_logitem’:
util.c:2092:13: error: ‘T_ESCAPE_LOGITEM’ undeclared (first use in this
function)
util.c: In function ‘ap_escape_errorlog_item’:
util.c:2162:13: error: ‘T_ESCAPE_LOGITEM’ undeclared (first use in this
function)
util.c: In function ‘ap_append_pid’:
util.c:2480:25: warning: format ‘%lld’ expects argument of type ‘long long
int’, but argument 5 has type ‘__pid_t’ [-Wformat]
make[2]: *** [util.lo] Error 1这是我用来配置的脚本
#!/bin/sh
export PATH=$PATH
export ARCH=armv7l
export CROSS_COMPILE=arm-linux-gnueabi-
export CC=arm-linux-gnueabi-gcc
export LD=arm-linux-gnueabi-ld
export LD_LIBRARY=/home/kyle/httpd/srclib/expat/bin
export CXX=arm-linux-gnueabi-g++
export AR=arm-linux-gnueabi-ar
export CPP=arm-linux-gnueabi-cpp
export STRIP=arm-linux-gnueabi-strip
export CC_FOR_BUILD=i686-linux-gnu-gcc
./configure \
--host=arm-linux-gnueabi \
--target=arm-linux-gnueabi \
--prefix=/home/kyle/httpd \
--build=i686-cross-linux-gnu \
--with-apr=/home/kyle/httpd/srclib/apr \
--with-apr-util=/home/kyle/httpd/srclib/apr-util \
--with-pcre=/home/kyle/httpd/srclib/pcre \
--with-expat=/home/kyle/httpd/srclib/expat \
--disable-libtool-lock \
ac_cv_file__dev_zero=no \
ac_cv_func_setpgrp_void=no \
apr_cv_tcp_nodelay_with_cork=no \
ap_cv_void_ptr_lt_long=4 \
ac_cv_sizeof_struct_iovec=1****编辑:我相信我已经找到解决方案****
问题是我正在拷贝来自APR的gen_test_char,以解决已知的bug,但这不是和httpd / server中的gen_test_char相同。所以一个简单的解决方法是运行make命令等待它失败,因为gen_test_char的格式不正确,然后运行
gcc gen_test_char.c -I"(where ever apr is)/apr/include" -o gen_test_char在这次运行之后再次进行,一切都应该工作。