summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2017-12-15 17:52:47 +0100
committerMichal Klocek <michal.klocek@qt.io>2018-01-23 17:00:53 +0000
commitd502c6e9d09803dd268100f8c53cf7bc563e3d1d (patch)
treef998c3179401c09e4399015b19e34593f12ef3c5 /mkspecs
parent3cec2ccb0ffdd41a41ab55d4c1ba88d4866e71d1 (diff)
Add pkg-host wrapper script
Currently we need pkg-config host for cross-builds to build build tools. Unfortunately if build environment exports PKG_CONFIG_* variables pkg-config will pick them up also for host builds, which can lead to compile errors. Create pkg-config-host_wrapper which explicitly unsets PKG_CONFIG_* variables. This is a temporary workaround till proper solution is implemented in qtbase. Task-number: QTBUG-65079 Change-Id: I9aff4a27ba62e096ed4c023cf022a41833260178 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/configure.prf6
-rw-r--r--mkspecs/features/functions.prf15
2 files changed, 21 insertions, 0 deletions
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
index 8b8fd3efe..2c0908598 100644
--- a/mkspecs/features/configure.prf
+++ b/mkspecs/features/configure.prf
@@ -53,6 +53,12 @@ defineTest(runConfigure) {
}
linux {
+
+ !qtConfig(webengine-host-pkg-config) {
+ skipBuild("Host pkg-config is required")
+ return(false)
+ }
+
!qtConfig(webengine-system-glibc) {
skipBuild("A suitable version of libc could not be found. See: https://sourceware.org/bugzilla/show_bug.cgi?id=14898")
return(false)
diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf
index 3b9a400b1..8564bad8a 100644
--- a/mkspecs/features/functions.prf
+++ b/mkspecs/features/functions.prf
@@ -115,3 +115,18 @@ defineTest(skipBuild) {
skipBuildReason = "$$skipBuildReason $${EOL}$$1"
export(skipBuildReason)
}
+
+defineReplace(pkgConfigHostExecutable) {
+ wrapper_name = $$OUT_PWD/pkg-config-host_wrapper.sh
+ wrapper_cmd = $$QMAKE_PKG_CONFIG_HOST
+ isEmpty(wrapper_cmd): wrapper_cmd = pkg-config
+ wrapper_content = \
+ "$$LITERAL_HASH!/bin/sh" \
+ "unset PKG_CONFIG_LIBDIR" \
+ "unset PKG_CONFIG_SYSROOT_DIR" \
+ "exec $$wrapper_cmd \"$@\""
+ !build_pass:!write_file($$wrapper_name, wrapper_content, exe): error()
+ QMAKE_DISTCLEAN += $$wrapper_name
+ export(QMAKE_DISTCLEAN)
+ return($$system_quote($$system_path($$wrapper_name)))
+}