diff options
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/unix/unixmake.cpp | 72 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 34 |
2 files changed, 24 insertions, 82 deletions
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 1a1ba58dd1..0cd0ee596f 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -432,7 +432,7 @@ UnixMakefileGenerator::findLibraries() for (int i = 0; lflags[i]; i++) { ProStringList &l = project->values(lflags[i]); for (ProStringList::Iterator it = l.begin(); it != l.end(); ) { - QString stub, dir, extn, opt = (*it).toQString(); + QString opt = (*it).toQString(); if(opt.startsWith("-")) { if(opt.startsWith("-L")) { QString lib = opt.mid(2); @@ -444,63 +444,39 @@ UnixMakefileGenerator::findLibraries() } libdirs.insert(libidx++, f); } else if(opt.startsWith("-l")) { - stub = opt.mid(2); - } else if (target_mode == TARG_MAC_MODE && opt.startsWith("-framework")) { - if (opt.length() == 10) - ++it; - // Skip - } - } else { - extn = dir = ""; - stub = opt; - int slsh = opt.lastIndexOf(Option::dir_sep); - if(slsh != -1) { - dir = opt.left(slsh); - stub = opt.mid(slsh+1); - } - QRegExp stub_reg("^.*lib(" + stub + "[^./=]*)\\.(.*)$"); - if(stub_reg.exactMatch(stub)) { - stub = stub_reg.cap(1); - extn = stub_reg.cap(2); - } - } - if(!stub.isEmpty()) { - stub += project->first(ProKey("QMAKE_" + stub.toUpper() + "_SUFFIX")).toQString(); - bool found = false; - ProStringList extens; - if(!extn.isNull()) - extens << extn; - else + QString lib = opt.mid(2); + lib += project->first(ProKey("QMAKE_" + lib.toUpper() + "_SUFFIX")).toQString(); + bool found = false; + ProStringList extens; extens << project->first("QMAKE_EXTENSION_SHLIB") << "a"; - for (ProStringList::Iterator extit = extens.begin(); extit != extens.end(); ++extit) { - if(dir.isNull()) { - for(QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin(); dep_it != libdirs.end(); ++dep_it) { + for (ProStringList::Iterator extit = extens.begin(); extit != extens.end(); ++extit) { + for (QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin(); + dep_it != libdirs.end(); ++dep_it) { QString pathToLib = ((*dep_it).local() + '/' + project->first("QMAKE_PREFIX_SHLIB") - + stub + "." + (*extit)); - if(exists(pathToLib)) { - (*it) = "-l" + stub; + + lib + '.' + (*extit)); + if (exists(pathToLib)) { + (*it) = "-l" + lib; found = true; break; } } - } else { - QString lib = dir + project->first("QMAKE_PREFIX_SHLIB") + stub + "." + (*extit); - if (exists(lib)) { - (*it) = lib; - found = true; - break; - } } - } - if(!found && project->isActiveConfig("compile_libtool")) { - for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) { - if (exists(libdirs[dep_i].local() + '/' + project->first("QMAKE_PREFIX_SHLIB") + stub + Option::libtool_ext)) { - (*it) = libdirs[dep_i].real() + Option::dir_sep + project->first("QMAKE_PREFIX_SHLIB") + stub + Option::libtool_ext; - found = true; - break; + if (!found && project->isActiveConfig("compile_libtool")) { + for (int dep_i = 0; dep_i < libdirs.size(); ++dep_i) { + if (exists(libdirs[dep_i].local() + '/' + + project->first("QMAKE_PREFIX_SHLIB") + lib + Option::libtool_ext)) { + (*it) = libdirs[dep_i].real() + Option::dir_sep + + project->first("QMAKE_PREFIX_SHLIB") + lib + Option::libtool_ext; + found = true; + break; + } } } + } else if (target_mode == TARG_MAC_MODE && opt.startsWith("-framework")) { + if (opt.length() == 10) + ++it; + // Skip } } ++it; diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 07e3531420..2059cc7585 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -156,40 +156,6 @@ Win32MakefileGenerator::findLibraries() if(out.isEmpty()) out = lib + ".lib"; (*it) = out; - } else if (!exists(Option::normalizePath(opt))) { - QList<QMakeLocalFileName> lib_dirs; - QString file = Option::fixPathToTargetOS(opt); - int slsh = file.lastIndexOf(Option::dir_sep); - if(slsh != -1) { - lib_dirs.append(QMakeLocalFileName(file.left(slsh+1))); - file = file.right(file.length() - slsh - 1); - } else { - lib_dirs = dirs; - } - if(file.endsWith(".lib")) { - file = file.left(file.length() - 4); - if(!file.at(file.length()-1).isNumber()) { - ProString suffix = project->first(ProKey("QMAKE_" + file.toUpper() + "_SUFFIX")); - for(QList<QMakeLocalFileName>::Iterator dep_it = lib_dirs.begin(); dep_it != lib_dirs.end(); ++dep_it) { - QString lib_tmpl(file + "%1" + suffix + ".lib"); - int ver = findHighestVersion((*dep_it).local(), file); - if(ver != -1) { - if(ver) - lib_tmpl = lib_tmpl.arg(ver); - else - lib_tmpl = lib_tmpl.arg(""); - if(slsh != -1) { - QString dir = (*dep_it).real(); - if(!dir.endsWith(Option::dir_sep)) - dir += Option::dir_sep; - lib_tmpl.prepend(dir); - } - (*it) = lib_tmpl; - break; - } - } - } - } } if(remove) { it = l.erase(it); |