summaryrefslogtreecommitdiffstats
path: root/configure.pri
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-07-06 13:58:53 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-08-18 17:10:25 +0000
commitfd3e12e7a6c71a244650415a86e98d910a011ebe (patch)
tree4b060b69d7cf683d477c731a01dd27fc4cb4ef46 /configure.pri
parent9172143f52757c29fbcf1a5f30d5ca25c52efb81 (diff)
replace mechanism to override variables from the mkspecs
it is sometimes desirable to override values from the mkspec without modifying (or wrapping) the spec itself. linux distributors do this on a regular basis. so far, we'd pick up CFLAGS, etc. from the environment, in a somewhat autoconf-like fashion. however, over time, this approach proved problematic: the concept doesn't mix particularly well with mkspecs to start with, is unexpected (and therefore causes frustration), and doesn't mix well with cross-building (at least the way it was realized). ironically, it was implemented this way (quite a while ago) upon my explicit request ... the new mechanism uses explicit variable manipulations on the configure command line, just like qmake itself understands. as it happens, this is again quite similar to autoconf-generated configure scripts. however, this time around we don't pretend to be actually autoconf-like, so we also don't try to map any variable names (some of which have different semantics anyway). this commit also eliminates the last use of the QMakeVar() function, so delete it and the underlying infrastructure. Task-number: QTBUG-32530 Task-number: QTBUG-42962 Change-Id: Id31a6b80e1add08ca21f5b178614bda530d12374 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'configure.pri')
-rw-r--r--configure.pri29
1 files changed, 23 insertions, 6 deletions
diff --git a/configure.pri b/configure.pri
index cc120c12d1..0e785349d7 100644
--- a/configure.pri
+++ b/configure.pri
@@ -1,5 +1,14 @@
# custom command line handling
+defineTest(qtConfCommandline_qmakeArgs) {
+ contains(1, QMAKE_[A-Z_]+ *[-+]?=.*) {
+ config.input.qmakeArgs += $$1
+ export(config.input.qmakeArgs)
+ return(true)
+ }
+ return(false)
+}
+
defineTest(qtConfCommandline_cxxstd) {
arg = $${1}
val = $${2}
@@ -560,11 +569,6 @@ defineTest(qtConfOutput_extraFeatures) {
}
-defineTest(qtConfOutputPostProcess_privatePro) {
- config.output.privatePro += $$cat($$OUT_PWD/.qmake.vars, lines)
- export(config.output.privatePro)
-}
-
defineTest(qtConfOutput_compilerFlags) {
# this output also exports the variables locally, so that subsequent compiler tests can use them
@@ -610,7 +614,7 @@ defineTest(qtConfOutput_gccSysroot) {
# This variable also needs to be exported immediately, so the compilation tests
# can pick it up.
- EXTRA_QMAKE_ARGS = \
+ EXTRA_QMAKE_ARGS += \
"\"QMAKE_CFLAGS += --sysroot=$$config.input.sysroot\"" \
"\"QMAKE_CXXFLAGS += --sysroot=$$config.input.sysroot\"" \
"\"QMAKE_LFLAGS += --sysroot=$$config.input.sysroot\""
@@ -626,6 +630,19 @@ defineTest(qtConfOutput_gccSysroot) {
export(config.output.publicPro)
}
+defineTest(qtConfOutput_qmakeArgs) {
+ !$${2}: return()
+
+ config.output.privatePro = "!host_build {"
+ for (a, config.input.qmakeArgs) {
+ config.output.privatePro += " $$a"
+ EXTRA_QMAKE_ARGS += $$system_quote($$a)
+ }
+ config.output.privatePro += "}"
+ export(EXTRA_QMAKE_ARGS)
+ export(config.output.privatePro)
+}
+
defineTest(qtConfOutputPostProcess_publicPro) {
qt_version = $$[QT_VERSION]
output = \