Cross-compiling Nginx for PowerPC

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.