svn commit: samba r5645 - branches/SAMBA_3_0/source trunk/source

tpot at samba.org tpot at samba.org
Thu Mar 3 06:15:14 GMT 2005


Author: tpot
Date: 2005-03-03 06:15:13 +0000 (Thu, 03 Mar 2005)
New Revision: 5645

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5645

Log:
Add an autoconf test for -Wdeclaration-after-statement so we don't add it
to the configure.developer CFLAGS if it's not supported.

Modified:
   branches/SAMBA_3_0/source/configure.in
   trunk/source/configure.in


Changeset:
Modified: branches/SAMBA_3_0/source/configure.in
===================================================================
--- branches/SAMBA_3_0/source/configure.in	2005-03-03 04:16:37 UTC (rev 5644)
+++ branches/SAMBA_3_0/source/configure.in	2005-03-03 06:15:13 UTC (rev 5645)
@@ -239,6 +239,22 @@
     [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)],

Modified: trunk/source/configure.in
===================================================================
--- trunk/source/configure.in	2005-03-03 04:16:37 UTC (rev 5644)
+++ trunk/source/configure.in	2005-03-03 06:15:13 UTC (rev 5645)
@@ -240,6 +240,22 @@
     [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)],



More information about the samba-cvs mailing list