[gobject-introspection] Use a launcher for executing g-ir-scanner



commit b638438e874fa437adff3bb0480710fe5cbe120c
Author: Nicola Fontana <ntd entidi it>
Date:   Mon Mar 23 22:04:32 2015 +0100

    Use a launcher for executing g-ir-scanner
    
    In cross-compilation the build system is unable to execute the compiled
    binary. Give the possibility to use  a launcher, e.g. wine for MinGW or
    qemu for different CPU type.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=696773

 common.mk                |    4 ++++
 giscanner/gdumpparser.py |    6 ++++++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/common.mk b/common.mk
index e26c637..b778f7a 100644
--- a/common.mk
+++ b/common.mk
@@ -24,8 +24,12 @@ INTROSPECTION_SCANNER_ARGS = \
     --add-include-path=$(top_builddir) \
     --add-include-path=$(top_builddir)/gir
 
+# GI_CROSS_LAUNCHER is the command to use for executing g-ir-compiler.
+# Normally will be undefined but can be set (e.g. to wine or qemu)
+# when cross-compiling
 INTROSPECTION_COMPILER = \
     env PATH=".libs:$(PATH)" \
+        $(GI_CROSS_LAUNCHER) \
         $(top_builddir)/g-ir-compiler$(EXEEXT)
 
 INTROSPECTION_COMPILER_ARGS = \
diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py
index 9bdc2bc..1134f33 100644
--- a/giscanner/gdumpparser.py
+++ b/giscanner/gdumpparser.py
@@ -162,6 +162,12 @@ blob containing data gleaned from GObject's primitive introspection."""
         out_path = os.path.join(self._binary.tmpdir, 'dump.xml')
 
         args = []
+
+        # Prepend the launcher command and arguments, if defined
+        launcher = os.environ.get('GI_CROSS_LAUNCHER')
+        if launcher:
+            args.extend(launcher.split())
+
         args.extend(self._binary.args)
         args.append('--introspect-dump=%s,%s' % (in_path, out_path))
 


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