]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/blob
c682b42af6fba72fb17942da2f3e8be022476288
[thirdparty/openembedded/openembedded-core-contrib.git] /
1 From b1503fe2693d602b3e24e4b832dc0934960d5d22 Mon Sep 17 00:00:00 2001
2 From: Alexander Kanavin <alex.kanavin@gmail.com>
3 Date: Mon, 19 Oct 2015 18:29:21 +0300
4 Subject: [PATCH 2/5] configure.ac: add host-gi, gi-cross-wrapper,
5 gi-ldd-wrapper and introspection-data options
6
7 With the first option, gobject-introspection tools (g-ir-doc-tool and g-ir-scanner)
8 that are already installed in the host system will be used for building the source tree.
9
10 With the second option, g-ir-scanner will be instructed to use an executable
11 wrapper to run binaries it's producing, and g-ir-compiler will be run
12 through the same wrapper (host system's g-ir-compiler cannot be used because
13 it's producing architecture-specific output).
14
15 With the third option, giscanner will be instructed to use a special ldd
16 command instead of system's ldd (which does not work when the binary to inspect
17 is compiled for a different architecture).
18
19 With the fourth option, it is possible to disable building of introspection data
20 (.gir and .typelib files), which may be difficult or impossible in cross-compilation
21 environments, because of lack of emulation (or native hardware) for the target architecture
22 on which the target binaries can be run.
23
24 These options are useful when cross-compiling for a different target architecture.
25
26 Upstream-Status: Pending [review on oe-core list]
27 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
28 ---
29 Makefile.am | 2 ++
30 common.mk | 39 +++++++++++++++++++++++++++++++++++++++
31 configure.ac | 42 ++++++++++++++++++++++++++++++++++++++++++
32 tests/Makefile.am | 5 ++++-
33 4 files changed, 87 insertions(+), 1 deletion(-)
34
35 Index: gobject-introspection-1.52.1/Makefile.am
36 ===================================================================
37 --- gobject-introspection-1.52.1.orig/Makefile.am
38 +++ gobject-introspection-1.52.1/Makefile.am
39 @@ -21,7 +21,9 @@ include Makefile-cmph.am
40 include Makefile-girepository.am
41 include Makefile-giscanner.am
42 include Makefile-examples.am
43 +if BUILD_INTROSPECTION_DATA
44 include Makefile-gir.am
45 +endif
46 include Makefile-tools.am
47 include Makefile-msvcproj.am
48
49 Index: gobject-introspection-1.52.1/common.mk
50 ===================================================================
51 --- gobject-introspection-1.52.1.orig/common.mk
52 +++ gobject-introspection-1.52.1/common.mk
53 @@ -6,6 +6,15 @@
54 # module itself.
55 #
56
57 +if USE_HOST_GI
58 +INTROSPECTION_SCANNER = \
59 + env PATH="$(PATH)" \
60 + LPATH=.libs \
61 + CC="$(CC)" \
62 + PYTHONPATH=$(top_builddir):$(top_srcdir) \
63 + UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
64 + g-ir-scanner
65 +else
66 INTROSPECTION_SCANNER = \
67 env PATH=".libs:$(PATH)" \
68 LPATH=.libs \
69 @@ -14,9 +23,24 @@ INTROSPECTION_SCANNER = \
70 UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) \
71 UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
72 $(top_builddir)/g-ir-scanner
73 +endif
74 +
75 +if USE_CROSS_WRAPPER
76 +CROSS_WRAPPER_ARG = --use-binary-wrapper=$(GI_CROSS_WRAPPER)
77 +else
78 +CROSS_WRAPPER_ARG =
79 +endif
80 +
81 +if USE_LDD_WRAPPER
82 +LDD_WRAPPER_ARG = --use-ldd-wrapper=$(GI_LDD_WRAPPER)
83 +else
84 +LDD_WRAPPER_ARG =
85 +endif
86
87 INTROSPECTION_SCANNER_ARGS = \
88 --verbose \
89 + $(CROSS_WRAPPER_ARG) \
90 + $(LDD_WRAPPER_ARG) \
91 -I$(top_srcdir) \
92 --add-include-path=$(srcdir) \
93 --add-include-path=$(top_srcdir)/gir \
94 @@ -24,9 +48,15 @@ INTROSPECTION_SCANNER_ARGS = \
95 --add-include-path=$(top_builddir) \
96 --add-include-path=$(top_builddir)/gir
97
98 +if USE_CROSS_WRAPPER
99 +INTROSPECTION_COMPILER = \
100 + env PATH=".libs:$(PATH)" \
101 + $(GI_CROSS_WRAPPER) $(top_builddir)/.libs/g-ir-compiler$(EXEEXT)
102 +else
103 INTROSPECTION_COMPILER = \
104 env PATH=".libs:$(PATH)" \
105 $(top_builddir)/g-ir-compiler$(EXEEXT)
106 +endif
107
108 INTROSPECTION_COMPILER_ARGS = \
109 --includedir=$(srcdir) \
110 @@ -35,6 +65,14 @@ INTROSPECTION_COMPILER_ARGS = \
111 --includedir=$(top_builddir) \
112 --includedir=$(top_builddir)/gir
113
114 +if USE_HOST_GI
115 +INTROSPECTION_DOCTOOL = \
116 + env PATH="$(PATH)" \
117 + LPATH=.libs \
118 + PYTHONPATH=$(top_builddir):$(top_srcdir) \
119 + UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
120 + g-ir-doc-tool
121 +else
122 INTROSPECTION_DOCTOOL = \
123 env PATH=".libs:$(PATH)" \
124 LPATH=.libs \
125 @@ -42,6 +80,7 @@ INTROSPECTION_DOCTOOL = \
126 UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) \
127 UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
128 $(top_builddir)/g-ir-doc-tool
129 +endif
130
131 INTROSPECTION_DOCTOOL_ARGS = \
132 --add-include-path=$(srcdir) \
133 Index: gobject-introspection-1.52.1/configure.ac
134 ===================================================================
135 --- gobject-introspection-1.52.1.orig/configure.ac
136 +++ gobject-introspection-1.52.1/configure.ac
137 @@ -366,6 +366,48 @@ dnl
138 AM_CONDITIONAL(MSVC_BASE_NO_TOOLSET_SET, [test x$MSVC_BASE_TOOLSET = x])
139 AM_CONDITIONAL(MSVC_NO_TOOLSET_SET, [test x$MSVC_TOOLSET = x])
140
141 +AC_ARG_ENABLE([host-gi],
142 +[AS_HELP_STRING([--enable-host-gi],[Use gobject introspection tools installed in the host system (useful when cross-compiling)])],
143 +[case "${enableval}" in
144 + yes) host_gi=true ;;
145 + no) host_gi=false ;;
146 + *) AC_MSG_ERROR([bad value ${enableval} for --enable-host-gi]) ;;
147 +esac],[host_gi=false])
148 +AM_CONDITIONAL([USE_HOST_GI], [test x$host_gi = xtrue])
149 +
150 +AC_ARG_ENABLE([gi-cross-wrapper],
151 +[AS_HELP_STRING([--enable-gi-cross-wrapper=path],[Use a wrapper to run gicompiler and binaries produced by giscanner (useful when cross-compiling)])],
152 +[
153 +GI_CROSS_WRAPPER="${enableval}"
154 +use_wrapper=true
155 +],[
156 +GI_CROSS_WRAPPER=""
157 +use_wrapper=false
158 +])
159 +AC_SUBST(GI_CROSS_WRAPPER)
160 +AM_CONDITIONAL([USE_CROSS_WRAPPER], [test x$use_wrapper = xtrue])
161 +
162 +AC_ARG_ENABLE([gi-ldd-wrapper],
163 +[AS_HELP_STRING([--enable-gi-ldd-wrapper=path],[Use a ldd wrapper instead of system's ldd command in giscanner (useful when cross-compiling)])],
164 +[
165 +GI_LDD_WRAPPER="${enableval}"
166 +use_ldd_wrapper=true
167 +],[
168 +GI_LDD_WRAPPER=""
169 +use_ldd_wrapper=false
170 +])
171 +AC_SUBST(GI_LDD_WRAPPER)
172 +AM_CONDITIONAL([USE_LDD_WRAPPER], [test x$use_ldd_wrapper = xtrue])
173 +
174 +AC_ARG_ENABLE([introspection-data],
175 +[AS_HELP_STRING([--enable-introspection-data],[Build introspection data (.gir and .typelib files) in addition to library and tools])],
176 +[case "${enableval}" in
177 + yes) introspection_data=true ;;
178 + no) introspection_data=false ;;
179 + *) AC_MSG_ERROR([bad value ${enableval} for --enable-introspection-data]) ;;
180 +esac],[introspection_data=true])
181 +AM_CONDITIONAL([BUILD_INTROSPECTION_DATA], [test x$introspection_data = xtrue])
182 +
183 AC_CONFIG_FILES([
184 Makefile
185 tests/Makefile
186 Index: gobject-introspection-1.52.1/tests/Makefile.am
187 ===================================================================
188 --- gobject-introspection-1.52.1.orig/tests/Makefile.am
189 +++ gobject-introspection-1.52.1/tests/Makefile.am
190 @@ -1,6 +1,9 @@
191 include $(top_srcdir)/common.mk
192
193 -SUBDIRS = . scanner repository offsets warn
194 +SUBDIRS = . scanner repository warn
195 +if BUILD_INTROSPECTION_DATA
196 +SUBDIRS += offsets
197 +endif
198
199 EXTRA_DIST=
200 BUILT_SOURCES=