summaryrefslogtreecommitdiff
path: root/m4/virt-introspection.m4
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2013-08-13 17:56:45 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2013-08-13 18:40:29 +0200
commitd7730acae904b75c11664b4cf90a7653f94d9636 (patch)
treee6ffd12c51d4bad35805f7e4f0065545f64b76c8 /m4/virt-introspection.m4
Import basic library framework
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Diffstat (limited to 'm4/virt-introspection.m4')
-rw-r--r--m4/virt-introspection.m426
1 files changed, 26 insertions, 0 deletions
diff --git a/m4/virt-introspection.m4 b/m4/virt-introspection.m4
new file mode 100644
index 0000000..5325b48
--- /dev/null
+++ b/m4/virt-introspection.m4
@@ -0,0 +1,26 @@
+AC_DEFUN([LIBVIRT_BUILDER_INTROSPECTION],[
+ AC_ARG_ENABLE([introspection],
+ AS_HELP_STRING([--enable-introspection], [enable GObject introspection]),
+ [], [enable_introspection=check])
+
+ if test "x$enable_introspection" != "xno" ; then
+ PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],
+ [gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED],
+ [enable_introspection=yes],
+ [
+ if test "x$enable_introspection" = "xcheck"; then
+ enable_introspection=no
+ else
+ AC_MSG_ERROR([gobject-introspection is not available])
+ fi
+ ])
+ if test "x$enable_introspection" = "xyes" ; then
+ AC_DEFINE([WITH_GOBJECT_INTROSPECTION], [1], [enable GObject introspection support])
+ AC_SUBST(GOBJECT_INTROSPECTION_CFLAGS)
+ AC_SUBST(GOBJECT_INTROSPECTION_LIBS)
+ AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
+ AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
+ fi
+ fi
+ AM_CONDITIONAL([WITH_INTROSPECTION], [test "x$enable_introspection" = "xyes"])
+])