configure.in
branchSDL-1.2
changeset 13068 4a2c30be1127
parent 13011 edf8cb7ce974
     1.1 --- a/configure.in	Fri Sep 06 20:00:40 2019 +0300
     1.2 +++ b/configure.in	Sat Sep 07 10:37:28 2019 +0300
     1.3 @@ -844,36 +844,6 @@
     1.4              ])
     1.5              AC_MSG_RESULT($have_gcc_altivec)
     1.6          fi
     1.7 -
     1.8 -        if test x$have_gcc_altivec = xno; then
     1.9 -            AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
    1.10 -            altivec_CFLAGS="-faltivec"
    1.11 -            CFLAGS="$save_CFLAGS $altivec_CFLAGS"
    1.12 -            AC_TRY_COMPILE([
    1.13 -            #include <altivec.h>
    1.14 -            vector unsigned int vzero() {
    1.15 -                return vec_splat_u32(0);
    1.16 -            }
    1.17 -            ],[
    1.18 -            ],[
    1.19 -            have_gcc_altivec=yes
    1.20 -            have_altivec_h_hdr=yes
    1.21 -            ])
    1.22 -            AC_MSG_RESULT($have_gcc_altivec)
    1.23 -        fi
    1.24 -
    1.25 -        if test x$have_gcc_altivec = xno; then
    1.26 -            AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
    1.27 -            AC_TRY_COMPILE([
    1.28 -            vector unsigned int vzero() {
    1.29 -                return vec_splat_u32(0);
    1.30 -            }
    1.31 -            ],[
    1.32 -            ],[
    1.33 -            have_gcc_altivec=yes
    1.34 -            ])
    1.35 -            AC_MSG_RESULT($have_gcc_altivec)
    1.36 -        fi
    1.37          CFLAGS="$save_CFLAGS"
    1.38  
    1.39          if test x$have_gcc_altivec = xyes; then
    1.40 @@ -886,6 +856,43 @@
    1.41      fi
    1.42  }
    1.43  
    1.44 +dnl Check for altivec instruction support - APPLE extensions
    1.45 +CheckAltivecApple()
    1.46 +{
    1.47 +    AC_ARG_ENABLE(altivec,
    1.48 +AC_HELP_STRING([--enable-altivec], [use altivec assembly blitters on PPC [[default=yes]]]),
    1.49 +                  , enable_altivec=yes)
    1.50 +    if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_altivec = xyes; then
    1.51 +        save_CFLAGS="$CFLAGS"
    1.52 +        have_gcc_altivec=no
    1.53 +        altivec_CFLAGS="-faltivec"
    1.54 +        CFLAGS="$save_CFLAGS $altivec_CFLAGS"
    1.55 +
    1.56 +        dnl -faltivec doesn't need altivec.h and actually
    1.57 +        dnl  emits a warning if included..
    1.58 +        AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
    1.59 +        AC_TRY_COMPILE([
    1.60 +        vector unsigned int vzero() {
    1.61 +            return vec_splat_u32(0);
    1.62 +        }
    1.63 +        ],[
    1.64 +        ],[
    1.65 +        have_gcc_altivec=yes
    1.66 +        ])
    1.67 +        AC_MSG_RESULT($have_gcc_altivec)
    1.68 +
    1.69 +        CFLAGS="$save_CFLAGS"
    1.70 +
    1.71 +        if test x$have_gcc_altivec = xyes; then
    1.72 +            AC_DEFINE(SDL_ALTIVEC_BLITTERS)
    1.73 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
    1.74 +        else
    1.75 +        dnl Check standart gcc altivec options
    1.76 +            CheckAltivec
    1.77 +        fi
    1.78 +    fi
    1.79 +}
    1.80 +
    1.81  dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
    1.82  dnl  Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
    1.83  CheckVisibilityHidden()
    1.84 @@ -2785,7 +2792,7 @@
    1.85          CheckMacGL
    1.86          CheckOpenGLX11
    1.87          CheckPTHREAD
    1.88 -        CheckAltivec
    1.89 +        CheckAltivecApple
    1.90  
    1.91          # Need this or things might misbuild on a G3.
    1.92          EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL"