summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
Diffstat (limited to 'qmake')
-rw-r--r--qmake/Makefile.unix1
-rw-r--r--qmake/Makefile.win323
-rw-r--r--qmake/doc/src/qmake-manual.qdoc23
-rw-r--r--qmake/generators/makefile.cpp3
-rw-r--r--qmake/generators/unix/unixmake.cpp19
-rw-r--r--qmake/generators/unix/unixmake2.cpp12
6 files changed, 51 insertions, 10 deletions
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index 520ae667e9..405bbf9212 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -102,6 +102,7 @@ CPPFLAGS = -g $(EXTRA_CPPFLAGS) \
-I$(BUILD_PATH)/src/corelib/global -DHAVE_QCONFIG_CPP \
-I$(QMAKESPEC) \
-I$(SOURCE_PATH)/tools/shared \
+ -DQT_VERSION_STR=\"$(QT_VERSION)\" -DQT_VERSION_MAJOR=$(QT_MAJOR_VERSION) -DQT_VERSION_MINOR=$(QT_MINOR_VERSION) -DQT_VERSION_PATCH=$(QT_PATCH_VERSION) \
-DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index c8608cbc92..1e8c5129be 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -22,7 +22,7 @@ CFLAGS_EXTRA = /Zc:wchar_t-
! elseif "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc2012" || "$(QMAKESPEC)" == "win32-msvc2013"
CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS $(CFLAGS_CRT)
! elseif "$(QMAKESPEC)" == "win32-msvc2015"
-CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /Zc:strictStrings /w44456 /w44457 /w44458 $(CFLAGS_CRT)
+CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /Zc:strictStrings /w44456 /w44457 /w44458 /wd4577 $(CFLAGS_CRT)
! else
! error Unsupported compiler for this Makefile
! endif
@@ -36,6 +36,7 @@ CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \
-I$(BUILD_PATH)\src\corelib\global -DHAVE_QCONFIG_CPP \
-I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \
-I$(SOURCE_PATH)\tools\shared \
+ -DQT_VERSION_STR=\"$(QT_VERSION)\" -DQT_VERSION_MAJOR=$(QT_MAJOR_VERSION) -DQT_VERSION_MINOR=$(QT_MINOR_VERSION) -DQT_VERSION_PATCH=$(QT_PATCH_VERSION) \
-DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index e7351edf5b..a37f19718b 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -1845,6 +1845,22 @@
The value of this variable is typically handled by
qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+ \section1 QMAKE_LFLAGS_REL_RPATH
+
+ Specifies the linker flags needed to enable relative paths in
+ \l{QMAKE_RPATHDIR}.
+
+ The value of this variable is typically handled by
+ qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+
+ \section1 QMAKE_REL_RPATH_BASE
+
+ Specifies the string the dynamic linker understands to be the
+ location of the referring executable or library.
+
+ The value of this variable is typically handled by
+ qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+
\section1 QMAKE_LFLAGS_RPATHLINK
Specifies the linker flags needed to use the values from
@@ -2095,6 +2111,13 @@
executable at link time so that the paths will be preferentially
searched at runtime.
+ When relative paths are specified, qmake will mangle them into a form
+ understood by the dynamic linker to be relative to the location of
+ the referring executable or library.
+ This is supported only by some platforms (currently Linux and
+ Darwin-based ones) and is detectable by checking whether
+ \l{QMAKE_REL_RPATH_BASE} is set.
+
\section1 QMAKE_RPATHLINKDIR
Specifies a list of library paths for the static linker to search for implicit
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 6f844a5c4d..a54083c04d 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -915,7 +915,8 @@ MakefileGenerator::processPrlFile(QString &file)
if (tgt.isEmpty()) {
fprintf(stderr, "Error: %s does not define QMAKE_PRL_TARGET\n",
meta_file.toLatin1().constData());
- } else if (!tgt.contains('.')) {
+ } else if (!tgt.contains('.')
+ && !libinfo.values("QMAKE_PRL_CONFIG").contains("lib_bundle")) {
fprintf(stderr, "Error: %s defines QMAKE_PRL_TARGET without extension\n",
meta_file.toLatin1().constData());
} else {
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 1d9ebb35e3..57c0a97228 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -125,10 +125,23 @@ UnixMakefileGenerator::init()
const ProStringList &rpathdirs = project->values("QMAKE_RPATHDIR");
for (int i = 0; i < rpathdirs.size(); ++i) {
QString rpathdir = rpathdirs[i].toQString();
- if (rpathdir.length() > 1 && rpathdir.at(0) == '$' && rpathdir.at(1) != '(')
+ if (rpathdir.length() > 1 && rpathdir.at(0) == '$' && rpathdir.at(1) != '(') {
rpathdir.replace(0, 1, "\\$$"); // Escape from make and the shell
- else if (!rpathdir.startsWith('@'))
- rpathdir = QFileInfo(rpathdir).absoluteFilePath();
+ } else if (!rpathdir.startsWith('@') && fileInfo(rpathdir).isRelative()) {
+ QString rpathbase = project->first("QMAKE_REL_RPATH_BASE").toQString();
+ if (rpathbase.isEmpty()) {
+ fprintf(stderr, "Error: This platform does not support relative paths in QMAKE_RPATHDIR (%s)\n",
+ rpathdir.toLatin1().constData());
+ continue;
+ }
+ if (rpathbase.startsWith('$'))
+ rpathbase.replace(0, 1, "\\$$"); // Escape from make and the shell
+ if (rpathdir == ".")
+ rpathdir = rpathbase;
+ else
+ rpathdir.prepend(rpathbase + '/');
+ project->values("QMAKE_LFLAGS").insertUnique(project->values("QMAKE_LFLAGS_REL_RPATH"));
+ }
project->values("QMAKE_LFLAGS") += var("QMAKE_LFLAGS_RPATH") + escapeFilePath(rpathdir);
}
}
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index d0cd5d2354..9db64bebee 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -262,11 +262,13 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " "
<< fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl;
t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl;
- // The comment is important for mingw32-make.exe on Windows as otherwise trailing slashes
- // would be interpreted as line continuation. The lack of spacing between the value and the
- // comment is also important as otherwise quoted use of "$(DESTDIR)" would include this
- // spacing.
- t << "DESTDIR = " << fileVar("DESTDIR") << "#avoid trailing-slash linebreak\n";
+ QString destd = fileVar("DESTDIR");
+ // When building on non-MSys MinGW, the path ends with a backslash, which
+ // GNU make will interpret that as a line continuation. Doubling the backslash
+ // avoids the problem, at the cost of the variable containing *both* backslashes.
+ if (destd.endsWith('\\'))
+ destd += '\\';
+ t << "DESTDIR = " << destd << endl;
t << "TARGET = " << fileVar("TARGET") << endl; // ### mixed use!
if(project->isActiveConfig("plugin")) {
t << "TARGETD = " << fileVar("TARGET") << endl;