Make -no-rpath build more useful on Apple platforms

[ChangeLog][Platform Specific Changes][OS X] Configure with -no-rpath
will now yield Qt dynamic libraries and frameworks with an absolute
install name (based in -libdir).

OS X package managers like Homebrew install Qt in a fixed location. This
change simplifies deployment for such package managers and is consistent
with the default expectation on Apple platforms for libraries with a
fixed location to also have absolute install names.

While a relocatable installation (the default) also works in this
scenario, it requires all software that depends on Qt to be aware of
this and to embed a suitable RPATH into application binaries (which is
not automatic for non-qmake builds). This might not be true for some
select fallback search locations, but as package managers on OS X tend
not to use those, embedding an RPATH becomes practically mandatory. In a
default Homebrew installation, Qt is configured such that the frameworks
end up in /usr/local/Cellar/qt5/<version>/lib and that will be later
symlinked to /usr/local/opt/qt5/lib, both of which are not searched by
the dynamic linker by default.

Task-number: QTBUG-48958
Change-Id: I4395df98771e06a2ce8a293d11dc755bdc50757f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
Martin Afanasjew 2015-10-19 23:52:10 +02:00
parent 833341e301
commit 6c222297ab
2 changed files with 5 additions and 1 deletions

4
configure vendored
View File

@ -2557,7 +2557,9 @@ Additional options:
-l <string> ........ Add an explicit library.
-no-rpath .......... Do not use the library install path as a runtime
library path.
library path. On Apple platforms, this implies using
absolute install names (based in -libdir) for dynamic
libraries and frameworks.
+ -rpath ............. Link Qt libraries and executables using the library
install path as a runtime library path. Equivalent
to -R install_libpath

View File

@ -135,6 +135,8 @@ mac {
contains(QT_CONFIG, rpath): \
QMAKE_SONAME_PREFIX = @rpath
else: \
CONFIG += absolute_library_soname
}
DEFINES += QT_BUILDING_QT