summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-03-03 06:15:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:53 -0500
commit85b094801e3dcabc7aa86360371515c5c471027f (patch)
treee1214a02fa9f909782cede48092fefbc8ca07d75 /source3
parentb6211e02628fdc272b494f35cee30bc59b330c8b (diff)
downloadsamba-85b094801e3dcabc7aa86360371515c5c471027f.tar.gz
samba-85b094801e3dcabc7aa86360371515c5c471027f.tar.bz2
samba-85b094801e3dcabc7aa86360371515c5c471027f.zip
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)
Diffstat (limited to 'source3')
-rw-r--r--source3/configure.in16
1 files changed, 16 insertions, 0 deletions
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)],