introduce QMAKE_LINK_O_FLAG

this makes it possible to properly parametrize alternative linkers.

Change-Id: Ia9cf574544a0259975470366d278b6c5dc747906
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This commit is contained in:
Oswald Buddenhagen 2013-01-30 15:58:00 +01:00 committed by The Qt Project
parent b20d15b58b
commit 1c061b4bcc
4 changed files with 13 additions and 7 deletions

View File

@ -448,6 +448,9 @@ MakefileGenerator::init()
if (chkglue.isEmpty()) // Backwards compat with Qt4 specs
chkglue = isWindowsShell() ? "" : "|| ";
if (v["QMAKE_LINK_O_FLAG"].isEmpty())
v["QMAKE_LINK_O_FLAG"].append("-o ");
ProStringList &quc = v["QMAKE_EXTRA_COMPILERS"];
//make sure the COMPILERS are in the correct input/output chain order

View File

@ -436,7 +436,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\n\t" << mkdir_p_asstring(destdir) << "\n\t";
if(!project->isEmpty("QMAKE_PRE_LINK"))
t << var("QMAKE_PRE_LINK") << "\n\t";
t << "$(LINK) $(LFLAGS) -o $(TARGET) " << incr_deps << " " << incr_objs << " $(OBJCOMP) $(LIBS)";
t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) " << incr_deps << " " << incr_objs << " $(OBJCOMP) $(LIBS)";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
t << endl << endl;
@ -451,7 +451,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << mkdir_p_asstring(destdir) << "\n\t";
if (!project->isEmpty("QMAKE_PRE_LINK"))
t << var("QMAKE_PRE_LINK") << "\n\t";
t << "$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)";
t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)";
if (!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
}
@ -503,7 +503,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)" << "\n\t";
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir) << "\n\t";
t << "$(LINK) " << incr_lflags << " -o "<< incr_target_dir <<
t << "$(LINK) " << incr_lflags << " " << var("QMAKE_LINK_O_FLAG") << incr_target_dir <<
" $(INCREMENTAL_OBJECTS)" << endl;
//communicated below
ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
@ -1173,7 +1173,7 @@ void UnixMakefileGenerator::init2()
}
if (project->values("QMAKE_LINK_SHLIB_CMD").isEmpty())
project->values("QMAKE_LINK_SHLIB_CMD").append(
"$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP)");
"$(LINK) $(LFLAGS) " + project->first("QMAKE_LINK_O_FLAG") + "$(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP)");
}
if (!project->values("QMAKE_APP_FLAG").isEmpty()) {
project->values("QMAKE_CFLAGS") += project->values("QMAKE_CFLAGS_APP");

View File

@ -405,7 +405,7 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
t << "\n\t" << objectsLinkLine << " " ;
}
} else if (project->first("TEMPLATE") != "aux") {
t << "\n\t" << "$(LINKER) $(LFLAGS) -o $(DESTDIR_TARGET) " << objectsLinkLine << " " << " $(LIBS)";
t << "\n\t" << "$(LINKER) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) " << objectsLinkLine << " " << " $(LIBS)";
}
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" <<var("QMAKE_POST_LINK");

View File

@ -276,6 +276,9 @@ void NmakeMakefileGenerator::init()
project->values("QMAKE_LFLAGS").append("/VERSION:" + major + "." + minor);
}
if (project->isEmpty("QMAKE_LINK_O_FLAG"))
project->values("QMAKE_LINK_O_FLAG").append("/OUT:");
// Base class init!
MakefileGenerator::init();
@ -377,7 +380,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
if(!project->isEmpty("QMAKE_PRE_LINK"))
t << "\n\t" <<var("QMAKE_PRE_LINK");
if(project->isActiveConfig("staticlib")) {
t << "\n\t" << "$(LIBAPP) $(LIBFLAGS) /OUT:$(DESTDIR_TARGET) @<<" << "\n\t "
t << "\n\t" << "$(LIBAPP) $(LIBFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) @<<" << "\n\t "
<< "$(OBJECTS)"
<< "\n<<";
} else if (templateName != "aux") {
@ -459,7 +462,7 @@ void NmakeMakefileGenerator::writeLinkCommand(QTextStream &t, const QString &ext
t << "$(LINKER) $(LFLAGS)";
if (!extraFlags.isEmpty())
t << ' ' << extraFlags;
t << " /OUT:$(DESTDIR_TARGET) @<<\n"
t << " " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) @<<\n"
<< "$(OBJECTS) $(LIBS)";
if (!extraInlineFileContent.isEmpty())
t << ' ' << extraInlineFileContent;