summaryrefslogtreecommitdiffstats
path: root/patches/gobject-introspection-1.46.0/0003-configure.ac-add-host-gi-and-gi-cross-wrapper-option.patch
blob: ae340338fadfe7e62f04cf6ac1796b84ebab5f4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Mon, 28 Dec 2015 11:42:16 +0100
Subject: [PATCH] configure.ac: add host-gi and gi-cross-wrapper options

Based on a patch from Alexander Kanavin <alex.kanavin@gmail.com>

Note: Not for upstream. It depends on PTXdist modifying the configure script.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 common.mk    | 12 +++++++++++-
 configure.ac | 14 ++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/common.mk b/common.mk
index e26c6377838a..2a6774cc2156 100644
--- a/common.mk
+++ b/common.mk
@@ -6,6 +6,15 @@
 # module itself.
 #
 
+if USE_HOST_GI
+INTROSPECTION_SCANNER = \
+    env PATH="$(PATH)" \
+        LPATH=.libs \
+        CC="$(CC)" \
+        PYTHONPATH=$(top_builddir):$(top_srcdir) \
+        UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
+        g-ir-scanner
+else
 INTROSPECTION_SCANNER = \
     env PATH=".libs:$(PATH)" \
         LPATH=.libs \
@@ -14,6 +23,7 @@ INTROSPECTION_SCANNER = \
         UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) \
         UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
         $(top_builddir)/g-ir-scanner
+endif
 
 INTROSPECTION_SCANNER_ARGS = \
     --verbose \
@@ -26,7 +36,7 @@ INTROSPECTION_SCANNER_ARGS = \
 
 INTROSPECTION_COMPILER = \
     env PATH=".libs:$(PATH)" \
-        $(top_builddir)/g-ir-compiler$(EXEEXT)
+        $(GI_CROSS_WRAPPER) $(top_builddir)/g-ir-compiler$(EXEEXT)
 
 INTROSPECTION_COMPILER_ARGS = \
     --includedir=$(srcdir) \
diff --git a/configure.ac b/configure.ac
index b11596be573c..a7b78715cdf3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -250,6 +250,20 @@ AC_FUNC_STRTOD
 AC_CHECK_FUNCS([memchr strchr strspn strstr strtol strtoull])
 AC_CHECK_FUNCS([backtrace backtrace_symbols])
 
+AC_ARG_ENABLE([gi-cross-wrapper],
+[AS_HELP_STRING([--enable-gi-cross-wrapper=path],[Use a wrapper to run gicompiler and binaries produced by giscanner (useful when cross-compiling)])],
+[GI_CROSS_WRAPPER="${enableval}"], [GI_CROSS_WRAPPER=])
+AC_SUBST(GI_CROSS_WRAPPER)
+
+AC_ARG_ENABLE([host-gi],
+[AS_HELP_STRING([--enable-host-gi],[Use gobject introspection tools installed in the host system (useful when cross-compiling)])],
+[case "${enableval}" in
+  yes) host_gi=true ;;
+  no)  host_gi=false ;;
+  *) AC_MSG_ERROR([bad value ${enableval} for --enable-host-gi]) ;;
+esac],[host_gi=false])
+AM_CONDITIONAL([USE_HOST_GI], [test x$host_gi = xtrue])
+
 # Python
 AM_PATH_PYTHON([2.7])
 case "$host" in