diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-05-21 15:14:45 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-23 11:39:25 +0200 |
commit | 4a35f21208f2f6ae23a4a2f668c72ea6d9def4c9 (patch) | |
tree | c3eac17fb5618c4335633ea2971ded9cf0c612e8 /mkspecs/features | |
parent | 26985092190a80c2db463f42c082c9f4792b5e66 (diff) |
fix quoting and path separators in qtPrepareTool()
we need to store commands with system path separators in the .pri files,
as we might clobber windows command arguments if we just converted
separators later on. and we can actually do that, as the path separators
are actually bound to the host system, not the shell.
we also need to shell-quote the commands, as whitespace, and more
commonly windows path separators in an msys shell, would break things.
we delay this to the last moment possible, as it does depend on the
shell.
Change-Id: I1fe6b63aebd5663b72492c32928ec397f86e336f
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Diffstat (limited to 'mkspecs/features')
-rw-r--r-- | mkspecs/features/qt_functions.prf | 24 | ||||
-rw-r--r-- | mkspecs/features/qt_tool.prf | 3 |
2 files changed, 16 insertions, 11 deletions
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 64b9fee361..d41fe3b4d5 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -191,26 +191,30 @@ defineTest(qtAddRpathLink) { # variable, default, [suffix for variable for system() use] defineTest(qtPrepareTool) { - $$1 = $$eval(QT_TOOL.$${2}.binary) - isEmpty($$1) { - $$1 = $$[QT_HOST_BINS]/$$2 - exists($$eval($$1).pl) { - $$1 = perl -w $$eval($$1).pl + cmd = $$eval(QT_TOOL.$${2}.binary) + isEmpty(cmd) { + cmd = $$[QT_HOST_BINS]/$$2 + exists($${cmd}.pl) { + cmd = perl -w $$system_path($${cmd}.pl) } else: contains(QMAKE_HOST.os, Windows) { - $$1 = $$eval($$1).exe + cmd = $$system_path($${cmd}.exe) } else:contains(QMAKE_HOST.os, Darwin) { - BUNDLENAME = $$eval($$1).app/Contents/MacOS/$$2 + BUNDLENAME = $${cmd}.app/Contents/MacOS/$$2 exists($$BUNDLENAME) { - $$1 = $$BUNDLENAME + cmd = $$BUNDLENAME } } } QT_TOOL_ENV += $$eval(QT_TOOL.$${2}.envvars) !isEmpty(3) { - $$1$$3 = $$system_path($$eval($$1)) + $$1$$3 = + for (arg, cmd): \ + $$1$$3 += $$system_quote($$arg) qtAddTargetEnv($$1$$3, QT_TOOL.$${2}.depends, system) } - $$1 = $$system_path($$eval($$1)) + $$1 = + for (arg, cmd): \ + $$1 += $$shell_quote($$arg) qtAddTargetEnv($$1, QT_TOOL.$${2}.depends, ) } diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf index f0864f9e74..1d3e88cbe9 100644 --- a/mkspecs/features/qt_tool.prf +++ b/mkspecs/features/qt_tool.prf @@ -45,8 +45,9 @@ CONFIG += console } else { module_envvars = } + bin = $$system_path($$QMAKE_RESOLVED_TARGET) TOOL_PRI_CONT = \ - "QT_TOOL.$${MODULE}.binary = $$QMAKE_RESOLVED_TARGET" \ + "QT_TOOL.$${MODULE}.binary = $$val_escape(bin)" \ "QT_TOOL.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" \ $$module_envvars write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.") |