windows下编译nginx 使用msys

简介Prerequisites To build nginx on the Microsoft Win32® platform you need: Microsoft Visual C compiler. Microsoft Visual Studio® 8 and 10 are known to work. MSYS. Perl, if you want to build OpenSSL®&nbs

Prerequisites

To build nginx on the Microsoft Win32® platform you need:

  • Microsoft Visual C compiler. Microsoft Visual Studio® 8 and 10 are known to work.
  • MSYS.
  • Perl, if you want to build OpenSSL® and nginx with SSL support. For example ActivePerl or Strawberry Perl.
  • Mercurial client.
  • PCREzlib and OpenSSL libraries sources.

Build steps

Ensure that paths to Perl, Mercurial and MSYS bin directories are added to PATH environment variable before you start build. To set Visual C environment run vcvarsall.bat script from Visual C directory.

To build nginx:

  • Start MSYS bash.
  • Check out nginx sources from the hg.nginx.org repository. For example:
    hg clone http://hg.nginx.org/nginx
  • Create a build and lib directories, and unpack zlib, PCRE and OpenSSL libraries sources into lib directory:
    mkdir objs mkdir objs/lib cd objs/lib tar -xzf ../../pcre-8.43.tar.gz tar -xzf ../../zlib-1.2.11.tar.gz tar -xzf ../../openssl-1.1.1c.tar.gz
  • Run configure script:
    auto/configure \ --with-cc=cl \ --with-debug \ --prefix= \ --conf-path=conf/nginx.conf \ --pid-path=logs/nginx.pid \ --http-log-path=logs/access.log \ --error-log-path=logs/error.log \ --sbin-path=nginx.exe \ --http-client-body-temp-path=temp/client_body_temp \ --http-proxy-temp-path=temp/proxy_temp \ --http-fastcgi-temp-path=temp/fastcgi_temp \ --http-scgi-temp-path=temp/scgi_temp \ --http-uwsgi-temp-path=temp/uwsgi_temp \ --with-cc-opt=-DFD_SETSIZE=1024 \ --with-pcre=objs/lib/pcre-8.43 \ --with-zlib=objs/lib/zlib-1.2.11 \ --with-openssl=objs/lib/openssl-1.1.1c \ --with-openssl-opt=no-asm \ --with-http_ssl_module
  • Run make:
    nmake
本文转自:http://nginx.org/en/docs/howto_build_on_win32.html
新加评论 评论标题:

文章评论

    Makefile文件生成指令

        2020-01-10    
    修改 删除


    auto/configure \
        --with-cc=cl \
        --with-debug \
        --prefix= \
        --conf-path=conf/nginx.conf \
        --pid-path=logs/nginx.pid \
        --http-log-path=logs/access.log \
        --error-log-path=logs/error.log \
        --sbin-path=nginx.exe \
        --http-client-body-temp-path=temp/client_body_temp \
        --http-proxy-temp-path=temp/proxy_temp \
        --http-fastcgi-temp-path=temp/fastcgi_temp \
        --http-scgi-temp-path=temp/scgi_temp \
        --http-uwsgi-temp-path=temp/uwsgi_temp \
        --with-cc-opt=-DFD_SETSIZE=1024 \
        --with-pcre=objs/lib/pcre-8.41 \
        --with-zlib=objs/lib/zlib-1.2.11 \
        --with-openssl=objs/lib/openssl-1.0.2u \
        --with-openssl-opt=no-asm \
        --with-select_module --with-http_ssl_module --add-module=objs/lib/nginx-rtmp-module-master  --with-debug --add-module=objs/lib/ngx_http_mytest_module
    
    
    


评论列表
Makefile文件生成指令