From e430cd53b02f6d37da6200ac81c89c588f99b089 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sat, 1 Apr 2006 09:48:58 +0000 Subject: [PATCH] m4/: add more macros Original commit message from CVS: * m4/gst-args.m4: * m4/gst-feature.m4: add more macros * m4/gst-x11.m4: X11-related checks --- ChangeLog | 8 +++++++ m4/gst-args.m4 | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ m4/gst-feature.m4 | 20 +++++++++++++++++ m4/gst-x11.m4 | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 159 insertions(+) create mode 100644 m4/gst-x11.m4 diff --git a/ChangeLog b/ChangeLog index 08efd3e..2c3b6b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2006-04-01 Thomas Vander Stichele + * m4/gst-args.m4: + * m4/gst-feature.m4: + add more macros + * m4/gst-x11.m4: + X11-related checks + +2006-04-01 Thomas Vander Stichele + * m4/as-version.m4: newer version * m4/gst-args.m4: diff --git a/m4/gst-args.m4 b/m4/gst-args.m4 index 6d6ab2d..67a71ea 100644 --- a/m4/gst-args.m4 +++ b/m4/gst-args.m4 @@ -173,3 +173,67 @@ AC_DEFUN([GST_ARG_WITH_PACKAGE_ORIGIN], [package origin]) AC_SUBST(GST_PACKAGE_ORIGIN) ]) + +dnl sets GST_PLUGINS_SELECTED to the list given as an argument, or to +dnl GST_PLUGINS_ALL +AC_DEFUN([GST_ARG_WITH_PLUGINS], +[ + AC_ARG_WITH(plugins, + AC_HELP_STRING([--with-plugins], + [comma-separated list of dependencyless plug-ins to compile]), + [ + for i in `echo $withval | tr , ' '`; do + if echo $GST_PLUGINS_ALL | grep $i > /dev/null + then + GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i" + else + echo "plug-in $i not recognized, ignoring..." + fi + done], + [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL]) +]) + +AC_DEFUN([GST_ARG_ENABLE_EXTERNAL], +[ + GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],, + HAVE_EXTERNAL=yes, enabled, + [ + AC_MSG_NOTICE(building external plug-ins) + BUILD_EXTERNAL="yes" + ],[ + AC_MSG_WARN(all plug-ins with external dependencies will not be built) + BUILD_EXTERNAL="no" + ]) + # make BUILD_EXTERNAL available to Makefile.am + AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes") +]) + +dnl experimental plug-ins; stuff that hasn't had the dust settle yet +dnl read 'builds, but might not work' +AC_DEFUN([GST_ARG_ENABLE_EXPERIMENTAL], +[ + GST_CHECK_FEATURE(EXPERIMENTAL, + [enable building of experimental plug-ins],, + HAVE_EXPERIMENTAL=yes, enabled, + [ + AC_MSG_WARN(building experimental plug-ins) + BUILD_EXPERIMENTAL="yes" + ],[ + AC_MSG_NOTICE(not building experimental plug-ins) + BUILD_EXPERIMENTAL="no" + ]) + # make BUILD_EXPERIMENTAL available to Makefile.am + AM_CONDITIONAL(BUILD_EXPERIMENTAL, test "x$BUILD_EXPERIMENTAL" = "xyes") +]) + +dnl broken plug-ins; stuff that doesn't seem to build at the moment +AC_DEFUN([GST_ARG_ENABLE_BROKEN], +[ + GST_CHECK_FEATURE(BROKEN, [enable building of broken plug-ins],, + HAVE_BROKEN=yes, disabled, + [ + AC_MSG_WARN([building broken plug-ins -- no bug reports on these, only patches ...]) + ],[ + AC_MSG_NOTICE([not building broken plug-ins]) + ]) +]) diff --git a/m4/gst-feature.m4 b/m4/gst-feature.m4 index 2dac893..0398f52 100644 --- a/m4/gst-feature.m4 +++ b/m4/gst-feature.m4 @@ -208,3 +208,23 @@ AC_DEFUN([GST_CHECK_SUBSYSTEM_DISABLE], undefine([subsys_def]) ]) +dnl relies on GST_PLUGINS_ALL, GST_PLUGINS_YES, GST_PLUGINS_NO, and +dnl BUILD_EXTERNAL +AC_DEFUN([GST_OUTPUT_PLUGINS], [ + +echo "configure: *** Plug-ins without external dependencies:" +( for i in $GST_PLUGINS_ALL; do echo -e '\t'$i; done ) | sort + +echo +if test "x$BUILD_EXTERNAL" = "xno"; then + echo "configure: *** No plug-ins with external dependencies will be built" +else + echo -n "configure: *** Plug-ins with dependencies that will be built:" + echo -e "$GST_PLUGINS_YES" | sort + echo + echo -n "configure: *** Plug-ins with dependencies that will NOT be built:" + echo -e "$GST_PLUGINS_NO" | sort + echo +fi +]) + diff --git a/m4/gst-x11.m4 b/m4/gst-x11.m4 new file mode 100644 index 0000000..112a572 --- /dev/null +++ b/m4/gst-x11.m4 @@ -0,0 +1,67 @@ +dnl macros for X-related detections +dnl AC_SUBST's HAVE_X, X_CFLAGS, X_LIBS +AC_DEFUN([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) +]) + +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([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 +]) -- 2.7.4