1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-18 04:51:52 +00:00

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

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10573 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2003-08-11 20:52:53 +00:00
parent 1e87b4bbaa
commit eb6fb0dbc9
4 changed files with 5 additions and 21 deletions

View File

@ -40,14 +40,6 @@ COMMON_LIBS = libmpcodecs/libmpcodecs.a mp3lib/libMP3.a liba52/liba52.a libmpeg2
CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Iloader -Ilibvo $(FREETYPE_INC) $(EXTRA_INC) $(CDPARANOIA_INC) $(SDL_INC) $(X11_INC) $(FRIBIDI_INC) # -Wall CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Iloader -Ilibvo $(FREETYPE_INC) $(EXTRA_INC) $(CDPARANOIA_INC) $(SDL_INC) $(X11_INC) $(FRIBIDI_INC) # -Wall
ifeq ($(TARGET_ALTIVEC),yes)
ifeq ($(TARGET_OS),Darwin)
CFLAGS += -faltivec
else
CFLAGS += -maltivec -mabi=altivec
endif
endif
PARTS = libmpdemux libmpcodecs mp3lib liba52 libmpeg2 libavcodec libao2 drivers osdep postproc input libvo libaf PARTS = libmpdemux libmpcodecs mp3lib liba52 libmpeg2 libavcodec libao2 drivers osdep postproc input libvo libaf
ifeq ($(VIDIX),yes) ifeq ($(VIDIX),yes)
PARTS += libdha vidix PARTS += libdha vidix

6
configure vendored
View File

@ -865,6 +865,7 @@ EOF
proc='' proc=''
_march='' _march=''
_mcpu='' _mcpu=''
_altivec_gcc_flags=''
# XXX: this should be removed imho... # XXX: this should be removed imho...
cpu750=`$_cpuinfo | grep "cpu.*750"` cpu750=`$_cpuinfo | grep "cpu.*750"`
if test -n "$cpu750"; then if test -n "$cpu750"; then
@ -875,11 +876,13 @@ EOF
proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -1` proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -1`
if test -n "`$_cpuinfo | grep altivec`"; then if test -n "`$_cpuinfo | grep altivec`"; then
_altivec=yes _altivec=yes
_altivec_gcc_flags='-maltivec -mabi=altivec'
fi fi
fi fi
if darwin ; then if darwin ; then
if [ `sysctl -n hw.vectorunit` -eq 1 ]; then if [ `sysctl -n hw.vectorunit` -eq 1 ]; then
_altivec=yes _altivec=yes
_altivec_gcc_flags='-faltivec'
fi fi
fi fi
if test -n "$proc"; then if test -n "$proc"; then
@ -901,6 +904,7 @@ EOF
esac esac
fi fi
fi fi
_mcpu="$_mcpu $_altivec_gcc_flags"
;; ;;
alpha) alpha)
@ -2045,7 +2049,7 @@ cat > $TMPC << EOF
int main(void) { return 0; } int main(void) { return 0; }
EOF EOF
_have_altivec_h=no _have_altivec_h=no
cc_check && _have_altivec_h=yes cc_check $_altivec_gcc_flags && _have_altivec_h=yes
if test "$_have_altivec_h" = yes ; then if test "$_have_altivec_h" = yes ; then
_def_altivec_h='#define HAVE_ALTIVEC_H 1' _def_altivec_h='#define HAVE_ALTIVEC_H 1'
else else

View File

@ -7,13 +7,6 @@ SRCS = crc.c resample.c bit_allocate.c bitstream.c downmix.c imdct.c imdct_ml
OBJS = $(SRCS:.c=.o) OBJS = $(SRCS:.c=.o)
CFLAGS = $(MLIB_INC) $(OPTFLAGS) CFLAGS = $(MLIB_INC) $(OPTFLAGS)
ifeq ($(TARGET_ALTIVEC),yes)
ifeq ($(TARGET_OS),Darwin)
CFLAGS+= -faltivec
else
CFLAGS+= -maltivec -mabi=altivec
endif
endif
.SUFFIXES: .c .o .SUFFIXES: .c .o

View File

@ -10,11 +10,6 @@ INCLUDE = -I. -I../libvo -I.. $(EXTRA_INC) $(MLIB_INC)
CFLAGS = $(OPTFLAGS) $(INCLUDE) -DMPG12PLAY CFLAGS = $(OPTFLAGS) $(INCLUDE) -DMPG12PLAY
ifeq ($(TARGET_ALTIVEC),yes) ifeq ($(TARGET_ALTIVEC),yes)
ifeq ($(TARGET_OS),Darwin)
CFLAGS += -faltivec
else
CFLAGS += -maltivec -mabi=altivec
endif
SRCS += motion_comp_altivec.c idct_altivec.c SRCS += motion_comp_altivec.c idct_altivec.c
endif endif