summaryrefslogtreecommitdiff
path: root/src/gir/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'src/gir/Makefile.am')
-rw-r--r--src/gir/Makefile.am30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gir/Makefile.am b/src/gir/Makefile.am
new file mode 100644
index 0000000..860b2f0
--- /dev/null
+++ b/src/gir/Makefile.am
@@ -0,0 +1,30 @@
+girdir = $(datarootdir)/gir-1.0
+
+dist_gir_DATA = $(srcdir)/%D%/Disfluid-$(DLL_VERSION).gir
+
+AM_G_IR_SCANNER_FLAGS = \
+ --format=gir -i GLib-2.0 -I$(abs_top_srcdir)/include
+
+if BUILD_GOBJECT
+
+# The rule to build the .gir file recursively make the libraries. If
+# you run "make -j all", and the libraries are not up to date, then
+# there is a race to build the libraries by this call, and by the
+# recursive calls due to the gir rules.
+
+# The introspection/Makefile.am is executed early and tries to make
+# sure that the recursive call is a no-op. However, if you bypass the
+# subdir order by executing "make -j src/gir/Disfluid-….gir", with the
+# dll version as …, then the race is still there. Automated build
+# scripts usually don’t do this, so it’s fine.
+
+%D%/Disfluid-$(DLL_VERSION).gir: $(INTROSPECTION_LISTS) $(INTROSPECTION_SRC)
+ $(MAKE) $(AM_MAKEFLAGS) $(INTROSPECTED_LIBS)
+ $(AM_V_GEN) $(G_IR_SCANNER) $(AM_G_IR_SCANNER_FLAGS) $(G_IR_SCANNER_FLAGS) --c-include=disfluid.h --c-include=disfluid/cache_entry.h --c-include=disfluid-gobject.h -n Disfluid --nsversion=$(DLL_VERSION) --symbol-prefix=disfluid_ --output=%D%/Disfluid-$(DLL_VERSION).gir-t $$(for lib in $(INTROSPECTED_LIBS) ; do echo "--library=$$lib" ; done) --cflags-begin $(GOBJECT_CFLAGS) --cflags-end $(INTROSPECTED_FILES) && $(SED) 's/shared-library="[^"]*"/shared-library=""/g' %D%/Disfluid-$(DLL_VERSION).gir-t > %D%/Disfluid-$(DLL_VERSION).gir-fixed && rm %D%/Disfluid-$(DLL_VERSION).gir-t && mv %D%/Disfluid-$(DLL_VERSION).gir-fixed $(srcdir)/%D%/Disfluid-$(DLL_VERSION).gir
+
+else # not BUILD_GOBJECT
+
+%D%/Disfluid-$(DLL_VERSION).gir: $(INTROSPECTION_LISTS) $(INTROSPECTION_SRC)
+ @>&2 echo "The introspection sources changed, so the gir file must be updated. Please configure with gobject." ; exit 1
+
+endif # not BUILD_GOBJECT