summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Gouget <fgouget@codeweavers.com>2015-11-03 13:05:40 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2015-11-04 10:34:19 +0100
commit437b817f49287e82cc800f3c1632e2499e0176da (patch)
treeffc6eb3feb1162b299b8d243fab7b4d2b4c86830
parent899a7c75e31c4ac9d64ab6ec7b61b2b6c6de3e3a (diff)
downloadspice-common-437b817f49287e82cc800f3c1632e2499e0176da.tar.gz
spice-common-437b817f49287e82cc800f3c1632e2499e0176da.tar.xz
spice-common-437b817f49287e82cc800f3c1632e2499e0176da.zip
build-sys: Add SPICE_CHECK_GSTREAMER()
This simplifies checking for GStreamer modules by setting all the variables we normally need. Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
-rw-r--r--m4/spice-deps.m420
1 files changed, 20 insertions, 0 deletions
diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4
index 57d5b78..bb58d0f 100644
--- a/m4/spice-deps.m4
+++ b/m4/spice-deps.m4
@@ -207,3 +207,23 @@ AC_DEFUN([SPICE_CHECK_LZ4], [
AC_DEFINE(USE_LZ4, [1], [Define to build with lz4 support])
fi
])
+
+
+# SPICE_CHECK_GSTREAMER(VAR, version, packages-to-check-for, [action-if-found, [action-if-not-found]])
+# ---------------------
+# Checks whether the specified GStreamer modules are present and sets the
+# corresponding autoconf variables and preprocessor definitions.
+# ---------------------
+AC_DEFUN([SPICE_CHECK_GSTREAMER], [
+ AS_VAR_PUSHDEF([have_gst],[have_]m4_tolower([$1]))dnl
+ PKG_CHECK_MODULES([$1], [$3],
+ [have_gst="yes"
+ AC_SUBST(AS_TR_SH([[$1]_CFLAGS]))
+ AC_SUBST(AS_TR_SH([[$1]_LIBS]))
+ AS_VAR_APPEND([SPICE_REQUIRES], [" $3"])
+ AC_DEFINE(AS_TR_SH([HAVE_$1]), [1], [Define if supporting GStreamer $2])
+ $4],
+ [have_gst="no"
+ $5])
+ AS_VAR_POPDEF([have_gst])dnl
+])