diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2007-03-26 06:58:22 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2007-03-26 06:58:22 +0000 |
commit | 988a5e16a349bf6829b1b7a2e9b71aca1b40ca5b (patch) | |
tree | 445dc13d41786aa05ec884ec41e5af34a7586397 /wiretap | |
parent | 6ecf2ccc7b1406b9af000a4d01e6c70737b1fe3e (diff) |
make the test for -Wdeclaration-after-statement gcc 2.96 friendly.
and once again the mighty wireshark compiles on rh71
svn path=/trunk/; revision=21206
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/configure.in | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/wiretap/configure.in b/wiretap/configure.in index 38e76115a9..898b244e99 100644 --- a/wiretap/configure.in +++ b/wiretap/configure.in @@ -50,12 +50,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]], |