diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2016-01-14 13:01:39 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-01-21 19:23:40 +0000 |
commit | f33c6f37a8226c67a199181a8721f09983089448 (patch) | |
tree | 538cbb0a894aca00bc7f0b3eb559ef3f14dc8ad3 /qmake/generators/unix/unixmake.cpp | |
parent | 2bb473c19a6926a0691219776109dee37a1a276b (diff) |
Work around MinGW-make's magic prefixing of paths.
When building QNX on MS-Windows, make magically adds the Msys root as
prefix to variables whose values look like paths; this applies to both
environment variables and variables given values on the command-line.
When we don't actually want to install under the Msys root, this is
unwelcome "help". So (for MinGW's make) support a magic prefix of our
own, @msyshack@, that'll make a path value for INSTALL_ROOT not look
like a path to make; we can then strip it off when we come to use it.
Change-Id: I951ad3c8fe3e5cfb49e6e361d7fff779f3a9d716
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'qmake/generators/unix/unixmake.cpp')
-rw-r--r-- | qmake/generators/unix/unixmake.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 57c0a97228..12b9f09edd 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -514,6 +514,20 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) return false; } +#ifdef Q_OS_WIN // MinGW x-compiling for QNX +QString UnixMakefileGenerator::installRoot() const +{ + /* + We include a magic prefix on the path to bypass mingw-make's "helpful" + intervention in the environment, recognising variables that look like + paths and adding the msys system root as prefix, which we don't want. + Once this hack has smuggled INSTALL_ROOT into make's variable space, we + can trivially strip the magic prefix back off to get the path we meant. + */ + return QStringLiteral("$(INSTALL_ROOT:@msyshack@%=%)"); +} +#endif + QString UnixMakefileGenerator::defaultInstall(const QString &t) { @@ -522,7 +536,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t) enum { NoBundle, SolidBundle, SlicedBundle } bundle = NoBundle; bool isAux = (project->first("TEMPLATE") == "aux"); - const QString root = "$(INSTALL_ROOT)"; + const QString root = installRoot(); ProStringList &uninst = project->values(ProKey(t + ".uninstall")); QString ret, destdir = project->first("DESTDIR").toQString(); if(!destdir.isEmpty() && destdir.right(1) != Option::dir_sep) |