Build introspection data if available and configured
authorColin Walters <walters@verbum.org>
Fri, 17 Jul 2009 20:35:34 +0000 (16:35 -0400)
committerJohan Dahlin <johan@gnome.org>
Wed, 9 Dec 2009 17:59:25 +0000 (15:59 -0200)
Add --enable-introspection option via the GOBJECT_INTROSPECTION_CHECK
macro, and implement the build rules.

https://bugzilla.gnome.org/show_bug.cgi?id=592146

atk/Makefile.am
configure.in

index 2459680..c4525e9 100644 (file)
@@ -2,6 +2,8 @@
 # which are more like other make's VPATH.
 GPATH = $(srcdir)
 
+CLEANFILES =
+
 if PLATFORM_WIN32
 no_undefined = -no-undefined
 else
@@ -138,6 +140,34 @@ s-enum-types-c: @REBUILD@ $(atk_headers) Makefile
        && rm -f tmp-atk-enum-types.c \
        && echo timestamp > $(@F)
 
+if HAVE_INTROSPECTION
+BUILT_GIRSOURCES =
+
+Atk-1.0.gir: $(INTROSPECTION_SCANNER) libatk-1.0.la Makefile
+       $(INTROSPECTION_SCANNER) -v \
+               --namespace Atk --nsversion=1.0 \
+               $(INCLUDES) \
+               --include=GObject-2.0 \
+               --library=libatk-1.0.la \
+               --libtool="$(LIBTOOL)" \
+               --output $@ \
+               $(libatkinclude_HEADERS) \
+               $(libatk_1_0_la_SOURCES)
+BUILT_GIRSOURCES += Atk-1.0.gir
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(BUILT_GIRSOURCES)
+
+typelibsdir = $(libdir)/girepository-1.0/
+
+typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+
+%.typelib: %.gir $(INTROSPECTION_COMPILER)
+       $(DEBUG) $(INTROSPECTION_COMPILER) --includedir=$(srcdir) --includedir=. $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+
+CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
+endif
+
 # ---------- Win32 stuff ----------
 
 if OS_WIN32
index 4aa7cb8..aaa6b50 100644 (file)
@@ -183,6 +183,8 @@ AM_GLIB_GNU_GETTEXT
 
 AC_CHECK_FUNCS(bind_textdomain_codeset)
 
+GOBJECT_INTROSPECTION_CHECK([0.6.4])
+
 GTK_DOC_CHECK([1.0])
 
 # define a MAINT-like variable REBUILD which is set if Perl