소스에서 nginx를 빌드하고 싶습니다. 그래서 나는이 작업을 수행하는 떠들썩한 파티 스크립트를 작성 :왜 -Werror가 오류를 구성합니까
#!/bin/bash
export LD_LIBRARY_PATH="/usr/lib64:$LD_LIBRARY_PATH"
dir=$(realpath `dirname $BASH_SOURCE`)
cd $dir/modules
for folder in *
do
ADD_MODULES="$ADD_MODULES \
--add-module=$dir/modules/$folder"
done
cd $dir/nginx
./auto/configure \
--prefix=/usr/share/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/lib/nginx/tmp/client_body \
--http-proxy-temp-path=/var/lib/nginx/tmp/proxy \
--http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi \
--http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi \
--http-scgi-temp-path=/var/lib/nginx/tmp/scgi \
--pid-path=/run/nginx.pid \
--lock-path=/run/lock/subsys/nginx \
--user=nginx \
--group=nginx \
--with-file-aio \
--with-ipv6 \
--with-http_ssl_module \
--with-http_spdy_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_xslt_module \
--with-http_image_filter_module \
--with-http_geoip_module \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_degradation_module \
--with-http_stub_status_module \
--with-http_perl_module \
--with-mail \
--with-mail_ssl_module \
--with-pcre \
--with-debug \
$ADD_MODULES \
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' \
--with-ld-opt='-Wl,-z,relro -Wl,-E'
if [ $? -ne 0 ]; then
exit
fi
read -p 'Run make & make install? [Y/n]> ' RUN
if [ "x$RUN" = "x" -o "x$RUN" = "xY" -o "x$RUN" = "xy" ]; then
make -j8
make install
fi
나는이 스크립트, configure
성공을 실행할 수 있지만 오류로 경고 치료가있을 때 (미사용하지만-설정 변수) 컴파일 및 make
종료시 이 오류가 있습니다.
그래서, 난 그런
./auto/configure: error: the HTTP XSLT module requires the libxml2/libxslt
libraries. You can either do not enable the module or install the libraries.
나는 "-Werror"로 변경 "--with-CC-선택 하" "-Werror"에 대한 옵션 변경 "-Wall"이 시간 configure
오류와 함께 실패 편집 에 "-Werror = 미사용하지만-변수 설정"및 configure
오류
./auto/configure: no supported file AIO was found
Currently file AIO is supported on FreeBSD 4.3+ and Linux 2.6.22+ only
실패 (나는 -W 옵션을 삭제하려했으나 -Wall과 동일)
누가 그 이유를 알고 있습니까?!
는 편집 : 나는 nginx를 configure
옵션 파일을 편집하여 해결
...
내가 너라make
비상 로그
CC -c -pipe -O -W -Wall -Wpointer-arith
-Wno-unused- 등의 매개 변수 -Werror -g -O2 -g -pipe -Werror=unused-but-set-variable -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic
-I SRC/핵심 -I (...
나는이 문제가 nginx를 configure
자동 생각 어떤 CC - 선택 광톱 덧대는 말을
그래서 내가 grep '\-Wall' ./auto -R
과 grep '\-Werror' ./auto -R
그들을 발견하고 그것을 삭제 사용하십시오.
이제 CC 플래그를 "완전하게"제어했습니다. R의 답변
감사합니다 : D
yum 패키지의'nginx -V'에서 configure 옵션을 사용하고 있지만 제 3의 모듈 ($ ADD_MODULES)을 추가하십시오. 나는'-Wall'과'-Werror'의 차이점과 configure 동안 왜 효과가 있는지 알고 싶습니다. – GongT