title: why -Werror cause configure error
body: <p>I want build nginx from source. so I write a bash script to do this:</p>
  
  <pre><code>#!/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 &amp; make install? [Y/n]&gt; ' RUN
  
  if [ "x$RUN" = "x" -o "x$RUN" = "xY" -o "x$RUN" = "xy" ]; then
      make -j8
      make install
  fi
  </code></pre>
  
  <p>when I run this script, <code>configure</code> success, but there is a warning treat as error(<strong>unused-but-set-variable</strong>) during compile and <code>make</code> exit with this error.</p>
  
  <p>So, I edit "--with-cc-opt" option, change "-Wall" to "-Werror", this time <code>configure</code> fail with error</p>
  
  <pre><code>./auto/configure: error: the HTTP XSLT module requires the libxml2/libxslt
  libraries. You can either do not enable the module or install the libraries.
  </code></pre>
  
  <p>Then I change "-Werror" to  "-Werror=unused-but-set-variable", and <code>configure</code> fail with error</p>
  
  <pre><code>./auto/configure: no supported file AIO was found
  Currently file AIO is supported on FreeBSD 4.3+ and Linux 2.6.22+ only
  </code></pre>
  
  <p><em>(I tried to delete -W option, but is same with -Wall)</em></p>
  
  <h1>Who knows why?!</h1>
  
  <p>EDIT:</p>
  
  <p>I solve by editing nginx <code>configure</code> option files...</p>
  
  <p>I noticed that the tail of <code>make</code> log</p>
  
  <p>cc -c -pipe  -O <code>-W -Wall -Wpointer-arith</code> -Wno-unused-parameter <strong>-Werror</strong> -g <code>-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</code>  -I src/core -I (.... etc</p>
  
  <p>I think these problem is nginx <code>configure</code> auto prepend some CC-opt bedore mine</p>
  
  <p>so I use <code>grep '\-Wall' ./auto -R</code> and <code>grep '\-Werror' ./auto -R</code> found them and delete it.</p>
  
  <p>now I have "complete" control of CC flag.</p>
  
  <p>thanks for R's answer :D</p>