# HG changeset patch # User Ryan C. Gordon # Date 1132199022 0 # Node ID 867f521591e5b977032db993769091c57d50e2f2 # Parent 8c43aceeed816e96f64a525cb08f7fac08768bb2 Fixed Altivec support on Mac OS X. diff -r 8c43aceeed81 -r 867f521591e5 configure.in --- a/configure.in Thu Nov 17 03:16:01 2005 +0000 +++ b/configure.in Thu Nov 17 03:43:42 2005 +0000 @@ -1922,42 +1922,70 @@ dnl Check for altivec instruction support using gas syntax CheckAltivec() { - dnl FIXME: Theoretically, you might not have altivec.h, we should check - dnl FIXME: that seperately, but I think all major platforms have it - dnl FIXME: at the moment... --ryan. + 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) CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -maltivec" - AC_TRY_COMPILE([ - #include - vector unsigned int vzero() { - return vec_splat_u32(0); - } - ],[ - ],[ - have_gcc_altivec=yes - ]) - AC_MSG_RESULT($have_gcc_altivec) + + 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 if test x$have_gcc_altivec = xno; then AC_MSG_CHECKING(for Altivec with GCC -faltivec option) - CFLAGS="${CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -faltivec" - AC_TRY_COMPILE([ - #include - vector unsigned int vzero() { - return vec_splat_u32(0); - } - ],[ - ],[ - have_gcc_altivec=yes - ]) - AC_MSG_RESULT($have_gcc_altivec) + CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -faltivec" + 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 fi if test x$have_gcc_altivec = xno; then CFLAGS="${save_CFLAGS}" + else + if test x$have_altivec_h_hdr = xyes; then + CFLAGS="${CFLAGS} -DHAVE_ALTIVEC_H" + fi fi } diff -r 8c43aceeed81 -r 867f521591e5 src/video/SDL_blit_A.c --- a/src/video/SDL_blit_A.c Thu Nov 17 03:16:01 2005 +0000 +++ b/src/video/SDL_blit_A.c Thu Nov 17 03:43:42 2005 +0000 @@ -422,7 +422,9 @@ #endif #ifdef USE_ALTIVEC_BLITTERS +#ifdef HAVE_ALTIVEC_H #include +#endif #include #if ((defined MACOSX) && (__GNUC__ < 4)) diff -r 8c43aceeed81 -r 867f521591e5 src/video/SDL_blit_N.c --- a/src/video/SDL_blit_N.c Thu Nov 17 03:16:01 2005 +0000 +++ b/src/video/SDL_blit_N.c Thu Nov 17 03:43:42 2005 +0000 @@ -36,7 +36,9 @@ /* Functions to blit from N-bit surfaces to other surfaces */ #ifdef USE_ALTIVEC_BLITTERS +#ifdef HAVE_ALTIVEC_H #include +#endif #include #include #ifdef MACOSX