summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>2013-04-11 04:42:55 +0300
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>2013-04-18 00:07:49 +0300
commit793856b93ade92a71469b8544998b97e219c1c07 (patch)
treeaec12c398689b0a2ccfa4a66b8b4a8b0c3dd8e32
parente71ad8e13e776d5f078ff3b6ffc3bd322fa77062 (diff)
Add Vala API
This is mostly (modified) copy&paste from libvirt-glib.
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac37
-rw-r--r--vapi/Makefile.am27
-rw-r--r--vapi/libvirt-designer-1.0.deps2
4 files changed, 67 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 7801b63..b928f83 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
-SUBDIRS = libvirt-designer examples docs
+SUBDIRS = libvirt-designer vapi examples docs
ACLOCAL_AMFLAGS = -I m4
diff --git a/configure.ac b/configure.ac
index a9c5c34..c999826 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,10 +71,46 @@ if test "x$enable_examples" != "xno" ; then
fi
AM_CONDITIONAL(WITH_EXAMPLES, [test "x$enable_examples" = "xyes"])
+AC_ARG_ENABLE([vala],
+ AS_HELP_STRING([--enable-vala], [enable Vala binding generation]),
+ [], [enable_vala=check])
+if test "x$enable_introspection" = "xyes" ; then
+ if test "x$enable_vala" != "xno" ; then
+ AC_PATH_PROG(VAPIGEN, vapigen, no)
+ if test "x$VAPIGEN" == "xno"; then
+ if test "x$enable_vala" == "xcheck" ; then
+ enable_vala=no
+ else
+ AC_MSG_ERROR([Cannot find the "vapigen" binary in your PATH])
+ fi
+ fi
+ AC_SUBST(VAPIGEN)
+ fi
+ if test "x$enable_vala" != "xno" ; then
+ AC_MSG_CHECKING([$VAPIGEN support for --metadatadir])
+ $VAPIGEN --help | grep metadatadir 1>/dev/null 2>&1
+ if test $? != 0 ; then
+ if test "x$enable_vala" == "xcheck" ; then
+ enable_vala=no
+ AC_MSG_RESULT([no])
+ else
+ AC_MSG_ERROR(["vapigen" binary in your PATH is too old (< 0.13)])
+ fi
+ else
+ AC_MSG_RESULT([no])
+ fi
+ fi
+ if test "x$enable_vala" = "xcheck" ; then
+ enable_vala=yes
+ fi
+fi
+AM_CONDITIONAL([WITH_VALA], [test "x$enable_vala" = "xyes"])
+
AC_OUTPUT(Makefile
libvirt-designer/Makefile
libvirt-designer.spec
libvirt-designer-1.0.pc
+ vapi/Makefile
docs/Makefile
examples/Makefile)
@@ -83,6 +119,7 @@ AC_MSG_NOTICE([Configuration summary])
AC_MSG_NOTICE([=====================])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([])
+AC_MSG_NOTICE([ Vala API: $enable_vala])
AC_MSG_NOTICE([ examples: $enable_examples])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([])
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
new file mode 100644
index 0000000..db54019
--- /dev/null
+++ b/vapi/Makefile.am
@@ -0,0 +1,27 @@
+NULL =
+
+if WITH_VALA
+vapidir = $(datadir)/vala/vapi
+vapi_DATA = \
+ libvirt-designer-1.0.deps \
+ libvirt-designer-1.0.vapi \
+ $(NULL)
+
+libvirt-designer-1.0.vapi: $(top_builddir)/libvirt-designer/LibvirtDesigner-1.0.gir
+ $(AM_V_GEN)$(VAPIGEN) \
+ --vapidir=$(builddir) \
+ --pkg gio-2.0 \
+ --pkg libosinfo-1.0 \
+ --pkg libvirt-gconfig-1.0 \
+ --library libvirt-designer-1.0 \
+ --metadatadir=$(srcdir) \
+ $<
+endif
+
+CLEANFILES = \
+ libvirt-designer-1.0.vapi \
+ $(NULL)
+
+EXTRA_DIST = \
+ libvirt-designer-1.0.deps \
+ $(NULL)
diff --git a/vapi/libvirt-designer-1.0.deps b/vapi/libvirt-designer-1.0.deps
new file mode 100644
index 0000000..ba30bfd
--- /dev/null
+++ b/vapi/libvirt-designer-1.0.deps
@@ -0,0 +1,2 @@
+libosinfo-1.0
+libvirt-gconfig-1.0