From 76f9b5c21eb35fdf5ff9f912913eba0716f72ec2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 19 Apr 2009 23:59:09 +0200 Subject: [PATCH] Use Gnulib's `manywarnings' module. * configure.ac: Use `gl_MANYWARN_ALL_GCC', with the exception of `-Wtraditional*' since Gnulib headers don't honor that. * m4/gnulib-cache.m4: Add `manywarnings' and `warnings'. --- configure.ac | 14 +++++++++++--- m4/.gitignore | 2 ++ m4/gnulib-cache.m4 | 4 +++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 66e5c5c..19c03c2 100644 --- a/configure.ac +++ b/configure.ac @@ -68,9 +68,17 @@ AC_C_BIGENDIAN if test "x$GCC" = "xyes"; then # Enable useful GCC compilation flags. - GCC_CFLAGS="-pipe -Wall -Werror" - GCC_CFLAGS="-Wcast-align -Wmissing-prototypes -Wpointer-arith $GCC_CFLAGS" - GCC_CFLAGS="-Winline -Wno-error=inline -Wdeclaration-after-statement $GCC_CFLAGS" + GCC_CFLAGS="" + + gl_MANYWARN_ALL_GCC([POTENTIAL_GCC_CFLAGS]) + POTENTIAL_GCC_CFLAGS="-pipe -Wall -Werror -Wno-error=inline $POTENTIAL_GCC_CFLAGS" + for flag in $POTENTIAL_GCC_CFLAGS + do + case "x$flag" in + *traditional*) break;; + *) gl_WARN_ADD([$flag], [GCC_CFLAGS]);; + esac + done else GCC_CFLAGS="" fi diff --git a/m4/.gitignore b/m4/.gitignore index 02d2cac..268ec65 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -33,3 +33,5 @@ unistd_h.m4 /00gnulib.m4 /multiarch.m4 /wint_t.m4 +/manywarnings.m4 +/warnings.m4 diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 index 0f044c6..c9da3d8 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -15,13 +15,14 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --local-dir=lgl --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl byteswap iconv_open-utf striconveh string uniconv/u16-strconv-from-locale uniconv/u16-strconv-to-locale uniconv/u32-strconv-from-locale uniconv/u32-strconv-to-locale uniconv/u8-strconv-from-locale uniconv/u8-strconv-to-locale +# gnulib-tool --import --dir=. --local-dir=lgl --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl byteswap iconv_open-utf manywarnings striconveh string uniconv/u16-strconv-from-locale uniconv/u16-strconv-to-locale uniconv/u32-strconv-from-locale uniconv/u32-strconv-to-locale uniconv/u8-strconv-from-locale uniconv/u8-strconv-to-locale warnings # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([lgl]) gl_MODULES([ byteswap iconv_open-utf + manywarnings striconveh string uniconv/u16-strconv-from-locale @@ -30,6 +31,7 @@ gl_MODULES([ uniconv/u32-strconv-to-locale uniconv/u8-strconv-from-locale uniconv/u8-strconv-to-locale + warnings ]) gl_AVOID([]) gl_SOURCE_BASE([lib]) -- 2.11.4.GIT