aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2007-03-26 06:52:04 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2007-03-26 06:52:04 +0000
commit6ecf2ccc7b1406b9af000a4d01e6c70737b1fe3e (patch)
treee48b57494335f449237c727a91be4f4be81751d1 /configure.in
parent46b8669566a546d6887d3f82aace2d8dea3608ff (diff)
older versions of gcc do not check -W parameters when only running the preprocessor.
change the test for whether -Wdeclaration-after-statement so that it also works for ancient gcc svn path=/trunk/; revision=21205
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in12
1 files changed, 11 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index a5eb2119a5..afc9ae885f 100644
--- a/configure.in
+++ b/configure.in
@@ -175,12 +175,22 @@ else
fi
AC_MSG_CHECKING(to see if we can add '-Wdeclaration-after-statement' to CFLAGS)
-if test x$GCC != x && echo yes | $CC -E -Wdeclaration-after-statement - 2>&1 | grep yes > /dev/null ; then
+if test x$GCC == xyes ; then
+ # some versions of GCC support this directive
+ rm -rf conftest*
+ echo "int foo;" >>conftest.c
+ $CC -c -o conftest.o conftest.c -Wdeclaration-after-statement
+ if [ $? == 0 ] ; then
CFLAGS="$CFLAGS -Wdeclaration-after-statement"
AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
else
+ # non-gcc compilers do not support this directive
AC_MSG_RESULT(no)
fi
+rm -rf conftest*
AC_ARG_WITH(warnings-as-errors,
[ --with-warnings-as-errors Treat warnings as errors (if using gcc). [default=no]],