]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r5645: Add an autoconf test for -Wdeclaration-after-statement so we don't add it
authorTim Potter <tpot@samba.org>
Thu, 3 Mar 2005 06:15:13 +0000 (06:15 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:55:53 +0000 (10:55 -0500)
to the configure.developer CFLAGS if it's not supported.

source/configure.in

index 40aa263c7a1357383d6a7fb2316c8a46a0fac978..7e7c3c20350cd893239e706f0cff1425f4cf13d0 100644 (file)
@@ -239,6 +239,22 @@ AC_ARG_ENABLE(developer, [  --enable-developer      Turn on developer warnings a
     [if eval "test x$enable_developer = xyes"; then
         developer=yes
        CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
+       # Add -Wdeclaration-after-statement if compiler supports it
+       AC_CACHE_CHECK(
+          [that the C compiler understands -Wdeclaration-after-statement],
+          samba_cv_HAVE_Wdeclaration_after_statement, [
+         AC_TRY_RUN_STRICT([
+           int main(void)
+           {
+               return 0;
+           }],[-Wdeclaration-after-statement],[$CPPFLAGS],[$LDFLAGS],
+           samba_cv_HAVE_Wdeclaration_after_statement=yes,
+           samba_cv_HAVE_Wdeclaration_after_statement=no,
+           samba_cv_HAVE_Wdeclaration_after_statement=cross)
+       ])
+       if test x"$samba_cv_HAVE_Wdeclaration_after_statement" = x"yes"; then
+           CFLAGS="${CFLAGS} -Wdeclaration-after-statement"
+       fi
     fi])
 
 AC_ARG_ENABLE(krb5developer, [  --enable-krb5developer  Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)],