ARM平台的Nginx移植
ARM 平台的Nginx 移植
Nginx 是一个不错的Http Server,附带很多实用的功能,特别是HTML5 的视频播放,
所以,打算把Nginx 移植到ARM 平台下。
一、准备工作
下载 pcre-8.32.tar.bz2
解压缩:tar xjvf pcre-8.32.tar.bz2
进入目录:cd pcre-8.32
配置编译工具:./configure –host=arm-none-linux
Vi Makefile 检查一下里面的CC、CPP、CXX、CXXCPP、RANLIB、STRIP
修改对应的命令定义arm-none-linux-cc ….
编译:make
下载nginx-1.4.0.tar.gz:
解压缩:tar xzvf nginx-1.4.0.tar.gz
进入目录:cd nginx-1.4.0
配置编译工具:./configure --with-pcre=/home/…./pcre-8.32
注:nginx 不支持直接 configure 的时候带—host 参数,只能先用./configure 产
生Makefile。
二、编译Nginx
1.修改Makefile
Vi objs/Makefile
Line 2: CC = cc => CC = arm-none-linux-gcc
Line 4: CPP = cc –E => arm-none-linux-gcc –E
Make 发现错误:
src/core/ngx_open_file_cache.c:507: warning: implicit declaration of function `openat'
src/core/ngx_open_file_cache.c:513: warning: implicit declaration of function `fstatat'
src/core/ngx_open_file_cache.c:513: error: `AT_SYMLINK_NOFOLLOW' undeclared (first use
in this function)
src/core/ngx_open_file_cache.c:513: error: (Each undeclared identifier is reported only once
src/core/ngx_open_file_cache.c:513: error: for each function it appears in.)
src/core/ngx_open_file_cache.c: In function `ngx_open_file_wrapper':
src/core/ngx_open_file_cache.c:624: error: `AT_FDCWD' undeclared (first use in this
function)
2. 修改objs/ngx_auto_config.h