summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-12-16 15:21:35 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2016-12-16 16:38:33 +0100
commitb13150336174083962d90922761fd96f07e173b4 (patch)
tree1655e9009efba21b008d7d2f810aacbde3e2c2d8 /mkspecs/features
parentff19ebcc2d9c9668af24fe8add9f70c160776367 (diff)
parent9bfe3ab71e5291445e66be96d6cd1f63934a2d83 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: configure configure.pri examples/widgets/painting/fontsampler/mainwindow.cpp examples/widgets/painting/fontsampler/mainwindow.h mkspecs/features/moc.prf src/corelib/global/qglobal.h src/gui/text/qtextdocument.cpp Change-Id: Ica65512e00871695190a14ccea5c275b0165f787
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/configure.prf2
-rw-r--r--mkspecs/features/configure_base.prf2
-rw-r--r--mkspecs/features/data/configure.json25
-rw-r--r--mkspecs/features/device_config.prf45
-rw-r--r--mkspecs/features/moc.prf5
-rw-r--r--mkspecs/features/qlalr.prf2
-rw-r--r--mkspecs/features/qt_configure.prf91
-rw-r--r--mkspecs/features/qt_tool.prf2
-rw-r--r--mkspecs/features/toolchain.prf3
9 files changed, 91 insertions, 86 deletions
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
index 4ca7c6ba07..934a18a924 100644
--- a/mkspecs/features/configure.prf
+++ b/mkspecs/features/configure.prf
@@ -4,6 +4,8 @@ cache()
load(configure_base)
+isEmpty(QMAKE_CONFIG_VERBOSE): QMAKE_CONFIG_VERBOSE = false
+
QMAKE_CONFIG_LOG = $$dirname(_QMAKE_CACHE_)/config.log
recheck: write_file($$QMAKE_CONFIG_LOG, "")
diff --git a/mkspecs/features/configure_base.prf b/mkspecs/features/configure_base.prf
index dd1f4e5bfc..41f429e204 100644
--- a/mkspecs/features/configure_base.prf
+++ b/mkspecs/features/configure_base.prf
@@ -22,8 +22,6 @@ QMAKE_MAKE = $$(MAKE)
# Make sure we don't inherit MAKEFLAGS - -i in particular is fatal.
QMAKE_MAKE = "$${SETENV_PFX}MAKEFLAGS=$$SETENV_SFX $$QMAKE_MAKE"
-isEmpty(QMAKE_CONFIG_VERBOSE): QMAKE_CONFIG_VERBOSE = false
-
defineTest(qtLog) {
write_file($$QMAKE_CONFIG_LOG, 1, append)
$$QMAKE_CONFIG_VERBOSE: for (l, 1): log("$$l$$escape_expand(\\n)")
diff --git a/mkspecs/features/data/configure.json b/mkspecs/features/data/configure.json
new file mode 100644
index 0000000000..8e5ff5f0a4
--- /dev/null
+++ b/mkspecs/features/data/configure.json
@@ -0,0 +1,25 @@
+{
+ "files": {
+ },
+
+ "commandline": {
+ "options": {
+ "v": { "type": "enum", "name": "verbose", "values": { "yes": "true", "no": "false" } },
+ "verbose": { "type": "enum", "values": { "yes": "true", "no": "false" } },
+
+ "continue": "void",
+
+ "recheck": { "type": "void", "name": "cache_use", "value": "positive" },
+ "recheck-all": { "type": "void", "name": "cache_use", "value": "none" },
+
+ "redo": { "type": "redo" }
+ }
+
+ },
+
+ "features": {
+ "builtins": {
+ "output": [ "builtins" ]
+ }
+ }
+}
diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf
index 9281d3e407..c15559e174 100644
--- a/mkspecs/features/device_config.prf
+++ b/mkspecs/features/device_config.prf
@@ -1,45 +1,12 @@
# This file is loaded by some qmakespecs to get early configuration data.
-host_build: \
- PRI_FILE_NAME = qhost.pri
-else: \
- PRI_FILE_NAME = qdevice.pri
-DEVICE_PRI = $$[QT_HOST_DATA/get]/mkspecs/$$PRI_FILE_NAME
+# Some of these qmakespecs can be used also in host mode, but they are not
+# supposed to be influenced by -device-option then.
+host_build: return()
+
+DEVICE_PRI = $$[QT_HOST_DATA/get]/mkspecs/qdevice.pri
exists($$DEVICE_PRI):include($$DEVICE_PRI)
unset(DEVICE_PRI)
# this variable can be persisted via qmake -set CROSS_COMPILE /foo
-!host_build:isEmpty(CROSS_COMPILE): CROSS_COMPILE = $$[CROSS_COMPILE]
-
-# Provide a function to be used by mkspecs
-defineTest(deviceSanityCheckCompiler) {
- equals(QMAKE_HOST.os, Windows): \
- sfx = .exe
- else: \
- sfx =
-
- # Build the compiler filename using the first value in QMAKE_CXX in order to
- # support tools like ccache, which give QMAKE_CXX values of the form:
- # ccache <path_to_compiler>
- compiler = $$first(QMAKE_CXX)$$sfx
-
- # Check if the binary exists with an absolute path. Do this check
- # before the CROSS_COMPILE empty check below to allow the mkspec
- # to derive the compiler path from other device options.
- exists($$compiler):return()
-
- # Check for possible reasons of failure
- # check if CROSS_COMPILE device-option is set
- isEmpty(CROSS_COMPILE):error("CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=<path>")
-
- # Check if QMAKE_CXX points to an executable.
- ensurePathEnv()
- for (dir, QMAKE_PATH_ENV) {
- exists($$dir/$${compiler}): \
- return()
- }
-
- # QMAKE_CXX does not point to a compiler.
- error("Compiler $$QMAKE_CXX not found. Check the value of CROSS_COMPILE -device-option")
-}
-
+isEmpty(CROSS_COMPILE): CROSS_COMPILE = $$[CROSS_COMPILE]
diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf
index 333d06f63a..119dc53d20 100644
--- a/mkspecs/features/moc.prf
+++ b/mkspecs/features/moc.prf
@@ -28,12 +28,13 @@ win32:count(MOC_INCLUDEPATH, 40, >) {
# UIKit builds are always multi-arch due to simulator_and_device (unless
# -sdk is used) so this feature cannot possibly work.
if(gcc|intel_icl|msvc):!rim_qcc:!uikit:if(!macos|count(QMAKE_APPLE_DEVICE_ARCHS, 1)) {
+ moc_predefs.name = "Generate moc_predefs.h"
moc_predefs.CONFIG = no_link
gcc: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -dM -E -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
- else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
+ else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Za -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
else:msvc {
moc_predefs.commands += $$QMAKE_CXX -Bx$$shell_quote($$shell_path($$QMAKE_QMAKE)) $$QMAKE_CXXFLAGS \
- -E ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT}
+ -E -Za ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT}
} else: error("Oops, I messed up")
moc_predefs.output = $$MOC_DIR/moc_predefs.h
moc_predefs.input = MOC_PREDEF_FILE
diff --git a/mkspecs/features/qlalr.prf b/mkspecs/features/qlalr.prf
index 941bfe0d9f..54d8b583c6 100644
--- a/mkspecs/features/qlalr.prf
+++ b/mkspecs/features/qlalr.prf
@@ -25,7 +25,7 @@ for (s, QLALRSOURCES) {
$${base}.variable_out = GENERATED_SOURCES
$${base}.depends += $$QMAKE_QLALR_EXE
$${base}.commands = $$QMAKE_QLALR $$QMAKE_QLALRFLAGS ${QMAKE_FILE_IN}
- silent: $${base}.commands = @echo qlalr ${QMAKE_FILE_IN} && $${base}.commands
+ silent: $${base}.commands = @echo qlalr ${QMAKE_FILE_IN} && $$eval($${base}.commands)
$${base}.name = QLALR ${QMAKE_FILE_IN}
$${base}_h.input = $$invar
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index 9b3deff331..a620e94e97 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -162,7 +162,8 @@ defineTest(qtConfCommandline_addString) {
val = $${2}
isEmpty(val): val = $$qtConfGetNextCommandlineArg()
- contains(val, "^-.*|[A-Z_]+=.*")|isEmpty(val) {
+ # Note: Arguments which are variable assignments are legit here.
+ contains(val, "^-.*")|isEmpty(val) {
qtConfAddError("No value supplied to command line option '$$opt'.")
return()
}
@@ -177,6 +178,17 @@ defineTest(qtConfCommandline_addString) {
export(config.input.$$opt)
}
+defineTest(qtConfCommandline_redo) {
+ !exists($$OUT_PWD/config.opt) {
+ qtConfAddError("No config.opt present - cannot redo configuration.")
+ return()
+ }
+ QMAKE_EXTRA_ARGS = $$cat($$OUT_PWD/config.opt, lines) $$QMAKE_EXTRA_ARGS
+ export(QMAKE_EXTRA_ARGS)
+ QMAKE_REDO_CONFIG = true
+ export(QMAKE_REDO_CONFIG)
+}
+
defineTest(qtConfParseCommandLine) {
customCalls =
for (cc, allConfigs) {
@@ -194,29 +206,6 @@ defineTest(qtConfParseCommandLine) {
c = $$qtConfGetNextCommandlineArg()
isEmpty(c): break()
- # handle options to turn on verbose logging
- contains(c, "^-v")|contains(c, "^--?verbose") {
- QMAKE_CONFIG_VERBOSE = true
- export(QMAKE_CONFIG_VERBOSE)
- next()
- }
- contains(c, "^-no-v")|contains(c, "^--?no-verbose") {
- QMAKE_CONFIG_VERBOSE = false
- export(QMAKE_CONFIG_VERBOSE)
- next()
- }
-
- contains(c, "^--?recheck") {
- QMAKE_CONFIG_CACHE_USE = positive
- export(QMAKE_CONFIG_CACHE_USE)
- next()
- }
- contains(c, "^--?recheck-all") {
- QMAKE_CONFIG_CACHE_USE = none
- export(QMAKE_CONFIG_CACHE_USE)
- next()
- }
-
didCustomCall = false
for (customCall, customCalls) {
$${customCall}($$c) {
@@ -774,6 +763,7 @@ defineTest(qtConfTest_compile) {
QMAKE_MAKE = "$$QMAKE_MAKE clean && $$QMAKE_MAKE"
mkpath($$test_out_dir)|error()
+ write_file($$test_out_dir/.qmake.cache)|error()
# add possible command line args
qmake_args += $$qtConfPrepareArgs($$eval($${1}.args)) $$eval($${1}.literal_args)
@@ -1622,6 +1612,19 @@ defineTest(qtConfOutput_privateFeature) {
}
}
+# command line built-ins post-processing
+defineTest(qtConfOutput_builtins) {
+ QMAKE_CONFIG_VERBOSE = $$eval(config.input.verbose)
+ isEmpty(QMAKE_CONFIG_VERBOSE): \
+ QMAKE_CONFIG_VERBOSE = false
+ export(QMAKE_CONFIG_VERBOSE)
+
+ QMAKE_CONFIG_CACHE_USE = $$eval(config.input.cache_use)
+ isEmpty(QMAKE_CONFIG_CACHE_USE): \
+ QMAKE_CONFIG_CACHE_USE = all
+ export(QMAKE_CONFIG_CACHE_USE)
+}
+
defineTest(qtConfProcessOneOutput) {
feature = $${1}
fpfx = $${currentConfig}.features.$${feature}
@@ -1657,7 +1660,7 @@ defineTest(qtConfProcessOutput) {
module = $$eval($${currentConfig}.module)
# write it to the output files
- isEmpty($${currentConfig}.files._KEYS_) {
+ !defined($${currentConfig}.files._KEYS_, var) {
# set defaults that should work for most Qt modules
isEmpty(module): \
error("Neither module nor files section specified in configuration file.")
@@ -1677,7 +1680,7 @@ defineTest(qtConfProcessOutput) {
$${currentConfig}.output.$$type += "$$k -= $$eval($${currentConfig}.output.$${type}.remove.$$k)"
for (k, $${currentConfig}.output.$${type}.append._KEYS_): \
$${currentConfig}.output.$$type += "$$k += $$eval($${currentConfig}.output.$${type}.append.$$k)"
- } else {
+ } else: contains(type, ".*Header") {
for (define, $${currentConfig}.output.$${type}._KEYS_) {
value = $$eval($${currentConfig}.output.$${type}.$${define})
$${currentConfig}.output.$$type += "$${LITERAL_HASH}define $$define $$value"
@@ -1730,6 +1733,8 @@ isEmpty(configsToProcess): \
load(configure_base)
QMAKE_POST_CONFIGURE =
+config.builtins.dir = $$PWD/data
+configsToProcess = builtins $$configsToProcess
allConfigs =
for(ever) {
isEmpty(configsToProcess): \
@@ -1763,14 +1768,22 @@ for(ever) {
for (currentConfig, allConfigs): \
qtConfSetupLibraries()
+QMAKE_SAVED_ARGS = $$QMAKE_EXTRA_ARGS
+QMAKE_REDO_CONFIG = false
+qtConfParseCommandLine()
+
+for (currentConfig, allConfigs) {
+ qtConfSetModuleName()
+ qtConfSetupModuleOutputs()
+ # do early checks, mainly to validate the command line
+ qtConfProcessEarlyChecks()
+}
+qtConfCheckErrors()
+
!isEmpty(_QMAKE_SUPER_CACHE_): \
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_SUPER_CACHE_)/config.cache
else: \
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_CACHE_)/config.cache
-QMAKE_CONFIG_CACHE_USE = all
-
-qtConfParseCommandLine()
-
!equals(QMAKE_CONFIG_CACHE_USE, none) {
include($$QMAKE_CONFIG_CACHE, , true)
# this crudely determines when to discard the cache. this also catches the case
@@ -1789,14 +1802,6 @@ QMAKE_CONFIG_LOG = $$OUT_PWD/config.log
!equals(QMAKE_CONFIG_CACHE_USE, all): \
write_file($$QMAKE_CONFIG_LOG, "")
-for (currentConfig, allConfigs) {
- qtConfSetModuleName()
- qtConfSetupModuleOutputs()
- # do early checks, mainly to validate the command line
- qtConfProcessEarlyChecks()
-}
-qtConfCheckErrors()
-
CONFIG += qt_conf_tests_allowed
logn()
logn("Running configuration tests...")
@@ -1842,13 +1847,17 @@ for (currentConfig, allConfigs) {
!isEmpty(QT_CONFIGURE_SKIPPED_MODULES): \
qtConfAddNote("The following modules are not being compiled in this configuration:" $$QT_CONFIGURE_SKIPPED_MODULES)
+logn("Done running configuration tests.")
+logn()
+
+!$$QMAKE_REDO_CONFIG {
+ write_file($$OUT_PWD/config.opt, QMAKE_SAVED_ARGS)|error()
+}
+
# these come from the pri files loaded above.
for (p, QMAKE_POST_CONFIGURE): \
eval($$p)
-logn("Done running configuration tests.")
-logn()
-
logn("Configure summary:")
logn()
qtConfPrintReport()
diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf
index 4b73b4b8f7..a8d589f0fa 100644
--- a/mkspecs/features/qt_tool.prf
+++ b/mkspecs/features/qt_tool.prf
@@ -27,7 +27,7 @@ DEFINES *= QT_USE_QSTRINGBUILDER
vars = binary depends
- isEmpty(HOST_QT_TOOLS) {
+ !host_build|isEmpty(HOST_QT_TOOLS) {
load(resolve_target)
!host_build|!force_bootstrap: MODULE_DEPENDS = $$replace(QT, -private$, _private)
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
index 3f266dd2a4..0ef0fa8fc7 100644
--- a/mkspecs/features/toolchain.prf
+++ b/mkspecs/features/toolchain.prf
@@ -1,4 +1,7 @@
+# In early configure setup; nothing useful to be done here.
+isEmpty(QMAKE_CXX): return()
+
defineReplace(qtMakeExpand) {
out = "$$1"
for(ever) {