configure.in
changeset 5389 24903690f48a
parent 5345 0202f62906ca
child 5408 35a63789c3f2
     1.1 --- a/configure.in	Mon Feb 21 23:45:48 2011 -0800
     1.2 +++ b/configure.in	Tue Feb 22 21:44:36 2011 -0800
     1.3 @@ -501,6 +501,33 @@
     1.4          fi
     1.5      fi
     1.6  
     1.7 +    AC_ARG_ENABLE(3dnow,
     1.8 +AC_HELP_STRING([--enable-3dnow], [use MMX assembly routines [[default=yes]]]),
     1.9 +                  , enable_3dnow=yes)
    1.10 +    if test x$enable_3dnow = xyes; then
    1.11 +        save_CFLAGS="$CFLAGS"
    1.12 +        have_gcc_3dnow=no
    1.13 +        AC_MSG_CHECKING(for GCC -m3dnow option)
    1.14 +        amd3dnow_CFLAGS="-m3dnow"
    1.15 +        CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
    1.16 +
    1.17 +        AC_TRY_COMPILE([
    1.18 +        #include <mm3dnow.h>
    1.19 +        #ifndef __3dNOW__
    1.20 +        #error Assembler CPP flag not enabled
    1.21 +        #endif
    1.22 +        ],[
    1.23 +        ],[
    1.24 +        have_gcc_3dnow=yes
    1.25 +        ])
    1.26 +        AC_MSG_RESULT($have_gcc_3dnow)
    1.27 +        CFLAGS="$save_CFLAGS"
    1.28 +
    1.29 +        if test x$have_gcc_3dnow = xyes; then
    1.30 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
    1.31 +        fi
    1.32 +    fi
    1.33 +
    1.34      AC_ARG_ENABLE(sse,
    1.35  AC_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
    1.36                    , enable_sse=yes)
    1.37 @@ -572,6 +599,82 @@
    1.38              EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
    1.39          fi
    1.40      fi
    1.41 +
    1.42 +    AC_ARG_ENABLE(altivec,
    1.43 +AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
    1.44 +                  , enable_altivec=yes)
    1.45 +    if test x$enable_altivec = xyes; then
    1.46 +        save_CFLAGS="$CFLAGS"
    1.47 +        have_gcc_altivec=no
    1.48 +        have_altivec_h_hdr=no
    1.49 +        altivec_CFLAGS="-maltivec"
    1.50 +        CFLAGS="$save_CFLAGS $altivec_CFLAGS"
    1.51 +
    1.52 +        AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
    1.53 +        AC_TRY_COMPILE([
    1.54 +        #include <altivec.h>
    1.55 +        vector unsigned int vzero() {
    1.56 +            return vec_splat_u32(0);
    1.57 +        }
    1.58 +        ],[
    1.59 +        ],[
    1.60 +        have_gcc_altivec=yes
    1.61 +        have_altivec_h_hdr=yes
    1.62 +        ])
    1.63 +        AC_MSG_RESULT($have_gcc_altivec)
    1.64 +
    1.65 +        if test x$have_gcc_altivec = xno; then
    1.66 +            AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
    1.67 +            AC_TRY_COMPILE([
    1.68 +            vector unsigned int vzero() {
    1.69 +                return vec_splat_u32(0);
    1.70 +            }
    1.71 +            ],[
    1.72 +            ],[
    1.73 +            have_gcc_altivec=yes
    1.74 +            ])
    1.75 +            AC_MSG_RESULT($have_gcc_altivec)
    1.76 +        fi
    1.77 +
    1.78 +        if test x$have_gcc_altivec = xno; then
    1.79 +            AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
    1.80 +            altivec_CFLAGS="-faltivec"
    1.81 +            CFLAGS="$save_CFLAGS $altivec_CFLAGS"
    1.82 +            AC_TRY_COMPILE([
    1.83 +            #include <altivec.h>
    1.84 +            vector unsigned int vzero() {
    1.85 +                return vec_splat_u32(0);
    1.86 +            }
    1.87 +            ],[
    1.88 +            ],[
    1.89 +            have_gcc_altivec=yes
    1.90 +            have_altivec_h_hdr=yes
    1.91 +            ])
    1.92 +            AC_MSG_RESULT($have_gcc_altivec)
    1.93 +        fi
    1.94 +
    1.95 +        if test x$have_gcc_altivec = xno; then
    1.96 +            AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
    1.97 +            AC_TRY_COMPILE([
    1.98 +            vector unsigned int vzero() {
    1.99 +                return vec_splat_u32(0);
   1.100 +            }
   1.101 +            ],[
   1.102 +            ],[
   1.103 +            have_gcc_altivec=yes
   1.104 +            ])
   1.105 +            AC_MSG_RESULT($have_gcc_altivec)
   1.106 +        fi
   1.107 +        CFLAGS="$save_CFLAGS"
   1.108 +
   1.109 +        if test x$have_gcc_altivec = xyes; then
   1.110 +            AC_DEFINE(SDL_ALTIVEC_BLITTERS)
   1.111 +            if test x$have_altivec_h_hdr = xyes; then
   1.112 +              AC_DEFINE(HAVE_ALTIVEC_H)
   1.113 +            fi
   1.114 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
   1.115 +        fi
   1.116 +    fi
   1.117  fi
   1.118  
   1.119  dnl See if the OSS audio interface is supported