comparison configure.in @ 4300:602642738b83 SDL-1.2

Debian patch: 050_altivec_detection.diff
author Sam Lantinga <slouken@libsdl.org>
date Sat, 10 Oct 2009 09:03:08 +0000
parents 7d60c0ac6aae
children 447fd6ae10cf
comparison
equal deleted inserted replaced
4299:0ca47eaff9c9 4300:602642738b83
808 { 808 {
809 AC_ARG_ENABLE(altivec, 809 AC_ARG_ENABLE(altivec,
810 AC_HELP_STRING([--enable-altivec], [use altivec assembly blitters on PPC [[default=yes]]]), 810 AC_HELP_STRING([--enable-altivec], [use altivec assembly blitters on PPC [[default=yes]]]),
811 , enable_altivec=yes) 811 , enable_altivec=yes)
812 if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_altivec = xyes; then 812 if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_altivec = xyes; then
813 have_altivec_h_hdr=no
814 AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes)
815
816 save_CFLAGS="$CFLAGS" 813 save_CFLAGS="$CFLAGS"
817 have_gcc_altivec=no 814 have_gcc_altivec=no
818 AC_MSG_CHECKING(for Altivec with GCC -maltivec option) 815 have_altivec_h_hdr=no
819 altivec_CFLAGS="-maltivec" 816 altivec_CFLAGS="-maltivec"
820 CFLAGS="$save_CFLAGS $altivec_CFLAGS" 817 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
821 818
822 if test x$have_altivec_h_hdr = xyes; then 819 AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
823 AC_TRY_COMPILE([ 820 AC_TRY_COMPILE([
824 #include <altivec.h> 821 #include <altivec.h>
825 vector unsigned int vzero() { 822 vector unsigned int vzero() {
826 return vec_splat_u32(0); 823 return vec_splat_u32(0);
827 } 824 }
828 ],[ 825 ],[
829 ],[ 826 ],[
830 have_gcc_altivec=yes 827 have_gcc_altivec=yes
831 ]) 828 have_altivec_h_hdr=yes
832 AC_MSG_RESULT($have_gcc_altivec) 829 ])
833 else 830 AC_MSG_RESULT($have_gcc_altivec)
834 AC_TRY_COMPILE([ 831
835 vector unsigned int vzero() { 832 if test x$have_gcc_altivec = xno; then
836 return vec_splat_u32(0); 833 AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
837 } 834 AC_TRY_COMPILE([
838 ],[ 835 vector unsigned int vzero() {
839 ],[ 836 return vec_splat_u32(0);
840 have_gcc_altivec=yes 837 }
841 ]) 838 ],[
842 AC_MSG_RESULT($have_gcc_altivec) 839 ],[
843 fi 840 have_gcc_altivec=yes
841 ])
842 AC_MSG_RESULT($have_gcc_altivec)
843 fi
844
845 if test x$have_gcc_altivec = xno; then
846 AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
847 altivec_CFLAGS="-faltivec"
848 CFLAGS="$save_CFLAGS $altivec_CFLAGS"
849 AC_TRY_COMPILE([
850 #include <altivec.h>
851 vector unsigned int vzero() {
852 return vec_splat_u32(0);
853 }
854 ],[
855 ],[
856 have_gcc_altivec=yes
857 have_altivec_h_hdr=yes
858 ])
859 AC_MSG_RESULT($have_gcc_altivec)
860 fi
844 861
845 if test x$have_gcc_altivec = xno; then 862 if test x$have_gcc_altivec = xno; then
846 AC_MSG_CHECKING(for Altivec with GCC -faltivec option) 863 AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
847 altivec_CFLAGS="-faltivec" 864 AC_TRY_COMPILE([
848 CFLAGS="$save_CFLAGS $altivec_CFLAGS" 865 vector unsigned int vzero() {
849 if test x$have_altivec_h_hdr = xyes; then 866 return vec_splat_u32(0);
850 AC_TRY_COMPILE([ 867 }
851 #include <altivec.h> 868 ],[
852 vector unsigned int vzero() { 869 ],[
853 return vec_splat_u32(0); 870 have_gcc_altivec=yes
854 } 871 ])
855 ],[ 872 AC_MSG_RESULT($have_gcc_altivec)
856 ],[
857 have_gcc_altivec=yes
858 ])
859 AC_MSG_RESULT($have_gcc_altivec)
860 else
861 AC_TRY_COMPILE([
862 vector unsigned int vzero() {
863 return vec_splat_u32(0);
864 }
865 ],[
866 ],[
867 have_gcc_altivec=yes
868 ])
869 AC_MSG_RESULT($have_gcc_altivec)
870 fi
871 fi 873 fi
872 CFLAGS="$save_CFLAGS" 874 CFLAGS="$save_CFLAGS"
873 875
874 if test x$have_gcc_altivec = xyes; then 876 if test x$have_gcc_altivec = xyes; then
875 AC_DEFINE(SDL_ALTIVEC_BLITTERS) 877 AC_DEFINE(SDL_ALTIVEC_BLITTERS)