summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase-5.1.0/0003-Add-external-hostbindir-option.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-qt/qt5/qtbase-5.1.0/0003-Add-external-hostbindir-option.patch')
-rw-r--r--recipes-qt/qt5/qtbase-5.1.0/0003-Add-external-hostbindir-option.patch218
1 files changed, 218 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtbase-5.1.0/0003-Add-external-hostbindir-option.patch b/recipes-qt/qt5/qtbase-5.1.0/0003-Add-external-hostbindir-option.patch
new file mode 100644
index 00000000..751275ed
--- /dev/null
+++ b/recipes-qt/qt5/qtbase-5.1.0/0003-Add-external-hostbindir-option.patch
@@ -0,0 +1,218 @@
1From 253db5565b402dfc0b2abbcc813d6ac32eecef96 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Sat, 6 Apr 2013 13:15:07 +0200
4Subject: [PATCH 03/23] Add -external-hostbindir option
5
6* when cross-compiling it's sometimes useful to use existing tools from machine
7 (or in OpenEmbedded built with separate native recipe) when building for target
8
9* this way we can skip bootstraping tools we already have
10
11Upstream-Status: Pending
12
13Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
14---
15 configure | 15 ++++++++++++++-
16 mkspecs/features/qt_functions.prf | 5 ++++-
17 mkspecs/features/qt_tool.prf | 2 +-
18 qmake/property.cpp | 1 +
19 qtbase.pro | 12 +++++++++---
20 src/corelib/global/qlibraryinfo.cpp | 3 ++-
21 src/corelib/global/qlibraryinfo.h | 1 +
22 tools/configure/configureapp.cpp | 8 ++++++++
23 8 files changed, 40 insertions(+), 7 deletions(-)
24
25diff --git a/configure b/configure
26index 45e0586..dbe7360 100755
27--- a/configure
28+++ b/configure
29@@ -1038,6 +1038,7 @@ QT_HOST_PREFIX=
30 QT_HOST_BINS=
31 QT_HOST_LIBS=
32 QT_HOST_DATA=
33+QT_EXTERNAL_HOST_BINS=
34
35 #flags for SQL drivers
36 QT_CFLAGS_PSQL=
37@@ -1145,7 +1146,7 @@ while [ "$#" -gt 0 ]; do
38 VAL=no
39 ;;
40 #Qt style options that pass an argument
41- -prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-skip|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-hostlibdir|-qpa|-qconfig|-android-sdk|-android-ndk|-android-ndk-platform|-android-ndk-host|-android-arch|-android-toolchain-version)
42+ -prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-skip|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-hostlibdir|-qpa|-qconfig|-android-sdk|-android-ndk|-android-ndk-platform|-android-ndk-host|-android-arch|-android-toolchain-version|-external-hostbindir)
43 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
44 shift
45 VAL="$1"
46@@ -1333,6 +1334,9 @@ while [ "$#" -gt 0 ]; do
47 hostlibdir)
48 QT_HOST_LIBS="$VAL"
49 ;;
50+ external-hostbindir)
51+ QT_EXTERNAL_HOST_BINS="$VAL"
52+ ;;
53 pkg-config)
54 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
55 CFG_PKGCONFIG="$VAL"
56@@ -3190,6 +3194,11 @@ if [ "$CFG_COMPILE_EXAMPLES" = "yes" ]; then
57 QMAKE_CONFIG="$QMAKE_CONFIG compile_examples"
58 fi
59
60+# default is empty, don't call makeabs if it is empty
61+if [ ! -z "$QT_EXTERNAL_HOST_BINS" ]; then
62+ QT_EXTERNAL_HOST_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_EXTERNAL_HOST_BINS"`
63+fi
64+
65 #-------------------------------------------------------------------------------
66 # help - interactive parts of the script _after_ this section please
67 #-------------------------------------------------------------------------------
68@@ -3358,6 +3367,9 @@ Installation options:
69 -hostdatadir <dir> . Data used by qmake will be installed to <dir>
70 (default HOSTPREFIX)
71
72+ -external-hostbindir <dir> Use external host executables instead of building them
73+ (not used by defaut)
74+
75 Configure options:
76
77 The defaults (*) are usually acceptable. A plus (+) denotes a default value
78@@ -3873,6 +3885,7 @@ static const char qt_configure_prefix_path_strs[][256 + 12] = {
79 "qt_hbinpath=$QT_HOST_BINS",
80 "qt_hlibpath=$QT_HOST_LIBS",
81 "qt_hdatpath=$QT_HOST_DATA",
82+ "qt_ebinpath=$QT_EXTERNAL_HOST_BINS",
83 "qt_targspec=$shortxspec",
84 "qt_hostspec=$shortspec",
85 #endif
86diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
87index bbbb5d3..d581367 100644
88--- a/mkspecs/features/qt_functions.prf
89+++ b/mkspecs/features/qt_functions.prf
90@@ -193,7 +193,10 @@ defineTest(qtAddRpathLink) {
91 defineTest(qtPrepareTool) {
92 $$1 = $$eval(QT_TOOL.$${2}.binary)
93 isEmpty($$1) {
94- $$1 = $$[QT_HOST_BINS]/$$2
95+ $$1 = $$[QT_EXTERNAL_HOST_BINS]/$$2
96+ isEmpty($$[QT_EXTERNAL_HOST_BINS]) {
97+ $$1 = $$[QT_HOST_BINS]/$$2
98+ }
99 exists($$eval($$1).pl) {
100 $$1 = perl -w $$eval($$1).pl
101 } else: contains(QMAKE_HOST.os, Windows) {
102diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf
103index 9a6b963..83ef3a0 100644
104--- a/mkspecs/features/qt_tool.prf
105+++ b/mkspecs/features/qt_tool.prf
106@@ -16,7 +16,7 @@ CONFIG += console
107 # If we are doing a prefix build, create a "module" pri which enables
108 # qtPrepareTool() to work with the non-installed build.
109 # Non-bootstrapped tools always need this because of the environment setup.
110-!build_pass:if(!host_build|!force_bootstrap|force_independent) {
111+!build_pass:if(!host_build|!force_bootstrap|force_independent):isEmpty($$[QT_EXTERNAL_HOST_BINS]) {
112 isEmpty(MODULE):MODULE = $$TARGET
113
114 !host_build|!force_bootstrap: MODULE_DEPENDS = $$replace(QT, -private$, )
115diff --git a/qmake/property.cpp b/qmake/property.cpp
116index 4685440..93eb1d4 100644
117--- a/qmake/property.cpp
118+++ b/qmake/property.cpp
119@@ -75,6 +75,7 @@ static const struct {
120 { "QT_HOST_DATA", QLibraryInfo::HostDataPath, true },
121 { "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true },
122 { "QT_HOST_LIBS", QLibraryInfo::HostLibrariesPath, true },
123+ { "QT_EXTERNAL_HOST_BINS", QLibraryInfo::ExternalHostBinariesPath, true },
124 { "QMAKE_SPEC", QLibraryInfo::HostSpecPath, true },
125 { "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true },
126 };
127diff --git a/qtbase.pro b/qtbase.pro
128index 6ab032e..38872b6 100644
129--- a/qtbase.pro
130+++ b/qtbase.pro
131@@ -68,16 +68,22 @@ CONFIG -= qt
132
133 #qmake
134 qmake.path = $$[QT_HOST_BINS]
135+qmake.files = $$OUT_PWD/bin/qmake
136+!isEmpty($$[QT_EXTERNAL_HOST_BINS]) {
137+ qmake.files = $$[QT_EXTERNAL_HOST_BINS]/bin/qmake
138+}
139 equals(QMAKE_HOST.os, Windows) {
140- qmake.files = $$OUT_PWD/bin/qmake.exe
141-} else {
142- qmake.files = $$OUT_PWD/bin/qmake
143+ qmake.files = $${qmake.files}.exe
144 }
145 INSTALLS += qmake
146
147 #syncqt
148 syncqt.path = $$[QT_HOST_BINS]
149 syncqt.files = $$PWD/bin/syncqt.pl
150+syncqt.files = $$PWD/bin/syncqt.pl
151+!isEmpty($$[QT_EXTERNAL_HOST_BINS]) {
152+ syncqt.files = $$[QT_EXTERNAL_HOST_BINS]/bin/syncqt.pl
153+}
154 INSTALLS += syncqt
155
156 # If we are doing a prefix build, create a "module" pri which enables
157diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
158index bda2ffe..530aea9 100644
159--- a/src/corelib/global/qlibraryinfo.cpp
160+++ b/src/corelib/global/qlibraryinfo.cpp
161@@ -270,7 +270,7 @@ QLibraryInfo::isDebugBuild()
162 */
163
164 static const struct {
165- char key[19], value[13];
166+ char key[21], value[13];
167 } qtConfEntries[] = {
168 { "Prefix", "." },
169 { "Documentation", "doc" }, // should be ${Data}/doc
170@@ -296,6 +296,7 @@ static const struct {
171 { "HostBinaries", "bin" },
172 { "HostLibraries", "lib" },
173 { "HostData", "." },
174+ { "ExternalHostBinaries", "" },
175 { "TargetSpec", "" },
176 { "HostSpec", "" },
177 #endif
178diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h
179index b275e01..0e6baed 100644
180--- a/src/corelib/global/qlibraryinfo.h
181+++ b/src/corelib/global/qlibraryinfo.h
182@@ -84,6 +84,7 @@ public:
183 HostBinariesPath,
184 HostLibrariesPath,
185 HostDataPath,
186+ ExternalHostBinariesPath,
187 TargetSpecPath,
188 HostSpecPath,
189 LastHostPath = HostSpecPath,
190diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
191index f92fad1..8f0bd0e 100644
192--- a/tools/configure/configureapp.cpp
193+++ b/tools/configure/configureapp.cpp
194@@ -1161,6 +1161,13 @@ void Configure::parseCmdLine()
195 dictionary[ "QT_HOST_DATA" ] = configCmdLine.at(i);
196 }
197
198+ else if (configCmdLine.at(i) == "-external-hostbindir") {
199+ ++i;
200+ if (i == argCount)
201+ break;
202+ dictionary[ "QT_EXTERNAL_HOST_BINS" ] = configCmdLine.at(i);
203+ }
204+
205 else if (configCmdLine.at(i) == "-make-tool") {
206 ++i;
207 if (i == argCount)
208@@ -3752,6 +3759,7 @@ void Configure::generateQConfigCpp()
209 << " \"qt_hbinpath=" << formatPath(dictionary["QT_HOST_BINS"]) << "\"," << endl
210 << " \"qt_hlibpath=" << formatPath(dictionary["QT_HOST_LIBS"]) << "\"," << endl
211 << " \"qt_hdatpath=" << formatPath(dictionary["QT_HOST_DATA"]) << "\"," << endl
212+ << " \"qt_ebinpath=" << formatPath(dictionary["QT_EXTERNAL_HOST_BINS"]) << "\"," << endl
213 << " \"qt_targspec=" << targSpec << "\"," << endl
214 << " \"qt_hostspec=" << hostSpec << "\"," << endl
215 << "#endif" << endl
216--
2171.8.3.2
218