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
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.
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).
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).
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.
24 These options are useful when cross-compiling for a different target architecture.
26 Upstream-Status: Pending [review on oe-core list]
27 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
30 common.mk | 39 +++++++++++++++++++++++++++++++++++++++
31 configure.ac | 42 ++++++++++++++++++++++++++++++++++++++++++
32 tests/Makefile.am | 5 ++++-
33 4 files changed, 87 insertions(+), 1 deletion(-)
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
46 include Makefile-tools.am
47 include Makefile-msvcproj.am
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
58 +INTROSPECTION_SCANNER = \
59 + env PATH="$(PATH)" \
62 + PYTHONPATH=$(top_builddir):$(top_srcdir) \
63 + UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
66 INTROSPECTION_SCANNER = \
67 env PATH=".libs:$(PATH)" \
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
76 +CROSS_WRAPPER_ARG = --use-binary-wrapper=$(GI_CROSS_WRAPPER)
82 +LDD_WRAPPER_ARG = --use-ldd-wrapper=$(GI_LDD_WRAPPER)
87 INTROSPECTION_SCANNER_ARGS = \
89 + $(CROSS_WRAPPER_ARG) \
90 + $(LDD_WRAPPER_ARG) \
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
99 +INTROSPECTION_COMPILER = \
100 + env PATH=".libs:$(PATH)" \
101 + $(GI_CROSS_WRAPPER) $(top_builddir)/.libs/g-ir-compiler$(EXEEXT)
103 INTROSPECTION_COMPILER = \
104 env PATH=".libs:$(PATH)" \
105 $(top_builddir)/g-ir-compiler$(EXEEXT)
108 INTROSPECTION_COMPILER_ARGS = \
109 --includedir=$(srcdir) \
110 @@ -35,6 +65,14 @@ INTROSPECTION_COMPILER_ARGS = \
111 --includedir=$(top_builddir) \
112 --includedir=$(top_builddir)/gir
115 +INTROSPECTION_DOCTOOL = \
116 + env PATH="$(PATH)" \
118 + PYTHONPATH=$(top_builddir):$(top_srcdir) \
119 + UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
122 INTROSPECTION_DOCTOOL = \
123 env PATH=".libs:$(PATH)" \
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
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])
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])
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)])],
153 +GI_CROSS_WRAPPER="${enableval}"
159 +AC_SUBST(GI_CROSS_WRAPPER)
160 +AM_CONDITIONAL([USE_CROSS_WRAPPER], [test x$use_wrapper = xtrue])
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)])],
165 +GI_LDD_WRAPPER="${enableval}"
166 +use_ldd_wrapper=true
169 +use_ldd_wrapper=false
171 +AC_SUBST(GI_LDD_WRAPPER)
172 +AM_CONDITIONAL([USE_LDD_WRAPPER], [test x$use_ldd_wrapper = xtrue])
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])
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
191 include $(top_srcdir)/common.mk
193 -SUBDIRS = . scanner repository offsets warn
194 +SUBDIRS = . scanner repository warn
195 +if BUILD_INTROSPECTION_DATA