apache arm 交叉编译_针对ARM问题交叉编译Apache

在Ubuntu 14.04 32位虚拟机上,作者尝试为ARM系统交叉编译Apache时遇到了编译错误,涉及到'T_HTTP_TOKEN_STOP'等标识符未声明的问题。通过分析配置脚本和编译过程,作者发现是由于gen_test_char文件的问题导致。解决方案是先运行带指定头文件路径的gcc命令生成gen_test_char,然后再继续make,从而成功完成交叉编译。
摘要由CSDN通过智能技术生成

我正在尝试使用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在这次运行之后再次进行,一切都应该工作。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值