comparison configure @ 26898:d9d4de238430

Rework AltiVec CFLAGS detection. '-maltivec -mabi=altivec' should be used only when altivec.h is available and preferred over '-faltivec'. This should now finally work on all Mac OS X and gcc combinations.
author diego
date Fri, 30 May 2008 18:03:36 +0000
parents 3aa8ad5202ea
children 13061a6174b6
comparison
equal deleted inserted replaced
26897:23c3741dc490 26898:d9d4de238430
2420 # check if AltiVec is supported by the compiler, and how to enable it 2420 # check if AltiVec is supported by the compiler, and how to enable it
2421 echocheck "GCC AltiVec flags" 2421 echocheck "GCC AltiVec flags"
2422 cat > $TMPC << EOF 2422 cat > $TMPC << EOF
2423 int main(void) { return 0; } 2423 int main(void) { return 0; }
2424 EOF 2424 EOF
2425 cc_check -maltivec -mabi=altivec \ 2425 if $(cc_check -maltivec -mabi=altivec) ; then
2426 && _altivec_gcc_flags="-maltivec -mabi=altivec" \ 2426 _altivec_gcc_flags="-maltivec -mabi=altivec"
2427 || { cc_check -faltivec && _altivec_gcc_flags=-faltivec ; } \
2428 || { _altivec=no && _altivec_gcc_flags="none, AltiVec disabled" ; }
2429 echores "$_altivec_gcc_flags"
2430
2431 # check if <altivec.h> should be included 2427 # check if <altivec.h> should be included
2432 echocheck "altivec.h"
2433 _def_altivec_h='#undef HAVE_ALTIVEC_H' 2428 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2434 _have_altivec_h=no
2435 cat > $TMPC << EOF 2429 cat > $TMPC << EOF
2436 #include <altivec.h> 2430 #include <altivec.h>
2437 int main(void) { return 0; } 2431 int main(void) { return 0; }
2438 EOF 2432 EOF
2439 cc_check $_altivec_gcc_flags && _have_altivec_h=yes \ 2433 if $(cc_check $_altivec_gcc_flags) ; then
2440 && inc_altivec_h="#include <altivec.h>" \ 2434 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2441 && _def_altivec_h='#define HAVE_ALTIVEC_H 1' 2435 inc_altivec_h='#include <altivec.h>'
2442 echores "$_have_altivec_h" 2436 else
2437 cat > $TMPC << EOF
2438 int main(void) { return 0; }
2439 EOF
2440 if $(cc_check -faltivec) ; then
2441 _altivec_gcc_flags="-faltivec"
2442 else
2443 _altivec=no
2444 _altivec_gcc_flags="none, AltiVec disabled"
2445 fi
2446 fi
2447 fi
2448 echores "$_altivec_gcc_flags"
2443 2449
2444 # check if the compiler supports braces for vector declarations 2450 # check if the compiler supports braces for vector declarations
2445 cat > $TMPC << EOF 2451 cat > $TMPC << EOF
2446 $inc_altivec_h 2452 $inc_altivec_h
2447 #define AVV(x...) {x} 2453 #define AVV(x...) {x}