configure.ac
changeset 12804 1a330416800d
parent 12762 0fa532733f3f
child 12869 2b56cef46971
     1.1 --- a/configure.ac	Sat Jun 08 18:22:18 2019 -0700
     1.2 +++ b/configure.ac	Sat Jun 08 18:32:29 2019 -0700
     1.3 @@ -1329,6 +1329,29 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 +dnl See if GCC's -fno-strict-aliasingis supported.
     1.8 +dnl  Reference: https://bugzilla.libsdl.org/show_bug.cgi?id=4254
     1.9 +CheckNoStrictAliasing()
    1.10 +{
    1.11 +    AC_MSG_CHECKING(for GCC -fno-strict-aliasing option)
    1.12 +    have_gcc_no_strict_aliasing=no
    1.13 +
    1.14 +    save_CFLAGS="$CFLAGS"
    1.15 +    CFLAGS="$save_CFLAGS -fno-strict-aliasing"
    1.16 +    AC_TRY_COMPILE([
    1.17 +    int x = 0;
    1.18 +    ],[
    1.19 +    ],[
    1.20 +    have_gcc_no_strict_aliasing=yes
    1.21 +    ])
    1.22 +    AC_MSG_RESULT($have_gcc_no_strict_aliasing)
    1.23 +    CFLAGS="$save_CFLAGS"
    1.24 +
    1.25 +    if test x$have_gcc_no_strict_aliasing = xyes; then
    1.26 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-strict-aliasing"
    1.27 +    fi
    1.28 +}
    1.29 +
    1.30  dnl See if GCC's -mpreferred-stack-boundary is supported.
    1.31  dnl  Reference: http://bugzilla.libsdl.org/show_bug.cgi?id=1296
    1.32  CheckStackBoundary()
    1.33 @@ -3263,6 +3286,7 @@
    1.34  
    1.35  dnl Do this on all platforms, before everything else (other things might want to override it).
    1.36  CheckWarnAll
    1.37 +CheckNoStrictAliasing
    1.38  
    1.39  dnl Do this for every platform, but for some it doesn't mean anything, but better to catch it here anyhow.
    1.40  CheckEventSignals