在龙芯mips64平台上编译Nginx
参考内容
部分参考内容见 https://blog.csdn.net/shan_xg/article/details/75356271
Nginx编译环境搭建
下载nginx
源代码
下载地址 。
下载pcre
源代码
nginx
依赖pcre
,pcre
,下载地址 。
下载openssl
源代码
下载地址 。
编译Nginx
以nginx-1.18.0.tar.gz
、pcre-7.8.tar.gz
、openssl-OpenSSL_1_1_1g.tar.gz
示例在龙芯设备上编译nginx
。
# 在设备上解压源代码
tar xf nginx-1.18.0.tar.gz
tar xf pcre-7.8.tar.gz
tar xf openssl-OpenSSL_1_1_1g.tar.gz
cd nginx-1.18.0
#配置编译环境,/root/pcre-7.8、/root/openssl-OpenSSL_1_1_1g分别是pcre、openssl源代码目录
./configure --prefix=/opt/nginx/nginx-1.18.0 --with-pcre=/root/pcre-7.8 --with-openssl=/root/openssl-OpenSSL_1_1_1g --with-http_ssl_module
修改openssl编译配置,编辑objs/Makefile
文件,找到以下内容
/root/openssl-OpenSSL_1_1_1g/.openssl/include/openssl/ssl.h: objs/Makefile
cd /root/openssl-OpenSSL_1_1_1g \
&& if [ -f Makefile ]; then $(MAKE) clean; fi \
&& ./config --prefix=/root/openssl-OpenSSL_1_1_1g/.openssl no-shared no-threads \
&& $(MAKE) \
&& $(MAKE) install_sw LIBDIR=lib
将&& ./config --prefix=/root/openssl-OpenSSL_1_1_1g/.openssl no-shared no-threads \
行替换为&& ./Configure linux64-mips64 no-asm --prefix=/root/src/openssl-1.1.1g/.openssl no-shared no-threads \
,如
/root/src/openssl-1.1.1g/.openssl/include/openssl/ssl.h: objs/Makefile
cd /root/src/openssl-1.1.1g \
&& if [ -f Makefile ]; then $(MAKE) clean; fi \
&& ./Configure linux64-mips64 no-asm --prefix=/root/src/openssl-1.1.1g/.openssl no-shared no-threads \
&& $(MAKE) \
&& $(MAKE) install_sw LIBDIR=lib
编译、安装
make -j4
make install