[libgsf] Update Introspection build.



commit ea0b2ba41a3c31c1b18265977301518af220b6d9
Author: Jean Brefort <jean brefort normalesup org>
Date:   Fri May 18 17:42:42 2012 +0200

    Update Introspection build.

 ChangeLog       |    6 ++++++
 Makefile.am     |    7 ++++++-
 configure.in    |   41 ++++++++++++++++++++++++++---------------
 gsf/Makefile.am |   47 +++++++++++++++++++----------------------------
 4 files changed, 57 insertions(+), 44 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2f02caf..e9e3c18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-18  Jean Brefort  <jean brefort normalesup org>
+
+	* Makefile.am: enhance introspection build support.
+	* configure.in: ditto.
+	* gsf/Makefile.am: ditto.
+
 2012-04-19  Morten Welinder <terra gnome org>
 
 	* configure.in: Post-release bump.
diff --git a/Makefile.am b/Makefile.am
index 5ee516d..55797c5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,4 +22,9 @@ EXTRA_DIST = BUGS HACKING	\
 
 DISTCLEANFILES = intltool-extract intltool-merge intltool-update
 
-DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper --enable-gtk-doc --enable-schemas-install
+DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper --enable-gtk-doc \
+	--enable-schemas-install \
+	--enable-introspection=auto \
+	--with-gir-dir=\$${datadir}/gir-1.0 \
+	--with-typelib-dir=\$${libdir}/girepository-1.0
+
diff --git a/configure.in b/configure.in
index d2d036d..87f7c6f 100644
--- a/configure.in
+++ b/configure.in
@@ -64,22 +64,33 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
 
 
 # GObject Introspection
-have_introspection=false
-PKG_CHECK_MODULES(INTROSPECTION, gobject-introspection-1.0 >= 0.6.4, have_introspection=true, have_introspection=false)
-AM_CONDITIONAL(HAVE_INTROSPECTION, $have_introspection)
-
-G_IR_SCANNER=
-G_IR_COMPILER=
-G_IR_GENERATE=
-if $have_introspection; then
-   G_IR_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
-   G_IR_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
-   G_IR_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
-fi
-AC_SUBST(G_IR_SCANNER)
-AC_SUBST(G_IR_COMPILER)
-AC_SUBST(G_IR_GENERATE)
 
+GOBJECT_INTROSPECTION_CHECK(1.0)
+dnl we need to change the install directories for distcheck
+AC_ARG_WITH([gir-dir],
+	AS_HELP_STRING(
+		[--with-gir-dir],
+		[
+		 path to gir repository
+		 (automatically detected via pkg-config)
+		]
+	),
+	[GIRDIR=$withval],
+	[GIRDIR=$INTROSPECTION_GIRDIR]
+)
+AC_SUBST(GIRDIR)
+AC_ARG_WITH([typelib-dir],
+	AS_HELP_STRING(
+		[--with-typelib-dir],
+		[
+		 path to typelibs repository
+		 (automatically detected via pkg-config)
+		]
+	),
+	[TYPELIBDIR=$withval],
+	[TYPELIBDIR=$INTROSPECTION_TYPELIBDIR]
+)
+AC_SUBST(TYPELIBDIR)
 
 dnl Checks for libraries.
 ifelse([
diff --git a/gsf/Makefile.am b/gsf/Makefile.am
index 18499d6..f710af0 100644
--- a/gsf/Makefile.am
+++ b/gsf/Makefile.am
@@ -4,6 +4,13 @@ AM_CPPFLAGS = -I$(top_srcdir) $(LIBGSF_CFLAGS) \
 lib_LTLIBRARIES = libgsf-1.la
 
 include $(top_srcdir)/gsf.mk
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = \
+	-v
+INTROSPECTION_COMPILER_ARGS = \
+	--includedir=$(srcdir) \
+    --includedir=.
 
 if WITH_GIO
 gioc=gsf-input-gio.c gsf-output-gio.c
@@ -150,39 +157,23 @@ gsf-1.lib: libgsf-1.la lib.def
 CLEANFILES += gsf-1.exp gsf-1.lib
 endif
 
-BUILT_GIRSOURCES = Gsf-1.gir
-
-Gsf-1.gir: $(libgsf_1_include_HEADERS)
-Gsf-1.gir: $(NOINST_H_FILES)
-Gsf-1.gir: $(libgsf_1_la_SOURCES)
-Gsf-1.gir: libgsf-1.la
-Gsf-1.gir: $(G_IR_SCANNER) Makefile
-	$(AM_V_GEN) $(G_IR_SCANNER) -v --namespace Gsf --nsversion=1 \
-	    --add-include-path=$(srcdir) --add-include-path=. \
-	    --include=GObject-2.0 \
-	    --include=Gio-2.0 \
-	    --include=libxml2-2.0 \
-	    --library=libgsf-1.la \
-	    --libtool="$(LIBTOOL)" \
-	    --output $@ \
-	    -I$(top_srcdir) \
-	    `for i in $(libgsf_1_include_HEADERS) $(libgsf_1_la_SOURCES); do echo "$(srcdir)/$$i"; done`
-
 if HAVE_INTROSPECTION
 
-girdir = $(datadir)/gir-1.0
-gir_DATA = $(BUILT_GIRSOURCES)
-
-typelibsdir = $(libdir)/girepository-1.0
-typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+INTROSPECTION_GIRS += Gsf-1.gir
 
-CLEANFILES += $(gir_DATA) $(typelibs_DATA)
+Gsf-1.gir: $(INTROSPECTION_SCANNER) libgsf-1.la Makefile
+Gsf_1_gir_INCLUDES = GObject-2.0 Gio-2.0 libxml2-2.0
+Gsf_1_gir_CFLAGS = $(AM_CPPFLAGS)
+Gsf_1_gir_LIBS = libgsf-1.la
+Gsf_1_gir_FILES = $(libgsf_1_include_HEADERS) $(libgsf_1_la_SOURCES)
 
-%.typelib: %.gir $(G_IR_COMPILER)
-	$(AM_V_GEN) LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) --includedir=$(srcdir) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $(builddir)/$(@F)
-
-endif # HAVE_INTROSPECTION
 
+girdir = $(GIRDIR)
+gir_DATA = $(INTROSPECTION_GIRS)
 
+typelibsdir = $(TYPELIBDIR)
+typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
+CLEANFILES += $(gir_DATA) $(typelibs_DATA)
 
+endif # HAVE_INTROSPECTION



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