Commit e61bfa60 authored by Christophe Massiot's avatar Christophe Massiot

Faster configure script and as-yet untested Darwin patches.

parent 93d7b1f0
...@@ -65,6 +65,7 @@ includedir = @includedir@ ...@@ -65,6 +65,7 @@ includedir = @includedir@
# Libraries for special cases # Libraries for special cases
# #
LIB_ALSA = @LIB_ALSA@ LIB_ALSA = @LIB_ALSA@
LIB_ALTIVEC = @LIB_ALTIVEC@
LIB_BEOS = @LIB_BEOS@ LIB_BEOS = @LIB_BEOS@
LIB_DARWIN = @LIB_DARWIN@ LIB_DARWIN = @LIB_DARWIN@
LIB_DVD = @LIB_DVD@ LIB_DVD = @LIB_DVD@
...@@ -90,6 +91,7 @@ LIB_YUV = @LIB_YUV@ ...@@ -90,6 +91,7 @@ LIB_YUV = @LIB_YUV@
# #
# CFLAGS for special cases # CFLAGS for special cases
# #
CFLAGS_ALTIVEC = @CFLAGS_ALTIVEC@
CFLAGS_DVD = @CFLAGS_DVD@ CFLAGS_DVD = @CFLAGS_DVD@
CFLAGS_LIBDVDCSS = @CFLAGS_LIBDVDCSS@ CFLAGS_LIBDVDCSS = @CFLAGS_LIBDVDCSS@
CFLAGS_GTK = @CFLAGS_GTK@ CFLAGS_GTK = @CFLAGS_GTK@
...@@ -171,6 +173,9 @@ INCLUDE += -Iinclude -Iextras ...@@ -171,6 +173,9 @@ INCLUDE += -Iinclude -Iextras
# #
# Libraries needed by built-in modules # Libraries needed by built-in modules
# #
# Let's go for a crude hack !
LIB_MOTIONALTIVEC := $(LIB_ALTIVEC)
LIB_IDCTALTIVEC := $(LIB_ALTIVEC)
ifneq (,$(BUILTINS)) ifneq (,$(BUILTINS))
LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done) LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
LIB += $(LIB_BUILTINS) LIB += $(LIB_BUILTINS)
...@@ -236,7 +241,7 @@ endif ...@@ -236,7 +241,7 @@ endif
# Optimizations for PowerPC # Optimizations for PowerPC
ifneq (,$(findstring powerpc,$(ARCH))) ifneq (,$(findstring powerpc,$(ARCH)))
CFLAGS += -mmultiple -mhard-float -mstring -Wa,-m7400 CFLAGS += -mmultiple -mhard-float -mstring
endif endif
# Optimizations for Sparc # Optimizations for Sparc
...@@ -258,7 +263,13 @@ DCFLAGS += -MM ...@@ -258,7 +263,13 @@ DCFLAGS += -MM
# #
LCFLAGS += @LCFLAGS@ $(LIB) LCFLAGS += @LCFLAGS@ $(LIB)
LCFLAGS += -Wall LCFLAGS += -Wall
#LCFLAGS += -s ifneq ($(DEBUG),1)
ifneq ($(GPROF),1)
ifneq ($(CPROF),1)
LCFLAGS += -s
endif
endif
endif
ifneq (,$(findstring mingw32,$(SYS))) ifneq (,$(findstring mingw32,$(SYS)))
LCFLAGS += -mwindows -Xlinker --force-exe-suffix LCFLAGS += -mwindows -Xlinker --force-exe-suffix
endif endif
......
This diff is collapsed.
...@@ -112,52 +112,68 @@ dnl Check for threads library ...@@ -112,52 +112,68 @@ dnl Check for threads library
AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h) AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
dnl Check for ntohl, etc. dnl Check for ntohl, etc.
CFLAGS="${save_CFLAGS} -Wall -Werror" AC_CACHE_CHECK([for ntohl in sys/param.h],
AC_MSG_CHECKING([for ntohl in sys/param.h]) [ac_cv_c_ntohl_sys_param_h],
AC_TRY_COMPILE([#include <sys/param.h> [CFLAGS="${save_CFLAGS} -Wall -Werror"
void foo() { int meuh; ntohl(meuh); }],, AC_TRY_COMPILE([#include <sys/param.h>],
AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.) [void foo() { int meuh; ntohl(meuh); }],
AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
if test x"$ac_cv_c_ntohl_sys_param_h" != x"no"; then
AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
fi
dnl Check for inline function size limit dnl Check for inline function size limit
CFLAGS="${save_CFLAGS} -finline-limit-30000" AC_CACHE_CHECK([if \$CC accepts -finline-limit],
AC_MSG_CHECKING([if \$CC accepts -finline-limit]) [ac_cv_c_inline_limit],
AC_TRY_COMPILE([],, [CFLAGS="${save_CFLAGS} -finline-limit-30000"
save_CFLAGS="${save_CFLAGS} -finline-limit-30000"; AC_MSG_RESULT(yes), AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
AC_MSG_RESULT(no)) if test x"$ac_cv_c_inline_limit" != x"no"; then
save_CFLAGS="${save_CFLAGS} -finline-limit-30000"
fi
dnl Check for Darwin plugin linking flags dnl Check for Darwin plugin linking flags
CFLAGS="${save_CFLAGS} -bundle -undefined suppress" AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error],
AC_MSG_CHECKING([if \$CC accepts -bundle -undefined suppress]) [ac_cv_ld_darwin],
AC_TRY_COMPILE([],, [CFLAGS="${save_CFLAGS} -bundle -undefined error"
PLCFLAGS="${PLCFLAGS} -bundle -undefined suppress"; AC_MSG_RESULT(yes), AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
AC_MSG_RESULT(no)) if test x"$ac_cv_ld_darwin" != x"no"; then
PLCFLAGS="${PLCFLAGS} -bundle -undefined error"
fi
dnl Check for standard plugin linking flags dnl Check for standard plugin linking flags
CFLAGS="${save_CFLAGS} -shared" AC_CACHE_CHECK([if \$CC accepts -shared],
AC_MSG_CHECKING([if \$CC accepts -shared]) [ac_cv_ld_plugins],
AC_TRY_COMPILE([],, [CFLAGS="${save_CFLAGS} -shared"
PLCFLAGS="${PLCFLAGS} -shared"; AC_MSG_RESULT(yes), AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
AC_MSG_RESULT(no)) if test x"$ac_cv_ld_plugins" != x"no"; then
PLCFLAGS="${PLCFLAGS} -shared"
dnl Check for standard soname setting
if test x"${SOFLAGS}" = x; then
try_SOFLAGS="-Wl,-soname -Wl,"
LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
AC_MSG_CHECKING([if linker accepts ${try_SOFLAGS}foo.so.0])
AC_TRY_LINK([],,
SOFLAGS="${try_SOFLAGS}"; AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
fi fi
dnl Check for SunOS soname setting dnl Check for soname setting
if test x"${SOFLAGS}" = x; then if test x"${SOFLAGS}" = x; then
try_SOFLAGS="-Wl,-h -Wl," AC_CACHE_CHECK([for soname setting],
LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0" [ac_cv_ld_soname],
AC_MSG_CHECKING([if linker accepts ${try_SOFLAGS}foo.so.0]) [
AC_TRY_LINK([],, # Standard
SOFLAGS="${try_SOFLAGS}"; AC_MSG_RESULT(yes), try_SOFLAGS="-Wl,-soname -Wl,"
AC_MSG_RESULT(no)) LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
AC_TRY_LINK([],,ac_cv_ld_soname="${try_SOFLAGS}", [
# SunOS
try_SOFLAGS="-Wl,-h -Wl,"
LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
AC_TRY_LINK([],,ac_cv_ld_soname="${try_SOFLAGS}",
ac_cv_ld_soname=none)
])])
if test x"$ac_cv_ld_soname" != x"none"; then
SOFLAGS=$ac_cv_ld_soname
else
echo "
------------
Your system doesn't seem to have support for dynamic linking. You may
have problems using libdvdcss.
------------
"
fi
fi fi
dnl End of the bizarre compilation tests dnl End of the bizarre compilation tests
...@@ -165,21 +181,29 @@ CFLAGS="${save_CFLAGS}" ...@@ -165,21 +181,29 @@ CFLAGS="${save_CFLAGS}"
LDFLAGS="${save_LDFLAGS}" LDFLAGS="${save_LDFLAGS}"
dnl Check for boolean_t dnl Check for boolean_t
AC_MSG_CHECKING([for boolean_t in sys/types.h]) AC_CACHE_CHECK([for boolean_t in sys/types.h],
AC_TRY_COMPILE([#include <sys/types.h> [ac_cv_c_boolean_t_sys_types_h],
void quux() { boolean_t foo; }],, [AC_TRY_COMPILE([#include <sys/types.h>], [void quux() { boolean_t foo; }],
AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.) ac_cv_c_boolean_t_sys_types_h=yes, ac_cv_c_boolean_t_sys_types_h=no)])
AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) if test x"$ac_cv_c_boolean_t_sys_types_h" != x"no"; then
AC_MSG_CHECKING([for boolean_t in pthread.h]) AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
AC_TRY_COMPILE([#include <pthread.h> fi
void quux() { boolean_t foo; }],,
AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.) AC_CACHE_CHECK([for boolean_t in pthread.h],
AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) [ac_cv_c_boolean_t_pthread_h],
AC_MSG_CHECKING([for boolean_t in cthreads.h]) [AC_TRY_COMPILE([#include <pthread.h>], [void quux() { boolean_t foo; }],
AC_TRY_COMPILE([#include <cthreads.h> ac_cv_c_boolean_t_pthread_h=yes, ac_cv_c_boolean_t_pthread_h=no)])
void quux() { boolean_t foo; }],, if test x"$ac_cv_c_boolean_t_pthread_h" != x"no"; then
AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.) AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) fi
AC_CACHE_CHECK([for boolean_t in cthreads.h],
[ac_cv_c_boolean_t_cthreads_h],
[AC_TRY_COMPILE([#include <cthreads.h>], [void quux() { boolean_t foo; }],
ac_cv_c_boolean_t_cthreads_h=yes, ac_cv_c_boolean_t_cthreads_h=no)])
if test x"$ac_cv_c_boolean_t_cthreads_h" != x"no"; then
AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
fi
dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST AC_C_CONST
...@@ -221,7 +245,7 @@ ALTIVEC_MODULES="idctaltivec motionaltivec" ...@@ -221,7 +245,7 @@ ALTIVEC_MODULES="idctaltivec motionaltivec"
AC_CACHE_CHECK([if \$CC groks MMX inline assembly], AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
[ac_cv_mmx_inline], [ac_cv_mmx_inline],
[AC_TRY_COMPILE([void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));}],, [AC_TRY_COMPILE(,[void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));}],
ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)]) ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
if test x"$ac_cv_mmx_inline" != x"no"; then if test x"$ac_cv_mmx_inline" != x"no"; then
ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}" ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
...@@ -229,7 +253,7 @@ fi ...@@ -229,7 +253,7 @@ fi
AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly], AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
[ac_cv_mmxext_inline], [ac_cv_mmxext_inline],
[AC_TRY_COMPILE([void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}],, [AC_TRY_COMPILE(,[void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}],
ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)]) ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
if test x"$ac_cv_mmxext_inline" != x"no"; then if test x"$ac_cv_mmxext_inline" != x"no"; then
ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}" ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
...@@ -237,7 +261,7 @@ fi ...@@ -237,7 +261,7 @@ fi
AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly], AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
[ac_cv_3dnow_inline], [ac_cv_3dnow_inline],
[AC_TRY_COMPILE([void quux(){void *p;asm("pfadd %%mm1,%%mm2"::"r"(p));}],, [AC_TRY_COMPILE(,[void quux(){void *p;asm("pfadd %%mm1,%%mm2"::"r"(p));}],
ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)]) ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
if test x"$ac_cv_3dnow_inline" != x"no"; then if test x"$ac_cv_3dnow_inline" != x"no"; then
ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}" ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
...@@ -245,7 +269,7 @@ fi ...@@ -245,7 +269,7 @@ fi
AC_CACHE_CHECK([if \$CC groks SSE inline assembly], AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
[ac_cv_sse_inline], [ac_cv_sse_inline],
[AC_TRY_COMPILE([void quux(){void *p;asm("xorps %%xmm1,%%xmm2"::"r"(p));}],, [AC_TRY_COMPILE(,[void quux(){void *p;asm("xorps %%xmm1,%%xmm2"::"r"(p));}],
ac_cv_sse_inline=yes, ac_cv_sse_inline=no)]) ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
if test x"$ac_cv_sse_inline" != x"no"; then if test x"$ac_cv_sse_inline" != x"no"; then
ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}" ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
...@@ -253,20 +277,47 @@ fi ...@@ -253,20 +277,47 @@ fi
AC_CACHE_CHECK([if \$CC groks Altivec inline assembly], AC_CACHE_CHECK([if \$CC groks Altivec inline assembly],
[ac_cv_altivec_inline], [ac_cv_altivec_inline],
[AC_TRY_COMPILE([void quux(){asm("mtspr 256,%0"::"r"(-1));}],, [AC_TRY_COMPILE(,[void quux(){asm("mtspr 256,%0"::"r"(-1));}],
ac_cv_altivec_inline=yes, ac_cv_altivec_inline=no)]) ac_cv_altivec_inline=yes,
[save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wa,-m7400"
AC_TRY_COMPILE(,[void quux(){asm("mtspr 256,%0"::"r"(-1));}],
[ac_cv_altivec_inline=yes; CFLAGS_ALTIVEC="-Wa,-m7400"],
ac_cv_altivec_inline=no)
CFLAGS=$save_CFLAGS
])])
if test x"$ac_cv_altivec_inline" != x"no"; then if test x"$ac_cv_altivec_inline" != x"no"; then
ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}" ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
fi fi
AC_CACHE_CHECK([if \$CC groks Altivec C extensions], AC_CACHE_CHECK([if \$CC groks Altivec C extensions],
[ac_cv_c_altivec], [ac_cv_c_altivec],
[save_CFLAGS=$CFLAGS; CFLAGS="$CFLAGS -faltivec" [save_CFLAGS=$CFLAGS
AC_TRY_COMPILE([void quux(){vec_mtvscr((vector unsigned int)(0));}],, CFLAGS="$CFLAGS -faltivec"
ac_cv_c_altivec=yes, ac_cv_c_altivec=no) # Darwin test
CFLAGS=$save_CFLAGS]) AC_TRY_COMPILE(,[void quux(){vec_mtvscr((vector unsigned int)(0));}],
ac_cv_c_altivec=-faltivec, [
# Linux/PPC test
CFLAGS="$save_CFLAGS $CFLAGS_ALTIVEC -fvec"
AC_TRY_COMPILE(,[void quux(){vec_mtvscr((vector unsigned int)(0));}],
[ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
])
CFLAGS=$save_CFLAGS
])
if test x"$ac_cv_c_altivec" != x"no"; then if test x"$ac_cv_c_altivec" != x"no"; then
AC_DEFINE(HAVE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.) AC_DEFINE(HAVE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.)
CFLAGS_ALTIVEC="$CFLAGS_ALTIVEC $ac_cv_c_altivec"
fi
AC_CACHE_CHECK([if linker needs -framework vecLib],
[ac_cv_ld_altivec],
[save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -framework vecLib"
AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
LDFLAGS=$save_LDFLAGS
])
if test x"$ac_cv_ld_altivec" != x"no"; then
LIB_ALTIVEC="-framework vecLib"
fi fi
dnl dnl
...@@ -358,7 +409,7 @@ AC_CHECK_HEADERS(sys/ioctl.h,[ ...@@ -358,7 +409,7 @@ AC_CHECK_HEADERS(sys/ioctl.h,[
dnl dnl
dnl Check the operating system dnl Check the operating system
dnl dnl
case ${_os} in case ${target_os} in
bsdi*) bsdi*)
SYS=bsdi SYS=bsdi
;; ;;
...@@ -959,6 +1010,7 @@ AC_SUBST(SOFLAGS) ...@@ -959,6 +1010,7 @@ AC_SUBST(SOFLAGS)
AC_SUBST(LIB) AC_SUBST(LIB)
AC_SUBST(LIB_ALSA) AC_SUBST(LIB_ALSA)
AC_SUBST(LIB_ALTIVEC)
AC_SUBST(LIB_BEOS) AC_SUBST(LIB_BEOS)
AC_SUBST(LIB_DARWIN) AC_SUBST(LIB_DARWIN)
AC_SUBST(LIB_DVD) AC_SUBST(LIB_DVD)
...@@ -982,6 +1034,7 @@ AC_SUBST(LIB_XVIDEO) ...@@ -982,6 +1034,7 @@ AC_SUBST(LIB_XVIDEO)
AC_SUBST(LIB_YUV) AC_SUBST(LIB_YUV)
AC_SUBST(CFLAGS_VLC) AC_SUBST(CFLAGS_VLC)
AC_SUBST(CFLAGS_ALTIVEC)
AC_SUBST(CFLAGS_DVD) AC_SUBST(CFLAGS_DVD)
AC_SUBST(CFLAGS_LIBDVDCSS) AC_SUBST(CFLAGS_LIBDVDCSS)
AC_SUBST(CFLAGS_GTK) AC_SUBST(CFLAGS_GTK)
......
...@@ -19,8 +19,8 @@ BUILTIN_IDCTMMX = $(PLUGIN_IDCTMMX:%.o=BUILTIN_IDCTMMX_%.o) ...@@ -19,8 +19,8 @@ BUILTIN_IDCTMMX = $(PLUGIN_IDCTMMX:%.o=BUILTIN_IDCTMMX_%.o)
BUILTIN_IDCTMMXEXT = $(PLUGIN_IDCTMMXEXT:%.o=BUILTIN_IDCTMMXEXT_%.o) BUILTIN_IDCTMMXEXT = $(PLUGIN_IDCTMMXEXT:%.o=BUILTIN_IDCTMMXEXT_%.o)
BUILTIN_IDCTALTIVEC = $(PLUGIN_IDCTALTIVEC:%.o=BUILTIN_IDCTALTIVEC_%.o) BUILTIN_IDCTALTIVEC = $(PLUGIN_IDCTALTIVEC:%.o=BUILTIN_IDCTALTIVEC_%.o)
PLUGIN_C = $(PLUGIN_IDCT) $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTMMXEXT) $(PLUGIN_IDCTALTIVEC) PLUGIN_C = $(PLUGIN_IDCT) $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTMMXEXT)
ALL_OBJ = $(PLUGIN_C) $(BUILTIN_IDCT) $(BUILTIN_IDCTCLASSIC) $(BUILTIN_IDCTMMX) $(BUILTIN_IDCTMMXEXT) $(BUILTIN_IDCTALTIVEC) ALL_OBJ = $(PLUGIN_C) $(PLUGIN_IDCTALTIVEC) $(BUILTIN_IDCT) $(BUILTIN_IDCTCLASSIC) $(BUILTIN_IDCTMMX) $(BUILTIN_IDCTMMXEXT) $(BUILTIN_IDCTALTIVEC)
# #
# Virtual targets # Virtual targets
...@@ -28,6 +28,10 @@ ALL_OBJ = $(PLUGIN_C) $(BUILTIN_IDCT) $(BUILTIN_IDCTCLASSIC) $(BUILTIN_IDCTMMX) ...@@ -28,6 +28,10 @@ ALL_OBJ = $(PLUGIN_C) $(BUILTIN_IDCT) $(BUILTIN_IDCTCLASSIC) $(BUILTIN_IDCTMMX)
include ../../Makefile.modules include ../../Makefile.modules
$(PLUGIN_IDCTALTIVEC): %.o: .dep/%.d
$(PLUGIN_IDCTALTIVEC): %.o: %.c
$(CC) $(CFLAGS) $(CFLAGS_ALTIVEC) -DPLUGIN $(PCFLAGS) -c -o $@ $<
$(BUILTIN_IDCT): BUILTIN_IDCT_%.o: .dep/%.d $(BUILTIN_IDCT): BUILTIN_IDCT_%.o: .dep/%.d
$(BUILTIN_IDCT): BUILTIN_IDCT_%.o: %.c $(BUILTIN_IDCT): BUILTIN_IDCT_%.o: %.c
$(CC) $(CFLAGS) -DBUILTIN -DMODULE_NAME=idct -c -o $@ $< $(CC) $(CFLAGS) -DBUILTIN -DMODULE_NAME=idct -c -o $@ $<
...@@ -46,7 +50,7 @@ $(BUILTIN_IDCTMMXEXT): BUILTIN_IDCTMMXEXT_%.o: %.c ...@@ -46,7 +50,7 @@ $(BUILTIN_IDCTMMXEXT): BUILTIN_IDCTMMXEXT_%.o: %.c
$(BUILTIN_IDCTALTIVEC): BUILTIN_IDCTALTIVEC_%.o: .dep/%.d $(BUILTIN_IDCTALTIVEC): BUILTIN_IDCTALTIVEC_%.o: .dep/%.d
$(BUILTIN_IDCTALTIVEC): BUILTIN_IDCTALTIVEC_%.o: %.c $(BUILTIN_IDCTALTIVEC): BUILTIN_IDCTALTIVEC_%.o: %.c
$(CC) $(CFLAGS) -DBUILTIN -DMODULE_NAME=idctaltivec -c -o $@ $< $(CC) $(CFLAGS) $(CFLAGS_ALTIVEC) -DBUILTIN -DMODULE_NAME=idctaltivec -c -o $@ $<
# #
# Real targets # Real targets
...@@ -81,7 +85,7 @@ $(BUILTIN_IDCTALTIVEC): BUILTIN_IDCTALTIVEC_%.o: %.c ...@@ -81,7 +85,7 @@ $(BUILTIN_IDCTALTIVEC): BUILTIN_IDCTALTIVEC_%.o: %.c
$(RANLIB) $@ $(RANLIB) $@
../idctaltivec.so: $(PLUGIN_IDCTALTIVEC) ../idctaltivec.so: $(PLUGIN_IDCTALTIVEC)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(CC) $(PCFLAGS) -o $@ $^ $(LIB_ALTIVEC) $(PLCFLAGS)
../idctaltivec.a: $(BUILTIN_IDCTALTIVEC) ../idctaltivec.a: $(BUILTIN_IDCTALTIVEC)
ar r $@ $^ ar r $@ $^
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* idctaltivec.c : Altivec IDCT module * idctaltivec.c : Altivec IDCT module
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: idctaltivec.c,v 1.16 2001/09/28 09:55:20 massiot Exp $ * $Id: idctaltivec.c,v 1.17 2001/09/28 14:17:16 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef __ALTIVEC__ #ifndef __BUILD_ALTIVEC_ASM__
#define MODULE_NAME idctaltivec #define MODULE_NAME idctaltivec
#include "modules_inner.h" #include "modules_inner.h"
...@@ -129,10 +129,12 @@ static int16_t constants[5][8] ATTR_ALIGN(16) = { ...@@ -129,10 +129,12 @@ static int16_t constants[5][8] ATTR_ALIGN(16) = {
{19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722} {19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722}
}; };
#ifndef HAVE_C_ALTIVEC
/* /*
* The asm code is generated with: * The asm code is generated with:
* *
* gcc-2.95 -fvec -D__ALTIVEC__ -O9 -fomit-frame-pointer -mregnames -S * gcc-2.95 -fvec -D__BUILD_ALTIVEC_ASM__ -O9 -fomit-frame-pointer -mregnames -S
* idct_altivec.c * idct_altivec.c
* *
* awk '{args=""; len=split ($2, arg, ","); * awk '{args=""; len=split ($2, arg, ",");
...@@ -555,7 +557,11 @@ void idct_block_add_altivec (int16_t * block, uint8_t * dest, int stride) ...@@ -555,7 +557,11 @@ void idct_block_add_altivec (int16_t * block, uint8_t * dest, int stride)
); );
} }
#else /* __ALTIVEC__ */ #endif /* !HAVE_C_ALTIVEC */
#endif /* __BUILD_ALTIVEC_ASM__ */
#if defined(HAVE_C_ALTIVEC) || defined(__BUILD_ALTIVEC_ASM__)
#define vector_s16_t vector signed short #define vector_s16_t vector signed short
#define vector_u16_t vector unsigned short #define vector_u16_t vector unsigned short
...@@ -733,8 +739,9 @@ void idct_block_add_altivec (vector_s16_t * block, unsigned char * dest, ...@@ -733,8 +739,9 @@ void idct_block_add_altivec (vector_s16_t * block, unsigned char * dest,
ADD (dest, vx7, perm1) ADD (dest, vx7, perm1)
} }
#endif /* __ALTIVEC__ */ #endif /* __BUILD_ALTIVEC_ASM__ || HAVE_C_ALTIVEC */
#ifndef __ALTIVEC__
#ifndef __BUILD_ALTIVEC_ASM__
/***************************************************************************** /*****************************************************************************
* Functions exported as capabilities. They are declared as static so that * Functions exported as capabilities. They are declared as static so that
...@@ -754,4 +761,4 @@ static void idct_getfunctions( function_list_t * p_function_list ) ...@@ -754,4 +761,4 @@ static void idct_getfunctions( function_list_t * p_function_list )
#undef F #undef F
} }
#endif /* __ALTIVEC__ */ #endif /* __BUILD_ALTIVEC_ASM__ */
...@@ -30,7 +30,7 @@ include ../../Makefile.modules ...@@ -30,7 +30,7 @@ include ../../Makefile.modules
$(PLUGIN_MOTIONALTIVEC): %.o: .dep/%.d $(PLUGIN_MOTIONALTIVEC): %.o: .dep/%.d
$(PLUGIN_MOTIONALTIVEC): %.o: %.c $(PLUGIN_MOTIONALTIVEC): %.o: %.c
$(CC) $(CFLAGS) -DPLUGIN $(PCFLAGS) -faltivec -c -o $@ $< $(CC) $(CFLAGS) $(CFLAGS_ALTIVEC) -DPLUGIN $(PCFLAGS) -c -o $@ $<
$(BUILTIN_MOTION): BUILTIN_MOTION_%.o: .dep/%.d $(BUILTIN_MOTION): BUILTIN_MOTION_%.o: .dep/%.d
$(BUILTIN_MOTION): BUILTIN_MOTION_%.o: %.c $(BUILTIN_MOTION): BUILTIN_MOTION_%.o: %.c
...@@ -50,7 +50,7 @@ $(BUILTIN_MOTION3DNOW): BUILTIN_MOTION3DNOW_%.o: %.c ...@@ -50,7 +50,7 @@ $(BUILTIN_MOTION3DNOW): BUILTIN_MOTION3DNOW_%.o: %.c
$(BUILTIN_MOTIONALTIVEC): BUILTIN_MOTIONALTIVEC_%.o: .dep/%.d $(BUILTIN_MOTIONALTIVEC): BUILTIN_MOTIONALTIVEC_%.o: .dep/%.d
$(BUILTIN_MOTIONALTIVEC): BUILTIN_MOTIONALTIVEC_%.o: %.c $(BUILTIN_MOTIONALTIVEC): BUILTIN_MOTIONALTIVEC_%.o: %.c
$(CC) $(CFLAGS) -DBUILTIN -DMODULE_NAME=motionaltivec -faltivec -c -o $@ $< $(CC) $(CFLAGS) $(CFLAGS_ALTIVEC) -DBUILTIN -DMODULE_NAME=motionaltivec -faltivec -c -o $@ $<
# #
# Real targets # Real targets
...@@ -92,7 +92,7 @@ $(BUILTIN_MOTIONALTIVEC): BUILTIN_MOTIONALTIVEC_%.o: %.c ...@@ -92,7 +92,7 @@ $(BUILTIN_MOTIONALTIVEC): BUILTIN_MOTIONALTIVEC_%.o: %.c
$(RANLIB) $@ $(RANLIB) $@
../motionaltivec.so: $(PLUGIN_MOTIONALTIVEC) ../motionaltivec.so: $(PLUGIN_MOTIONALTIVEC)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(CC) $(PCFLAGS) -o $@ $^ $(LIB_ALTIVEC) $(PLCFLAGS)
../motionaltivec.a: $(BUILTIN_MOTIONALTIVEC) ../motionaltivec.a: $(BUILTIN_MOTIONALTIVEC)
ar r $@ $^ ar r $@ $^
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* motionaltivec.c : Altivec motion compensation module for vlc * motionaltivec.c : Altivec motion compensation module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: motionaltivec.c,v 1.4 2001/09/25 11:46:14 massiot Exp $ * $Id: motionaltivec.c,v 1.5 2001/09/28 14:17:16 massiot Exp $
* *
* Authors: Michel Lespinasse <walken@zoy.org> * Authors: Michel Lespinasse <walken@zoy.org>
* Paul Mackerras <paulus@linuxcare.com.au> * Paul Mackerras <paulus@linuxcare.com.au>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef __ALTIVEC__ #ifndef __BUILD_ALTIVEC_ASM__
#define MODULE_NAME motionaltivec #define MODULE_NAME motionaltivec
#include "modules_inner.h" #include "modules_inner.h"
...@@ -94,10 +94,12 @@ static int motion_Probe( probedata_t *p_data ) ...@@ -94,10 +94,12 @@ static int motion_Probe( probedata_t *p_data )
* Motion compensation in Altivec * Motion compensation in Altivec
*****************************************************************************/ *****************************************************************************/
#ifndef HAVE_C_ALTIVEC
/* /*
* The asm code is generated with: * The asm code is generated with:
* *
* gcc-2.95 -fvec -D__ALTIVEC__ -O9 -fomit-frame-pointer -mregnames -S * gcc-2.95 -fvec -D__BUILD_ALTIVEC_ASM__ -O9 -fomit-frame-pointer -mregnames -S
* motion_comp_altivec.c * motion_comp_altivec.c
* *
* sed 's/.L/._L/g' motion_comp_altivec.s | * sed 's/.L/._L/g' motion_comp_altivec.s |
...@@ -1126,7 +1128,10 @@ static void MC_avg_xy_8_altivec (uint8_t * dest, uint8_t * ref, ...@@ -1126,7 +1128,10 @@ static void MC_avg_xy_8_altivec (uint8_t * dest, uint8_t * ref,
); );
} }
#else /* __ALTIVEC__ */ #endif /* !HAVE_C_ALTIVEC */
#endif /* __BUILD_ALTIVEC_ASM__ */
#if defined(HAVE_C_ALTIVEC) || defined(__BUILD_ALTIVEC_ASM__)
#define vector_s16_t vector signed short #define vector_s16_t vector signed short
#define vector_u16_t vector unsigned short #define vector_u16_t vector unsigned short
...@@ -2078,8 +2083,8 @@ void MC_avg_xy_8_altivec (unsigned char * dest, unsigned char * ref, ...@@ -2078,8 +2083,8 @@ void MC_avg_xy_8_altivec (unsigned char * dest, unsigned char * ref,
vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest);
} }
#endif /* __ALTIVEC__ */ #endif /* HAVE_C_ALTIVEC || __BUILD_ALTIVEC_ASM__ */
#ifndef __ALTIVEC__ #ifndef __BUILD_ALTIVEC_ASM__
/***************************************************************************** /*****************************************************************************
* Functions exported as capabilities. They are declared as static so that * Functions exported as capabilities. They are declared as static so that
...@@ -2123,4 +2128,4 @@ static void motion_getfunctions( function_list_t * p_function_list ) ...@@ -2123,4 +2128,4 @@ static void motion_getfunctions( function_list_t * p_function_list )
return; return;
} }
#endif /* __ALTIVEC__ */ #endif /* __BUILD_ALTIVEC_ASM__ */
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