comparison configure @ 10572:d7ec2e2bb0da

Simplified/fixed altivec/altivec.h detection on Linux and Darwin (and others). Patch by Magnus Damm <damm@opensource.se>
author alex
date Mon, 11 Aug 2003 20:52:53 +0000
parents ad5a27d63a60
children de20638eef6c
comparison
equal deleted inserted replaced
10571:07cfe1e1a2c9 10572:d7ec2e2bb0da
863 _target_arch='TARGET_ARCH_POWERPC = yes' 863 _target_arch='TARGET_ARCH_POWERPC = yes'
864 iproc='ppc' 864 iproc='ppc'
865 proc='' 865 proc=''
866 _march='' 866 _march=''
867 _mcpu='' 867 _mcpu=''
868 _altivec_gcc_flags=''
868 # XXX: this should be removed imho... 869 # XXX: this should be removed imho...
869 cpu750=`$_cpuinfo | grep "cpu.*750"` 870 cpu750=`$_cpuinfo | grep "cpu.*750"`
870 if test -n "$cpu750"; then 871 if test -n "$cpu750"; then
871 _march='-mcpu=750' 872 _march='-mcpu=750'
872 _mcpu='-mtune=750' 873 _mcpu='-mtune=750'
873 fi 874 fi
874 if linux ; then 875 if linux ; then
875 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -1` 876 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -1`
876 if test -n "`$_cpuinfo | grep altivec`"; then 877 if test -n "`$_cpuinfo | grep altivec`"; then
877 _altivec=yes 878 _altivec=yes
879 _altivec_gcc_flags='-maltivec -mabi=altivec'
878 fi 880 fi
879 fi 881 fi
880 if darwin ; then 882 if darwin ; then
881 if [ `sysctl -n hw.vectorunit` -eq 1 ]; then 883 if [ `sysctl -n hw.vectorunit` -eq 1 ]; then
882 _altivec=yes 884 _altivec=yes
885 _altivec_gcc_flags='-faltivec'
883 fi 886 fi
884 fi 887 fi
885 if test -n "$proc"; then 888 if test -n "$proc"; then
886 case "$proc" in 889 case "$proc" in
887 601) _march='-mcpu=601' _mcpu='-mtune=601' ;; 890 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
899 7450*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;; 902 7450*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
900 *) ;; 903 *) ;;
901 esac 904 esac
902 fi 905 fi
903 fi 906 fi
907 _mcpu="$_mcpu $_altivec_gcc_flags"
904 ;; 908 ;;
905 909
906 alpha) 910 alpha)
907 _def_arch='#define ARCH_ALPHA 1' 911 _def_arch='#define ARCH_ALPHA 1'
908 _target_arch='TARGET_ARCH_ALPHA = yes' 912 _target_arch='TARGET_ARCH_ALPHA = yes'
2043 cat > $TMPC << EOF 2047 cat > $TMPC << EOF
2044 #include <altivec.h> 2048 #include <altivec.h>
2045 int main(void) { return 0; } 2049 int main(void) { return 0; }
2046 EOF 2050 EOF
2047 _have_altivec_h=no 2051 _have_altivec_h=no
2048 cc_check && _have_altivec_h=yes 2052 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2049 if test "$_have_altivec_h" = yes ; then 2053 if test "$_have_altivec_h" = yes ; then
2050 _def_altivec_h='#define HAVE_ALTIVEC_H 1' 2054 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2051 else 2055 else
2052 _def_altivec_h='#undef HAVE_ALTIVEC_H' 2056 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2053 fi 2057 fi