summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorjcorgan2008-08-24 17:41:07 +0000
committerjcorgan2008-08-24 17:41:07 +0000
commit34af4364456b9005efee3c3986ea0f4dce87c99e (patch)
tree06dc2b36e42a00985364f043748f9ab1881bde0b /configure.ac
parent66a225bf721cd61c736879bdf8ab44674319426d (diff)
downloadgnuradio-34af4364456b9005efee3c3986ea0f4dce87c99e.tar.gz
gnuradio-34af4364456b9005efee3c3986ea0f4dce87c99e.tar.bz2
gnuradio-34af4364456b9005efee3c3986ea0f4dce87c99e.zip
Fix compiler warnings across the tree. Adds --enable-warnings-as-errors configure option. Currently compiles with no warnings with GCC 4.2.3 on Ubuntu 8.04.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9396 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 11 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 0986a9fdb..14e982b34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,6 +40,13 @@ LF_CONFIGURE_CC
LF_CONFIGURE_CXX
GR_LIB64 dnl check for lib64 suffix after choosing compilers
+cxx_warnings_as_errors=""
+AC_ARG_ENABLE(
+ [warnings-as-errors],
+ [--enable-warnings-as-errors Treat compiler warnings as errors],
+ [cxx_warnings_as_errors="-Werror"]
+)
+
dnl The three macros above are known to override CXXFLAGS if the user
dnl didn't specify them. Though I'm sure somebody thought this was
dnl a good idea, it makes it hard to use other than -g -O2 when compiling
@@ -50,16 +57,16 @@ dnl the output of swig use use -O1 if we're using g++.
dnl See Makefile.common for the rest of the magic.
if test "$user_set_cxxflags" != yes; then
autoconf_default_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=""
+ CXXFLAGS=$cxx_warnings_as_errors
if test "$GXX" = yes; then
case "$host_cpu" in
powerpc*)
dnl "-O1" is broken on the PPC for some reason
dnl (at least as of g++ 4.1.1)
- swig_CXXFLAGS="-g1 -O2"
+ swig_CXXFLAGS="-g1 -O2 -fno-strict-aliasing"
;;
*)
- swig_CXXFLAGS="-g -O1"
+ swig_CXXFLAGS="-g -O1 -fno-strict-aliasing"
;;
esac
fi
@@ -246,7 +253,7 @@ GR_SUBVERSION
dnl Component specific configuration
dnl The order of the GR_ macros determines the order of compilation
dnl For -any- checks on $enable_all_components
-dnl use the following guildlines:
+dnl use the following guidelines:
dnl yes : --enable-all-components was specified, so error out if any
dnl components do not pass configuration checks.
dnl no : --disable-all-components was specified, so try to build the