Commit 9d8634e7 authored by al3x's avatar al3x

Simplified and fixed altivec/altivec.h detection under Linux and Darwin (and...

Simplified and fixed altivec/altivec.h detection under Linux and Darwin (and others). Patch by Magnus Damm <damm@opensource.se>


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@2120 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent a827bf13
...@@ -419,6 +419,17 @@ if test $tune != "generic"; then ...@@ -419,6 +419,17 @@ if test $tune != "generic"; then
esac esac
fi fi
# AltiVec flags: The FSF version of GCC differs from the Darwin version
if test $cpu = "powerpc"; then
if test $altivec = "yes"; then
if test "$darwin" = "yes"; then
CFLAGS="$CFLAGS -faltivec"
else
CFLAGS="$CFLAGS -maltivec -mabi=altivec"
fi
fi
fi
# See if we have <altivec.h> # See if we have <altivec.h>
cat > $TMPC << EOF cat > $TMPC << EOF
#include <altivec.h> #include <altivec.h>
...@@ -426,7 +437,7 @@ int main( void ) { return 0; } ...@@ -426,7 +437,7 @@ int main( void ) { return 0; }
EOF EOF
_altivec_h="no" _altivec_h="no"
if $cc -o $TMPE $TMPC 2> /dev/null ; then if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
_altivec_h="yes" _altivec_h="yes"
fi fi
...@@ -450,11 +461,7 @@ int main(void) { ...@@ -450,11 +461,7 @@ int main(void) {
} }
EOF EOF
fi fi
if test "$darwin" = "yes"; then $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
$cc -o $TMPE $TMPC -faltivec 2> /dev/null || altivec="no"
else
$cc -o $TMPE $TMPC -maltivec -mabi=altivec 2> /dev/null || altivec="no"
fi
fi fi
# Can only do mmi on mips # Can only do mmi on mips
......
...@@ -127,11 +127,6 @@ OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o ...@@ -127,11 +127,6 @@ OBJS += ps2/dsputil_mmi.o ps2/idct_mmi.o ps2/mpegvideo_mmi.o
endif endif
ifeq ($(TARGET_ALTIVEC),yes) ifeq ($(TARGET_ALTIVEC),yes)
ifeq ($(TARGET_OS),Darwin)
CFLAGS += -faltivec
else
CFLAGS += -maltivec -mabi=altivec
endif
OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \ OBJS += ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o \
ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fft_altivec.o ppc/gmc_altivec.o
endif endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment