mac nginx compile

编译

./configure \
--prefix=/usr/local/services/nginx-1.14.0 \
--with-openssl=/Users/gavin/Downloads/src/openssl-1.0.2l \
--with-http_ssl_module \
--user=www \
--group=www \
--with-pcre \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module

注意

--with-openssl 是指定 openssl 的源代码的库目录,不是安装的目录

问题 - ./Configure darwin64-x86_64-cc

问题是 openssl/config 脚本猜对你的系统是64位,但是会根据 $KERNEL_BITS 来判断是否开启 x86_64 编译,默认是不开启的(很奇怪的设置,虽然会给你5秒时间停止编译并手动开启),所以你生成的 openssl 库文件是 32 位的,最后静态链接到 nginx 会出错。

解决

编译之前先设置一下变量

export KERNEL_BITS=64

猜你喜欢

转载自www.cnblogs.com/brookin/p/9916809.html