[Spice-commits] m4/common.m4 m4/spice-deps.m4

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Mar 2 13:54:52 UTC 2020

 m4/common.m4     |    6 ++++++
 m4/spice-deps.m4 |   31 +++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

New commits:
commit 19ea60416c301e0b4b69ea038618452f0845d173
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Tue Nov 26 21:07:03 2019 +0000

    m4: Make easier to integrate in other projects
    Add a common.m4 file to be included directly in other project.
    This include will include all needed checks to use spice-common.
    Just include directly this file in your configure.ac.
    This will define SPICE_COMMON_CFLAGS and SPICE_COMMON_DIR (for
    linking .la files) which are needed to use spice-common.
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Kevin Pouget <kpouget at redhat.com>

diff --git a/m4/common.m4 b/m4/common.m4
new file mode 100644
index 0000000..5e6c6bb
--- /dev/null
+++ b/m4/common.m4
@@ -0,0 +1,6 @@
+dnl This file should be included by spice-common user from
+dnl configure.ac to have all required checks in order to use spice-common
+dnl Automatically include m4 files in m4 directory
diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4
index 53255e1..9e1b8fd 100644
--- a/m4/spice-deps.m4
+++ b/m4/spice-deps.m4
     AM_CONDITIONAL([ENABLE_RECORDER],[test "$enable_instrumentation" = "recorder"])
     AM_CONDITIONAL([ENABLE_AGENT_INTERFACE],[test "$enable_instrumentation" = "agent"])
+# -----------------
+# Define variables in order to use spice-common
+# SPICE_COMMON_DIR        directory for output libraries
+# SPICE_COMMON_CFLAGS     CFLAGS to add to use the library
+# SPICE_PROTOCOL_MIN_VER  input (m4) and output (autoconf) SPICE protocol version
+# SPICE_PROTOCOL_CFLAGS   CFLAGS for SPICE protocol, already automatically included
+dnl These add some flags and checks to component using spice-common
+dnl The flags are necessary in order to make included header working
+dnl Get the required spice protocol version
+    m4_define([SPICE_PROTOCOL_MIN_VER],m4_if(m4_version_compare(SPICE_PROTOCOL_MIN_VER,[0.12.12]),[1],SPICE_PROTOCOL_MIN_VER,[0.12.12]))dnl
+    m4_undefine([SPICE_PROTOCOL_MIN_VER])dnl
+dnl Configuration variables
+    AC_CONFIG_SUBDIRS([$1])dnl
+    SPICE_COMMON_CFLAGS='-I${top_srcdir}/$1 -I${top_builddir}/$1 -DG_LOG_DOMAIN=\"Spice\" $(SPICE_PROTOCOL_CFLAGS)'
+    SPICE_COMMON_DIR='${top_builddir}/$1'

More information about the Spice-commits mailing list