summaryrefslogtreecommitdiff
path: root/mkspecs
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/common/linux-android.conf113
-rw-r--r--mkspecs/features/configure.prf9
-rw-r--r--mkspecs/features/configure_base.prf12
-rw-r--r--mkspecs/features/ctest_testcase_common.prf2
-rw-r--r--mkspecs/features/lex.prf1
-rw-r--r--mkspecs/features/mac/asset_catalogs.prf2
-rw-r--r--mkspecs/features/mac/default_post.prf3
-rw-r--r--mkspecs/features/moc.prf2
-rw-r--r--mkspecs/features/qmake_use.prf5
-rw-r--r--mkspecs/features/qt_configure.prf123
-rw-r--r--mkspecs/features/qt_helper_lib.prf11
-rw-r--r--mkspecs/features/qt_module.prf8
-rw-r--r--mkspecs/features/qt_parts.prf2
-rw-r--r--mkspecs/features/spec_post.prf2
-rw-r--r--mkspecs/features/testcase.prf2
-rw-r--r--mkspecs/features/uikit/xcodebuild.prf2
-rw-r--r--mkspecs/features/yacc.prf1
-rw-r--r--mkspecs/macx-ios-clang/features/default_post.prf9
18 files changed, 142 insertions, 167 deletions
diff --git a/mkspecs/common/linux-android.conf b/mkspecs/common/linux-android.conf
deleted file mode 100644
index b8e052d1ec..0000000000
--- a/mkspecs/common/linux-android.conf
+++ /dev/null
@@ -1,113 +0,0 @@
-MAKEFILE_GENERATOR = UNIX
-QMAKE_INCREMENTAL_STYLE = sublib
-
-QMAKE_PLATFORM += android
-
-include(linux.conf)
-include(gcc-base-unix.conf)
-
-QT_QPA_DEFAULT_PLATFORM = minimal
-
-NDK_ROOT = $$(ANDROID_NDK_ROOT)
-isEmpty(NDK_ROOT): error("$ANDROID_NDK_ROOT is empty, please set it to something like ~/android/ndk-r7c")
-
-NDK_HOST = $$(ANDROID_NDK_HOST)
-isEmpty(NDK_HOST): error("$ANDROID_NDK_HOST is empty, please set it to something like linux-x86 or darwin-x86")
-
-ANDROID_PLATFORM = $$(ANDROID_NDK_PLATFORM)
-isEmpty(ANDROID_PLATFORM): ANDROID_PLATFORM = android-5
-
-NDK_TOOLCHAIN_VERSION = $$(ANDROID_NDK_TOOLCHAIN_VERSION)
-isEmpty(NDK_TOOLCHAIN_VERSION): NDK_TOOLCHAIN_VERSION = 4.4.3
-
-!contains(NDK_TOOLCHAIN_VERSION, 4.4.3): ANDROID_CXXSTL_SUFFIX = -$$NDK_TOOLCHAIN_VERSION
-
-NDK_TOOLCHAIN = $$ANDROID_NDK_TOOLCHAIN_PREFIX-$$NDK_TOOLCHAIN_VERSION
-NDK_TOOLCHAIN_PATH = $$NDK_ROOT/toolchains/$$NDK_TOOLCHAIN/prebuilt/$$NDK_HOST
-
-CONFIG += $$ANDROID_PLATFORM $$ANDROID_TARGET_ARCH
-ANDROID_PLATFORM_ROOT_PATH = $$NDK_ROOT/platforms/$$ANDROID_PLATFORM/arch-$$ANDROID_ARCHITECTURE/
-ANDROID_PLATFORM_PATH = $$ANDROID_PLATFORM_ROOT_PATH/usr
-
-# used to compile platform plugins for android-4 and android-5
-QMAKE_ANDROID_PLATFORM_INCDIR = $$NDK_ROOT/platforms/$$ANDROID_PLATFORM/arch-$$ANDROID_ARCHITECTURE/usr/include
-QMAKE_ANDROID_PLATFORM_LIBDIR = $$NDK_ROOT/platforms/$$ANDROID_PLATFORM/arch-$$ANDROID_ARCHITECTURE/usr/lib
-
-ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl$$ANDROID_CXXSTL_SUFFIX/gnu-libstdc++/libs/$$ANDROID_TARGET_ARCH
-ANDROID_SOURCES_CXX_STL_INCDIR = $$NDK_ROOT/sources/cxx-stl$$ANDROID_CXXSTL_SUFFIX/gnu-libstdc++/include $$ANDROID_SOURCES_CXX_STL_LIBDIR/include
-
-# modifications to g++.conf
-QMAKE_CC = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_NDK_TOOLS_PREFIX-gcc
-
-QMAKE_CFLAGS_WARN_ON = -Wall -Wextra
-QMAKE_CFLAGS_WARN_OFF = -Wno-psabi
-
-QMAKE_CFLAGS_SHLIB = -fPIC
-QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
-QMAKE_CFLAGS_THREAD = -D_REENTRANT
-QMAKE_CFLAGS_HIDESYMS = -fvisibility=hidden
-
-QMAKE_CXX = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_NDK_TOOLS_PREFIX-g++
-QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
-QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
-QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
-QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE
-QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG
-QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
-QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
-QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
-QMAKE_CXXFLAGS_HIDESYMS = $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden
-
-QMAKE_LINK = $$QMAKE_CXX
-QMAKE_LINK_SHLIB = $$QMAKE_LINK
-
-# modifications to linux.conf
-QMAKE_AR = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_NDK_TOOLS_PREFIX-ar cqs
-QMAKE_OBJCOPY = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_NDK_TOOLS_PREFIX-objcopy
-QMAKE_NM = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_NDK_TOOLS_PREFIX-nm -P
-QMAKE_STRIP = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_NDK_TOOLS_PREFIX-strip
-QMAKE_RANLIB = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_NDK_TOOLS_PREFIX-ranlib
-
-QMAKE_INCDIR = $$ANDROID_PLATFORM_PATH/include $$ANDROID_SOURCES_CXX_STL_INCDIR
-QMAKE_LIBDIR = $$ANDROID_SOURCES_CXX_STL_LIBDIR $$ANDROID_PLATFORM_PATH/lib
-QMAKE_INCDIR_X11 =
-QMAKE_LIBDIR_X11 =
-QMAKE_INCDIR_OPENGL =
-QMAKE_INCDIR_OPENGL_ES2 =
-QMAKE_LIBDIR_OPENGL_ES2 =
-
-contains(ANDROID_TARGET_ARCH, x86): LIBGCC_PATH_FULL = $$system($$QMAKE_CC -print-libgcc-file-name)
- else: LIBGCC_PATH_FULL = $$system($$QMAKE_CC -mthumb-interwork -print-libgcc-file-name)
-
-QMAKE_LINK = $$QMAKE_CXX
-QMAKE_LINK_SHLIB = $$QMAKE_CXX
-QMAKE_LFLAGS = --sysroot=$$ANDROID_PLATFORM_ROOT_PATH -L$$dirname(LIBGCC_PATH_FULL) -Wl,-rpath-link=$$ANDROID_PLATFORM_PATH/lib
-QMAKE_LFLAGS_APP =
-QMAKE_LFLAGS_SHLIB = -Wl,--no-undefined -Wl,-z,noexecstack -shared
-
-contains(NDK_ROOT, ".*r[56].*") {
- !contains(ANDROID_PLATFORM, ".*android-[458].*") {
- message("Your NDK-version is out-dated. A work-around is enabled. Consider updating your NDK (workarounds are required until r6(a))")
- QMAKE_LFLAGS_SHLIB += $$ANDROID_PLATFORM_PATH/lib/crtbegin_so.o $$ANDROID_PLATFORM_PATH/lib/crtend_so.o
- }
-}
-
-QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
-QMAKE_LFLAGS_SONAME =
-QMAKE_LFLAGS_NOUNDEF = -Wl,--no-undefined
-QMAKE_LFLAGS_RPATH = -Wl,-rpath=
-
-# TODO: -lgnustl_static was -lstdc++, but that leads to undefined reference to
-# std::__throw_bad_alloc during configure.
-QMAKE_LIBS = -lsupc++ -llog -lz -lm -ldl -lc -lgcc -lgnustl_static
-QMAKE_LIBS_X11 =
-QMAKE_LIBS_X11SM =
-QMAKE_LIBS_QT_THREAD =
-QMAKE_LIBS_QT_OPENGL =
-QMAKE_LIBS_QTOPIA =
-QMAKE_LIBS_THREAD =
-QMAKE_LIBS_OPENGL =
-QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 $$QMAKE_LIBS
-
-load(qt_config)
-
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
index f275e3ac06..4ca7c6ba07 100644
--- a/mkspecs/features/configure.prf
+++ b/mkspecs/features/configure.prf
@@ -1,5 +1,12 @@
+# Ensure that a cache is present. If none was found on startup, this will create
+# one in the build directory of the project which loads this feature.
+cache()
+
load(configure_base)
+QMAKE_CONFIG_LOG = $$dirname(_QMAKE_CACHE_)/config.log
+recheck: write_file($$QMAKE_CONFIG_LOG, "")
+
isEmpty(QMAKE_CONFIG_TESTS_DIR): QMAKE_CONFIG_TESTS_DIR = $$_PRO_FILE_PWD_/config.tests
# Try to build the test project in $$QMAKE_CONFIG_TESTS_DIR/$$1
@@ -25,7 +32,7 @@ defineTest(qtCompileTest) {
test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$1
test_out_dir = $$shadowed($$test_dir)
- test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&"
+ test_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$test_out_dir)) &&"
# Disable qmake features which are typically counterproductive for tests
qmake_configs = "\"CONFIG -= qt debug_and_release app_bundle lib_bundle\""
diff --git a/mkspecs/features/configure_base.prf b/mkspecs/features/configure_base.prf
index dc630a3528..dd1f4e5bfc 100644
--- a/mkspecs/features/configure_base.prf
+++ b/mkspecs/features/configure_base.prf
@@ -33,7 +33,10 @@ defineTest(qtRunLoggedCommand) {
qtLog("+ $$1")
output = $$system("( $$1 ) 2>&1", lines, result)
- qtLog($$output)
+ lg =
+ for (l, output): \
+ lg += "> $$l"
+ qtLog($$lg)
!isEmpty(2) {
$$2 = $$output
export($$2)
@@ -42,10 +45,3 @@ defineTest(qtRunLoggedCommand) {
!equals(result, 0): return(false)
return(true)
}
-
-# Ensure that a cache is present. If none was found on startup, this will create
-# one in the build directory of the project which loads this feature.
-cache()
-
-QMAKE_CONFIG_LOG = $$dirname(_QMAKE_CACHE_)/config.log
-write_file($$QMAKE_CONFIG_LOG, "")
diff --git a/mkspecs/features/ctest_testcase_common.prf b/mkspecs/features/ctest_testcase_common.prf
index af80fc00a1..8cdad77a78 100644
--- a/mkspecs/features/ctest_testcase_common.prf
+++ b/mkspecs/features/ctest_testcase_common.prf
@@ -86,7 +86,7 @@ for (MODULE_UNDER_TEST, CMAKE_QT_MODULES_UNDER_TEST) {
CMAKE_MODULES_UNDER_TEST = $$join(CMAKE_MODULES_UNDER_TEST, ;)
check.commands = \
- $(MKDIR) $$BUILD_DIR && cd $$BUILD_DIR && \
+ $(MKDIR) $$BUILD_DIR && $$QMAKE_CD $$BUILD_DIR && \
cmake $$CMAKE_TEST_LOCATION $$CMAKE_GENERATOR \
-DCMAKE_C_COMPILER=$$QMAKE_CC \
-DCMAKE_CXX_COMPILER=$$QMAKE_CXX \
diff --git a/mkspecs/features/lex.prf b/mkspecs/features/lex.prf
index 16d3a6aa94..7d8325bedb 100644
--- a/mkspecs/features/lex.prf
+++ b/mkspecs/features/lex.prf
@@ -5,6 +5,7 @@
{
lex.name = Lex ${QMAKE_FILE_IN}
lex.input = LEXSOURCES
+ lex.dependency_type = TYPE_C
lex_included {
lex.CONFIG += no_link
} else {
diff --git a/mkspecs/features/mac/asset_catalogs.prf b/mkspecs/features/mac/asset_catalogs.prf
index 57d93d56d5..87875136c2 100644
--- a/mkspecs/features/mac/asset_catalogs.prf
+++ b/mkspecs/features/mac/asset_catalogs.prf
@@ -65,7 +65,7 @@
actool_output_files = $$system(\
mkdir -p $$system_quote($$QMAKE_ASSET_CATALOGS_BUILD_PATH) && \
/usr/libexec/PlistBuddy -c \'Print :com.apple.actool.compilation-results:output-files\' \
- /dev/stdin <<< $($${asset_catalog_compiler.commands} 2>/dev/null) | grep \'^ .*$\', lines)
+ /dev/stdin <<< $($${asset_catalog_compiler.commands} 2>/dev/null) | sed -Ene \'s/^ +//p\', lines)
for (output_file, actool_output_files) {
!equals(output_file, $$asset_catalog_compiler.target): \
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index 33dffe603e..1b2e5d5db4 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -69,6 +69,9 @@ macx-xcode {
device|!simulator: VALID_ARCHS += $$QMAKE_APPLE_DEVICE_ARCHS
simulator: VALID_ARCHS += $$QMAKE_APPLE_SIMULATOR_ARCHS
+ isEmpty(VALID_ARCHS): \
+ error("QMAKE_APPLE_DEVICE_ARCHS or QMAKE_APPLE_SIMULATOR_ARCHS must contain at least one architecture")
+
single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
ACTIVE_ARCHS = $(filter $(EXPORT_VALID_ARCHS), $(ARCHS))
diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf
index 35626e343f..0bc7482ec7 100644
--- a/mkspecs/features/moc.prf
+++ b/mkspecs/features/moc.prf
@@ -32,7 +32,7 @@ if(gcc|intel_icl|msvc):!rim_qcc:!uikit:if(!macos|count(QMAKE_APPLE_DEVICE_ARCHS,
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:msvc {
- moc_predefs.commands += $$QMAKE_CXX -Bx$$shell_quote($$shell_path($$[QT_INSTALL_BINS/get]/qmake)) $$QMAKE_CXXFLAGS -E ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT}
+ moc_predefs.commands += $$QMAKE_CXX -Bx$$QMAKE_QMAKE $$QMAKE_CXXFLAGS -E ${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/qmake_use.prf b/mkspecs/features/qmake_use.prf
index 81b841d457..9b6c67ccc2 100644
--- a/mkspecs/features/qmake_use.prf
+++ b/mkspecs/features/qmake_use.prf
@@ -10,14 +10,17 @@ for(ever) {
else: \
libs = $$eval(QMAKE_LIBS_$${nu}_RELEASE)
libs += $$eval(QMAKE_LIBS_$$nu)
+ libdir = $$eval(QMAKE_LIBDIR_$$nu)
defines = $$eval(QMAKE_DEFINES_$${nu})
includes = $$eval(QMAKE_INCDIR_$${nu})
isEmpty(libs):isEmpty(defines):isEmpty(includes): \
error("Library '$$name' is not defined.")
- !contains(use, nolink): \
+ !contains(use, nolink) {
+ QMAKE_LIBDIR += $$libdir
LIBS$${suffix} += $$libs
+ }
!contains(use, linkonly) {
DEFINES += $$defines
INCLUDEPATH += $$includes
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index d76f3ac311..1181566fec 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -324,7 +324,7 @@ defineTest(qtConfParseCommandLine) {
defineReplace(qtConfToolchainSupportsFlag) {
test_out_dir = $$shadowed($$QMAKE_CONFIG_TESTS_DIR)
- test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&"
+ test_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$test_out_dir)) &&"
conftest = "int main() { return 0; }"
write_file("$$test_out_dir/conftest.cpp", conftest)|error()
@@ -611,9 +611,7 @@ defineTest(qtConfHandleLibrary) {
return()
}
- qtLogTestIntro($${lpfx})
- msg = "looking for library $${1}"
- write_file($$QMAKE_CONFIG_LOG, msg, append)
+ qtLogTestIntro($${lpfx}, "looking for library $${1}")
result = false
for (s, $${lpfx}.sources._KEYS_) {
@@ -649,7 +647,7 @@ defineTest(qtConfHandleLibrary) {
qtLog(" => source accepted.")
$${lpfx}.cache += source
- for (v, $$list(libs includes cflags version export)): \
+ for (v, $$list(libs includedir cflags version export)): \
$${lpfx}.cache += sources.$${s}.$${v}
for (b, $${spfx}.builds._KEYS_): \
$${lpfx}.cache += sources.$${s}.builds.$${b}
@@ -677,13 +675,33 @@ defineTest(qtConfTest_library) {
defineTest(qtConfTestPrepare_compile) {
for (u, $$list($$eval($${1}.use))) {
- !contains($${currentConfig}.libraries._KEYS_, $$u): \
- error("Test $$1 tries to use undeclared library '$$u'")
- qtConfHandleLibrary($$u)
- lpfx = $${currentConfig}.libraries.$${u}
- isEmpty($${lpfx}.source): \
- return(false)
- $${1}.literal_args += $$qtConfLibraryArgs($${lpfx}.sources.$$eval($${lpfx}.source))
+ libConfig =
+ contains($${currentConfig}.libraries._KEYS_, $$u) {
+ libConfig = $${currentConfig}
+ qtConfHandleLibrary($$u)
+ } else {
+ for (d, QMAKE_CONFIG_DEPS) {
+ contains($${d}.libraries._KEYS_, $$u) {
+ libConfig = $$d
+ break()
+ }
+ }
+ }
+ isEmpty(libConfig) {
+ nu = $$upper($$u)
+ libs = $$eval(QMAKE_LIBS_$$nu) $$eval(QMAKE_LIBS_$${nu}_DEBUG) $$eval(QMAKE_LIBS_$${nu}_RELEASE)
+ defines = $$eval(QMAKE_DEFINES_$${nu})
+ includes = $$eval(QMAKE_INCDIR_$${nu})
+
+ isEmpty(libs):isEmpty(defines):isEmpty(includes): \
+ error("Test $$1 tries to use undeclared library '$$u'")
+ $${1}.literal_args += $$system_quote(QMAKE_USE += $$u)
+ } else {
+ lpfx = $${libConfig}.libraries.$${u}
+ isEmpty($${lpfx}.source): \
+ return(false)
+ $${1}.literal_args += $$qtConfLibraryArgs($${lpfx}.sources.$$eval($${lpfx}.source))
+ }
}
export($${1}.literal_args)
return(true)
@@ -698,7 +716,7 @@ defineTest(qtConfTest_compile) {
test_out_dir = $$shadowed($$test_dir)
!isEmpty($${1}.pro): \
test_dir = $$test_dir/$$eval($${1}.pro)
- test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&"
+ test_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$test_out_dir)) &&"
qmake_args = $$qtConfPkgConfigEnv()$$system_quote($$system_path($$QMAKE_QMAKE))
!isEmpty(QMAKE_QTCONF): \
@@ -798,10 +816,9 @@ defineTest(qtLogTestIntro) {
label = $$eval($${1}.label)
isEmpty(label): return()
- msg = "Checking for $${label}... "
- log($$msg)
+ log("Checking for $${label}... ")
$$QMAKE_CONFIG_VERBOSE: log("$$escape_expand(\\n)")
- write_file($$QMAKE_CONFIG_LOG, msg, append)
+ write_file($$QMAKE_CONFIG_LOG, 2, append)
}
defineTest(qtLogTestResult) {
@@ -927,9 +944,7 @@ defineTest(qtRunSingleTest) {
qtConfLoadResult($${tpfx}, $$1): \
return()
- qtLogTestIntro($${tpfx})
- msg = "executing config test $${1}"
- write_file($$QMAKE_CONFIG_LOG, msg, append)
+ qtLogTestIntro($${tpfx}, "executing config test $${1}")
result = false
$${call}($${tpfx}): result = true
@@ -941,6 +956,15 @@ defineTest(qtRunSingleTest) {
qtConfSaveResult($${tpfx}, $$1)
}
+defineTest(qtConfHaveModule) {
+ module = $$replace(1, -, _)
+ !isEmpty(QT.$${module}.skip):$$eval(QT.$${module}.skip): \
+ return(false)
+ !isEmpty(QT.$${module}.name): \
+ return(true)
+ return(false)
+}
+
defineReplace(qtConfEvaluate) {
isEmpty(1): return(true)
@@ -1024,6 +1048,10 @@ defineReplace(qtConfEvaluateSingleExpression) {
var = $$replace(e, "^config\.", "")
result = false
contains(CONFIG, $$var): result = true
+ } else: contains(e, "^module\..*") {
+ var = $$replace(e, "^module\.", "")
+ result = false
+ qtConfHaveModule($$var): result = true
} else: contains(e, "^arch\..*") {
var = $$replace(e, "^arch\.", "")
result = false
@@ -1186,12 +1214,23 @@ defineTest(qtConfCheckFeature) {
$${fpfx}.available = $$result
export($${fpfx}.available)
- for (i, $${currentConfig}.features.$${feature}.output._KEYS_): \
- qtConfProcessOneOutput($$feature, $$i)
+ for (i, $${fpfx}.output._KEYS_): \
+ qtConfProcessOneOutput($${1}, $$i)
return(true)
}
+defineTest(qtConfCheckModuleCondition) {
+ QT.$${currentModule}.skip = false
+ !$$qtConfEvaluate($$eval($${currentConfig}.condition)): \
+ QT.$${currentModule}.skip = true
+ export(QT.$${currentModule}.skip)
+
+ # ensure qtConfHaveModule() works
+ QT.$${currentModule}.name = -
+ export(QT.$${currentModule}.name)
+}
+
defineTest(qtConfProcessFeatures) {
for (feature, $${currentConfig}.features._KEYS_): \
@@ -1556,9 +1595,6 @@ defineTest(qtConfOutput_publicFeature) {
}
}
-# currently this is somewhat inconsistent, as the feature is output to the public pro file,
-# whereas the define is being added to the private pro file.
-# This should get cleaned up to add to the private pro and header instead.
defineTest(qtConfOutput_privateFeature) {
name = "$$eval($${1}.name)"
isEmpty(name): \
@@ -1640,13 +1676,17 @@ defineTest(qtConfProcessOutput) {
}
}
- ppScope =
- !isEmpty(module): ppScope = $${module}_
- defined(qtConfOutputPostProcess_$${ppScope}$${type}, test): \
- qtConfOutputPostProcess_$${ppScope}$${type}()
+ content = $$eval($${currentConfig}.output.$${type})
+
+ !isEmpty(module): \
+ call = qtConfOutputPostProcess_$${module}_$${type}
+ else: \
+ call = qtConfOutputPostProcess_$${type}
+ defined($$call, replace): \
+ eval(content = \$\$"$$call"(\$\$content))
file = $$eval($${currentConfig}.files.$${type})
- fileCont.$$file += $$eval($${currentConfig}.output.$${type})
+ fileCont.$$file += $$content
fileCont._KEYS_ *= $$file
}
@@ -1737,6 +1777,10 @@ equals(QMAKE_CONFIG_CACHE_USE, none) {
write_file($$QMAKE_CONFIG_CACHE, cont)
}
+QMAKE_CONFIG_LOG = $$OUT_PWD/config.log
+!equals(QMAKE_CONFIG_CACHE_USE, all): \
+ write_file($$QMAKE_CONFIG_LOG, "")
+
for (currentConfig, allConfigs) {
qtConfSetModuleName()
qtConfSetupModuleOutputs()
@@ -1768,15 +1812,28 @@ for (currentConfig, allConfigs) {
}
}
- # process all features
- qtConfProcessFeatures()
+ qtConfCheckModuleCondition()
+
+ qtConfHaveModule($$currentModule) {
+ # process all features
+ qtConfProcessFeatures()
+ } else {
+ qtConfOutputVar(assign, "privatePro", "QT.$${currentModule}.skip", "true")
+ }
# generate files and reports
qtConfProcessOutput()
- qtConfCreateReport()
- qtConfCreateSummary()
+ qtConfHaveModule($$currentModule) {
+ qtConfCreateReport()
+ qtConfCreateSummary()
+ } else {
+ QT_CONFIGURE_SKIPPED_MODULES += " $$currentModule"
+ }
}
+!isEmpty(QT_CONFIGURE_SKIPPED_MODULES): \
+ qtConfAddNote("The following modules are not being compiled in this configuration:" $$QT_CONFIGURE_SKIPPED_MODULES)
+
# these come from the pri files loaded above.
for (p, QMAKE_POST_CONFIGURE): \
eval($$p)
diff --git a/mkspecs/features/qt_helper_lib.prf b/mkspecs/features/qt_helper_lib.prf
index 07e4f48771..99ba0c6877 100644
--- a/mkspecs/features/qt_helper_lib.prf
+++ b/mkspecs/features/qt_helper_lib.prf
@@ -27,6 +27,8 @@ qtConfig(build_all): CONFIG += build_all
DESTDIR = $$MODULE_BASE_OUTDIR/lib
DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin
+THE_TARGET = $$qt5LibraryTarget($$TARGET)
+
!build_pass {
MODULE = $$replace(TARGET, ^qt, )
MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_ext_$${MODULE}.pri
@@ -35,22 +37,23 @@ DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin
MODULE_PRI_CONT = \
"QMAKE_INCDIR_$${ucmodule} = $$val_escape(MODULE_INCLUDEPATH)" \
"QMAKE_DEFINES_$${ucmodule} = $$val_escape(MODULE_DEFINES)"
- MODULE_LIBS = -L$$DESTDIR -l$$TARGET
debug_and_release {
win32: MODULE_DEBUG_LIBS = -L$$DESTDIR -l$${TARGET}d
darwin: MODULE_DEBUG_LIBS = -L$$DESTDIR -l$${TARGET}_debug
+ MODULE_RELEASE_LIBS = -L$$DESTDIR -l$$TARGET
MODULE_PRI_CONT += \
"QMAKE_LIBS_$${ucmodule}_DEBUG = $$val_escape(MODULE_DEBUG_LIBS)" \
- "QMAKE_LIBS_$${ucmodule}_RELEASE = $$val_escape(MODULE_LIBS)"
+ "QMAKE_LIBS_$${ucmodule}_RELEASE = $$val_escape(MODULE_RELEASE_LIBS)"
} else {
+ MODULE_LIBS = -L$$DESTDIR -l$$THE_TARGET
MODULE_PRI_CONT += \
"QMAKE_LIBS_$${ucmodule} = $$val_escape(MODULE_LIBS)"
}
write_file($$MODULE_PRI, MODULE_PRI_CONT)|error()
}
+TARGET = $$THE_TARGET
+
# In static builds of Qt, convenience libraries must be installed,
# as in this case they are not linked to the final library/plugin.
installed|if(!not_installed:qtConfig(static)): load(qt_installs)
-
-TARGET = $$qt5LibraryTarget($$TARGET)
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 954fdb2501..31d628596c 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -18,6 +18,10 @@ exists($$OUT_PWD/qt$${MODULE}-config.pri) {
CONFIG += generated_privates
}
+skip = $$eval(QT.$${MODULE}.skip)
+isEmpty(skip): skip = false
+requires(!$$skip)
+
# Compile as shared/DLL or static according to the option given to configure
# unless overridden. Host builds are always static
host_build|staticlib: CONFIG += static
@@ -64,7 +68,9 @@ load(qt_build_paths)
header_module {
TEMPLATE = aux
- CONFIG += force_qt # Needed for the headers_clean tests.
+ CONFIG += \
+ force_qt \ # Needed for the headers_clean tests.
+ qt_no_install_library
} else {
TEMPLATE = lib
}
diff --git a/mkspecs/features/qt_parts.prf b/mkspecs/features/qt_parts.prf
index 0accef6665..67e218ca73 100644
--- a/mkspecs/features/qt_parts.prf
+++ b/mkspecs/features/qt_parts.prf
@@ -88,7 +88,7 @@ for (t, tests): \
testdirs = $$unique(testdirs)
for (td, testdirs) {
t = $$basename(td)-distclean
- $${t}.commands = -cd $$shell_path($$td) && $(MAKE) distclean
+ $${t}.commands = -$$QMAKE_CD $$shell_path($$td) && $(MAKE) distclean
QMAKE_EXTRA_TARGETS += $$t
DISTCLEAN_DEPS += $$t
}
diff --git a/mkspecs/features/spec_post.prf b/mkspecs/features/spec_post.prf
index 234189fed1..f87bf3c037 100644
--- a/mkspecs/features/spec_post.prf
+++ b/mkspecs/features/spec_post.prf
@@ -67,6 +67,7 @@ equals(MAKEFILE_GENERATOR, MSBUILD) \
|isEmpty(QMAKE_SH) {
QMAKE_ZIP = zip -r -9
+ QMAKE_CD = cd /d
QMAKE_COPY = copy /y
QMAKE_COPY_FILE = $$QMAKE_COPY
QMAKE_COPY_DIR = xcopy /s /q /y /i
@@ -87,6 +88,7 @@ equals(MAKEFILE_GENERATOR, MSBUILD) \
QMAKE_TAR = tar -cf
QMAKE_GZIP = gzip -9f
+ QMAKE_CD = cd
QMAKE_COPY = cp -f
QMAKE_COPY_FILE = $$QMAKE_COPY
QMAKE_COPY_DIR = $$QMAKE_COPY -R
diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf
index 06b29ea04b..3e1537dde0 100644
--- a/mkspecs/features/testcase.prf
+++ b/mkspecs/features/testcase.prf
@@ -52,7 +52,7 @@ unix {
$${type}.commands += $(TESTARGS)
!isEmpty(TESTRUN_CWD):!contains(TESTRUN_CWD, ^\\./?): \
- $${type}.commands = cd $$shell_path($$TESTRUN_CWD) && $$eval($${type}.commands)
+ $${type}.commands = $$QMAKE_CD $$shell_path($$TESTRUN_CWD) && $$eval($${type}.commands)
# If the test is marked as insignificant, discard the exit code
insignificant_test: $${type}.commands = -$$eval($${type}.commands)
diff --git a/mkspecs/features/uikit/xcodebuild.prf b/mkspecs/features/uikit/xcodebuild.prf
index df015b583a..a766b9ea5c 100644
--- a/mkspecs/features/uikit/xcodebuild.prf
+++ b/mkspecs/features/uikit/xcodebuild.prf
@@ -27,7 +27,7 @@ for(arg, QMAKE_ARGS) {
cmd = "$$QMAKE_QMAKE $$system_quote($$_PRO_FILE_) -spec macx-xcode $$args"
debug(1, "Generating Xcode project in $$OUT_PWD using '$$cmd'")
-system("cd $$system_quote($$OUT_PWD) && $$cmd")
+system("$$QMAKE_CD $$system_quote($$OUT_PWD) && $$cmd")
# Subtargets
diff --git a/mkspecs/features/yacc.prf b/mkspecs/features/yacc.prf
index 915fbf6850..618f0668c2 100644
--- a/mkspecs/features/yacc.prf
+++ b/mkspecs/features/yacc.prf
@@ -35,6 +35,7 @@
yacc_impl.name = source for ${QMAKE_FILE_IN}
yacc_impl.input = YACCSOURCES
yacc_impl.variable_out = GENERATED_SOURCES
+ yacc_impl.dependency_type = TYPE_C
yacc_impl.commands = $$escape_expand(\\n) # We don't want any commands where, but if command is empty no rules are created
yacc_impl.depends += $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)} # Make sure we depend on the step above
yacc_impl.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_CPP)} # Faked output from this step, output really created in step above
diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf
new file mode 100644
index 0000000000..2ed96fc5c7
--- /dev/null
+++ b/mkspecs/macx-ios-clang/features/default_post.prf
@@ -0,0 +1,9 @@
+load(default_post)
+
+!xcodebuild:equals(TEMPLATE, app):!isEmpty(QMAKE_INFO_PLIST) {
+ # Only link in photo library support if Info.plist contains
+ # NSPhotoLibraryUsageDescription. Otherwise it will be rejected from AppStore.
+ plist_path = $$absolute_path($$QMAKE_INFO_PLIST, $$_PRO_FILE_PWD_)
+ system("/usr/libexec/PlistBuddy -c 'Print NSPhotoLibraryUsageDescription' $$system_quote($$plist_path) &>/dev/null"): \
+ QTPLUGIN += qiosnsphotolibrarysupport
+}