summaryrefslogtreecommitdiff
path: root/m4/xv.m4
diff options
context:
space:
mode:
authorMatt Messier <mmessier@grapetv.org>2007-05-12 23:02:00 -0400
committerMatt Messier <mmessier@grapetv.org>2007-05-12 23:02:00 -0400
commitcf7fe6007ee6008037e63c8d9fc7ad9af8bc8d23 (patch)
tree80afe4c0d76ef0eb341208a2390de1cfa9df56d0 /m4/xv.m4
parent88e4fa03427252304dbbae078ce394269bfc71e9 (diff)
downloadxine-lib-cf7fe6007ee6008037e63c8d9fc7ad9af8bc8d23.tar.gz
xine-lib-cf7fe6007ee6008037e63c8d9fc7ad9af8bc8d23.tar.bz2
X11 and video output plugin configuration check cleanups
-- Move x11.m4 back into configure.ac, because AC_PATH_XTRA was behaving oddly inside a macro. That code is now cleaned up enough so that it's not too painful having it there. -- Move opengl.m4 inline into video_out.m4 -- Fix x11 checks to work on Darwin, including XShm checks, Xv checks, OpenGL, and GLU checks.
Diffstat (limited to 'm4/xv.m4')
-rw-r--r--m4/xv.m4167
1 files changed, 45 insertions, 122 deletions
diff --git a/m4/xv.m4 b/m4/xv.m4
index 1c1e98be9..5780aeb1b 100644
--- a/m4/xv.m4
+++ b/m4/xv.m4
@@ -1,135 +1,58 @@
-# AC_FIND_LIBXV_IMPL (LIB)
-# -------------------------
-#
-AC_DEFUN([AC_PATH_LIBXV_IMPL],
-[
- AC_MSG_CHECKING([for $1])
- if test -f "$xv_path/$1"; then
- AC_MSG_RESULT([found $1 in $xv_path])
- XV_LIBS="$1"
- else
- if test -f "/usr/lib/$1"; then
- AC_MSG_RESULT([found $1 in /usr/lib])
- XV_LIBS="$1"
- else
- AC_MSG_RESULT([$1 not found in $xv_path])
- fi
- fi
-])
-
-AC_DEFUN([AC_TEST_LIBXV],
-[
- dnl -----------------------------------------------
- dnl Testing installed Xv library
- dnl -----------------------------------------------
- AC_CHECK_LIB(Xv, XvShmCreateImage,
- [
- AC_DEFINE(HAVE_XV,
- 1,
- [Define this if you have libXv installed])
-
- ac_have_xv="yes"
- case x$XV_LIBS in
- x*.a)
- AC_DEFINE(HAVE_XV_STATIC,
- 1,
- [Define this if you have libXv.a])
- ac_have_xv_static="yes"
- XV_LIBS="$xv_path/$XV_LIBS"
- ;;
- x*.so)
- XV_LIBS=`echo $XV_LIBS | sed 's/^lib/-l/; s/\.so$//'`
- ;;
- *)
- AC_MSG_ERROR([sorry, I don't know about $XV_LIBS])
- ;;
- esac
- ],
- ,
- [$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS])
-
- dnl -----------------------------------------------
- dnl xine_check use Xv functions API.
- dnl -----------------------------------------------
- if test x$ac_have_xv = "xyes"; then
- EXTRA_X_LIBS="-L$xv_path $XV_LIBS -lXext"
- EXTRA_X_CFLAGS=""
- fi
- AC_SUBST(XV_LIBS)
- AC_SUBST(EXTRA_X_LIBS)
- AC_SUBST(EXTRA_X_CFLAGS)
-])
-
-# AC_PATH_LIBXV
-# -------------------------
-#
-AC_DEFUN([AC_FIND_LIBXV],
-[
- # Ensure that AC_PATH_XTRA is executed before this
- AC_REQUIRE([AC_PATH_XTRA])
-
- if test x$xv_path = x; then
- xv_path=/usr/X11R6/lib
- fi
-
- if test "x$xv_prefer_shared" = "xyes"; then
- AC_PATH_LIBXV_IMPL([libXv.so])
- else
- AC_PATH_LIBXV_IMPL([libXv.a])
- fi
-
- # Try the other lib if prefered failed
- if test x$XV_LIBS = x; then
- if ! test "x$xv_prefer_shared" = "xyes"; then
- AC_PATH_LIBXV_IMPL([libXv.so])
- else
- AC_PATH_LIBXV_IMPL([libXv.a])
- fi
- fi
-
- if ! test x$XV_LIBS = x; then
- AC_TEST_LIBXV
- fi
-])
-
-dnl ----------------------------------------------
-dnl Check for Xv and XvMC support
-dnl ----------------------------------------------
-
AC_DEFUN([XINE_XV_SUPPORT], [
dnl With recent XFree86 or Xorg, dynamic linking is preferred!
dnl Only dynamic linking is possible when using libtool < 1.4.0
-
- AC_ARG_WITH(xv-path, AS_HELP_STRING([--with-xv-path=path], [where libXv is installed]),
- xv_path="$withval",)
+ AC_ARG_WITH([xv-path],
+ [AS_HELP_STRING([--with-xv-path=path], [where libXv is installed])])
AC_ARG_ENABLE([static-xv],
- AS_HELP_STRING([--enable-static-xv],[Enable this to force linking against libXv.a]))
-
- if test "x$enable_static_xv" = "xyes"; then
- xv_prefer_shared="no"
- else
- xv_prefer_shared="yes"
- fi
-
- if test "x$no_x" != "xyes"; then
- PKG_CHECK_MODULES([XV], [xv], [
- ac_have_xv="yes"
- AC_DEFINE([HAVE_XV], [1], [Define this if you have libXv installed])
- ], [AC_FIND_LIBXV])
- fi
- AM_CONDITIONAL(HAVE_XV, test "x$ac_have_xv" = "xyes")
-
-
+ [AS_HELP_STRING([--enable-static-xv], [Enable this to force linking against libXv.a])],
+ [test x"$enableval" != x"no" && xv_prefer_static="yes"], [xv_prefer_static="no"])
case "$host_or_hostalias" in
- hppa*)
- if test "x$ac_have_xv_static" = "xyes"; then
- echo "warning: hppa linker - disabling static libXv"
- XV_LIBS="libXv.so"
+ hppa*) xv_libexts="$acl_cv_shlibext" ;;
+ *)
+ if test x"$xv_prefer_static" = x"yes"; then
+ xv_libexts="$acl_cv_libext $acl_cv_shlibext"
+ else
+ xv_libexts="$acl_cv_shlibext $acl_cv_libext"
fi
;;
esac
+ if test x"$no_x" != x"yes"; then
+ PKG_CHECK_MODULES([XV], [xv], [have_xv=yes], [have_xv=no])
+ if test x"$have_xv" = x"no"; then
+ dnl No Xv package -- search for it
+ for xv_libext in $xv_libexts; do
+ xv_lib="libXv.$xv_libext"
+ AC_MSG_CHECKING([for $xv_lib])
+ for xv_try_path in "$with_xv_path" "$x_libraries" /usr/X11R6/lib /usr/lib; do
+ if test x"$xv_try_path" != x"" && test -f "$xv_try_path/$xv_lib"; then
+ case $xv_lib in
+ *.$acl_cv_libext) xv_try_libs="$xv_try_path/$xv_lib" ;;
+ *.$acl_cv_shlibext) xv_try_libs="-L$xv_try_path -lXv" ;;
+ esac
+ ac_save_LIBS="$LIBS" LIBS="$xv_try_libs $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS $LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvShmCreateImage()]])], [have_xv=yes], [])
+ LIBS="$ac_save_LIBS"
+ if test x"$have_xv" = x"yes"; then
+ AC_MSG_RESULT([$xv_try_path])
+ XV_LIBS="$xv_try_libs"
+ break
+ fi
+ fi
+ done
+ test x"$have_xv" = x"yes" && break
+ AC_MSG_RESULT([no])
+ done
+ fi
+
+ if test x"$have_xv" = x"yes"; then
+ AC_DEFINE([HAVE_XV], 1, [Define this if you have libXv installed])
+ fi
+ fi
+ AM_CONDITIONAL([HAVE_XV], [test x"$have_xv" = x"yes"])
+
+
dnl
dnl Check if we can enable the xxmc plugin.
dnl