linux 交叉编译 nginx,交叉编译 nginx

thinks http://www.cppblog.com/van201314/articles/165661.html

HOST: ubuntu 12.04 LTS

NGINX VERSION: nginx-1.5.8

ZLIB VERSION: zlib-1.2.8

PCRE VERSION: pcre-8.20

1.auto/cc/name

if [ "$NGX_PLATFORM" != win32 ]; then

ngx_feature="C compiler"

ngx_feature_name=

#ngx_feature_run=yes

ngx_feature_run=no   ==>set to no to skip check

ngx_feature_incs=

ngx_feature_path=

2.auto/types/sizeof

ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS

==> ngx_test="gcc $CC_TEST_FLAGS $CC_AUX_FLAGS

3.src/os/unix/ngx_errno.h

at line 15 add #define NGX_SYS_NERR 333

4.src/os/unix/ngx_errno.c

#if (NGX_HAVE_MAP_ANON) ==> #if (!NGX_HAVE_MAP_ANON)

5.prepare zlib and pcre

download zlib-1.2.8 and decompress to /home/mo/zlib-1.2.8

download pcre-8.20 and decompress to /home/mo/pcre-8.20

6.auto/lib/pcre/make

./configure --disable-shared $PCRE_CONF_OPT

==>./configure --disable-shared $PCRE_CONF_OPT --host=arm

7.write a configure script

#!/bin/sh

BUILD_PATH=/home/mo/nginx-1.5.8/arm-build

CC_PATH=/opt/arm-hisiv200-linux/bin/arm-hisiv200-linux-gnueabi-gcc

CPP_PATH=/opt/arm-hisiv200-linux/bin/arm-hisiv200-linux-gnueabi-g++

./configure

--prefix=$BUILD_PATH

--user=root

--group=root

--builddir=$BUILD_PATHuild

--with-zlib=/home/mo/zlib-1.2.8

--with-pcre

--with-pcre=/home/mo/pcre-8.20

--with-pcre-jit

--with-cc=$CC_PATH

--with-cpp=$CPP_PATH

save to my_configure.sh

8.start to compile

./my_configure.sh

make

make install

9.copy the install dir arm_build to the board(like /home/app/nginx),and run link this

/home/app/nginx/sbin/nginx -p /home/app/nginx

下面是修改好的代码的链接:

http://download.csdn.net/detail/crazyman2010/8311117

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值