[Spice-devel] [spice-common v2 11/11] build-sys: Move pixman check to m4 macro

Christophe Fergeau cfergeau at redhat.com
Tue Dec 9 06:39:29 PST 2014


---
 common/Makefile.am |  1 -
 configure.ac       |  4 +---
 m4/spice-deps.m4   | 12 ++++++++++++
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/common/Makefile.am b/common/Makefile.am
index 5a689fe..b4384e8 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -92,7 +92,6 @@ endif
 AM_CPPFLAGS =				\
 	-I$(top_srcdir)			\
 	$(SPICE_COMMON_CFLAGS)		\
-	$(PIXMAN_CFLAGS)		\
 	$(PROTOCOL_CFLAGS)		\
 	$(NULL)
 
diff --git a/configure.ac b/configure.ac
index ff0e34c..32d4c4d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,9 +36,7 @@ AC_CONFIG_SUBDIRS([spice-protocol])
 PROTOCOL_CFLAGS='-I ${top_srcdir}/spice-protocol'
 AC_SUBST(PROTOCOL_CFLAGS)
 
-PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.17.7)
-AC_SUBST(PIXMAN_CFLAGS)
-
+SPICE_CHECK_PIXMAN(SPICE_COMMON)
 SPICE_CHECK_SMARTCARD(SPICE_COMMON)
 SPICE_CHECK_CELT051(SPICE_COMMON)
 SPICE_CHECK_OPUS(SPICE_COMMON)
diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4
index 80b8eb0..b4eb7fd 100644
--- a/m4/spice-deps.m4
+++ b/m4/spice-deps.m4
@@ -129,3 +129,15 @@ AC_DEFUN([SPICE_CHECK_OPENGL], [
     AS_VAR_APPEND([$1_CFLAGS], [" $GL_CFLAGS"])
     AS_VAR_APPEND([$1_LIBS], [" $GL_LIBS"])
 ])
+
+
+# SPICE_CHECK_PIXMAN(PREFIX)
+# --------------------------
+# Check for the availability of pixman. If found, it will set the $PREFIX_CFLAGS
+# and $PREFIX_LIBS variables.
+#---------------------------
+AC_DEFUN([SPICE_CHECK_PIXMAN], [
+    PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.17.7)
+    AS_VAR_APPEND([$1_CFLAGS], [" $PIXMAN_CFLAGS"])
+    AS_VAR_APPEND([$1_LIBS], [" $PIXMAN_LIBS"])
+])
-- 
2.1.0



More information about the Spice-devel mailing list