2010-04-19 Marcus Brinkmann <marcus@g10code.de>
authorMarcus Brinkmann <mb@g10code.com>
Mon, 19 Apr 2010 17:15:03 +0000 (17:15 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Mon, 19 Apr 2010 17:15:03 +0000 (17:15 +0000)
* configure.ac: Check for -fno-strict-aliasing.

ChangeLog
configure.ac

index 9222463..f2dbb64 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-19  Marcus Brinkmann  <marcus@g10code.de>
+
+       * configure.ac: Check for -fno-strict-aliasing.
+
 2010-04-12  Brad Hards  <bradh@frogmouth.net>  (wk)
 
        * configure.ac: Print more verbose info at the end.
index 65e29cd..d05c9cb 100644 (file)
@@ -928,6 +928,17 @@ if test "$GCC" = yes; then
         if test x"$_gcc_wopt" = xyes ; then
           CFLAGS="$CFLAGS -Wpointer-arith"
         fi
+
+        AC_MSG_CHECKING([if gcc supports -fno-strict-aliasing])
+        _gcc_cflags_save=$CFLAGS
+        CFLAGS="-fno-strict-aliasing"
+        AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_wopt=yes,_gcc_wopt=no)
+        AC_MSG_RESULT($_gcc_wopt)
+        CFLAGS=$_gcc_cflags_save;
+        if test x"$_gcc_wopt" = xyes ; then
+          CFLAGS="$CFLAGS -fno-strict-aliasing"
+        fi
+
     fi
 
 fi