Commit 34487b0b authored by Sam Hocevar's avatar Sam Hocevar

  * xvideo.so is now built in by default. Mixing PIC and non-PIC code was not
  very nice.
  * Fixed compilation errors in src/interface/main.c when the compiler did
  not support SSE or 3DNow! inline assembly.
parent 3cf37ffe
This diff is collapsed.
......@@ -309,7 +309,7 @@ ALTIVEC_MODULES="idctaltivec motionaltivec"
AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
[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 volatile("packuswb %%mm1,%%mm2"::"r"(p));}],
ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
if test x"$ac_cv_mmx_inline" != x"no"; then
ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
......@@ -317,7 +317,7 @@ fi
AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
[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 volatile("maskmovq %%mm1,%%mm2"::"r"(p));}],
ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
if test x"$ac_cv_mmxext_inline" != x"no"; then
ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
......@@ -325,32 +325,35 @@ fi
AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
[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 volatile("pfadd %%mm1,%%mm2"::"r"(p));}],
ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
if test x"$ac_cv_3dnow_inline" != x"no"; then
AC_DEFINE(HAVE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
fi
AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
[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 volatile("xorps %%xmm1,%%xmm2"::"r"(p));}],
ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
if test x"$ac_cv_sse_inline" != x"no"; then
AC_DEFINE(HAVE_SSE, 1, Define if \$CC groks SSE inline assembly.)
ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
fi
AC_CACHE_CHECK([if \$CC groks Altivec inline assembly],
[ac_cv_altivec_inline],
[AC_TRY_COMPILE(,[void quux(){asm("vperm 0,1,2,3");}],
[AC_TRY_COMPILE(,[void quux(){asm volatile("vperm 0,1,2,3");}],
ac_cv_altivec_inline=yes,
[save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wa,-m7400"
AC_TRY_COMPILE(,[void quux(){asm("vperm 0,1,2,3");}],
AC_TRY_COMPILE(,[void quux(){asm volatile("vperm 0,1,2,3");}],
[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
AC_DEFINE(HAVE_ALTIVEC, 1, Define if \$CC groks ALTIVEC inline assembly.)
ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
fi
......@@ -1024,7 +1027,7 @@ if test x$enable_xvideo != xno; then
saved_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$x_includes"
AC_CHECK_HEADERS(X11/extensions/Xv.h, [
PLUGINS="${PLUGINS} xvideo"
BUILTINS="${BUILTINS} xvideo"
LIB_XVIDEO="-L$x_libraries -lX11 -lXext -lXv"
CFLAGS_X11="-I$x_includes"
]
......
......@@ -35,11 +35,6 @@ build-stamp:
--infodir=$${prefix}/share/info \
$(shell echo $(CONFIG_FLAGS)) $(shell echo $(LIBDVDCSS_FLAGS))
# Fix Makefile
sed -e 's/^\(PLUGINS.*\)xvideo/\1/' -e 's/^BUILTINS.*/& xvideo/' \
< Makefile.opts > Makefile.opts.tmp
mv -f Makefile.opts.tmp Makefile.opts
$(MAKE)
touch build-stamp
......
......@@ -202,6 +202,15 @@
/* Maximum supported data alignment */
#undef ATTRIBUTE_ALIGNED_MAX
/* Define if $CC groks 3D Now! inline assembly. */
#undef HAVE_3DNOW
/* Define if $CC groks SSE inline assembly. */
#undef HAVE_SSE
/* Define if $CC groks ALTIVEC inline assembly. */
#undef HAVE_ALTIVEC
/* Define if your compiler groks C altivec extensions. */
#undef HAVE_C_ALTIVEC
......
......@@ -4,7 +4,7 @@
* and spawn threads.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: main.c,v 1.119 2001/10/22 00:43:23 jobi Exp $
* $Id: main.c,v 1.120 2001/10/22 12:02:17 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -1164,6 +1164,7 @@ static int CPUCapabilities( void )
{
i_capabilities |= CPU_CAPABILITY_MMXEXT;
#ifdef HAVE_SSE
/* We test if OS support the SSE instructions */
i_illegal = 0;
if( setjmp( env ) == 0 )
......@@ -1185,6 +1186,7 @@ static int CPUCapabilities( void )
fprintf( stderr, "(you will need Linux kernel 2.4.x or later)\n" );
#endif
}
#endif
}
/* test for additional capabilities */
......@@ -1199,6 +1201,7 @@ static int CPUCapabilities( void )
/* list these additional capabilities */
cpuid( 0x80000001 );
#ifdef HAVE_3DNOW
if( i_edx & 0x80000000 )
{
i_illegal = 0;
......@@ -1213,6 +1216,7 @@ static int CPUCapabilities( void )
i_capabilities |= CPU_CAPABILITY_3DNOW;
}
}
#endif
if( b_amd && ( i_edx & 0x00400000 ) )
{
......@@ -1223,9 +1227,11 @@ static int CPUCapabilities( void )
return( i_capabilities );
#elif defined( __powerpc__ )
/* Test for Altivec */
signal( SIGILL, InstructionSignalHandler );
#ifdef HAVE_ALTIVEC
i_illegal = 0;
if( setjmp( env ) == 0 )
{
......@@ -1236,9 +1242,9 @@ static int CPUCapabilities( void )
{
i_capabilities |= CPU_CAPABILITY_ALTIVEC;
}
#endif
signal( SIGILL, NULL );
return( i_capabilities );
#else
......
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