[common 02/11] build-sys: Add SPICE_CHECK_GSTREAMER()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This simplifies checking for GStreamer modules by setting all the
variables we normally need.

Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
---
 m4/spice-deps.m4 | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

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
+])
-- 
2.6.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]