title: clang fails autoconf AC_CHECK_HEADER checks with explicit CPPFLAGS search paths
body: <p>In an established autotools-managed project which is almost always built with GCC, I decided to try using LLVM clang as a g++ substitute, but found that it falls over on a personally-written header check that uses the standard AC_CHECK_HEADER macro. Here's the checking code:</p>
  
  <pre><code>oldCPPFLAGS=$CPPFLAGS
  CPPFLAGS="$CPPFLAGS -I$GSLINCPATH"
  AC_CHECK_HEADER([gsl/gsl_vector.h], [], [AC_MSG_ERROR([GSL vectors not found.])])
  CPPFLAGS=$oldCPPFLAGS
  </code></pre>
  
  <p>and here's the failure message:</p>
  
  <pre><code>checking gsl/gsl_vector.h usability... no
  checking gsl/gsl_vector.h presence... no
  checking for gsl/gsl_vector.h... no
  configure: error: GSL vectors not found.
  </code></pre>
  
  <p>The value of $GSLINCPATH is /usr/include (explicitly checked), /usr/include/gsl/gsl_vector.h does exist, and this check code works nicely with GCC. The temporary switching in of a modified $CPPFLAGS seems to be the de facto standard way to do this test, but is there a better way that is more portable? Or is there another reason for this problem?</p>