Changeset 103
- Timestamp:
- Aug 12, 2009, 3:19:40 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mkspecs/os2-g++/qmake.conf
r101 r103 100 100 101 101 QMAKE_RUN_LINK = $(LINK) $(LFLAGS) -o $(DESTDIR_TARGET) $(DEF_FILE) $$QMAKE_OBJECTS_REF $(LIBS) 102 QMAKE_RUN_IMPLIB = emximp -p 128 -o $( basename $(DESTDIR_TARGET)).lib$(DEF_FILE)102 QMAKE_RUN_IMPLIB = emximp -p 128 -o $(TARGET_IMPLIB) $(DEF_FILE) 103 103 104 104 QMAKE_RUN_GENDEF = \ … … 112 112 $$QMAKE_OBJECTS_REF) 113 113 114 QMAKE_GENDEF_DEPS = $(OBJECTS) 114 QMAKE_GENDEF_DEPS = $(OBJECTS) $$_PRO_FILE_ 115 115 116 116 QMAKE_LIBS = -
trunk/qmake/generators/os2/gnumake.cpp
r94 r103 95 95 } 96 96 97 QString 98 GNUMakefileGenerator::findBestVersion(const QString &d, const QString &stem, const QString &ext) 99 { 100 QString bd = Option::fixPathToLocalOS(d, true); 101 if(!exists(bd)) 102 return QString(); 103 104 QString dllStem = stem + QTDLL_POSTFIX; 105 106 QString versionOverride; 107 if(!project->values("QMAKE_" + stem.toUpper() + "_VERSION_OVERRIDE").isEmpty()) 108 versionOverride = project->values("QMAKE_" + stem.toUpper() + "_VERSION_OVERRIDE").first(); 109 110 if (project->isActiveConfig("link_prl")) { 111 QMakeMetaInfo libinfo; 112 if (libinfo.readLib(bd + Option::dir_sep + dllStem)) { 113 QString target = libinfo.first("QMAKE_PRL_TARGET"); 114 if (target.isEmpty()) 115 target = stem; 116 if (!versionOverride.isEmpty()) 117 target += versionOverride; 118 else if (!libinfo.isEmpty("QMAKE_PRL_VERSION")) 119 target += libinfo.first("QMAKE_PRL_VERSION").replace(".", ""); 120 121 const QStringList &in = libinfo.values("QMAKE_PRL_LIBS"); 122 QStringList &out = project->values("QMAKE_INTERNAL_PRL_LIBS"); 123 for (QStringList::ConstIterator it = in.begin(); it != in.end(); ++it) { 124 if (!out.contains(*it)) 125 out.append((*it)); 126 } 127 return target; 128 } 129 } 130 131 if (!versionOverride.isEmpty()) 132 return stem + versionOverride; 133 134 int biggest = -1; 135 if(!project->isActiveConfig("no_versionlink")) { 136 QDir dir(bd); 137 QStringList entries = dir.entryList(); 138 QRegExp regx(QString("((lib)?%1([0-9]*))(%2)$").arg(dllStem).arg(ext), Qt::CaseInsensitive); 139 for(QStringList::Iterator it = entries.begin(); it != entries.end(); ++it) { 140 if(regx.exactMatch((*it))) { 141 if (!regx.cap(3).isEmpty()) { 142 bool ok = true; 143 int num = regx.cap(3).toInt(&ok); 144 biggest = qMax(biggest, (!ok ? -1 : num)); 145 } 146 } 147 } 148 } 149 if (biggest != -1) 150 return stem + QString::number(biggest); 151 152 return QString(); 153 } 154 97 155 bool GNUMakefileGenerator::findLibraries() 98 156 { … … 107 165 } 108 166 109 QStringList::Iterator it = l.begin(); 110 while (it != l.end()) { 111 if ((*it).startsWith("-l")) { 112 QString steam = (*it).mid(2), out; 167 for (QStringList::Iterator it = l.begin(); it != l.end(); ++it) { 168 if((*it).startsWith("-L")) { 169 dirs.append(QMakeLocalFileName((*it).mid(2))); 170 } else { 171 QString stem = *it, out; 172 173 if (stem.startsWith("-l")) 174 stem = stem.mid(2); 175 113 176 QString suffix; 114 if (!project->isEmpty("QMAKE_" + ste am.toUpper() + "_SUFFIX"))115 suffix = project->first("QMAKE_" + ste am.toUpper() + "_SUFFIX");177 if (!project->isEmpty("QMAKE_" + stem.toUpper() + "_SUFFIX")) 178 suffix = project->first("QMAKE_" + stem.toUpper() + "_SUFFIX"); 116 179 for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) { 117 QString extension; 118 int ver = findHighestVersion((*dir_it).local(), steam, "dll.lib|lib"); 119 if (ver != -1) 120 extension += QString::number(ver); 121 extension += suffix; 122 if(QMakeMetaInfo::libExists((*dir_it).local() + Option::dir_sep + steam) || 123 exists((*dir_it).local() + Option::dir_sep + steam + extension + ".lib") || 124 exists((*dir_it).local() + Option::dir_sep + steam + extension + ".dll.lib")) { 125 out = (*it) + extension; 126 break; 180 QString best = findBestVersion((*dir_it).local(), stem, 181 QString("%1.lib").arg(suffix)); 182 if (!best.isEmpty()) { 183 out = best.prepend("-l"); 184 break; 127 185 } 128 186 } 129 187 if (!out.isEmpty()) // We assume if it never finds it that its correct 130 (*it) = out; 131 } else if((*it).startsWith("-L")) { 132 dirs.append(QMakeLocalFileName((*it).mid(2))); 133 } 134 135 ++it; 136 } 188 if (!project->values("QMAKE_LIBS").contains(out)) 189 (*it) = out; 190 } 191 } 192 193 QStringList l2 = project->values("QMAKE_INTERNAL_PRL_LIBS"); 194 for (QStringList::ConstIterator it = l2.begin(); it != l2.end(); ++it) { 195 if (!l.contains(*it)) 196 l.append((*it)); 197 } 198 137 199 return true; 138 200 } … … 383 445 t << "\n\t" << var("QMAKE_RUN_RC2EXE"); 384 446 } 385 if (mode == DLL && !project->isEmpty("QMAKE_RUN_IMPLIB")) {386 t << "\n\t" << var("QMAKE_RUN_IMPLIB");387 }388 447 } 389 448 if(!project->isEmpty("QMAKE_POST_LINK")) … … 399 458 if (!project->isEmpty("RES_FILE")) { 400 459 t << "RES_FILE = " << valList(escapeFilePaths(project->values("RES_FILE"))) << endl; 401 }402 if (mode == DLL && !project->isEmpty("QMAKE_RUN_IMPLIB")) {403 t << "TARGET_IMPLIB = $(basename $(DESTDIR_TARGET)).lib" << endl;404 project->values("QMAKE_CLEAN").append("$(TARGET_IMPLIB)");405 460 } 406 461 … … 429 484 project->values("POST_TARGETDEPS") += escapeFileVars("$(DEF_FILE)"); 430 485 } 486 487 if (mode == DLL && !project->isEmpty("QMAKE_RUN_IMPLIB")) { 488 t << "TARGET_IMPLIB = $(basename $(DESTDIR_TARGET)).lib" << endl; 489 project->values("QMAKE_CLEAN").append("$(TARGET_IMPLIB)"); 490 project->values("POST_TARGETDEPS") += escapeFileVars("$(TARGET_IMPLIB)"); 491 } 431 492 } 432 493 … … 439 500 } 440 501 441 if (project->isEmpty("DEF_FILE") && mode == DLL) { 442 /* generate a DEF file for the DLL when not supplied */ 443 t << escapeFileVars("$(DEF_FILE): ") << var("QMAKE_GENDEF_DEPS"); 444 t << valGlue(var("QMAKE_RUN_GENDEF").split(";;"), "\n\t", "\n\t", "") << endl; 502 if (mode == DLL) { 503 if (project->isEmpty("DEF_FILE")) { 504 /* generate a DEF file for the DLL when not supplied */ 505 t << escapeFileVars("$(DEF_FILE): ") << var("QMAKE_GENDEF_DEPS"); 506 t << valGlue(var("QMAKE_RUN_GENDEF").split(";;"), "\n\t", "\n\t", "") << endl; 507 } 508 if (!project->isEmpty("QMAKE_RUN_IMPLIB")) { 509 /* generate the import library */ 510 t << escapeFileVars("$(TARGET_IMPLIB): ") << escapeFileVars("$(DEF_FILE)"); 511 t << "\n\t" << var("QMAKE_RUN_IMPLIB") << endl; 512 } 445 513 } 446 514 } … … 470 538 void GNUMakefileGenerator::processPrlVariable(const QString &var, const QStringList &l) 471 539 { 472 if (var == "QMAKE_PRL_LIBS") { 473 QString where = "QMAKE_LIBS"; 474 if (!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS")) 475 where = project->first("QMAKE_INTERNAL_PRL_LIBS"); 476 QStringList &out = project->values(where); 477 for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) { 478 out.removeAll((*it)); 479 out.append((*it)); 480 } 481 } else { 482 Win32MakefileGenerator::processPrlVariable(var, l); 483 } 540 // we don't do any processing here; everything we need is done in 541 // GNUMakefileGenerator::findLibraries() 542 return; 543 } 544 545 void GNUMakefileGenerator::processPrlFiles() 546 { 547 // we don't do any processing here; everything we need is done in 548 // GNUMakefileGenerator::findLibraries() 549 return; 484 550 } 485 551 -
trunk/qmake/generators/os2/gnumake.h
r44 r103 71 71 void processRcFileVar(); 72 72 void processPrlVariable(const QString &var, const QStringList &l); 73 void processPrlFiles(); 73 74 74 75 QStringList &findDependencies(const QString &file); … … 76 77 QString preCompHeaderOut; 77 78 79 QString findBestVersion(const QString &d, const QString &stem, const QString &ext); 78 80 virtual bool findLibraries(); 79 81 void fixTargetExt();
Note:
See TracChangeset
for help on using the changeset viewer.