summaryrefslogtreecommitdiffstats
path: root/patches/gobject-introspection-1.56.1/0001-don-t-build-g-ir-scanner-when-cross-compiling.patch
blob: a711f77800dca47a2adf5a3974f9284b2a156665 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Mon, 28 Dec 2015 11:42:16 +0100
Subject: [PATCH] don't build g-ir-scanner when cross-compiling

Note: Not for upstream. It depends on host-gobject-introspection.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 Makefile-gir.am   |  5 ++++-
 Makefile-tools.am |  4 ++++
 Makefile.am       |  2 ++
 common.mk         | 10 ++++++++++
 configure.ac      |  3 +++
 5 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/Makefile-gir.am b/Makefile-gir.am
index 86ab5bf1eda4..61a540df922e 100644
--- a/Makefile-gir.am
+++ b/Makefile-gir.am
@@ -87,7 +87,10 @@ endif
 
 BUILT_GIRSOURCES += GLib-2.0.gir
 
-GLib-2.0.gir: g-ir-scanner g-ir-compiler$(EXEEXT)
+if !USE_HOST_GI
+GLib-2.0.gir: g-ir-scanner
+endif
+GLib-2.0.gir: g-ir-compiler$(EXEEXT)
 
 gir/DBusGLib-1.0.typelib: GObject-2.0.gir
 
diff --git a/Makefile-tools.am b/Makefile-tools.am
index 952937354e43..54135bffb84b 100644
--- a/Makefile-tools.am
+++ b/Makefile-tools.am
@@ -1,15 +1,18 @@
 bin_PROGRAMS += g-ir-compiler g-ir-generate g-ir-inspect
+if !USE_HOST_GI
 bin_SCRIPTS += g-ir-scanner g-ir-annotation-tool
 
 if BUILD_DOCTOOL
 bin_SCRIPTS += g-ir-doc-tool
 endif
+endif
 
 EXTRA_DIST += 				\
 	tools/g-ir-tool-template.in
 
 TOOL_SUBSTITUTIONS = -e s,@libdir\@,$(libdir), -e s,@datarootdir\@,$(datarootdir), -e s,@PYTHON\@,$(PYTHON),
 
+if !USE_HOST_GI
 g-ir-scanner: tools/g-ir-tool-template.in _giscanner.la Makefile
 	$(AM_V_GEN) sed $(TOOL_SUBSTITUTIONS) -e s,@TOOL_MODULE\@,scannermain, -e s,@TOOL_FUNCTION\@,scanner_main, $< > $@.tmp && mv $@.tmp $@
 	@chmod a+x $@
@@ -21,6 +24,7 @@ g-ir-annotation-tool: tools/g-ir-tool-template.in _giscanner.la Makefile
 g-ir-doc-tool: tools/g-ir-tool-template.in _giscanner.la Makefile
 	$(AM_V_GEN) sed $(TOOL_SUBSTITUTIONS) -e s,@TOOL_MODULE\@,docmain, -e s,@TOOL_FUNCTION\@,doc_main, $< > $@.tmp && mv $@.tmp $@
 	@chmod a+x $@
+endif
 
 g_ir_compiler_SOURCES = tools/compiler.c
 g_ir_compiler_CPPFLAGS = -DGIREPO_DEFAULT_SEARCH_PATH="\"$(libdir)\"" \
diff --git a/Makefile.am b/Makefile.am
index dafea3846a30..0fcea1988378 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,9 @@ include Makefile.introspection
 
 include Makefile-cmph.am
 include Makefile-girepository.am
+if !USE_HOST_GI
 include Makefile-giscanner.am
+endif
 include Makefile-examples.am
 include Makefile-gir.am
 include Makefile-tools.am
diff --git a/common.mk b/common.mk
index b778f7aaf955..70872cd3d53d 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 \
diff --git a/configure.ac b/configure.ac
index 2a685146292a..e57144f9df56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -273,7 +273,10 @@ case "$host" in
 	pyexecdir=`echo $pyexecdir | tr '\\\\' '/'`
 	;;
 esac
+AM_CONDITIONAL([USE_HOST_GI], [test "$cross_compiling" = yes])
+AS_IF([test "$cross_compiling" != yes], [
 AM_CHECK_PYTHON_HEADERS(, AC_MSG_ERROR([Python headers not found]))
+])
 if test "x$os_win32" = "xyes"; then
   AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.]))
 fi