summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-12-04 09:58:43 +0100
committerLiang Qi <liang.qi@qt.io>2018-12-04 09:58:43 +0100
commit5d5c00c67682bce105197b659687fd1fee8f60cf (patch)
tree686e41dc3ea121235fb73afb9157ed603f1bfeff /mkspecs
parentf213e818f03d35cb82e3daf187415197fd156f8e (diff)
parentb82559244e2dc03f1ceff66bb67630df4300dc7c (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: src/gui/painting/qdrawhelper.cpp Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/common/android-base-tail.conf3
-rw-r--r--mkspecs/common/msvc-desktop.conf2
-rw-r--r--mkspecs/features/ctest_testcase_common.prf3
-rwxr-xr-xmkspecs/features/data/mac/objc_namespace.sh2
-rw-r--r--mkspecs/features/qmake_use.prf1
-rw-r--r--mkspecs/features/qt_configure.prf171
-rw-r--r--mkspecs/features/qt_helper_lib.prf19
-rw-r--r--mkspecs/features/toolchain.prf4
-rw-r--r--mkspecs/features/wasm/wasm.prf4
9 files changed, 159 insertions, 50 deletions
diff --git a/mkspecs/common/android-base-tail.conf b/mkspecs/common/android-base-tail.conf
index 57f009f78f..f403ef9330 100644
--- a/mkspecs/common/android-base-tail.conf
+++ b/mkspecs/common/android-base-tail.conf
@@ -87,6 +87,3 @@ QMAKE_LIBS_OPENGL_ES2 = -lGLESv2
!exists($$NDK_ROOT): error("You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.")
load(qt_config)
-
-QMAKE_DEFAULT_LIBDIRS = $$QMAKE_LIBDIR
-QMAKE_DEFAULT_INCDIRS = $$QMAKE_INCDIR
diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf
index d5db3e81d5..0b94e5a3f5 100644
--- a/mkspecs/common/msvc-desktop.conf
+++ b/mkspecs/common/msvc-desktop.conf
@@ -106,7 +106,7 @@ QMAKE_LIBS_OPENGL_ES2_DEBUG = gdi32.lib user32.lib
QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32.lib ws2_32.lib
QMAKE_LIBS_QT_ENTRY = -lqtmain
-QMAKE_IDL = midl /NOLOGO
+QMAKE_IDL = midl
QMAKE_LIB = lib /NOLOGO
QMAKE_RC = rc /NOLOGO
diff --git a/mkspecs/features/ctest_testcase_common.prf b/mkspecs/features/ctest_testcase_common.prf
index 63e31f5415..ea90bf89cd 100644
--- a/mkspecs/features/ctest_testcase_common.prf
+++ b/mkspecs/features/ctest_testcase_common.prf
@@ -65,7 +65,8 @@ for (MODULE_UNDER_TEST, CMAKE_QT_MODULES_UNDER_TEST) {
CMAKE_MODULES_UNDER_TEST = $$join(CMAKE_MODULES_UNDER_TEST, ;)
check.commands = \
- $(MKDIR) $$BUILD_DIR && $$QMAKE_CD $$BUILD_DIR && \
+ $$sprintf($$QMAKE_MKDIR_CMD, $$BUILD_DIR) $$escape_expand(\\n\\t) \
+ $$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/data/mac/objc_namespace.sh b/mkspecs/features/data/mac/objc_namespace.sh
index 6ac004fe2d..ceff2df324 100755
--- a/mkspecs/features/data/mac/objc_namespace.sh
+++ b/mkspecs/features/data/mac/objc_namespace.sh
@@ -146,7 +146,7 @@ inspect_binary() {
echo "found namespaced class names, updating class entries..."
fi
- classes=$(otool -o "$target" | grep class_ro_t)
+ classes=$(otool -o -v "$target" | grep class_ro_t)
while read -a class; do
address="$(sanitize_address ${class[1]})"
diff --git a/mkspecs/features/qmake_use.prf b/mkspecs/features/qmake_use.prf
index f81d1cece4..dba45de92a 100644
--- a/mkspecs/features/qmake_use.prf
+++ b/mkspecs/features/qmake_use.prf
@@ -9,7 +9,6 @@ for(ever) {
error("Library '$$name' is not defined.")
!contains(use, nolink) {
- QMAKE_LIBDIR += $$eval(QMAKE_LIBDIR_$$nu)
debug: \
LIBS$${suffix} += $$eval(QMAKE_LIBS_$${nu}_DEBUG) $$eval(QMAKE_LIBS_$$nu)
else: \
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index 65ee7df50b..44d8a3e639 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -365,9 +365,13 @@ defineTest(qtConfTest_linkerSupportsFlag) {
}
defineReplace(qtConfFindInPathList) {
+ # This nesting is consistent with Apple ld -search_paths_first,
+ # and presumably with GNU ld (no actual documentation found).
for (dir, 2) {
- exists("$$dir/$${1}"): \
- return("$$dir/$${1}")
+ for (file, 1) {
+ exists("$$dir/$$file"): \
+ return("$$dir/$$file")
+ }
}
return()
}
@@ -488,6 +492,110 @@ defineTest(qtConfSetupLibraries) {
}
}
+# libs-var, libs, in-paths, out-paths-var
+defineTest(qtConfResolveLibs) {
+ ret = true
+ paths = $$3
+ out =
+ copy = false
+ for (l, 2) {
+ $$copy {
+ copy = false
+ out += $$l
+ } else: equals(l, "-s") {
+ # em++ flag to link libraries from emscripten-ports; passed on literally.
+ copy = true
+ out += $$l
+ } else: contains(l, "^-L.*") {
+ lp = $$replace(l, "^-L", )
+ !exists($$lp/.) {
+ qtLog("Library path $$val_escape(lp) is invalid.")
+ ret = false
+ } else {
+ paths += $$lp
+ }
+ } else: contains(l, "^-l.*") {
+ lib = $$replace(l, "^-l", )
+ lcan =
+ unix {
+ # Under UNIX, we look for actual shared libraries, in addition
+ # to static ones.
+ lcan += \
+ $${QMAKE_PREFIX_SHLIB}$${lib}.$${QMAKE_EXTENSION_SHLIB} \
+ $${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB}
+ } else {
+ # Under Windows, we look only for static libraries, as even for DLLs
+ # one actually links against a static import library.
+ mingw {
+ lcan += \
+ # MinGW supports UNIX-style library naming in addition to
+ # the MSVC style.
+ lib$${lib}.dll.a lib$${lib}.a \
+ # Fun fact: prefix-less libraries are also supported.
+ $${lib}.dll.a $${lib}.a
+ }
+ lcan += $${lib}.lib
+ }
+ l = $$qtConfFindInPathList($$lcan, $$paths $$EXTRA_LIBDIR $$QMAKE_DEFAULT_LIBDIRS)
+ isEmpty(l) {
+ qtLog("None of [$$val_escape(lcan)] found in [$$val_escape(paths)] and global paths.")
+ ret = false
+ } else {
+ out += $$l
+ }
+ } else {
+ out += $$l
+ }
+ }
+ $$1 = $$out
+ export($$1)
+ !isEmpty(4) {
+ $$4 = $$paths
+ export($$4)
+ }
+ return($$ret)
+}
+
+# source-var
+defineTest(qtConfResolveAllLibs) {
+ ret = true
+ !qtConfResolveLibs($${1}.libs, $$eval($${1}.libs), , $${1}.libdirs): \
+ ret = false
+ for (b, $${1}.builds._KEYS_): \
+ !qtConfResolveLibs($${1}.builds.$${b}, $$eval($${1}.builds.$${b}), $$eval($${1}.libdirs), ): \
+ ret = false
+ return($$ret)
+}
+
+# libs-var, in-paths, libs
+defineTest(qtConfResolvePathLibs) {
+ ret = true
+ for (libdir, 2) {
+ !exists($$libdir/.) {
+ qtLog("Library path $$val_escape(libdir) is invalid.")
+ ret = false
+ }
+ }
+ !qtConfResolveLibs($$1, $$3, $$2): \
+ ret = false
+ return($$ret)
+}
+
+# includes-var, includes
+defineTest(qtConfResolvePathIncs) {
+ ret = true
+ for (incdir, 2) {
+ !exists($$incdir/.) {
+ qtLog("Include path $$val_escape(incdir) is invalid.")
+ ret = false
+ }
+ }
+ 2 -= $$QMAKE_DEFAULT_INCDIRS
+ $$1 = $$2
+ export($$1)
+ return($$ret)
+}
+
# the library is specified inline in a 'libs' field.
# overrides from the command line are accepted.
defineTest(qtConfLibrary_inline) {
@@ -517,7 +625,6 @@ defineTest(qtConfLibrary_inline) {
vars += $$eval(config.commandline.rev_assignments.$${iv})
defined(config.input.$${iv}, var) {
eval($${1}.builds.$${b} = $$eval(config.input.$${iv}))
- export($${1}.builds.$${b})
$${1}.builds._KEYS_ *= $${b}
any = true
} else {
@@ -532,35 +639,30 @@ defineTest(qtConfLibrary_inline) {
export($${1}.builds._KEYS_)
# we also reset the generic libs, to avoid surprises.
$${1}.libs =
- export($${1}.libs)
}
# direct libs. overwrites inline libs.
- defined(config.input.$${input}.libs, var) {
+ defined(config.input.$${input}.libs, var): \
eval($${1}.libs = $$eval(config.input.$${input}.libs))
- export($${1}.libs)
- }
+
+ includes = $$eval(config.input.$${input}.incdir)
# prefix. prepends to (possibly overwritten) inline libs.
prefix = $$eval(config.input.$${input}.prefix)
!isEmpty(prefix) {
- $${1}.includedir = $$prefix/include
- export($${1}.includedir)
+ includes += $$prefix/include
$${1}.libs = -L$$prefix/lib $$eval($${1}.libs)
- export($${1}.libs)
- }
-
- incdir = $$eval(config.input.$${input}.incdir)
- !isEmpty(incdir) {
- $${1}.includedir = $$incdir
- export($${1}.includedir)
}
libdir = $$eval(config.input.$${input}.libdir)
- !isEmpty(libdir) {
+ !isEmpty(libdir): \
$${1}.libs = -L$$libdir $$eval($${1}.libs)
- export($${1}.libs)
- }
+
+ !qtConfResolveAllLibs($$1): \
+ return(false)
+
+ !qtConfResolvePathIncs($${1}.includedir, $$includes): \
+ return(false)
return(true)
}
@@ -572,17 +674,13 @@ defineTest(qtConfLibrary_makeSpec) {
isEmpty(spec): \
error("makeSpec source in library '$$eval($${1}.library)' does not specify 'spec'.")
- $${1}.includedir = $$eval(QMAKE_INCDIR_$$spec)
- export($${1}.includedir)
- $${1}.libs =
- for (l, QMAKE_LIBDIR_$$spec): \
- $${1}.libs += -L$$l
- $${1}.libs += $$eval(QMAKE_LIBS_$$spec)
- export($${1}.libs)
+ !qtConfResolvePathLibs($${1}.libs, $$eval(QMAKE_LIBDIR_$$spec), $$eval(QMAKE_LIBS_$$spec)): \
+ return(false)
- # the library definition is always in scope, so no point in exporting it.
- $${1}.export = false
- export($${1}.export)
+ !qtConfResolvePathIncs($${1}.includedir, $$eval(QMAKE_INCDIR_$$spec)): \
+ return(false)
+
+ # note that the object is re-exported, because we resolve the libraries.
return(true)
}
@@ -602,13 +700,15 @@ defineTest(qtConfLibrary_pkgConfig) {
}
qtRunLoggedCommand("$$pkg_config --modversion $$args", version)|return(false)
- qtRunLoggedCommand("$$pkg_config --libs-only-L $$args", libpaths)|return(false)
- qtRunLoggedCommand("$$pkg_config --libs-only-l $$args", libs)|return(false)
version ~= s/[^0-9.].*$//
$${1}.version = $$first(version)
export($${1}.version)
- eval($${1}.libs = $$libpaths $$libs)
- export($${1}.libs)
+
+ qtRunLoggedCommand("$$pkg_config --libs-only-L $$args", libpaths)|return(false)
+ qtRunLoggedCommand("$$pkg_config --libs-only-l $$args", libs)|return(false)
+ eval(libs = $$libpaths $$libs)
+ !qtConfResolveLibs($${1}.libs, $$libs): \
+ return(false)
qtRunLoggedCommand("$$pkg_config --cflags $$args", $${1}.cflags)|return(false)
# Split CFLAGS into stuff that goes into DEFINES, INCLUDEPATH, and other stuff.
@@ -633,10 +733,11 @@ defineTest(qtConfLibrary_pkgConfig) {
}
!isEmpty(ignored): \
qtLog("Note: Dropped compiler flags '$$ignored'.")
+ !qtConfResolvePathIncs($${1}.includedir, $$includes): \
+ return(false)
$${1}.defines = $$defines
export($${1}.defines)
- $${1}.includedir = $$includes
- export($${1}.includedir)
+
return(true)
}
diff --git a/mkspecs/features/qt_helper_lib.prf b/mkspecs/features/qt_helper_lib.prf
index b3e49e4626..1a8446acb4 100644
--- a/mkspecs/features/qt_helper_lib.prf
+++ b/mkspecs/features/qt_helper_lib.prf
@@ -34,19 +34,30 @@ THE_TARGET = $$qt5LibraryTarget($$TARGET)
MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_ext_$${MODULE}.pri
ucmodule = $$upper($$MODULE)
+ win32|CONFIG(static, static|shared) {
+ prefix = $$QMAKE_PREFIX_STATICLIB
+ suffix = $$QMAKE_EXTENSION_STATICLIB
+ } else {
+ prefix = $$QMAKE_PREFIX_SHLIB
+ suffix = $$QMAKE_EXTENSION_SHLIB
+ }
MODULE_PRI_CONT = \
"QMAKE_INCDIR_$${ucmodule} = $$val_escape(MODULE_INCLUDEPATH)" \
"QMAKE_DEFINES_$${ucmodule} = $$val_escape(MODULE_DEFINES)"
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
+ win32: \
+ MODULE_DEBUG_LIBS = $$DESTDIR/$$prefix$${TARGET}d.$$suffix
+ else: darwin: \
+ MODULE_DEBUG_LIBS = $$DESTDIR/$$prefix$${TARGET}_debug.$$suffix
+ else: \
+ error("'$$QMAKE_PLATFORM' does not do debug_and_release.")
+ MODULE_RELEASE_LIBS = $$DESTDIR/$$prefix$${TARGET}.$$suffix
MODULE_PRI_CONT += \
"QMAKE_LIBS_$${ucmodule} =" \ # Needed for the module to be recognized.
"QMAKE_LIBS_$${ucmodule}_DEBUG = $$val_escape(MODULE_DEBUG_LIBS)" \
"QMAKE_LIBS_$${ucmodule}_RELEASE = $$val_escape(MODULE_RELEASE_LIBS)"
} else {
- MODULE_LIBS = -L$$DESTDIR -l$$THE_TARGET
+ MODULE_LIBS = $$DESTDIR/$$prefix$${THE_TARGET}.$$suffix
MODULE_PRI_CONT += \
"QMAKE_LIBS_$${ucmodule} = $$val_escape(MODULE_LIBS)"
}
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
index 4ecfb8d889..6039c52bd0 100644
--- a/mkspecs/features/toolchain.prf
+++ b/mkspecs/features/toolchain.prf
@@ -128,8 +128,8 @@ isEmpty($${target_prefix}.INCDIRS) {
# paths, so it can't just be used in place of the above code).
# What's more, -print-search-dirs can't be used on clang on Apple because it
# won't print all the library paths (only the clang-internal ones).
- output = $$system("$$cmd_prefix $$QMAKE_CXX -print-search-dirs", lines, ec)
- !equals(ec, 0): qtCompilerErrror($$QMAKE_CXX, $$output)
+ output = $$system("$$cmd_prefix $$QMAKE_LINK $$QMAKE_LFLAGS -print-search-dirs", lines, ec)
+ !equals(ec, 0): qtCompilerErrror($$QMAKE_LINK, $$output)
for (line, output) {
contains(line, "^libraries: .*") {
diff --git a/mkspecs/features/wasm/wasm.prf b/mkspecs/features/wasm/wasm.prf
index 278a6719c7..13ac43443d 100644
--- a/mkspecs/features/wasm/wasm.prf
+++ b/mkspecs/features/wasm/wasm.prf
@@ -41,14 +41,14 @@ contains(TEMPLATE, .*app) {
appjs.name = application qtloader.js
appjs.output = $$DESTDIR/qtloader.js
- appjs.commands = $$QMAKE_COPY $$WASM_PLUGIN_PATH/qtloader.js $$DESTDIR
+ appjs.commands = $$QMAKE_COPY $$shell_path($$WASM_PLUGIN_PATH/qtloader.js) $$shell_path($$DESTDIR)
appjs.input = $$WASM_PLUGIN_PATH/qtloader.js
appjs.depends = $$appjs.input
QMAKE_EXTRA_COMPILERS += appjs
appsvg.name = application qtlogo.svg
appsvg.output = $$DESTDIR/qtlogo.svg
- appsvg.commands = $$QMAKE_COPY $$WASM_PLUGIN_PATH/qtlogo.svg $$DESTDIR
+ appsvg.commands = $$QMAKE_COPY $$shell_path($$WASM_PLUGIN_PATH/qtlogo.svg) $$shell_path($$DESTDIR)
appsvg.input = $$WASM_PLUGIN_PATH/qtlogo.svg
appsvg.depends = $$appsvg.input
QMAKE_EXTRA_COMPILERS += appsvg