CFLAGS="-g -O0" ./configure --prefix=/root/marco \
--with-debug \
--with-http_stub_status_module \
--with-pcre=/root/src/public/pcre-8.38 \
--with-openssl-opt="-g -O0"\
--with-openssl=/root/src/public/openssl-1.0.2g/ \
--with-http_ssl_module \
--with-ld-opt="-Wl,-rpath,$LUAJIT_LIB" \
--add-module=addons/lua-nginx-module-master
#make
#make install
备注:openssl默认编译选项是O3,加上--with-openssl=-g -O0,只是在编译选项的开头加上了该选项,并没有将O3替换掉,因此没有达到想要的效果。
CFLAGS="-g -O0" ./configure --prefix=/root/marco \
--with-debug \
--with-http_stub_status_module \
--with-pcre=/root/src/public/pcre-8.38 \
--with-openssl-opt="-g -O0"\
--with-openssl=/root/src/public/openssl-1.0.2g/ \
--with-http_ssl_module \
--with-ld-opt="-Wl,-rpath,$LUAJIT_LIB" \
--add-module=addons/lua-nginx-module-master
备注:nginx./configure完成后会生成objs/Makefile。
#vi objs/Makefile
#make depend
#./config --prefix=/root/src/public/openssl-1.0.2g/.openssl no-shared -g -O0
备注:将生成的Makefile中的O3改为O0。
#make install
备注:默认安装在.openssl/下,nginx链接的也是该目录。(如果你优化了openssl的代码,不想把代码分享给其他人,也可以这样做)
openssl手动编译好后,nginx再进行make和make install,即可得到可调试版本的openssl。