[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [libvirt-designer] Add Vala API



From: "Zeeshan Ali (Khattak)" <zeeshanak gnome org>

This is mostly (modified) copy&paste from libvirt-glib.
---
 Makefile.am                    |  2 +-
 configure.ac                   | 37 +++++++++++++++++++++++++++++++++++++
 vapi/Makefile.am               | 26 ++++++++++++++++++++++++++
 vapi/libvirt-designer-1.0.deps |  3 +++
 4 files changed, 67 insertions(+), 1 deletion(-)
 create mode 100644 vapi/Makefile.am
 create mode 100644 vapi/libvirt-designer-1.0.deps

diff --git a/Makefile.am b/Makefile.am
index f5bcc47..53d36ea 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..0aecb7e
--- /dev/null
+++ b/vapi/Makefile.am
@@ -0,0 +1,26 @@
+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-gobject-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
diff --git a/vapi/libvirt-designer-1.0.deps b/vapi/libvirt-designer-1.0.deps
new file mode 100644
index 0000000..757e44e
--- /dev/null
+++ b/vapi/libvirt-designer-1.0.deps
@@ -0,0 +1,3 @@
+libosinfo-1.0
+libvirt-gobject-1.0
+libvirt-gconfig-1.0
-- 
1.8.1.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]