From 523c7e3fd55c853dd424d57f28e225d57439cf89 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 Mar 2016 14:12:16 +0100 Subject: build with explicitlib after all unlike speculated in 2fe363514, this is not a workaround at all: it causes that libraries' public link interfaces (LIBS) are exported in the first place. unlike with staticlib, this does not export LIBS_PRIVATE, so it wouldn't even be a particularly effective workaround for rpath brokenness anyway. the problem was pretty well hidden by the qt module system, which at the level of libraries is pretty redundant with the .prl file handling, which shows just how stupid the whole "design" is. unlike before, we now enable explicitlib for all libraries, not just qt modules - we enable create_prl for all of them as well, after all. an immediate effect of this change is that it fixes linking on RaspPI: the qtcore headers make the user code require linking libatomic, so we must add it to our public link interface. Task-number: QTBUG-51621 Change-Id: I5742c88694db8e8a9b79d17222dc6df2b38e5ab2 Reviewed-by: Joerg Bornemann Reviewed-by: Allan Sandfeld Jensen --- mkspecs/features/qt_build_config.prf | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf index 518fd93f04..b3081b960e 100644 --- a/mkspecs/features/qt_build_config.prf +++ b/mkspecs/features/qt_build_config.prf @@ -72,6 +72,10 @@ CONFIG += \ # However, testcases should be still built with exceptions. exceptions_off testcase_exceptions +# Under Windows, this is neither necessary (transitive deps are automatically +# resolved), nor functional (.res files end up in .prl files and break things). +unix: CONFIG += explicitlib + defineTest(qtBuildPart) { bp = $$eval($$upper($$section(_QMAKE_CONF_, /, -2, -2))_BUILD_PARTS) -- cgit v1.2.3 From 867357235ecfe12edd9940d5c8ef08f4e6ac559d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 8 Mar 2016 19:38:59 +0100 Subject: delay application of configure -D/-I/-L/-l/-R flags it is important that the flags coming from the current qt build appear first, as otherwise a pre-existing qt installation may interfere with the build. the windows configure does not have any of this magic to start with. Task-number: QTBUG-6351 Change-Id: Iacc1d9b5aa9eed9a5f0513baef9f6c6ffcef0735 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_build_config.prf | 3 +++ mkspecs/features/qt_build_extra.prf | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 mkspecs/features/qt_build_extra.prf (limited to 'mkspecs') diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf index b3081b960e..2d437e7f91 100644 --- a/mkspecs/features/qt_build_config.prf +++ b/mkspecs/features/qt_build_config.prf @@ -52,6 +52,9 @@ QMAKE_DIR_REPLACE_SANE = PRECOMPILED_DIR OBJECTS_DIR MOC_DIR RCC_DIR UI_DIR unset(modpath) } +# Apply extra compiler flags passed via configure last. +CONFIG = qt_build_extra $$CONFIG + # Don't actually try to install anything in non-prefix builds. # This is much easier and safer than making every single INSTALLS # assignment conditional. diff --git a/mkspecs/features/qt_build_extra.prf b/mkspecs/features/qt_build_extra.prf new file mode 100644 index 0000000000..4b01c7b285 --- /dev/null +++ b/mkspecs/features/qt_build_extra.prf @@ -0,0 +1,27 @@ +# +# W A R N I N G +# ------------- +# +# This file is not part of the Qt API. It exists purely as an +# implementation detail. It may change from version to version +# without notice, or even be removed. +# +# We mean it. +# + +equals(TEMPLATE, subdirs): return() + +# The headersclean check needs defines and includes even for +# header-only modules. +DEFINES += $$EXTRA_DEFINES +INCLUDEPATH += $$EXTRA_INCLUDEPATH + +# The other flags are relevant only for actual libraries. +equals(TEMPLATE, aux): return() + +LIBS += $$EXTRA_LIBS + +# Static libs need no rpaths +static: return() + +QMAKE_RPATHDIR += $$EXTRA_RPATHS -- cgit v1.2.3 From d8be8110a484460504b977dade5f163ee37b8225 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 9 Mar 2016 18:12:08 +0100 Subject: make -D/-I/-L/-l/-R not affect bootstrapped tools it's likely that these will be wrong, and the bootstrapped tools usually don't need them anyway. should they turn out necessary after all, we need to add -H* variants of the flags. Change-Id: I15c54c5e25d20ebd474073a530f00254842f515d Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_build_extra.prf | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_build_extra.prf b/mkspecs/features/qt_build_extra.prf index 4b01c7b285..a346525e66 100644 --- a/mkspecs/features/qt_build_extra.prf +++ b/mkspecs/features/qt_build_extra.prf @@ -11,6 +11,10 @@ equals(TEMPLATE, subdirs): return() +# It's likely that these extra flags will be wrong for host builds, +# and the bootstrapped tools usually don't need them anyway. +host_build:force_bootstrap: return() + # The headersclean check needs defines and includes even for # header-only modules. DEFINES += $$EXTRA_DEFINES -- cgit v1.2.3 From adc5c93ddc85d5348ee88c330bd3ca7244781311 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 9 Mar 2016 17:42:29 +0100 Subject: support relative paths in configure -R [ChangeLog][configure][Unix] configure -R now supports paths relative to -libdir. Change-Id: Ie56264a6dedcbaf5577c7ef44b056c8a7870ef48 Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt.prf | 15 +-------------- mkspecs/features/qt_build_extra.prf | 11 ++++++++++- mkspecs/features/qt_functions.prf | 13 +++++++++++++ 3 files changed, 24 insertions(+), 15 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index f62b6bb139..5cc176c2ae 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -160,21 +160,8 @@ qt_module_deps = $$resolve_depends(qt_module_deps, "QT.") contains(qt_module_deps, core) { relative_qt_rpath:!isEmpty(QMAKE_REL_RPATH_BASE):contains(INSTALLS, target):\ isEmpty(target.files):isEmpty(target.commands):isEmpty(target.extra) { - mac { - if(equals(TEMPLATE, app):app_bundle)|\ - if(equals(TEMPLATE, lib):plugin:plugin_bundle) { - ios: binpath = $$target.path/$${TARGET}.app - else: binpath = $$target.path/$${TARGET}.app/Contents/MacOS - } else: equals(TEMPLATE, lib):!plugin:lib_bundle { - binpath = $$target.path/$${TARGET}.framework/Versions/Current - } else { - binpath = $$target.path - } - } else { - binpath = $$target.path - } # NOT the /dev property, as INSTALLS use host paths - QMAKE_RPATHDIR += $$relative_path($$[QT_INSTALL_LIBS], $$binpath) + QMAKE_RPATHDIR += $$relative_path($$[QT_INSTALL_LIBS], $$qtRelativeRPathBase()) } else { QMAKE_RPATHDIR += $$[QT_INSTALL_LIBS/dev] } diff --git a/mkspecs/features/qt_build_extra.prf b/mkspecs/features/qt_build_extra.prf index a346525e66..378f5bbd7c 100644 --- a/mkspecs/features/qt_build_extra.prf +++ b/mkspecs/features/qt_build_extra.prf @@ -28,4 +28,13 @@ LIBS += $$EXTRA_LIBS # Static libs need no rpaths static: return() -QMAKE_RPATHDIR += $$EXTRA_RPATHS +for (rp, EXTRA_RPATHS) { + absrp = $$absolute_path($$rp, $$[QT_INSTALL_LIBS]) + !isEqual(absrp, $$rp) { + isEmpty(QMAKE_REL_RPATH_BASE)|!contains(INSTALLS, target): \ + rp = $$absrp + else: \ + rp = $$relative_path($$absrp, $$qtRelativeRPathBase()) + } + QMAKE_RPATHDIR += $$rp +} diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index b2c2507807..86396958f1 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -32,6 +32,19 @@ defineReplace(qt5LibraryTarget) { return($$LIBRARY_NAME) } +defineReplace(qtRelativeRPathBase) { + darwin { + if(equals(TEMPLATE, app):app_bundle)|\ + if(equals(TEMPLATE, lib):plugin:plugin_bundle) { + ios: return($$target.path/$${TARGET}.app) + return($$target.path/$${TARGET}.app/Contents/MacOS) + } + equals(TEMPLATE, lib):!plugin:lib_bundle: \ + return($$target.path/$${TARGET}.framework/Versions/Current) + } + return($$target.path) +} + defineTest(qtAddLibrary) { warning("qtAddLibrary() is deprecated. Use QT+= instead.") -- cgit v1.2.3