configure.in
changeset 2264 f7f80b822c1f
parent 2261 c20476d7d7b3
child 2271 60b4c52a7906
--- a/configure.in	Fri Aug 17 06:40:12 2007 +0000
+++ b/configure.in	Fri Aug 17 06:41:20 2007 +0000
@@ -356,6 +356,32 @@
         fi
     fi
 
+    AC_ARG_ENABLE(sse2,
+AC_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=yes]]]),
+                  , enable_sse2=yes)
+    if test x$enable_sse2 = xyes; then
+        save_CFLAGS="$CFLAGS"
+        have_gcc_sse2=no
+        AC_MSG_CHECKING(for GCC -msse2 option)
+        sse2_CFLAGS="-msse2"
+        CFLAGS="$save_CFLAGS $sse2_CFLAGS"
+
+        AC_TRY_COMPILE([
+        #include <emmintrin.h>
+        #ifndef __SSE2__
+        #error Assembler CPP flag not enabled
+        #endif
+        ],[
+        ],[
+        have_gcc_sse2=yes
+        ])
+        AC_MSG_RESULT($have_gcc_sse2)
+
+        if test x$have_gcc_sse2 = xyes; then
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
+        fi
+    fi
+
     AC_ARG_ENABLE(altivec,
 AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
                   , enable_altivec=yes)