configure.in
changeset 5389 24903690f48a
parent 5345 0202f62906ca
child 5408 35a63789c3f2
--- a/configure.in	Mon Feb 21 23:45:48 2011 -0800
+++ b/configure.in	Tue Feb 22 21:44:36 2011 -0800
@@ -501,6 +501,33 @@
         fi
     fi
 
+    AC_ARG_ENABLE(3dnow,
+AC_HELP_STRING([--enable-3dnow], [use MMX assembly routines [[default=yes]]]),
+                  , enable_3dnow=yes)
+    if test x$enable_3dnow = xyes; then
+        save_CFLAGS="$CFLAGS"
+        have_gcc_3dnow=no
+        AC_MSG_CHECKING(for GCC -m3dnow option)
+        amd3dnow_CFLAGS="-m3dnow"
+        CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
+
+        AC_TRY_COMPILE([
+        #include <mm3dnow.h>
+        #ifndef __3dNOW__
+        #error Assembler CPP flag not enabled
+        #endif
+        ],[
+        ],[
+        have_gcc_3dnow=yes
+        ])
+        AC_MSG_RESULT($have_gcc_3dnow)
+        CFLAGS="$save_CFLAGS"
+
+        if test x$have_gcc_3dnow = xyes; then
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
+        fi
+    fi
+
     AC_ARG_ENABLE(sse,
 AC_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
                   , enable_sse=yes)
@@ -572,6 +599,82 @@
             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)
+    if test x$enable_altivec = xyes; then
+        save_CFLAGS="$CFLAGS"
+        have_gcc_altivec=no
+        have_altivec_h_hdr=no
+        altivec_CFLAGS="-maltivec"
+        CFLAGS="$save_CFLAGS $altivec_CFLAGS"
+
+        AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
+        AC_TRY_COMPILE([
+        #include <altivec.h>
+        vector unsigned int vzero() {
+            return vec_splat_u32(0);
+        }
+        ],[
+        ],[
+        have_gcc_altivec=yes
+        have_altivec_h_hdr=yes
+        ])
+        AC_MSG_RESULT($have_gcc_altivec)
+
+        if test x$have_gcc_altivec = xno; then
+            AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
+            AC_TRY_COMPILE([
+            vector unsigned int vzero() {
+                return vec_splat_u32(0);
+            }
+            ],[
+            ],[
+            have_gcc_altivec=yes
+            ])
+            AC_MSG_RESULT($have_gcc_altivec)
+        fi
+
+        if test x$have_gcc_altivec = xno; then
+            AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
+            altivec_CFLAGS="-faltivec"
+            CFLAGS="$save_CFLAGS $altivec_CFLAGS"
+            AC_TRY_COMPILE([
+            #include <altivec.h>
+            vector unsigned int vzero() {
+                return vec_splat_u32(0);
+            }
+            ],[
+            ],[
+            have_gcc_altivec=yes
+            have_altivec_h_hdr=yes
+            ])
+            AC_MSG_RESULT($have_gcc_altivec)
+        fi
+
+        if test x$have_gcc_altivec = xno; then
+            AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
+            AC_TRY_COMPILE([
+            vector unsigned int vzero() {
+                return vec_splat_u32(0);
+            }
+            ],[
+            ],[
+            have_gcc_altivec=yes
+            ])
+            AC_MSG_RESULT($have_gcc_altivec)
+        fi
+        CFLAGS="$save_CFLAGS"
+
+        if test x$have_gcc_altivec = xyes; then
+            AC_DEFINE(SDL_ALTIVEC_BLITTERS)
+            if test x$have_altivec_h_hdr = xyes; then
+              AC_DEFINE(HAVE_ALTIVEC_H)
+            fi
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
+        fi
+    fi
 fi
 
 dnl See if the OSS audio interface is supported