# HG changeset patch # User Sam Lantinga # Date 1228172949 0 # Node ID 33ddad305f3dcbd29c487b107b1d0f1d309288f3 # Parent 222aa027e65074e4bb6c8a5eb24314fe359db5af Make sure that we don't generate floating point code that would cause illegal instruction exceptions on older processors, unless someone passes --enable-ssemath to configure. diff -r 222aa027e650 -r 33ddad305f3d configure.in --- a/configure.in Mon Dec 01 09:45:01 2008 +0000 +++ b/configure.in Mon Dec 01 23:09:09 2008 +0000 @@ -394,6 +394,30 @@ fi fi + # Make sure that we don't generate floating point code that would + # cause illegal instruction exceptions on older processors + case "$host" in + *-*-darwin*) + # Don't need to worry about Apple hardware, it's all SSE capable + default_ssemath=yes + ;; + *64-*-*) + # x86 64-bit architectures all have SSE instructions + default_ssemath=yes + ;; + *) + default_ssemath=no + ;; + esac + AC_ARG_ENABLE(ssemath, +AC_HELP_STRING([--enable-ssemath], [Allow GCC to use SSE floating point math [[default=no]]]), + , enable_ssemath=$default_ssemath) + if test x$enable_ssemath = xno; then + if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387" + fi + fi + AC_ARG_ENABLE(altivec, AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]), , enable_altivec=yes)