[libgda] Simplified GObject introspection build for Libgda
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Simplified GObject introspection build for Libgda
- Date: Sun, 6 Jun 2010 16:17:12 +0000 (UTC)
commit f2af711256f0b5e88a7b83f5c2d548f652d37a24
Author: Vivien Malerba <malerba gnome-db org>
Date: Sun Jun 6 14:36:41 2010 +0200
Simplified GObject introspection build for Libgda
introspection.m4 | 12 ++++++-
libgda/Makefile.am | 83 +++++++++++++++++++--------------------------------
2 files changed, 41 insertions(+), 54 deletions(-)
---
diff --git a/introspection.m4 b/introspection.m4
index bb3a0da..91b9051 100644
--- a/introspection.m4
+++ b/introspection.m4
@@ -21,7 +21,7 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
],[dnl
AC_ARG_ENABLE(introspection,
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
- [Enable introspection for this build]),,
+ [Enable introspection for this build]),,
[enable_introspection=auto])
])dnl
@@ -42,7 +42,7 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
[auto],[dnl
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
],dnl
- [dnl
+ [dnl
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
])dnl
@@ -58,13 +58,21 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+ INTROSPECTION_GIRDIR=${INTROSPECTION_GIRDIR/$datadir/\$(datadir)}
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+ INTROSPECTION_TYPELIBDIR=${INTROSPECTION_TYPELIBDIR/$libdir/\$(libdir)}
+ INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
+ INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
+ INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
fi
AC_SUBST(INTROSPECTION_SCANNER)
AC_SUBST(INTROSPECTION_COMPILER)
AC_SUBST(INTROSPECTION_GENERATE)
AC_SUBST(INTROSPECTION_GIRDIR)
AC_SUBST(INTROSPECTION_TYPELIBDIR)
+ AC_SUBST(INTROSPECTION_CFLAGS)
+ AC_SUBST(INTROSPECTION_LIBS)
+ AC_SUBST(INTROSPECTION_MAKEFILE)
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
])
diff --git a/libgda/Makefile.am b/libgda/Makefile.am
index 6a70912..606411a 100644
--- a/libgda/Makefile.am
+++ b/libgda/Makefile.am
@@ -280,7 +280,16 @@ EXTRA_DIST = \
DISTCLEANFILES = .deps/*.P
if HAVE_INTROSPECTION
-BUILT_GIRSOURCES =
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) \
+ --add-include-path=providers-support \
+ --add-include-path=sql-parser \
+ --add-include-path=thread-wrapper \
+ --add-include-path=handlers \
+ --namespace Gda
+INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
+
psupport = \
providers-support/gda-pstmt.h \
providers-support/gda-pstmt.c
@@ -331,57 +340,27 @@ handlers = \
handlers/gda-handler-time.c \
handlers/gda-handler-type.c
-Gda- GDA_ABI_VERSION@.gir: $(INTROSPECTION_SCANNER) libgda- GDA_ABI_VERSION@.la
- $(INTROSPECTION_SCANNER) -v \
- --namespace Gda --nsversion= GDA_ABI_VERSION@ \
- -I$(top_srcdir) -I$(top_srcdir)/libgda \
- $(LIBGDA_CFLAGS) \
- --include=GL-1.0 \
- --include=GObject-2.0 \
- --include=libxml2-2.0 \
- --library=gda- GDA_ABI_VERSION@ \
- $(INCLUDE_CFLAGS) \
- --c-include=$(top_srcdir)/libgda/csv.h \
- --c-include=$(top_srcdir)/libgda/libcsv.c \
- --c-include=$(srcdir)/gda-attributes-manager.c \
- --c-include=$(top_srcdir)/libgda/gda-connection-internal.h \
- --c-include=$(srcdir)/gda-connection-sqlite.h \
- --c-include=$(top_srcdir)/libgda/gda-custom-marshal.c \
- --c-include=$(srcdir)/gda-custom-marshal.h \
- --c-include=$(top_srcdir)/libgda/gda-data-select-extra.h \
- --c-include=$(srcdir)/gda-types.c \
- --c-include=$(top_srcdir)/libgda/gda-types.h \
- --c-include=$(srcdir)/gda-marshal.c \
- --c-include=$(top_srcdir)/libgda/gda-meta-store-extra.h \
- --c-include=$(srcdir)/gda-meta-struct-private.h \
- --c-include=$(top_srcdir)/libgda/global.h \
- --c-include=$(srcdir)/md5.h \
- --c-include=$(top_srcdir)/libgda/md5c.c \
- --output $@ \
- $(addprefix $(srcdir)/, $(gda_headers)) \
- $(srcdir)/gda-types.h \
- libgda.h \
- $(addprefix $(srcdir)/, $(gda_sources)) \
- $(addprefix $(srcdir)/, $(psupport)) \
- $(addprefix $(srcdir)/, $(sqlparser)) \
- sql-parser/gda-sql-parser-enum-types.c \
- $(addprefix $(srcdir)/, $(threadwrapper)) \
- $(addprefix $(srcdir)/, $(handlers))
-
-BUILT_GIRSOURCES += Gda- GDA_ABI_VERSION@.gir
-
-endif
+introspection_sources = $(gda_sources) \
+ gda-types.c \
+ gda-types.h \
+ $(gda_headers) \
+ $(psupport) \
+ $(threadwrapper) \
+ $(sqlparser) \
+ $(handlers)
+Gda-4_0.gir: $(lib_LTLIBRARIES)
+Gda_4_0_gir_INCLUDES = GObject-2.0 libxml2-2.0
+Gda_4_0_gir_CFLAGS = $(AM_CPPFLAGS)
+Gda_4_0_gir_LIBS = $(lib_LTLIBRARIES)
+Gda_4_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_sources))
+Gda_4_0_gir_PACKAGES = gobject-2.0 libxml-2.0
+INTROSPECTION_GIRS += Gda-4.0.gir
+INTROSPECTION_LIBS += -lxml2
girdir = $(datadir)/gir-1.0
-gir_DATA = $(BUILT_GIRSOURCES)
-
-typelibsdir = $(libdir)/girepository-1.0/
-
-typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+gir_DATA = $(INTROSPECTION_GIRS)
-Gda- GDA_ABI_VERSION@.typelib: Gda- GDA_ABI_VERSION@.gir $(INTROSPECTION_COMPILER)
- $(QUIET_GEN)$(DEBUG) $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
-CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
+typelibsdir = $(libdir)/girepository-1.0
+typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+CLEANFILES += $(INTROSPECTION_GIRS) $(typelibs_DATA)
+endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]