[Spice-devel] [spice-gtk] Only use GOBJECT_INTROSPECTION_CHECK when available

Christophe Fergeau cfergeau at redhat.com
Tue Aug 13 08:16:53 PDT 2013


Current el6 systems don't have gobject-introspection packages,
so the GOBJECT_INTROSPECTION_CHECK m4 macro is not available
on such systems. This makes it difficult to run autogen.sh
on these systems.
This commit uses m4_ifdef to check if this macro is available
before trying to use it, and makes sure introspection is
disabled when GOBJECT_INTROSPECTION_CHECK could not be found.
This allows to compile spice-gtk from git on el6 systems
with:
./autogen.sh --with-gtk=2.0 --disable-gtk-doc --disable-vala
             --disable-controller --disable-werror
---
 configure.ac | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 11f11fc..1235f4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -537,11 +537,13 @@ AM_CONDITIONAL(WITH_WINFIBER, [test "x$WITH_WINFIBER" = "x1"])
 AC_DEFINE_UNQUOTED(WITH_GTHREAD,[$WITH_GTHREAD], [Whether to use gthread coroutine impl])
 AM_CONDITIONAL(WITH_GTHREAD, [test "x$WITH_GTHREAD" = "x1"])
 
-AM_CONDITIONAL([HAVE_INTROSPECTION], [test "0" != "1"])
-PKG_CHECK_EXISTS([GOBJECT_INTROSPECTION],
-        [gobject-introspection-1.0 >= 0.9.4],
-        [has_symbol_prefix=yes], [:])
-GOBJECT_INTROSPECTION_CHECK([0.6.7])
+AM_CONDITIONAL([HAVE_INTROSPECTION], [test "0" = "1"])
+m4_ifdef([GOBJECT_INTROSPECTION_CHECK],[
+    PKG_CHECK_EXISTS([GOBJECT_INTROSPECTION],
+            [gobject-introspection-1.0 >= 0.9.4],
+            [has_symbol_prefix=yes], [:])
+    GOBJECT_INTROSPECTION_CHECK([0.6.7])
+])
 AM_CONDITIONAL([G_IR_SCANNER_SYMBOL_PREFIX], [test "x$has_symbol_prefix" = "xyes"])
 
 AC_ARG_ENABLE([controller],
-- 
1.8.3.1



More information about the Spice-devel mailing list