Added gst-plugins-base-subtitles0.10-0.10.34 for Meego Harmattan 1.2
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / common / m4 / gst-x11.m4
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],
4 [
5   AC_PATH_XTRA
6   ac_cflags_save="$CFLAGS"
7   ac_cppflags_save="$CPPFLAGS"
8   CFLAGS="$CFLAGS $X_CFLAGS"
9   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
10
11   dnl now try to find the HEADER
12   AC_CHECK_HEADER(X11/Xlib.h, HAVE_X="yes", HAVE_X="no")
13
14   if test "x$HAVE_X" = "xno"
15   then
16     AC_MSG_NOTICE([cannot find X11 development files])
17   else
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"
23     AC_SUBST(X_CFLAGS)
24     AC_SUBST(X_LIBS)
25   fi
26   AC_SUBST(HAVE_X)
27
28   CFLAGS="$ac_cflags_save"
29   CPPFLAGS="$ac_cppflags_save"
30 ])
31
32 dnl *** XVideo ***
33 dnl Look for the PIC library first, Debian requires it.
34 dnl Check debian-devel archives for gory details.
35 dnl 20020110:
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],
47 [
48   if test x$HAVE_X = xyes; then
49     AC_CHECK_LIB(Xv_pic, XvQueryExtension,
50                  HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
51                  $X_LIBS -lXext)
52
53     if test x$HAVE_XVIDEO = xyes; then
54       XVIDEO_LIBS="-lXv_pic -lXext"
55       AC_SUBST(XVIDEO_LIBS)
56     else
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",
61                    $X_LIBS -lXext)
62
63         if test x$HAVE_XVIDEO = xyes; then
64           XVIDEO_LIBS="-lXv -lXext"
65           AC_SUBST(XVIDEO_LIBS)
66         fi
67       fi
68     fi
69   fi
70 ])