默认编译出的 nginx 可执行文件会依赖编译环境的一些动态库,现在想着编译出来之后可以在不同的设备上部署,是否可以在编译时静态链接,本人尝试使用如下编译参数 ./configure --with-pcre --prefix=/home/nginx-1.16.1/output/ --with-http_ssl_module --with-openssl=/usr/src/openssl-1.0.1g --with-pcre=/home/source_pkt/pcre-8.44 --with-zlib=/home/source_pkt/zlib-1.2.11 --with-cc-opt=-static-libgcc --with-ld-opt='-static' 在编译时加入了-static 但是报错如下: checking for --with-ld-opt="-static" ... not found ./configure: error: the invalid value in --with-ld-opt="-static"
有没有知道怎么静态编译 nginx 的,谢谢