解压完毕nginx后,执行命令后
[…nginx-1.9.9]# make && make install
问题1:
src/core/ngx_murmurhash.c:37:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
h ^= data[2] << 16;
~~^~~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:38:5: note: here
case 2:
^~~~
src/core/ngx_murmurhash.c:39:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
h ^= data[1] << 8;
~~^~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:40:5: note: here
case 1:
^~~~
cc1: all warnings being treated as errors
原因,是将警告当成了错误处理,打开/home/vagrant/nginx-1.9.9/objs/Makefile,
去掉CFLAGS中的-Werror或者注释该整行
再重新make
-Wall 表示打开gcc的所有警告
-Werror,它要求gcc将所有的警告当成错误进行处理.
问题2
src/os/unix/ngx_user.c: In function ‘ngx_libc_crypt’:
src/os/unix/ngx_user.c:36:7: error: ‘struct crypt_data’ has no member named ‘current_salt’
cd.current_salt[0] = ~salt[0];
经过百度发现需要进入nginx的…/src/os/unix/ngx_user.c中进行源码修改。
只需要注释第36行代码即可。
/* cd.current_salt[0] = ~salt[0];*/