From c2efbc90d0759a935898e828d048ed1c66bf7993 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 13 Oct 2009 06:33:46 +0000 Subject: [PATCH] Debian patch: 050_altivec_detection.diff --- configure.in | 98 +++++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/configure.in b/configure.in index 1fda3b622..5b2aeb573 100644 --- a/configure.in +++ b/configure.in @@ -468,64 +468,66 @@ AC_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=no]]]), AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]), , enable_altivec=yes) if test x$enable_altivec = xyes; then - have_altivec_h_hdr=no - AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes) - save_CFLAGS="$CFLAGS" have_gcc_altivec=no - AC_MSG_CHECKING(for Altivec with GCC -maltivec option) + have_altivec_h_hdr=no altivec_CFLAGS="-maltivec" CFLAGS="$save_CFLAGS $altivec_CFLAGS" - if test x$have_altivec_h_hdr = xyes; then - AC_TRY_COMPILE([ - #include - vector unsigned int vzero() { - return vec_splat_u32(0); - } - ],[ - ],[ - have_gcc_altivec=yes - ]) - AC_MSG_RESULT($have_gcc_altivec) - else - AC_TRY_COMPILE([ - vector unsigned int vzero() { - return vec_splat_u32(0); - } - ],[ - ],[ - have_gcc_altivec=yes - ]) - AC_MSG_RESULT($have_gcc_altivec) + AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option) + AC_TRY_COMPILE([ + #include + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + have_altivec_h_hdr=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) + + if test x$have_gcc_altivec = xno; then + AC_MSG_CHECKING(for Altivec with GCC -maltivec option) + AC_TRY_COMPILE([ + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) fi if test x$have_gcc_altivec = xno; then - AC_MSG_CHECKING(for Altivec with GCC -faltivec option) + AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option) altivec_CFLAGS="-faltivec" CFLAGS="$save_CFLAGS $altivec_CFLAGS" - if test x$have_altivec_h_hdr = xyes; then - AC_TRY_COMPILE([ - #include - vector unsigned int vzero() { - return vec_splat_u32(0); - } - ],[ - ],[ - have_gcc_altivec=yes - ]) - AC_MSG_RESULT($have_gcc_altivec) - else - AC_TRY_COMPILE([ - vector unsigned int vzero() { - return vec_splat_u32(0); - } - ],[ - ],[ - have_gcc_altivec=yes - ]) - AC_MSG_RESULT($have_gcc_altivec) - fi + AC_TRY_COMPILE([ + #include + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + have_altivec_h_hdr=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) + fi + + if test x$have_gcc_altivec = xno; then + AC_MSG_CHECKING(for Altivec with GCC -faltivec option) + AC_TRY_COMPILE([ + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) fi CFLAGS="$save_CFLAGS"