From: Thomas Vander Stichele Date: Mon, 17 Oct 2005 15:36:48 +0000 (+0000) Subject: m4/: add macro for easy checks for GStreamer libs X-Git-Tag: RELEASE-0_9_4~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d9e2e10b66efa4ce40e896212108543831aa0e9;p=platform%2Fupstream%2Fgst-common.git m4/: add macro for easy checks for GStreamer libs Original commit message from CVS: * m4/gst-glib2.m4: * m4/Makefile.am: * m4/gst-check.m4: add macro for easy checks for GStreamer libs --- diff --git a/ChangeLog b/ChangeLog index b95e28e..cae7298 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-10-17 Thomas Vander Stichele + + * m4/gst-glib2.m4: + * m4/Makefile.am: + * m4/gst-check.m4: + add macro for easy checks for GStreamer libs + 2005-10-16 Thomas Vander Stichele * m4/gst-glib2.m4: diff --git a/m4/Makefile.am b/m4/Makefile.am index 96ac11a..5f5d267 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -14,6 +14,7 @@ EXTRA_DIST = \ glib-gettext.m4 \ gst-arch.m4 \ gst-args.m4 \ + gst-check.m4 \ gst-debuginfo.m4 \ gst-doc.m4 \ gst-feature.m4 \ diff --git a/m4/gst-check.m4 b/m4/gst-check.m4 new file mode 100644 index 0000000..9f542ae --- /dev/null +++ b/m4/gst-check.m4 @@ -0,0 +1,77 @@ +dnl pkg-config-based checks for GStreamer modules + +dnl generic: +dnl GST_CHECK_MODULES([PREFIX], [MODULE], [MINVER], [NAME], [REQUIRED]) +dnl sets HAVE_[$PREFIX], [$PREFIX]_* + +dnl specific: +dnl GST_CHECK_GST([MAJMIN], [MINVER], [REQUIRED]) +dnl also sets/ACSUBSTs GST_TOOLS_DIR and GST_PLUGINS_DIR +dnl GST_CHECK_GST_BASE([MAJMIN], [MINVER], [REQUIRED]) +dnl GST_CHECK_GST_GDP([MAJMIN], [MINVER], [REQUIRED]) +dnl GST_CHECK_GST_CONTROLLER([MAJMIN], [MINVER], [REQUIRED]) +dnl GST_CHECK_GST_CHECK([MAJMIN], [MINVER], [REQUIRED]) + +AC_DEFUN([GST_CHECK_MODULES], +[ + AC_REQUIRE([PKG_CHECK_MODULES]) + module=[$2] + minver=[$3] + name="[$4]" + required=ifelse([$5], [$5], "yes") dnl fail by default + + PKG_CHECK_MODULES([$1], $module >= $minver, + HAVE_[$1]="yes", HAVE_[$1]="no") + + if test "x$HAVE_[$1]" = "xno"; then + if test "x$required" = "xyes"; then + AC_MSG_ERROR([no $module >= $minver ($name) found]) + else + AC_MSG_NOTICE([no $module >= $minver ($name) found]) + fi + fi +])) + +AC_DEFUN([GST_CHECK_GST], +[ + GST_CHECK_MODULES(GST, gstreamer-[$1], [$2], [GStreamer], [$3]) + GST_TOOLS_DIR=`pkg-config --variable=toolsdir gstreamer-$GST_MAJORMINOR` + if test -z $GST_TOOLS_DIR; then + AC_MSG_ERROR( + [no tools dir set in GStreamer pkg-config file; core upgrade needed.]) + fi + AC_SUBST(GST_TOOLS_DIR) + + dnl check for where core plug-ins got installed + dnl this is used for unit tests + GST_PLUGINS_DIR=`pkg-config --variable=pluginsdir gstreamer-$GST_MAJORMINOR` + if test -z $GST_PLUGINS_DIR; then + AC_MSG_ERROR( + [no pluginsdir set in GStreamer pkg-config file; core upgrade needed.]) + fi + AC_SUBST(GST_PLUGINS_DIR) +]) + +AC_DEFUN([GST_CHECK_GST_BASE], +[ + GST_CHECK_MODULES(GST_BASE, gstreamer-base-[$1], [$2], + [GStreamer Base Libraries], [$3]) +]) + +AC_DEFUN([GST_CHECK_GST_GDP], +[ + GST_CHECK_MODULES(GST_GDP, gstreamer-dataprotocol-[$1], [$2], + [GStreamer Data Protocol Library], [$3]) +]) + +AC_DEFUN([GST_CHECK_GST_CONTROLLER], +[ + GST_CHECK_MODULES(GST_CONTROLLER, gstreamer-controller-[$1], [$2], + [GStreamer Controller Library], [$3]) +]) + +AC_DEFUN([GST_CHECK_GST_CHECK], +[ + GST_CHECK_MODULES(GST_CHECK, gstreamer-check-[$1], [$2], + [GStreamer Check unittest Library], [$3]) +])