1. 下载nginx-quic 源码
下载后的版本号为
nginx-quic-3be953161026.zip
2. 下载msys2
3. 准备编译环境
安装 MSYS2
安装完成后执行以下命令更新包 在msys2 控制台中执行
pacman -Syu
安装编译工具
pacman -S --needed base-devel mingw-w64-x86_64-toolchain
在这个控制台执行gcc
解压 libressl-3.6.0.tar.gz 到 libressl
下载 http://www.zlib.net/
下载 https://sourceforge.net/projects/pcre/
导航到 msys2 安装目录 D:\soft\msys2\home\xueji
下载 https://github.com/openssl/openssl#download
git clone git://git.openssl.org/openssl.git
解压 nginx-quic-3be953161026.zip 到 nginx-quic-3be953161026
cd nginx-quic-3be953161026/
配置
./auto/configure --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-openssl=openssl \
--with-pcre=pcre \
--with-zlib=zlib \
--with-http_v2_module \
--with-http_ssl_module \
--with-http_v3_module \
--with-stream_quic_module \
--with-cc-opt="-I../libressl/build/include" \
--with-ld-opt="-L../libressl/build/lib"
安装cmake
$ pacman -S make cmake
resolving dependencies...
looking for conflicting packages...
编译过程,需要在 mingw64.exe 命令行中编译,不能直接在 msys2.exe 中执行
xueji@xue MINGW64 ~/nginx-quic-3be953161026
$ ./auto/configure --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-openssl=openssl \
--with-pcre=pcre \
--with-zlib=zlib \
--with-http_v2_module \
--with-http_ssl_module \
--with-http_v3_module \
--with-stream_quic_module \
--with-cc-opt="-I../libressl/build/include" \
--with-ld-opt="-L../libressl/build/lib"
checking for OS
+ MINGW64_NT-10.0-22621 3.3.6-341.x86_64 x86_64
+ using GNU C compiler
+ gcc version: 12.2.0 (Rev4, Built by MSYS2 project)
checking for gcc -pipe switch ... found
checking for MINGW64_NT-10.0-22621 specific features
creating objs/Makefile
Configuration summary
+ using PCRE library: pcre
+ using OpenSSL library: openssl
+ using zlib library: zlib
nginx path prefix: ""
nginx binary file: "/nginx.exe"
nginx modules path: "/modules"
nginx configuration prefix: "/conf"
nginx configuration file: "/conf/nginx.conf"
nginx pid file: "/logs/nginx.pid"
nginx error log file: "/logs/error.log"
nginx http access log file: "/logs/access.log"
nginx http client request body temporary files: "temp/client_body_temp"
nginx http proxy temporary files: "temp/proxy_temp"
nginx http fastcgi temporary files: "temp/fastcgi_temp"
nginx http uwsgi temporary files: "temp/uwsgi_temp"
nginx http scgi temporary files: "temp/scgi_temp"
xueji@xue MINGW64 ~/nginx-quic-3be953161026
$ make
make -f objs/Makefile
make[1]: Entering directory '/home/xueji/nginx-quic-3
...
....
没搞定