summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2011-02-22 21:44:36 -0800
committerSam Lantinga <slouken@libsdl.org>2011-02-22 21:44:36 -0800
commite4a0db291e4bfbf316ff0f90f3b22890b62d5232 (patch)
tree713365a72b91566b2792b7f4a54ae8e5e2d23b7e /configure.in
parent92bf0fc2fd37bed2c987f2f0e450095d5a1beddd (diff)
Re-added the 3DNow! and AltiVec instruction support.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in103
1 files changed, 103 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 38bd40a2..49c4f41a 100644
--- a/configure.in
+++ b/configure.in
@@ -501,6 +501,33 @@ AC_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=yes]]]),
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 @@ AC_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=no]]]),
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