summaryrefslogtreecommitdiffstats
path: root/configure.pri
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2019-10-18 15:26:23 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2019-10-25 18:15:36 +0200
commit73cb5cb01e9531d2b2249597a64d57fa0029c300 (patch)
treef13a6db59abac3fd80fe3a89f13ccc565304a47d /configure.pri
parentef9c498215f0eeb73d1ffdcd0d58464c56ea56ac (diff)
Fix prefix for non-Windows cross-builds on Windows
When one specified a prefix "/usr/qt5" on Windows for a non-Windows target (e.g. QNX) that prefix was translated to "C:/usr/qt5" and passed on to the Makefiles, for example as "-Wl,-rpath,C:/usr/qt5/lib". The reason was that we called $$absolute_path on the user-specified prefix. However, absolute_path operates according to the rules of the host operating system. When cross-building, the prefix is an on-device path. Therefore we must not attempt to make it absolute to the build directory. The check whether we're cross-compiling looks a bit arcane, but we cannot use $$qtConfEvaluate(features.cross_compile) at this stage of configure. Instead, we use XSPEC (set up by qtConfOutput_prepareSpec) and $$[QMAKE_SPEC] which is the right host mkspec. Fixes: QTBUG-79214 Change-Id: Id8664f8512cf1d9e178054a38e72323d7929547d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'configure.pri')
-rw-r--r--configure.pri8
1 files changed, 7 insertions, 1 deletions
diff --git a/configure.pri b/configure.pri
index 3778ece180..16e2fccd77 100644
--- a/configure.pri
+++ b/configure.pri
@@ -741,7 +741,13 @@ defineTest(qtConfOutput_preparePaths) {
}
have_prefix = false
} else {
- config.input.prefix = $$absolute_path($$config.input.prefix, $$OUT_PWD)
+ equals(XSPEC, $$[QMAKE_SPEC]) {
+ # Only make the user-specified prefix absolute if we're not cross-compiling.
+ config.input.prefix = $$absolute_path($$config.input.prefix, $$OUT_PWD)
+ } else {
+ # But we still must normalize path separators.
+ config.input.prefix = $$replace(config.input.prefix, \\\\, /)
+ }
have_prefix = true
}