[devhelp/wip/tintou/gobject-introspection: 2/2] Enable GObject introspection



commit 30a91f37caf68d3c6d012e112bdd7473417223b2
Author: Corentin Noël <corentin elementary io>
Date:   Sun Oct 30 03:26:03 2016 +0100

    Enable GObject introspection
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770785

 Makefile.am     |    1 +
 configure.ac    |    2 ++
 src/Makefile.am |   33 +++++++++++++++++++++++++++++++++
 3 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 414b36d..c2ebead 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,5 @@
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+AM_DISTCHECK_CONFIGURE_FLAGS = --enable-introspection
 
 SUBDIRS = po src data misc contrib docs
 
diff --git a/configure.ac b/configure.ac
index 36540da..5ef94dd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,6 +42,8 @@ GLIB_GSETTINGS
 
 PKG_PROG_PKG_CONFIG
 
+GOBJECT_INTROSPECTION_CHECK([1.30.0])
+
 GNOME_COMPILE_WARNINGS([maximum])
 
 AC_CHECK_LIBM
diff --git a/src/Makefile.am b/src/Makefile.am
index a018d99..820af14 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -124,3 +124,36 @@ dh-enum-types.c: dh-enum-types.c.template $(libdevhelp_public_headers) $(GLIB_MK
        $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template dh-enum-types.c.template 
$(libdevhelp_public_headers)) > $@
 
 DISTCLEANFILES = $(BUILT_SOURCES)
+
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS =                   \
+       --add-include-path=$(srcdir)            \
+       --warn-all                              \
+       --identifier-prefix Dh                  \
+       --identifier-prefix dh                  \
+       --pkg-export libdevhelp-3.0             \
+       --c-include="devhelp/devhelp.h"
+
+INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
+
+if HAVE_INTROSPECTION
+introspection_sources =                                \
+       $(libdevhelp_public_c_files)            \
+       $(libdevhelp_public_headers)
+
+Devhelp-3.0.gir: libdevhelp-3.la
+Devhelp_3_0_gir_INCLUDES = Gtk-3.0 WebKit2-4.0
+Devhelp_3_0_gir_CFLAGS = $(INCLUDES)
+Devhelp_3_0_gir_LIBS = libdevhelp-3.la
+Devhelp_3_0_gir_FILES = $(introspection_sources)
+INTROSPECTION_GIRS += Devhelp-3.0.gir
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+DISTCLEANFILES += $(gir_DATA) $(typelib_DATA)
+endif


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