交叉编译nginx,luajit

`nginx 编译文档

1.使用自定义的openssl

auto/lib/openssl/conf

CORE_INCS="$CORE_INCS

$OPENSSL/.openssl/include"

CORE_DEPS="$CORE_DEPS

$OPENSSL/.openssl/include/openssl/ssl.h"

CORE_LIBS="$CORE_LIBS

$OPENSSL/.openssl/lib/libssl.a"

CORE_LIBS="$CORE_LIBS

$OPENSSL/.openssl/lib/libcrypto.a"

修改为

CORE_INCS="$CORE_INCS

$OPENSSL/include"

CORE_DEPS="$CORE_DEPS

$OPENSSL/include/openssl/ssl.h"

CORE_LIBS="$CORE_LIBS

$OPENSSL/lib/libssl.a"

CORE_LIBS="$CORE_LIBS

$OPENSSL/lib/libcrypto.a"

2.auto/cc/name 21 行 频闭掉

3.auto/types/sizeof

将ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS

改为 ngx_test="gcc $CC_TEST_FLAGS $CC_AUX_FLAGS

4.src/os/unix/ngx_errno.h

15行 add #define NGX_SYS_NERR 333

5.auto/lib/pcre/make 添加 --host="arm-hisiv200-linux"

./configure --disable-shared $PCRE_CONF_OPT --host="arm-hisiv200-linux"

6.src/core/ngx_rwlock.c

12行 #if (NGX_HAVE_ATOMIC_OPS)改为#if (!NGX_HAVE_ATOMIC_OPS)

7.src/os/unix/ngx_shmem.c

11行添加#define NGX_HAVE_MAP_ANON 1

8.支持epoll

修改auto/linux 第39行 将 ngx_feature_run=yes 改为ngx_feature_run=

LuaJIT:

修改Makfile

prefix=/usr/local/arm-lua

make HOST_CC="gcc -m32" CROSS=arm-hisiv200-linux-gnueabi-

make install

修改ngx_lua_module 13行增加

LUAJIT_INC="/usr/local/arm-lua/include/luajit-2.0"

LUAJIT_LIB="/usr/local/arm-lua/lib"

./configure  --prefix=/usr/local/arm_nginx --user=root --group=root --with-pcre --with-pcre=/root/arm-hisiv200-linux/install/zx-nginx/pcre-8.35 --with-zlib=/root/arm-hisiv200-linux/install/zx-nginx/zlib-1.2.8 --with-openssl=/root/arm-

hisiv200-linux/install/zx-nginx/openssl-1.0.1t --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-

http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-cc=/root/arm-hisiv200-linux/bin/arm-hisiv200-linux-gnueabi-gcc --with-

cpp=/root/arm-hisiv200-linux/bin/arm-hisiv200-linux-gnueabi-g++ --with-pcre-jit --with-poll_module --add-module=/root/arm-hisiv200-linux/install/zx-nginx/ngx_http_substitutions_filter_module --add-module=/root/arm-hisiv200-

linux/install/zx-nginx/ngx_devel_kit --add-module=/root/arm-hisiv200-linux/install/zx-nginx/lua-nginx-module

推荐阅读更多精彩内容