summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2009-05-20 11:03:59 +0200
committerSimon Josefsson <simon@josefsson.org>2009-05-20 11:03:59 +0200
commit789c9d820186328e14dc93c32c1a766445ede4f4 (patch)
tree641268a774842029293c181e2215a36965376692
parent5965229e8240569a8f942a4f9c4ea779fd77502d (diff)
downloadlibtasn1-789c9d820186328e14dc93c32c1a766445ede4f4.tar.gz
Add --enable-gcc-warnings.
-rw-r--r--NEWS1
-rw-r--r--configure.ac21
2 files changed, 19 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index c69871e..18955b4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
Version 2.2 (unreleased)
- Changed license of libtasn1.pc from GPLv3+ to LGPLv2.1+.
Reported by Jeff Cai <Jeff.Cai@Sun.COM>.
+- Building with many warning flags now requires --enable-gcc-warnings.
Version 2.1 (released 2009-04-17)
- Fix compilation failure on platforms that can't generate empty archives,
diff --git a/configure.ac b/configure.ac
index 91fd29c..7befa74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,8 +58,21 @@ GTK_DOC_CHECK(1.2)
gl_INIT
lgl_INIT
-# Add many warnings, except some...
-if test "$GCC" = "yes"; then
+
+AC_ARG_ENABLE([gcc-warnings],
+ [AS_HELP_STRING([--enable-gcc-warnings],
+ [turn on lots of GCC warnings (for developers)])],
+ [case $enableval in
+ yes|no) ;;
+ *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
+ esac
+ gl_gcc_warnings=$enableval],
+ [gl_gcc_warnings=no]
+)
+
+if test "$gl_gcc_warnings" = yes; then
+ gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
+
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
nw="$nw -Wc++-compat" # We don't care strongly about C++ compilers
nw="$nw -Wtraditional" # Warns on #elif which we use often
@@ -73,11 +86,13 @@ if test "$GCC" = "yes"; then
nw="$nw -Wunused-macros" # Breaks on bison generated ASN1.c
nw="$nw -Wunsafe-loop-optimizations"
nw="$nw -Wstrict-overflow"
+
gl_MANYWARN_ALL_GCC([ws])
gl_MANYWARN_COMPLEMENT(ws, [$ws], [$nw])
for w in $ws; do
gl_WARN_ADD([$w])
done
+
gl_WARN_ADD([-Wno-missing-field-initializers])
gl_WARN_ADD([-Wno-sign-compare])
gl_WARN_ADD([-Wno-pointer-sign])
@@ -107,7 +122,7 @@ AC_MSG_NOTICE([summary of build options:
Host type: ${host}
Install prefix: ${prefix}
Compiler: ${CC}
- Warning flags: ${WARN_CFLAGS}
+ Warning flags: errors: ${WERROR_CFLAGS} warnings: ${WARN_CFLAGS}
Library types: Shared=${enable_shared}, Static=${enable_static}
Valgrind: ${VALGRIND}
Version script: $have_ld_version_script