From 85b094801e3dcabc7aa86360371515c5c471027f Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 3 Mar 2005 06:15:13 +0000 Subject: r5645: Add an autoconf test for -Wdeclaration-after-statement so we don't add it to the configure.developer CFLAGS if it's not supported. (This used to be commit ce0dedea8d95f07745ba3e945dc88bceb97989d7) --- source3/configure.in | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source3') diff --git a/source3/configure.in b/source3/configure.in index 40aa263c7a..7e7c3c2035 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -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)], -- cgit