2013-08-23 2 views
3

소스에서 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 -Rgrep '\-Werror' ./auto -R 그들을 발견하고 그것을 삭제 사용하십시오.

이제 CC 플래그를 "완전하게"제어했습니다. R의 답변

감사합니다 : D

답변

2

--with-file-aio 옵션을 제거합니다. 유용하지 않습니다.

--with-http_xslt_module 옵션을 제거하거나 libxml2 및 libxslt를 설치하십시오.

일반적으로 사용자가 이해하지 못하는 옵션 인 --with--enable은 사용하지 마십시오.

+0

yum 패키지의'nginx -V'에서 configure 옵션을 사용하고 있지만 제 3의 모듈 ($ ADD_MODULES)을 추가하십시오. 나는'-Wall'과'-Werror'의 차이점과 configure 동안 왜 효과가 있는지 알고 싶습니다. – GongT

2

첫 번째 문제 (오류 : HTTP XSLT 모듈에 libxml2/libxslt가 필요함)는 libxslt-devel 패킷을 설치하면 해결할 수 있습니다.

+3

(우분투에서) 설치가 필요한'libxslt1-dev'였습니다. –

관련 문제