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 | 219 |
1 files changed, 219 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..ba4badca --- /dev/null +++ b/recipes-qt/qt5/qtbase/0003-Add-external-hostbindir-option.patch | |||
| @@ -0,0 +1,219 @@ | |||
| 1 | From 72d8aaf00e3d722b56b66bd5fa1f1f3d3e8a8552 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 3/6] 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 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
| 12 | --- | ||
| 13 | configure | 15 ++++++++++++++- | ||
| 14 | mkspecs/features/qt_functions.prf | 5 ++++- | ||
| 15 | mkspecs/features/qt_tool.prf | 2 +- | ||
| 16 | qmake/property.cpp | 1 + | ||
| 17 | qtbase.pro | 15 +++++++++++---- | ||
| 18 | src/corelib/global/qlibraryinfo.cpp | 3 ++- | ||
| 19 | src/corelib/global/qlibraryinfo.h | 1 + | ||
| 20 | tools/configure/configureapp.cpp | 8 ++++++++ | ||
| 21 | 8 files changed, 42 insertions(+), 8 deletions(-) | ||
| 22 | |||
| 23 | diff --git a/configure b/configure | ||
| 24 | index 0ab8eee..50f1ef2 100755 | ||
| 25 | --- a/configure | ||
| 26 | +++ b/configure | ||
| 27 | @@ -928,6 +928,7 @@ CFG_GCC_SYSROOT="yes" | ||
| 28 | QT_HOST_PREFIX= | ||
| 29 | QT_HOST_BINS= | ||
| 30 | QT_HOST_DATA= | ||
| 31 | +QT_EXTERNAL_HOST_BINS= | ||
| 32 | |||
| 33 | #flags for SQL drivers | ||
| 34 | QT_CFLAGS_PSQL= | ||
| 35 | @@ -1026,7 +1027,7 @@ while [ "$#" -gt 0 ]; do | ||
| 36 | VAL=no | ||
| 37 | ;; | ||
| 38 | #Qt style options that pass an argument | ||
| 39 | - -prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa|-qconfig) | ||
| 40 | + -prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa|-qconfig|-external-hostbindir) | ||
| 41 | VAR=`echo $1 | sed "s,^-\(.*\),\1,"` | ||
| 42 | shift | ||
| 43 | VAL="$1" | ||
| 44 | @@ -1223,6 +1224,9 @@ while [ "$#" -gt 0 ]; do | ||
| 45 | hostbindir) | ||
| 46 | QT_HOST_BINS="$VAL" | ||
| 47 | ;; | ||
| 48 | + external-hostbindir) | ||
| 49 | + QT_EXTERNAL_HOST_BINS="$VAL" | ||
| 50 | + ;; | ||
| 51 | pkg-config) | ||
| 52 | if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then | ||
| 53 | CFG_PKGCONFIG="$VAL" | ||
| 54 | @@ -2921,6 +2925,11 @@ else | ||
| 55 | QT_HOST_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_HOST_DATA"` | ||
| 56 | fi | ||
| 57 | |||
| 58 | +# default is empty, don't call makeabs if it is empty | ||
| 59 | +if [ ! -z "$QT_EXTERNAL_HOST_BINS" ]; then | ||
| 60 | + QT_EXTERNAL_HOST_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_EXTERNAL_HOST_BINS"` | ||
| 61 | +fi | ||
| 62 | + | ||
| 63 | #------------------------------------------------------------------------------- | ||
| 64 | # help - interactive parts of the script _after_ this section please | ||
| 65 | #------------------------------------------------------------------------------- | ||
| 66 | @@ -3087,6 +3096,9 @@ Installation options: | ||
| 67 | -hostdatadir <dir> . Data used by qmake will be installed to <dir> | ||
| 68 | (default HOSTPREFIX) | ||
| 69 | |||
| 70 | + -external-hostbindir <dir> Use external host executables instead of building them | ||
| 71 | + (not used by defaut) | ||
| 72 | + | ||
| 73 | Configure options: | ||
| 74 | |||
| 75 | The defaults (*) are usually acceptable. A plus (+) denotes a default value | ||
| 76 | @@ -3558,6 +3570,7 @@ static const char qt_configure_prefix_path_strs[][256 + 12] = { | ||
| 77 | "qt_hpfxpath=$QT_HOST_PREFIX", | ||
| 78 | "qt_hbinpath=$QT_HOST_BINS", | ||
| 79 | "qt_hdatpath=$QT_HOST_DATA", | ||
| 80 | + "qt_ebinpath=$QT_EXTERNAL_HOST_BINS", | ||
| 81 | "qt_targspec=$shortxspec", | ||
| 82 | "qt_hostspec=$shortspec", | ||
| 83 | #endif | ||
| 84 | diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf | ||
| 85 | index 389f241..e249960 100644 | ||
| 86 | --- a/mkspecs/features/qt_functions.prf | ||
| 87 | +++ b/mkspecs/features/qt_functions.prf | ||
| 88 | @@ -194,7 +194,10 @@ defineTest(qtAddModules) { | ||
| 89 | defineTest(qtPrepareTool) { | ||
| 90 | $$1 = $$eval(QT_TOOL.$${2}.command) | ||
| 91 | isEmpty($$1) { | ||
| 92 | - $$1 = $$[QT_HOST_BINS/get]/$$2 | ||
| 93 | + $$1 = $$[QT_EXTERNAL_HOST_BINS]/$$2 | ||
| 94 | + isEmpty($$[QT_EXTERNAL_HOST_BINS]) { | ||
| 95 | + $$1 = $$[QT_HOST_BINS/get]/$$2 | ||
| 96 | + } | ||
| 97 | contains(QMAKE_HOST.os, Windows):!contains($$1, .*\\.(exe|bat)$) { | ||
| 98 | exists($$eval($$1).bat) { | ||
| 99 | $$1 = $$eval($$1).bat | ||
| 100 | diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf | ||
| 101 | index 16db6c7..5518933 100644 | ||
| 102 | --- a/mkspecs/features/qt_tool.prf | ||
| 103 | +++ b/mkspecs/features/qt_tool.prf | ||
| 104 | @@ -31,7 +31,7 @@ load(qt_targets) | ||
| 105 | |||
| 106 | # If we are doing a prefix build, create a "module" pri which enables | ||
| 107 | # qtPrepareTool() to work with the non-installed build. | ||
| 108 | -!build_pass:!exists($$[QT_INSTALL_PREFIX]/.qmake.cache) { | ||
| 109 | +!build_pass:!exists($$[QT_INSTALL_PREFIX]/.qmake.cache):isEmpty($$[QT_EXTERNAL_HOST_BINS]) { | ||
| 110 | |||
| 111 | isEmpty(MODULE):MODULE = $$TARGET | ||
| 112 | |||
| 113 | diff --git a/qmake/property.cpp b/qmake/property.cpp | ||
| 114 | index bbd4734..dca0c58 100644 | ||
| 115 | --- a/qmake/property.cpp | ||
| 116 | +++ b/qmake/property.cpp | ||
| 117 | @@ -74,6 +74,7 @@ static const struct { | ||
| 118 | { "QT_HOST_PREFIX", QLibraryInfo::HostPrefixPath, true }, | ||
| 119 | { "QT_HOST_DATA", QLibraryInfo::HostDataPath, true }, | ||
| 120 | { "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true }, | ||
| 121 | + { "QT_EXTERNAL_HOST_BINS", QLibraryInfo::ExternalHostBinariesPath, true }, | ||
| 122 | { "QMAKE_SPEC", QLibraryInfo::HostSpecPath, true }, | ||
| 123 | { "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true }, | ||
| 124 | }; | ||
| 125 | diff --git a/qtbase.pro b/qtbase.pro | ||
| 126 | index e66d9fb..a6ae763 100644 | ||
| 127 | --- a/qtbase.pro | ||
| 128 | +++ b/qtbase.pro | ||
| 129 | @@ -68,17 +68,24 @@ CONFIG -= qt | ||
| 130 | |||
| 131 | #qmake | ||
| 132 | qmake.path = $$[QT_HOST_BINS] | ||
| 133 | +qmake.files = $$OUT_PWD/bin/qmake | ||
| 134 | +!isEmpty($$[QT_EXTERNAL_HOST_BINS]) { | ||
| 135 | + qmake.files = $$[QT_EXTERNAL_HOST_BINS]/bin/qmake | ||
| 136 | +} | ||
| 137 | equals(QMAKE_HOST.os, Windows) { | ||
| 138 | - qmake.files = $$OUT_PWD/bin/qmake.exe | ||
| 139 | -} else { | ||
| 140 | - qmake.files = $$OUT_PWD/bin/qmake | ||
| 141 | + qmake.files = $${qmake.files}.exe | ||
| 142 | } | ||
| 143 | INSTALLS += qmake | ||
| 144 | |||
| 145 | #syncqt | ||
| 146 | syncqt.path = $$[QT_HOST_BINS] | ||
| 147 | syncqt.files = $$PWD/bin/syncqt | ||
| 148 | -equals(QMAKE_HOST.os, Windows):syncqt.files += $$PWD/bin/syncqt.bat | ||
| 149 | +!isEmpty($$[QT_EXTERNAL_HOST_BINS]) { | ||
| 150 | + syncqt.files = $$[QT_EXTERNAL_HOST_BINS]/bin/syncqt | ||
| 151 | +} | ||
| 152 | +equals(QMAKE_HOST.os, Windows) { | ||
| 153 | + syncqt.files = $${syncqt.files}.bat | ||
| 154 | +} | ||
| 155 | INSTALLS += syncqt | ||
| 156 | |||
| 157 | #mkspecs | ||
| 158 | diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp | ||
| 159 | index c16dfcb..56a269f 100644 | ||
| 160 | --- a/src/corelib/global/qlibraryinfo.cpp | ||
| 161 | +++ b/src/corelib/global/qlibraryinfo.cpp | ||
| 162 | @@ -272,7 +272,7 @@ QLibraryInfo::isDebugBuild() | ||
| 163 | */ | ||
| 164 | |||
| 165 | static const struct { | ||
| 166 | - char key[19], value[13]; | ||
| 167 | + char key[21], value[13]; | ||
| 168 | } qtConfEntries[] = { | ||
| 169 | { "Prefix", "." }, | ||
| 170 | { "Documentation", "doc" }, // should be ${Data}/doc | ||
| 171 | @@ -293,6 +293,7 @@ static const struct { | ||
| 172 | { "HostPrefix", "" }, | ||
| 173 | { "HostBinaries", "bin" }, | ||
| 174 | { "HostData", "." }, | ||
| 175 | + { "ExternalHostBinaries", "" }, | ||
| 176 | { "TargetSpec", "" }, | ||
| 177 | { "HostSpec", "" }, | ||
| 178 | #endif | ||
| 179 | diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h | ||
| 180 | index a574b4b..1535d20 100644 | ||
| 181 | --- a/src/corelib/global/qlibraryinfo.h | ||
| 182 | +++ b/src/corelib/global/qlibraryinfo.h | ||
| 183 | @@ -85,6 +85,7 @@ public: | ||
| 184 | HostPrefixPath, | ||
| 185 | HostBinariesPath, | ||
| 186 | HostDataPath, | ||
| 187 | + ExternalHostBinariesPath, | ||
| 188 | TargetSpecPath, | ||
| 189 | HostSpecPath, | ||
| 190 | LastHostPath = HostSpecPath, | ||
| 191 | diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp | ||
| 192 | index 126643e..0e01ab5 100644 | ||
| 193 | --- a/tools/configure/configureapp.cpp | ||
| 194 | +++ b/tools/configure/configureapp.cpp | ||
| 195 | @@ -1143,6 +1143,13 @@ void Configure::parseCmdLine() | ||
| 196 | dictionary[ "QT_HOST_DATA" ] = configCmdLine.at(i); | ||
| 197 | } | ||
| 198 | |||
| 199 | + else if (configCmdLine.at(i) == "-external-hostbindir") { | ||
| 200 | + ++i; | ||
| 201 | + if (i == argCount) | ||
| 202 | + break; | ||
| 203 | + dictionary[ "QT_EXTERNAL_HOST_BINS" ] = configCmdLine.at(i); | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | else if (configCmdLine.at(i) == "-make-tool") { | ||
| 207 | ++i; | ||
| 208 | if (i == argCount) | ||
| 209 | @@ -3627,6 +3634,7 @@ void Configure::generateQConfigCpp() | ||
| 210 | << " \"qt_hpfxpath=" << formatPath(dictionary["QT_HOST_PREFIX"]) << "\"," << endl | ||
| 211 | << " \"qt_hbinpath=" << formatPath(dictionary["QT_HOST_BINS"]) << "\"," << endl | ||
| 212 | << " \"qt_hdatpath=" << formatPath(dictionary["QT_HOST_DATA"]) << "\"," << endl | ||
| 213 | + << " \"qt_ebinpath=" << formatPath(dictionary["QT_EXTERNAL_HOST_BINS"]) << "\"," << endl | ||
| 214 | << " \"qt_targspec=" << targSpec << "\"," << endl | ||
| 215 | << " \"qt_hostspec=" << hostSpec << "\"," << endl | ||
| 216 | << "#endif" << endl | ||
| 217 | -- | ||
| 218 | 1.8.2.1 | ||
| 219 | |||
