qmake: remove support for static archive splitting

this was introduced in 2002 supposedly for qnx4, but doesn't appear to
have actually been used ever. remove it, as it's in the way now.

Change-Id: I54dcabb61e1d3609a1e7a9fa4ff4b25509cfdb7a
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Oswald Buddenhagen 2018-10-08 17:07:59 +02:00 committed by Liang Qi
parent 4d51e099b3
commit d30de09000
2 changed files with 14 additions and 74 deletions

View File

@ -300,35 +300,11 @@ UnixMakefileGenerator::init()
}
init2();
project->values("QMAKE_INTERNAL_PRL_LIBS") << "QMAKE_LIBS";
ProString target = project->first("TARGET");
int slsh = target.lastIndexOf(Option::dir_sep);
if (slsh != -1)
target.chopFront(slsh + 1);
project->values("LIB_TARGET").prepend(target);
if(!project->isEmpty("QMAKE_MAX_FILES_PER_AR")) {
bool ok;
int max_files = project->first("QMAKE_MAX_FILES_PER_AR").toInt(&ok);
ProStringList ar_sublibs, objs = project->values("OBJECTS");
if(ok && max_files > 5 && max_files < (int)objs.count()) {
QString lib;
for(int i = 0, obj_cnt = 0, lib_cnt = 0; i != objs.size(); ++i) {
if((++obj_cnt) >= max_files) {
if(lib_cnt) {
lib.sprintf("lib%s-tmp%d.a",
project->first("QMAKE_ORIG_TARGET").toLatin1().constData(), lib_cnt);
ar_sublibs << lib;
obj_cnt = 0;
}
lib_cnt++;
}
}
}
if(!ar_sublibs.isEmpty()) {
project->values("QMAKE_AR_SUBLIBS") = ar_sublibs;
project->values("QMAKE_INTERNAL_PRL_LIBS") << "QMAKE_AR_SUBLIBS";
}
}
}
QStringList

View File

@ -690,56 +690,20 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QString destdir_r = project->first("DESTDIR").toQString();
QString destdir_d = escapeDependencyPath(destdir_r);
QString destdir = escapeFilePath(destdir_r);
allDeps = ' ' + destdir_d + depVar("TARGET")
+ varGlue("QMAKE_AR_SUBLIBS", ' ' + destdir_d, ' ' + destdir_d, "");
t << "staticlib: " << destdir_d << "$(TARGET)\n\n";
if(project->isEmpty("QMAKE_AR_SUBLIBS")) {
t << destdir_d << depVar("TARGET") << ": " << depVar("PRE_TARGETDEPS")
<< " $(OBJECTS) $(OBJCOMP) " << depVar("POST_TARGETDEPS") << "\n\t";
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir, false) << "\n\t";
if (!project->isEmpty("QMAKE_PRE_LINK"))
t << var("QMAKE_PRE_LINK") << "\n\t";
t << "-$(DEL_FILE) " << destdir << "$(TARGET)\n\t"
<< var("QMAKE_AR_CMD") << "\n";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\t" << var("QMAKE_POST_LINK") << "\n";
if(!project->isEmpty("QMAKE_RANLIB"))
t << "\t$(RANLIB) " << destdir << "$(TARGET)\n";
} else {
int max_files = project->first("QMAKE_MAX_FILES_PER_AR").toInt();
ProStringList objs = project->values("OBJECTS") + project->values("OBJCOMP"),
libs = project->values("QMAKE_AR_SUBLIBS");
libs.prepend("$(TARGET)");
for (ProStringList::Iterator libit = libs.begin(), objit = objs.begin();
libit != libs.end(); ++libit) {
ProStringList build;
for(int cnt = 0; cnt < max_files && objit != objs.end(); ++objit, cnt++)
build << (*objit);
QString ar;
ProString lib = destdir + escapeFilePath(*libit);
if((*libit) == "$(TARGET)") {
t << destdir_d << depVar("TARGET") << ": " << depVar("PRE_TARGETDEPS")
<< ' ' << depVar("POST_TARGETDEPS") << valList(escapeDependencyPaths(build)) << "\n\t";
ar = project->first("QMAKE_AR_CMD").toQString();
ar.replace(QLatin1String("$(OBJECTS)"), escapeFilePaths(build).join(' '));
} else {
t << destdir_d << escapeDependencyPath(*libit) << ": "
<< valList(escapeDependencyPaths(build)) << "\n\t";
ar = "$(AR) " + lib + ' ' + escapeFilePaths(build).join(' ');
}
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir, false) << "\n\t";
if (!project->isEmpty("QMAKE_PRE_LINK"))
t << var("QMAKE_PRE_LINK") << "\n\t";
t << "-$(DEL_FILE) " << lib << "\n\t"
<< ar << "\n";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\t" << var("QMAKE_POST_LINK") << "\n";
if(!project->isEmpty("QMAKE_RANLIB"))
t << "\t$(RANLIB) " << lib << "\n";
}
}
allDeps = ' ' + destdir_d + depVar("TARGET");
t << "staticlib: " << destdir_d << "$(TARGET)\n\n"
<< destdir_d << depVar("TARGET") << ": " << depVar("PRE_TARGETDEPS")
<< " $(OBJECTS) $(OBJCOMP) " << depVar("POST_TARGETDEPS") << "\n\t";
if (!destdir.isEmpty())
t << mkdir_p_asstring(destdir, false) << "\n\t";
if (!project->isEmpty("QMAKE_PRE_LINK"))
t << var("QMAKE_PRE_LINK") << "\n\t";
t << "-$(DEL_FILE) " << destdir << "$(TARGET)\n\t"
<< var("QMAKE_AR_CMD") << "\n";
if (!project->isEmpty("QMAKE_POST_LINK"))
t << "\t" << var("QMAKE_POST_LINK") << "\n";
if (!project->isEmpty("QMAKE_RANLIB"))
t << "\t$(RANLIB) " << destdir << "$(TARGET)\n";
t << endl << endl;
}