diff options
author | Günther Deschner <gd@samba.org> | 2007-04-22 21:17:49 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:19:36 -0500 |
commit | 31982beaab0e4777dfc6026bc63d8ed89cc9efbc (patch) | |
tree | ae54d474897e4d4c4ea5928a1eed214ce5a076e7 /source3 | |
parent | 2713a9ca0e97a6f9eaaed4eed906eaac9a161fd4 (diff) | |
download | samba-31982beaab0e4777dfc6026bc63d8ed89cc9efbc.tar.gz samba-31982beaab0e4777dfc6026bc63d8ed89cc9efbc.tar.bz2 samba-31982beaab0e4777dfc6026bc63d8ed89cc9efbc.zip |
r22467: Adding configure check for -Werror-implicit-function-declaration and use it in
-enable-developer.
Guenther
(This used to be commit 750156337eadc2b7d7f30480f74b0816bc1f79e6)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/configure.in | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/source3/configure.in b/source3/configure.in index 9980d18f43..2a60e43601 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -399,7 +399,7 @@ AC_ARG_WITH(smbtorture4_path, AC_ARG_ENABLE(developer, [ --enable-developer Turn on developer warnings and debugging (default=no)], [if eval "test x$enable_developer = xyes"; then developer=yes - CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER" + DEVELOPER_CFLAGS="-gstabs -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -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], @@ -414,7 +414,24 @@ AC_ARG_ENABLE(developer, [ --enable-developer Turn on developer warnings a samba_cv_HAVE_Wdeclaration_after_statement=cross) ]) if test x"$samba_cv_HAVE_Wdeclaration_after_statement" = x"yes"; then - CFLAGS="${CFLAGS} -Wdeclaration-after-statement" + DEVELOPER_CFLAGS="${DEVELOPER_CFLAGS} -Wdeclaration-after-statement" + fi + # here + #-Werror-implicit-function-declaration + AC_CACHE_CHECK( + [that the C compiler understands -Werror-implicit-function-declaration], + samba_cv_HAVE_Werror_implicit_function_declaration, [ + AC_TRY_RUN_STRICT([ + int main(void) + { + return 0; + }],[-Werror-implicit-function-declaration],[$CPPFLAGS],[$LDFLAGS], + samba_cv_HAVE_Werror_implicit_function_declaration=yes, + samba_cv_HAVE_Werror_implicit_function_declaration=no, + samba_cv_HAVE_Werror_implicit_function_declaration=cross) + ]) + if test x"$samba_cv_HAVE_Werror_implicit_function_declaration" = x"yes"; then + DEVELOPER_CFLAGS="${DEVELOPER_CFLAGS} -Werror-implicit-function-declaration" fi fi]) @@ -6287,6 +6304,11 @@ AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"], AC_MSG_ERROR([summary failure. Aborting config]); exit 1;, AC_MSG_WARN([cannot run when cross-compiling])) +dnl Merge in developer cflags from now on +if test x"$developer" = x"yes"; then + CFLAGS="${CFLAGS} ${DEVELOPER_CFLAGS}" +fi + builddir=`pwd` AC_SUBST(builddir) |