summaryrefslogtreecommitdiff
path: root/common/m4/gst-x11.m4
diff options
context:
space:
mode:
authorjk7744.park <jk7744.park@samsung.com>2015-10-24 16:49:49 +0900
committerjk7744.park <jk7744.park@samsung.com>2015-10-24 16:49:49 +0900
commitfed9ccc4d4585e39e42dc6079432ff6aae32eb1a (patch)
tree6731ed9fe52be60184497e20ece1a9b725f8d8b9 /common/m4/gst-x11.m4
parentb324cb9340d425326f3d0a491c7754cfcdd1c571 (diff)
downloadgst-plugins-ugly-accepted/tizen_2.4_mobile.tar.gz
gst-plugins-ugly-accepted/tizen_2.4_mobile.tar.bz2
gst-plugins-ugly-accepted/tizen_2.4_mobile.zip
Diffstat (limited to 'common/m4/gst-x11.m4')
-rw-r--r--common/m4/gst-x11.m470
1 files changed, 70 insertions, 0 deletions
diff --git a/common/m4/gst-x11.m4 b/common/m4/gst-x11.m4
new file mode 100644
index 0000000..d3baf2d
--- /dev/null
+++ b/common/m4/gst-x11.m4
@@ -0,0 +1,70 @@
+dnl macros for X-related detections
+dnl AC_SUBST's HAVE_X, X_CFLAGS, X_LIBS
+AC_DEFUN([AG_GST_CHECK_X],
+[
+ AC_PATH_XTRA
+ ac_cflags_save="$CFLAGS"
+ ac_cppflags_save="$CPPFLAGS"
+ CFLAGS="$CFLAGS $X_CFLAGS"
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
+ dnl now try to find the HEADER
+ AC_CHECK_HEADER(X11/Xlib.h, HAVE_X="yes", HAVE_X="no")
+
+ if test "x$HAVE_X" = "xno"
+ then
+ AC_MSG_NOTICE([cannot find X11 development files])
+ else
+ dnl this is much more than we want
+ X_LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS"
+ dnl AC_PATH_XTRA only defines the path needed to find the X libs,
+ dnl it does not add the libs; therefore we add them here
+ X_LIBS="$X_LIBS -lX11"
+ AC_SUBST(X_CFLAGS)
+ AC_SUBST(X_LIBS)
+ fi
+ AC_SUBST(HAVE_X)
+
+ CFLAGS="$ac_cflags_save"
+ CPPFLAGS="$ac_cppflags_save"
+])
+
+dnl *** XVideo ***
+dnl Look for the PIC library first, Debian requires it.
+dnl Check debian-devel archives for gory details.
+dnl 20020110:
+dnl At the moment XFree86 doesn't distribute shared libXv due
+dnl to unstable API. On many platforms you CAN NOT link a shared
+dnl lib to a static non-PIC lib. This is what the xvideo GStreamer
+dnl plug-in wants to do. So Debian distributes a PIC compiled
+dnl version of the static lib for plug-ins to link to when it is
+dnl inappropriate to link the main application to libXv directly.
+dnl FIXME: add check if this platform can support linking to a
+dnl non-PIC libXv, if not then don not use Xv.
+dnl FIXME: perhaps warn user if they have a shared libXv since
+dnl this is an error until XFree86 starts shipping one
+AC_DEFUN([AG_GST_CHECK_XV],
+[
+ if test x$HAVE_X = xyes; then
+ AC_CHECK_LIB(Xv_pic, XvQueryExtension,
+ HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
+ $X_LIBS -lXext)
+
+ if test x$HAVE_XVIDEO = xyes; then
+ XVIDEO_LIBS="-lXv_pic -lXext"
+ AC_SUBST(XVIDEO_LIBS)
+ else
+ dnl try again using something else if we didn't find it first
+ if test x$HAVE_XVIDEO = xno; then
+ AC_CHECK_LIB(Xv, XvQueryExtension,
+ HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
+ $X_LIBS -lXext)
+
+ if test x$HAVE_XVIDEO = xyes; then
+ XVIDEO_LIBS="-lXv -lXext"
+ AC_SUBST(XVIDEO_LIBS)
+ fi
+ fi
+ fi
+ fi
+])