From 4a6fd43313782e16fc79841048942291e19257df Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Tue, 3 Apr 2012 05:31:20 +0200 Subject: [PATCH] Configure with gcc older than 2.95 I don't know why people use such ancient gcc versions, but the fix seems straightforward enough to maybe just do it. --- configure.in | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 299b3f5f..97ffae08 100644 --- a/configure.in +++ b/configure.in @@ -41,12 +41,21 @@ AC_PROG_MKDIR_P AC_PROG_GCC_TRADITIONAL +# We need to test for at least gcc 2.95 here, because older versions don't +# have -fno-strict-aliasing +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [ +#if !defined(__GNUC__) || (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 95) +#error +#endif])], have_gcc295=yes, have_gcc295=no) + if test "$GCC" = "yes" ; then # Enable many gcc warnings by default... CFLAGS="$CFLAGS -Wall" # And disable the strict-aliasing optimization, since it breaks # our sockaddr-handling code in strange ways. - CFLAGS="$CFLAGS -fno-strict-aliasing" + if test x$have_gcc295 = xyes; then + CFLAGS="$CFLAGS -fno-strict-aliasing" + fi fi # OS X Lion started deprecating the system openssl. Let's just disable