aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-03-18 12:44:37 -0400
committerNick Mathewson <nickm@torproject.org>2011-03-18 12:44:37 -0400
commit8b393afa94891cb7d4d0371ff38469fbabbe61b3 (patch)
treed2d2dcb2eb148b2d940e3b512e1a752c62e577d5 /configure.in
parent1db6eb6cb7db46d8dde482f629fbc1c578310d52 (diff)
parentfe86be61b6d84fbb442b13aa52139e6a3892dac0 (diff)
downloadtor-8b393afa94891cb7d4d0371ff38469fbabbe61b3.tar
tor-8b393afa94891cb7d4d0371ff38469fbabbe61b3.tar.gz
Merge remote branch 'origin/maint-0.2.2'
Trivial Conflicts: configure.in
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in22
1 files changed, 18 insertions, 4 deletions
diff --git a/configure.in b/configure.in
index d7cb91f51..f5dcf44ed 100644
--- a/configure.in
+++ b/configure.in
@@ -1068,12 +1068,13 @@ fi
# Set CFLAGS _after_ all the above checks, since our warnings are stricter
# than autoconf's macros like.
if test "$GCC" = yes; then
- CFLAGS="$CFLAGS -Wall -g -O2"
# Disable GCC's strict aliasing checks. They are an hours-to-debug
# accident waiting to happen.
- CFLAGS="$CFLAGS -fno-strict-aliasing"
+ CFLAGS="$CFLAGS -Wall -fno-strict-aliasing"
else
- CFLAGS="$CFLAGS -g -O"
+ # Autoconf sets -g -O2 by default. Override optimization level
+ # for non-gcc compilers
+ CFLAGS="$CFLAGS -O"
enable_gcc_warnings=no
enable_gcc_warnings_advisory=no
fi
@@ -1097,6 +1098,11 @@ if test x$enable_gcc_warnings = xyes || test x$enable_gcc_warnings_advisory = xy
#error
#endif])], have_gcc43=yes, have_gcc43=no)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+#if !defined(__clang__) || (__clang_major__ > 2) || (__clang_major__ == 2 && __clang_minor__ > 9)
+#error
+#endif])], have_clang29orlower=yes, have_clang29orlower=no)
+
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wshorten-64-to-32"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], have_shorten64_flag=yes,
@@ -1132,10 +1138,18 @@ if test x$enable_gcc_warnings = xyes || test x$enable_gcc_warnings_advisory = xy
if test x$have_gcc42 = xyes ; then
# These warnings break gcc 4.0.2 and work on gcc 4.2
# XXXX020 See if any of these work with earlier versions.
- CFLAGS="$CFLAGS -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=1"
+ CFLAGS="$CFLAGS -Waddress -Wmissing-noreturn -Wstrict-overflow=1"
+
# We used to use -Wstrict-overflow=5, but that breaks us heavily under 4.3.
fi
+ if test x$have_gcc42 = xyes && test x$have_clang29orlower = xno; then
+ # These warnings break gcc 4.0.2 and clang, but work on gcc 4.2
+ # We only disable these for clang 2.9 and lower, in case they are
+ # supported in later versions.
+ CFLAGS="$CFLAGS -Wnormalized=id -Woverride-init"
+ fi
+
if test x$have_gcc43 = xyes ; then
# These warnings break gcc 4.2 and work on gcc 4.3
# XXXX020 See if any of these work with earlier versions.