summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-07-20 20:22:50 +0200
committerLars Knoll <lars.knoll@qt.io>2016-08-10 15:42:23 +0000
commit62838f07d4e4e8ae578801167b11e02480d34daa (patch)
treee8a351152894ba2878b46b1e930fe773fa51b3f4
parent53e06e68b6c675e3d3d6f49e23a6466e3404d377 (diff)
fix handling of multi-token fields in config test definitions
standardize on the fields in the json structure being single strings in which separate elements are quoted and space-joined (because quoting is unlikely to be necessary in the json file itself, and this format avoids the visual noise of array handling). the quoting itself is expected to be qmake-compatible, which is assumed to be the case for the output of pkg-config (it's actually shell-quoted, but that's the same except in some not-so-relevant corner cases). Change-Id: Icc1d7abc02c449fa759d9714bc5e56e2b8809585 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--configure.pri38
-rw-r--r--mkspecs/features/qt_configure.prf15
2 files changed, 31 insertions, 22 deletions
diff --git a/configure.pri b/configure.pri
index cdded4f2d4..4cc1640d6f 100644
--- a/configure.pri
+++ b/configure.pri
@@ -293,15 +293,17 @@ defineTest(qtConfTest_psqlCompile) {
isEmpty(pg_config): \
pg_config = $$qtConfFindInPath("pg_config")
!win32:!isEmpty(pg_config) {
- libdir = $$system("$$pg_config --libdir")
+ libdir = $$system("$$pg_config --libdir", lines)
libdir -= $$QMAKE_DEFAULT_LIBDIRS
- !isEmpty(libdir): libs = "-L$$libdir"
+ libs =
+ !isEmpty(libdir): libs += "-L$$libdir"
libs += "-lpq"
- $${1}.libs = $$libs
- $${1}.includedir = $$system("$$pg_config --includedir")
- $${1}.includedir -= $$QMAKE_DEFAULT_INCDIRS
- !isEmpty($${1}.includedir): \
- $${1}.cflags = "-I$$eval($${1}.includedir)"
+ $${1}.libs = "$$val_escape(libs)"
+ includedir = $$system("$$pg_config --includedir", lines)
+ includedir -= $$QMAKE_DEFAULT_INCDIRS
+ $${1}.includedir = "$$val_escape(includedir)"
+ !isEmpty(includedir): \
+ $${1}.cflags = "-I$$val_escape(includedir)"
}
# Respect PSQL_LIBS if set
@@ -328,15 +330,19 @@ defineTest(qtConfTest_mysqlCompile) {
# query is either --libs or --libs_r
query = $$eval($${1}.query)
- $${1}.libs = $$filterLibraryPath($$system("$$mysql_config $$query"))
+ libs = $$system("$$mysql_config $$query", lines)
+ eval(libs = $$libs)
+ libs = $$filterLibraryPath($$libs)
# -rdynamic should not be returned by mysql_config, but is on RHEL 6.6
- $${1}.libs -= -rdynamic
- includedir = $$system("$$mysql_config --include")
+ libs -= -rdynamic
+ $${1}.libs = "$$val_escape(libs)"
+ includedir = $$system("$$mysql_config --include", lines)
+ eval(includedir = $$includedir)
includedir ~= s/^-I//g
includedir -= $$QMAKE_DEFAULT_INCDIRS
- $${1}.includedir = $$includedir
- !isEmpty($${1}.includedir): \
- $${1}.cflags = "-I$$eval($${1}.includedir)"
+ $${1}.includedir = "$$val_escape(includedir)"
+ !isEmpty(includedir): \
+ $${1}.cflags = "-I$$val_escape(includedir)"
export($${1}.libs)
export($${1}.includedir)
export($${1}.cflags)
@@ -347,10 +353,12 @@ defineTest(qtConfTest_mysqlCompile) {
}
defineTest(qtConfTest_tdsCompile) {
+ libs =
sybase = $$getenv(SYBASE)
!isEmpty(sybase): \
- $${1}.libs = "-L$${sybase}/lib"
- $${1}.libs += $$getenv(SYBASE_LIBS)
+ libs += "-L$${sybase}/lib"
+ libs += $$getenv(SYBASE_LIBS)
+ $${1}.libs = "$$val_escape(libs)"
export($${1}.libs)
qtConfTest_compile($${1}): return(true)
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index e815baebf1..aaed0cb2d1 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -350,11 +350,12 @@ defineTest(qtConfTest_pkgConfig) {
!qtConfPkgConfigPackageExists($$pkg_config, $$args): \
return(false)
- $${1}.libs = $$system("$$pkg_config --libs $$args")
- $${1}.cflags = $$system("$$pkg_config --cflags $$args")
- includes = $$system("$$pkg_config --cflags-only-I $$args")
+ $${1}.libs = $$system("$$pkg_config --libs $$args", lines)
+ $${1}.cflags = $$system("$$pkg_config --cflags $$args", lines)
+ includes = $$system("$$pkg_config --cflags-only-I $$args", lines)
+ eval(includes = $$includes)
includes ~= s/^-I//g
- $${1}.includedir = $$includes
+ $${1}.includedir = "$$val_escape(includes)"
version = $$system("$$pkg_config --modversion $$args")
$${1}.version = $$first(version)
export($${1}.libs)
@@ -1089,9 +1090,9 @@ defineTest(qtConfOutput_library) {
isEmpty(lookup): \
error("Output type 'library' used in feature '$$eval($${1}.feature)' without a 'test' entry.")
- libs = $$eval($${lookup}.libs)
- cflags = $$eval($${lookup}.cflags)
- includes = $$eval($${lookup}.includedir)
+ eval(libs = $$eval($${lookup}.libs))
+ eval(cflags = $$eval($${lookup}.cflags))
+ eval(includes = $$eval($${lookup}.includedir))
version = $$split($${lookup}.version, '.')
!isEmpty(libs): qtConfOutputVar(assign, $$output, QMAKE_LIBS_$$NAME, $$libs)