summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-11-24 19:48:33 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-12-19 19:21:49 +0000
commita8207699ce282cdcaa9423374fdad20a63897d25 (patch)
treed36eea9463284e76549400a8d3f7a367cf8ddbcc
parent32aa6734d445e1eed38e55ee03af4267ab6cd2c7 (diff)
configure: normalize dashes to underscores in exported libraries
it works without it, but technically speaking it's undefined behavior. Change-Id: Icdcdd5b923ce4cecd9dc9e75f9d5d66d0fa8a032 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--mkspecs/features/qmake_use.prf6
-rw-r--r--mkspecs/features/qt_configure.prf16
-rw-r--r--mkspecs/features/qt_helper_lib.prf3
3 files changed, 13 insertions, 12 deletions
diff --git a/mkspecs/features/qmake_use.prf b/mkspecs/features/qmake_use.prf
index 8159e471a2..64faa4f215 100644
--- a/mkspecs/features/qmake_use.prf
+++ b/mkspecs/features/qmake_use.prf
@@ -5,14 +5,14 @@ for(ever) {
for (use, QMAKE_USE$${suffix}) {
use = $$split(use, /)
name = $$take_first(use)
- nu = $$upper($$name)
+ nu = $$upper($$replace(name, -, _))
!contains(use, linkonly): CC_USES += $$nu
!contains(use, nolink): LD_USES += $$nu
}
CC_USES = $$resolve_depends(CC_USES, QMAKE_DEPENDS_, _CC)
for (nu, CC_USES) {
!defined(QMAKE_LIBS_$$nu, var): \
- error("Library '$$lower($$nu)' is not defined.")
+ error("Library '$$lower($$replace(nu, _, -))' is not defined.")
DEFINES += $$eval(QMAKE_DEFINES_$${nu})
INCLUDEPATH += $$eval(QMAKE_INCDIR_$${nu})
@@ -20,7 +20,7 @@ for(ever) {
LD_USES = $$resolve_depends(LD_USES, QMAKE_DEPENDS_, _LD)
for (nu, LD_USES) {
!defined(QMAKE_LIBS_$$nu, var): \
- error("Library '$$lower($$nu)' is not defined.")
+ error("Library '$$lower($$replace(nu, _, -))' is not defined.")
debug: \
LIBS$${suffix} += $$eval(QMAKE_LIBS_$${nu}_DEBUG) $$eval(QMAKE_LIBS_$$nu)
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index 5798a8a27b..83802cffca 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -439,12 +439,12 @@ defineTest(qtConfSetupLibraries) {
lpfx = $${currentConfig}.libraries.$${l}
# 'export' may be omitted, in which case it falls back to the library's name
!defined($${lpfx}.export, var) {
- $${lpfx}.export = $$l
+ $${lpfx}.export = $$replace(l, -, _)
export($${lpfx}.export)
}
# 'export' may also be empty, but we need a derived identifier
alias = $$eval($${lpfx}.export)
- isEmpty(alias): alias = $$l
+ isEmpty(alias): alias = $$replace(l, -, _)
$${lpfx}.alias = $$alias
export($${lpfx}.alias)
# make it easy to refer to the library by its export name.
@@ -804,7 +804,7 @@ defineTest(qtConfLibrary_pkgConfig) {
largs = $$qtConfAllLibraryArgs($$eval($${2}.dependencies))
for (la, largs): \
eval("$$la")
- USES = $$eval($$list($$upper($$QMAKE_USE)))
+ USES = $$eval($$list($$upper($$replace(QMAKE_USE, -, _))))
# _CC == _LD for configure's library sources, so pick first arbitrarily.
DEPS = $$resolve_depends(USES, QMAKE_DEPENDS_, _CC)
for (DEP, DEPS) {
@@ -837,7 +837,7 @@ defineTest(qtConfTest_getPkgConfigVariable) {
}
defineReplace(qtConfLibraryArgs) {
- NAME = $$upper($$eval($${1}.library))
+ NAME = $$upper($$replace($${1}.library, -, _))
qmake_args = "QMAKE_LIBS_$${NAME} = $$val_escape($${1}.libs)"
for (b, $${1}.builds._KEYS_): \
qmake_args += "QMAKE_LIBS_$${NAME}_$$upper($$b) = $$val_escape($${1}.builds.$${b})"
@@ -853,8 +853,8 @@ defineReplace(qtConfLibraryArgs) {
for (use, depends): \
dep_uses += $$section(use, :, 1, 1)
qmake_args += \
- "QMAKE_DEPENDS_$${NAME}_CC = $$upper($$dep_uses)" \
- "QMAKE_DEPENDS_$${NAME}_LD = $$upper($$dep_uses)"
+ "QMAKE_DEPENDS_$${NAME}_CC = $$upper($$replace(dep_uses, -, _))" \
+ "QMAKE_DEPENDS_$${NAME}_LD = $$upper($$replace(dep_uses, -, _))"
}
return($$qmake_args)
}
@@ -917,7 +917,7 @@ defineTest(qtConfExportLibrary) {
!isEmpty(use_cfg): \
depends += $$upper($$eval($${use_cfg}.libraries.$${use_lib}.export))
else: \
- depends += $$upper($$use_lib)
+ depends += $$upper($$replace(use_lib, -, _))
}
# we use suffixes instead of infixes, because $$resolve_depends() demands it.
qtConfOutputVar(assign, $$output, QMAKE_DEPENDS_$${NAME}_CC, $$depends)
@@ -1092,7 +1092,7 @@ defineTest(qtConfTestPrepare_compile) {
}
}
isEmpty(libConfig) {
- nu = $$upper($$u)
+ nu = $$upper($$replace(u, -, _))
!defined(QMAKE_LIBS_$$nu, var): \
error("Test $$1 tries to use undeclared library '$$u'")
# using an external library by exported name.
diff --git a/mkspecs/features/qt_helper_lib.prf b/mkspecs/features/qt_helper_lib.prf
index 05d3b941bd..2cb54fc547 100644
--- a/mkspecs/features/qt_helper_lib.prf
+++ b/mkspecs/features/qt_helper_lib.prf
@@ -31,6 +31,7 @@ THE_TARGET = $$qt5LibraryTarget($$TARGET)
!build_pass {
MODULE = $$replace(TARGET, ^qt, )
+ MODULE ~= s,-,_,
MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_ext_$${MODULE}.pri
ucmodule = $$upper($$MODULE)
@@ -46,7 +47,7 @@ THE_TARGET = $$qt5LibraryTarget($$TARGET)
for (use, QMAKE_USE) {
use = $$split(use, /)
name = $$take_first(use)
- nu = $$upper($$name)
+ nu = $$upper($$replace(name, -, _))
!contains(use, linkonly): CC_USES += $$nu
!contains(use, nolink): LD_USES += $$nu
}