diff options
author | OBATA Akio <obache@wizdas.com> | 2020-08-02 16:42:31 +0900 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2021-02-02 01:57:09 +0100 |
commit | 5b1f8617d1361bdf7dd3b64fc953623fc8e01d96 (patch) | |
tree | 081e4caa19a2965d73742224c5dd6a7451c8c18f | |
parent | a35e51a4fde9d292e94e824454d5d589f22b0f19 (diff) | |
download | qt3-5b1f8617d1361bdf7dd3b64fc953623fc8e01d96.tar.gz qt3-5b1f8617d1361bdf7dd3b64fc953623fc8e01d96.zip |
Prevent to set build directories as RPATH
It result in unwanted RPATH reference from installed binaries.
Signed-off-by: OBATA Akio <obache@wizdas.com>
-rw-r--r-- | qmake/generators/unix/unixmake.cpp | 8 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 14 |
2 files changed, 3 insertions, 19 deletions
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index c70eba9..d41a983 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -352,11 +352,9 @@ UnixMakefileGenerator::init() comp_flags += " -version-info " + QString::number(10*maj + min) + ":" + QString::number(pat) + ":0"; if(libtoolify[i] != "QMAKE_AR_CMD") { - QString rpath = Option::output_dir; - if(!project->isEmpty("DESTDIR")) { - rpath = project->first("DESTDIR"); - if(QDir::isRelativePath(rpath)) - rpath.prepend(Option::output_dir + Option::dir_sep); + QString rpath = project->first("target.path"); + if(rpath.right(1) != Option::dir_sep) { + rpath += Option::dir_sep; } comp_flags += " -rpath " + Option::fixPathToTargetOS(rpath, FALSE); } diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 96e1f0d..3ad8728 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1386,20 +1386,6 @@ void UnixMakefileGenerator::init2() if(!project->isActiveConfig("compile_libtool")) project->variables()["QMAKE_LFLAGS"] += project->variables()["QMAKE_LFLAGS_SONAME"]; } - QString destdir = project->first("DESTDIR"); - if ( !destdir.isEmpty() && !project->variables()["QMAKE_RPATH"].isEmpty() ) { - QString rpath_destdir = destdir; - if(QDir::isRelativePath(rpath_destdir)) { - QFileInfo fi(Option::fixPathToLocalOS(rpath_destdir)); - if(fi.convertToAbs()) //strange, shouldn't really happen - rpath_destdir = Option::fixPathToTargetOS(rpath_destdir, FALSE); - else - rpath_destdir = fi.filePath(); - } else { - rpath_destdir = Option::fixPathToTargetOS(rpath_destdir, FALSE); - } - project->variables()["QMAKE_LFLAGS"] += project->first("QMAKE_RPATH") + rpath_destdir; - } } QStringList &quc = project->variables()["QMAKE_EXTRA_UNIX_COMPILERS"]; for(QStringList::Iterator it = quc.begin(); it != quc.end(); ++it) { |