1 dnl macros for X-related detections
2 dnl AC_SUBST's HAVE_X, X_CFLAGS, X_LIBS
3 AC_DEFUN([AG_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"
28 CFLAGS="$ac_cflags_save"
29 CPPFLAGS="$ac_cppflags_save"
33 dnl Look for the PIC library first, Debian requires it.
34 dnl Check debian-devel archives for gory details.
36 dnl At the moment XFree86 doesn't distribute shared libXv due
37 dnl to unstable API. On many platforms you CAN NOT link a shared
38 dnl lib to a static non-PIC lib. This is what the xvideo GStreamer
39 dnl plug-in wants to do. So Debian distributes a PIC compiled
40 dnl version of the static lib for plug-ins to link to when it is
41 dnl inappropriate to link the main application to libXv directly.
42 dnl FIXME: add check if this platform can support linking to a
43 dnl non-PIC libXv, if not then don not use Xv.
44 dnl FIXME: perhaps warn user if they have a shared libXv since
45 dnl this is an error until XFree86 starts shipping one
46 AC_DEFUN([AG_GST_CHECK_XV],
48 if test x$HAVE_X = xyes; then
49 AC_CHECK_LIB(Xv_pic, XvQueryExtension,
50 HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
53 if test x$HAVE_XVIDEO = xyes; then
54 XVIDEO_LIBS="-lXv_pic -lXext"
57 dnl try again using something else if we didn't find it first
58 if test x$HAVE_XVIDEO = xno; then
59 AC_CHECK_LIB(Xv, XvQueryExtension,
60 HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
63 if test x$HAVE_XVIDEO = xyes; then
64 XVIDEO_LIBS="-lXv -lXext"