]> granicus.if.org Git - apache/commitdiff
Use -Wdeclaration-after-statement in maintainer mode if we use a recent
authorStefan Fritsch <sf@apache.org>
Tue, 11 Jan 2011 21:13:20 +0000 (21:13 +0000)
committerStefan Fritsch <sf@apache.org>
Tue, 11 Jan 2011 21:13:20 +0000 (21:13 +0000)
enough gcc.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1057868 13f79535-47bb-0310-9956-ffa450edef68

configure.in

index 318e488c80f74c12ee9e7728217e90eebc0fc5b8..6df1629f1ac411133b3d71500f8795680dcf4f8c 100644 (file)
@@ -530,6 +530,16 @@ AC_ARG_ENABLE(maintainer-mode,APACHE_HELP_STRING(--enable-maintainer-mode,Turn o
   APR_ADDTO(CPPFLAGS, -DAP_DEBUG)
   if test "$GCC" = "yes"; then
     APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations])
+    AC_CACHE_CHECK([whether gcc accepts -Wdeclaration-after-statement], [ap_cv_cc_Wdas], [
+      save_CFLAGS=$CFLAGS
+      CFLAGS="$CFLAGS -Wdeclaration-after-statement"
+      AC_COMPILE_IFELSE([int foo() { return 0; }],
+        [ap_cv_cc_Wdas=yes], [ap_cv_cc_Wdas=no])
+      CFLAGS=$save_CFLAGS
+    ])
+    if test "$ap_cv_cc_Wdas" = "yes"; then
+      APR_ADDTO(CFLAGS,[-Wdeclaration-after-statement])
+    fi
   elif test "$AIX_XLC" = "yes"; then
     APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE -qcheck=all -qinfo=pro)
   fi