diff options
Diffstat (limited to 'recipes-qt/qt5/qtbase/0003-Add-external-hostbindir-option.patch')
| -rw-r--r-- | recipes-qt/qt5/qtbase/0003-Add-external-hostbindir-option.patch | 228 |
1 files changed, 228 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtbase/0003-Add-external-hostbindir-option.patch b/recipes-qt/qt5/qtbase/0003-Add-external-hostbindir-option.patch new file mode 100644 index 00000000..3f7854fd --- /dev/null +++ b/recipes-qt/qt5/qtbase/0003-Add-external-hostbindir-option.patch | |||
| @@ -0,0 +1,228 @@ | |||
| 1 | From 21c595fd0e386bea1a2e2b19323dc517bb2c7333 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Martin Jansa <Martin.Jansa@gmail.com> | ||
| 3 | Date: Sat, 6 Apr 2013 13:15:07 +0200 | ||
| 4 | Subject: [PATCH 03/14] 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 | |||
| 11 | * qt_functions: temporary remove isEmpty check | ||
| 12 | * now we assume that every build will provide QT_EXTERNAL_HOST_BINS value | ||
| 13 | * isEmpty works correctly only with qmake variables (e.g. $$FOO - | ||
| 14 | isEmpty(FOO)), but doesn't work with system properties like $$[FOO]. | ||
| 15 | |||
| 16 | Upstream-Status: Pending | ||
| 17 | |||
| 18 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
| 19 | --- | ||
| 20 | configure | 15 +++++++++++++++ | ||
| 21 | mkspecs/features/qt_functions.prf | 9 ++++++++- | ||
| 22 | mkspecs/features/qt_tool.prf | 3 +-- | ||
| 23 | qmake/property.cpp | 1 + | ||
| 24 | qtbase.pro | 12 +++++++++--- | ||
| 25 | src/corelib/global/qlibraryinfo.cpp | 3 ++- | ||
| 26 | src/corelib/global/qlibraryinfo.h | 1 + | ||
| 27 | tools/configure/configureapp.cpp | 8 ++++++++ | ||
| 28 | 8 files changed, 45 insertions(+), 7 deletions(-) | ||
| 29 | |||
| 30 | diff --git a/configure b/configure | ||
| 31 | index 1b328ae..46f7230 100755 | ||
| 32 | --- a/configure | ||
| 33 | +++ b/configure | ||
| 34 | @@ -785,6 +785,7 @@ QT_HOST_BINS= | ||
| 35 | QT_HOST_LIBS= | ||
| 36 | QT_HOST_DATA= | ||
| 37 | QT_EXT_PREFIX= | ||
| 38 | +QT_EXTERNAL_HOST_BINS= | ||
| 39 | |||
| 40 | #flags for SQL drivers | ||
| 41 | QT_CFLAGS_PSQL= | ||
| 42 | @@ -905,6 +906,7 @@ while [ "$#" -gt 0 ]; do | ||
| 43 | -testsdir| \ | ||
| 44 | -hostdatadir| \ | ||
| 45 | -hostbindir| \ | ||
| 46 | + -external-hostbindir| \ | ||
| 47 | -hostlibdir| \ | ||
| 48 | -extprefix| \ | ||
| 49 | -sysroot| \ | ||
| 50 | @@ -1118,6 +1120,9 @@ while [ "$#" -gt 0 ]; do | ||
| 51 | extprefix) | ||
| 52 | QT_EXT_PREFIX="$VAL" | ||
| 53 | ;; | ||
| 54 | + external-hostbindir) | ||
| 55 | + QT_EXTERNAL_HOST_BINS="$VAL" | ||
| 56 | + ;; | ||
| 57 | pkg-config) | ||
| 58 | if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then | ||
| 59 | CFG_PKGCONFIG="$VAL" | ||
| 60 | @@ -2226,6 +2231,10 @@ Installation options: | ||
| 61 | -hostdatadir <dir> . Data used by qmake will be installed to <dir> | ||
| 62 | (default HOSTPREFIX) | ||
| 63 | |||
| 64 | + -external-hostbindir <dir> Use external host executables instead of building them | ||
| 65 | + (not used by defaut) | ||
| 66 | + | ||
| 67 | + | ||
| 68 | Configure options: | ||
| 69 | |||
| 70 | The defaults (*) are usually acceptable. A plus (+) denotes a default value | ||
| 71 | @@ -3133,6 +3142,11 @@ fi | ||
| 72 | # command line and environment validation | ||
| 73 | #------------------------------------------------------------------------------- | ||
| 74 | |||
| 75 | +# default is empty, don't call makeabs if it is empty | ||
| 76 | +if [ ! -z "$QT_EXTERNAL_HOST_BINS" ]; then | ||
| 77 | + QT_EXTERNAL_HOST_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_EXTERNAL_HOST_BINS"` | ||
| 78 | +fi | ||
| 79 | + | ||
| 80 | # update QT_CONFIG to show our current predefined configuration | ||
| 81 | CFG_QCONFIG_PATH=$relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h | ||
| 82 | case "$CFG_QCONFIG" in | ||
| 83 | @@ -3820,6 +3834,7 @@ static const char qt_configure_prefix_path_strs[][256 + 12] = { | ||
| 84 | "qt_hbinpath=$QT_HOST_BINS", | ||
| 85 | "qt_hlibpath=$QT_HOST_LIBS", | ||
| 86 | "qt_hdatpath=$QT_HOST_DATA", | ||
| 87 | + "qt_ebinpath=$QT_EXTERNAL_HOST_BINS", | ||
| 88 | "qt_targspec=$shortxspec", | ||
| 89 | "qt_hostspec=$shortspec", | ||
| 90 | #endif | ||
| 91 | diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf | ||
| 92 | index 1dacfed..7229845 100644 | ||
| 93 | --- a/mkspecs/features/qt_functions.prf | ||
| 94 | +++ b/mkspecs/features/qt_functions.prf | ||
| 95 | @@ -193,7 +193,14 @@ defineTest(qtAddRpathLink) { | ||
| 96 | defineTest(qtPrepareTool) { | ||
| 97 | $$1 = $$eval(QT_TOOL.$${2}.binary) | ||
| 98 | isEmpty($$1) { | ||
| 99 | - $$1 = $$[QT_HOST_BINS]/$$2 | ||
| 100 | + $$1 = $$[QT_EXTERNAL_HOST_BINS]/$$2 | ||
| 101 | + # for some reason isEmpty does not work here, FIXME before submitting upstream | ||
| 102 | + # DEBUG 1: mkspecs/features/qt_functions.prf:198: calling built-in isEmpty(/OE/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin/qt5) | ||
| 103 | + # DEBUG 1: mkspecs/features/qt_functions.prf:198: test function returned true | ||
| 104 | + # DEBUG 1: mkspecs/features/qt_functions.prf:198: taking 'then' branch | ||
| 105 | + !exists($$[QT_EXTERNAL_HOST_BINS]/$$2) { | ||
| 106 | + $$1 = $$[QT_HOST_BINS]/$$2 | ||
| 107 | + } | ||
| 108 | exists($$eval($$1).pl) { | ||
| 109 | $$1 = perl -w $$eval($$1).pl | ||
| 110 | } else: contains(QMAKE_HOST.os, Windows) { | ||
| 111 | diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf | ||
| 112 | index f0864f9..50bfac8 100644 | ||
| 113 | --- a/mkspecs/features/qt_tool.prf | ||
| 114 | +++ b/mkspecs/features/qt_tool.prf | ||
| 115 | @@ -15,8 +15,7 @@ CONFIG += console | ||
| 116 | |||
| 117 | # If we are doing a prefix build, create a "module" pri which enables | ||
| 118 | # qtPrepareTool() to work with the non-installed build. | ||
| 119 | -# Non-bootstrapped tools always need this because of the environment setup. | ||
| 120 | -!build_pass:if(!host_build|!force_bootstrap|force_independent) { | ||
| 121 | +!build_pass:if(!host_build|!force_bootstrap|force_independent):!exists($$[QT_EXTERNAL_HOST_BINS]) { | ||
| 122 | isEmpty(MODULE):MODULE = $$TARGET | ||
| 123 | |||
| 124 | !host_build|!force_bootstrap: MODULE_DEPENDS = $$replace(QT, -private$, _private) | ||
| 125 | diff --git a/qmake/property.cpp b/qmake/property.cpp | ||
| 126 | index e50485c..71291ad 100644 | ||
| 127 | --- a/qmake/property.cpp | ||
| 128 | +++ b/qmake/property.cpp | ||
| 129 | @@ -75,6 +75,7 @@ static const struct { | ||
| 130 | { "QT_HOST_DATA", QLibraryInfo::HostDataPath, true }, | ||
| 131 | { "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true }, | ||
| 132 | { "QT_HOST_LIBS", QLibraryInfo::HostLibrariesPath, true }, | ||
| 133 | + { "QT_EXTERNAL_HOST_BINS", QLibraryInfo::ExternalHostBinariesPath, true }, | ||
| 134 | { "QMAKE_SPEC", QLibraryInfo::HostSpecPath, true }, | ||
| 135 | { "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true }, | ||
| 136 | }; | ||
| 137 | diff --git a/qtbase.pro b/qtbase.pro | ||
| 138 | index 7576db7..d51af0e 100644 | ||
| 139 | --- a/qtbase.pro | ||
| 140 | +++ b/qtbase.pro | ||
| 141 | @@ -70,16 +70,22 @@ CONFIG -= qt | ||
| 142 | |||
| 143 | #qmake | ||
| 144 | qmake.path = $$[QT_HOST_BINS] | ||
| 145 | +qmake.files = $$OUT_PWD/bin/qmake | ||
| 146 | +!isEmpty($$[QT_EXTERNAL_HOST_BINS]) { | ||
| 147 | + qmake.files = $$[QT_EXTERNAL_HOST_BINS]/bin/qmake | ||
| 148 | +} | ||
| 149 | equals(QMAKE_HOST.os, Windows) { | ||
| 150 | - qmake.files = $$OUT_PWD/bin/qmake.exe | ||
| 151 | -} else { | ||
| 152 | - qmake.files = $$OUT_PWD/bin/qmake | ||
| 153 | + qmake.files = $${qmake.files}.exe | ||
| 154 | } | ||
| 155 | INSTALLS += qmake | ||
| 156 | |||
| 157 | #syncqt | ||
| 158 | syncqt.path = $$[QT_HOST_BINS] | ||
| 159 | syncqt.files = $$PWD/bin/syncqt.pl | ||
| 160 | +syncqt.files = $$PWD/bin/syncqt.pl | ||
| 161 | +!isEmpty($$[QT_EXTERNAL_HOST_BINS]) { | ||
| 162 | + syncqt.files = $$[QT_EXTERNAL_HOST_BINS]/bin/syncqt.pl | ||
| 163 | +} | ||
| 164 | INSTALLS += syncqt | ||
| 165 | |||
| 166 | # If we are doing a prefix build, create a "module" pri which enables | ||
| 167 | diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp | ||
| 168 | index c647a16..da82913 100644 | ||
| 169 | --- a/src/corelib/global/qlibraryinfo.cpp | ||
| 170 | +++ b/src/corelib/global/qlibraryinfo.cpp | ||
| 171 | @@ -281,7 +281,7 @@ QLibraryInfo::isDebugBuild() | ||
| 172 | */ | ||
| 173 | |||
| 174 | static const struct { | ||
| 175 | - char key[19], value[13]; | ||
| 176 | + char key[21], value[13]; | ||
| 177 | } qtConfEntries[] = { | ||
| 178 | { "Prefix", "." }, | ||
| 179 | { "Documentation", "doc" }, // should be ${Data}/doc | ||
| 180 | @@ -307,6 +307,7 @@ static const struct { | ||
| 181 | { "HostBinaries", "bin" }, | ||
| 182 | { "HostLibraries", "lib" }, | ||
| 183 | { "HostData", "." }, | ||
| 184 | + { "ExternalHostBinaries", "" }, | ||
| 185 | { "TargetSpec", "" }, | ||
| 186 | { "HostSpec", "" }, | ||
| 187 | #endif | ||
| 188 | diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h | ||
| 189 | index 17864b5..a14bc0f 100644 | ||
| 190 | --- a/src/corelib/global/qlibraryinfo.h | ||
| 191 | +++ b/src/corelib/global/qlibraryinfo.h | ||
| 192 | @@ -84,6 +84,7 @@ public: | ||
| 193 | HostBinariesPath, | ||
| 194 | HostLibrariesPath, | ||
| 195 | HostDataPath, | ||
| 196 | + ExternalHostBinariesPath, | ||
| 197 | TargetSpecPath, | ||
| 198 | HostSpecPath, | ||
| 199 | LastHostPath = HostSpecPath, | ||
| 200 | diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp | ||
| 201 | index e2fef2c..ab475c3 100644 | ||
| 202 | --- a/tools/configure/configureapp.cpp | ||
| 203 | +++ b/tools/configure/configureapp.cpp | ||
| 204 | @@ -1186,6 +1186,13 @@ void Configure::parseCmdLine() | ||
| 205 | dictionary[ "QT_EXT_PREFIX" ] = configCmdLine.at(i); | ||
| 206 | } | ||
| 207 | |||
| 208 | + else if (configCmdLine.at(i) == "-external-hostbindir") { | ||
| 209 | + ++i; | ||
| 210 | + if (i == argCount) | ||
| 211 | + break; | ||
| 212 | + dictionary[ "QT_EXTERNAL_HOST_BINS" ] = configCmdLine.at(i); | ||
| 213 | + } | ||
| 214 | + | ||
| 215 | else if (configCmdLine.at(i) == "-make-tool") { | ||
| 216 | ++i; | ||
| 217 | if (i == argCount) | ||
| 218 | @@ -3852,6 +3859,7 @@ void Configure::generateQConfigCpp() | ||
| 219 | << " \"qt_hbinpath=" << formatPath(dictionary["QT_HOST_BINS"]) << "\"," << endl | ||
| 220 | << " \"qt_hlibpath=" << formatPath(dictionary["QT_HOST_LIBS"]) << "\"," << endl | ||
| 221 | << " \"qt_hdatpath=" << formatPath(dictionary["QT_HOST_DATA"]) << "\"," << endl | ||
| 222 | + << " \"qt_ebinpath=" << formatPath(dictionary["QT_EXTERNAL_HOST_BINS"]) << "\"," << endl | ||
| 223 | << " \"qt_targspec=" << targSpec << "\"," << endl | ||
| 224 | << " \"qt_hostspec=" << hostSpec << "\"," << endl | ||
| 225 | << "#endif" << endl | ||
| 226 | -- | ||
| 227 | 1.8.5.2 | ||
| 228 | |||
