请问有静态编译 nginx 的吗?

2021-03-03 10:49:28 +08:00
 1260475686

默认编译出的 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 的,谢谢

4340 次点击
所在节点    NGINX
22 条回复
guanzhangzhang
2022-01-26 16:53:05 +08:00
1260475686
2022-05-12 22:01:56 +08:00
@guanzhangzhang 大佬,厉害

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/757913

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX