- [ac_cv_c_altivec],
- [# OS X/PPC test (gcc 4.x)
- CFLAGS="${CFLAGS} -mpim-altivec -force_cpusubtype_ALL"
- AC_TRY_COMPILE([vector unsigned char foo;],
- [vec_ld(0, (unsigned char *)0);],
- [ac_cv_c_altivec="-mpim-altivec -force_cpusubtype_ALL"],
- [# OS X/PPC test (gcc 3.x)
- CFLAGS="${CFLAGS} -faltivec"
- AC_TRY_COMPILE([vector unsigned char foo;],
- [vec_ld(1 * sizeof(vector float), (unsigned char *)0);],
- [ac_cv_c_altivec="-faltivec"],
- dnl Below this are the Linux tests
- [# Linux/PPC test (gcc 4.x)
- CFLAGS="${CFLAGS} -maltivec"
- AC_TRY_COMPILE([#include <altivec.h>],
- [vec_ld(0, (unsigned char *)0);],
- [ac_cv_c_altivec="-maltivec"],
- [# Linux/PPC test (gcc 3.3)
- CFLAGS="${CFLAGS} -maltivec -mabi=altivec"
- AC_TRY_COMPILE([#include <altivec.h>],
- [vec_ld(0, (unsigned char *)0);],
- [ac_cv_c_altivec=""
- ac_cv_c_altivec_abi="-maltivec -mabi=altivec"],
- [# Linux/PPC test (gcc 3.3)
- CFLAGS="${CFLAGS} -fvec"
- AC_TRY_COMPILE([#include <altivec.h>],
- [vec_ld(0, (unsigned char *)0);],
- [ac_cv_c_altivec="-fvec"],
- [ac_cv_c_altivec=no])
- ])
- ])
- ])
- ])
+ [ac_cv_c_altivec], [
+ CFLAGS="${CFLAGS} -maltivec"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+[#include <altivec.h>]], [
+[vec_ld(0, (unsigned char *)0);]])], [
+ ac_cv_c_altivec="-maltivec"
+ ], [
+ ac_cv_c_altivec="no"
+ ])