1 dnl macros for X-related detections
2 dnl AC_SUBST's HAVE_X, X_CFLAGS, X_LIBS
3 AC_DEFUN([GST_CHECK_X],
6 ac_cflags_save="$CFLAGS"
7 ac_cppflags_save="$CPPFLAGS"
8 CFLAGS="$CFLAGS $X_CFLAGS"
9 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
11 dnl now try to find the HEADER
12 AC_CHECK_HEADER(X11/Xlib.h, HAVE_X="yes", HAVE_X="no")
14 if test "x$HAVE_X" = "xno"
16 AC_MSG_NOTICE([cannot find X11 development files])
18 dnl this is much more than we want
19 X_LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS"
20 dnl AC_PATH_XTRA only defines the path needed to find the X libs,
21 dnl it does not add the libs; therefore we add them here
22 X_LIBS="$X_LIBS -lX11"
30 dnl Look for the PIC library first, Debian requires it.
31 dnl Check debian-devel archives for gory details.
33 dnl At the moment XFree86 doesn't distribute shared libXv due
34 dnl to unstable API. On many platforms you CAN NOT link a shared
35 dnl lib to a static non-PIC lib. This is what the xvideo GStreamer
36 dnl plug-in wants to do. So Debian distributes a PIC compiled
37 dnl version of the static lib for plug-ins to link to when it is
38 dnl inappropriate to link the main application to libXv directly.
39 dnl FIXME: add check if this platform can support linking to a
40 dnl non-PIC libXv, if not then don not use Xv.
41 dnl FIXME: perhaps warn user if they have a shared libXv since
42 dnl this is an error until XFree86 starts shipping one
43 AC_DEFUN([GST_CHECK_XV],
45 if test x$HAVE_X = xyes; then
46 AC_CHECK_LIB(Xv_pic, XvQueryExtension,
47 HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
50 if test x$HAVE_XVIDEO = xyes; then
51 XVIDEO_LIBS="-lXv_pic -lXext"
54 dnl try again using something else if we didn't find it first
55 if test x$HAVE_XVIDEO = xno; then
56 AC_CHECK_LIB(Xv, XvQueryExtension,
57 HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
60 if test x$HAVE_XVIDEO = xyes; then
61 XVIDEO_LIBS="-lXv -lXext"