Host:mint
NGINX version:nginx-1.5.8 (Nginx-1.5.8_arm.tar)
ZLIB version:zlib-1.2.8
PCRE version:pcre-8.33
Nginx incredibly does not support cross-compilation, configure inside no existing parameters can be set.
But fortunately provided--WITH-CC--with-cpp.
The latest Pcre version on the web is 10.0,nginx use this version will have a problem (Pcre2), the recommended use of pcre-8.33.
1../configure--prefix=/disk2/nginx/install--with-zlib=/disk2/zlib/zlib-1.2.8--with-pcre--with-pcre=/disk2/pcre /pcre-8.33--with-pcre-jit--WITH-CC=POWERPC-LINUX-GCC--with-cpp=powerpc-linux-g++
--with-zlib back is your zlib after extracting the source directory
--with-pcre back is your pcre after extracting the source directory
--WITH-CC directly after the PowerPC C compiler name, you can add a path (preferably C compiler in the path path)
--with-cpp directly after the PowerPC C + + compiler name, you can add a path (preferably C + + compiler in the path path)
2. Now make will appear "cc1:warnings being treated as errors"
Edit Objs/makefile, cancel the-WERROR flag in Cflags (line three)
CFLAGS =-pipe-o-w-wall-wpointer-arith-wno-unused-parameter-werror-g = "
CFLAGS =-pipe-o-w-wall-wpointer-arith-wno-unused-parameter-g
3. Edit the Auto/cc/name file on line tenth
Ngx_feature_run=yes = "
Ngx_feature_run=no
4. Edit auto/types/sizeof,36 Line
ngx_test= "$CC $CC _test_flags $CC _aux_flags ="
ngx_test= "gcc $CC _test_flags $CC _aux_flags
5. Edit Src/os/unix/ngx_errno.h,
#include <ngx_core.h> back Plus
#ifndef Ngx_sys_nerr
#define NGX_SYS_NERR 666
#endif
6. Edit Src/os/unix/ngx_shmem.c, line 12th
#if (Ngx_have_map_anon) = "
#if (! Ngx_have_map_anon)
"Undefined reference to ' Ngx_shm_free '" error will appear without modifying this
7. Make
8. Make Install
9. Wrap Up
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Cross-compiling Nginx for PowerPC