diff options
Diffstat (limited to 'qmake/generators/unix/unixmake2.cpp')
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 78 |
1 files changed, 41 insertions, 37 deletions
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index d1ed572..e583419 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1386,20 +1386,6 @@ void UnixMakefileGenerator::init2() if(!project->isActiveConfig("compile_libtool")) project->variables()["QMAKE_LFLAGS"] += project->variables()["QMAKE_LFLAGS_SONAME"]; } - QString destdir = project->first("DESTDIR"); - if ( !destdir.isEmpty() && !project->variables()["QMAKE_RPATH"].isEmpty() ) { - QString rpath_destdir = destdir; - if(QDir::isRelativePath(rpath_destdir)) { - QFileInfo fi(Option::fixPathToLocalOS(rpath_destdir)); - if(fi.convertToAbs()) //strange, shouldn't really happen - rpath_destdir = Option::fixPathToTargetOS(rpath_destdir, FALSE); - else - rpath_destdir = fi.filePath(); - } else { - rpath_destdir = Option::fixPathToTargetOS(rpath_destdir, FALSE); - } - project->variables()["QMAKE_LFLAGS"] += project->first("QMAKE_RPATH") + rpath_destdir; - } } QStringList &quc = project->variables()["QMAKE_EXTRA_UNIX_COMPILERS"]; for(QStringList::Iterator it = quc.begin(); it != quc.end(); ++it) { @@ -1428,7 +1414,7 @@ UnixMakefileGenerator::libtoolFileName() QString ret = var("TARGET"); int slsh = ret.findRev(Option::dir_sep); if(slsh != -1) - ret = ret.right(ret.length() - slsh); + ret = ret.right(ret.length() - slsh - 1); int dot = ret.find('.'); if(dot != -1) ret = ret.left(dot); @@ -1452,9 +1438,8 @@ UnixMakefileGenerator::writeLibtoolFile() QTextStream t(&ft); t << "# " << lname << " - a libtool library file\n"; - time_t now = time(NULL); t << "# Generated by qmake/libtool (" << qmake_version() << ") (Qt " - << QT_VERSION_STR << ") on: " << ctime(&now) << "\n"; + << QT_VERSION_STR << ")\n"; t << "# The name that we can dlopen(3).\n" << "dlname='" << var(project->isActiveConfig("plugin") ? "TARGET" : "TARGET_x") @@ -1466,13 +1451,17 @@ UnixMakefileGenerator::writeLibtoolFile() t << var("TARGET"); } else { if (project->isEmpty("QMAKE_HPUX_SHLIB")) - t << var("TARGET_x.y.z") << " "; + t << var("TARGET_x.y.z") << " " << var("TARGET_x.y") << " "; t << var("TARGET_x") << " " << var("TARGET_"); } t << "'\n\n"; t << "# The name of the static archive.\n" - << "old_library='" << lname.left(lname.length()-Option::libtool_ext.length()) << ".a'\n\n"; + << "old_library='"; + if(project->isActiveConfig("staticlib")) { + t << lname.left(lname.length()-Option::libtool_ext.length()) << ".a"; + } + t << "'\n\n"; t << "# Libraries that this one depends upon.\n"; QStringList libs; @@ -1513,7 +1502,7 @@ UnixMakefileGenerator::pkgConfigFileName() QString ret = var("TARGET"); int slsh = ret.findRev(Option::dir_sep); if(slsh != -1) - ret = ret.right(ret.length() - slsh); + ret = ret.right(ret.length() - slsh - 1); if(ret.startsWith("lib")) ret = ret.mid(3); int dot = ret.find('.'); @@ -1557,23 +1546,38 @@ UnixMakefileGenerator::writePkgConfigFile() // ### does make sense only for project->variables()["ALL_DEPS"].append(fname); QTextStream t(&ft); - QString prefix = pkgConfigPrefix(); - QString libDir = project->first("QMAKE_PKGCONFIG_LIBDIR"); - if(libDir.isEmpty()) - libDir = prefix + "/lib"; - QString includeDir = project->first("QMAKE_PKGCONFIG_INCDIR"); - if(includeDir.isEmpty()) - includeDir = prefix + "/include"; - QString pluginsDir = project->first("QMAKE_PKGCONFIG_PLUGINS"); - if(pluginsDir.isEmpty()) - pluginsDir = prefix + "/plugins"; - - t << "prefix=" << prefix << endl; - t << "exec_prefix=${prefix}\n" - << "libdir=" << pkgConfigFixPath(libDir) << "\n" - << "includedir=" << pkgConfigFixPath(includeDir) << endl; - // non-standard entry. Provides path for plugins - t << "pluginsdir=" << pkgConfigFixPath(pluginsDir) << endl; + QString prefix = pkgConfigPrefix(); + QString libDir = qInstallPathLibs(); + if (libDir.isEmpty()) + { + libDir = prefix + "/lib"; + } + QString includeDir = qInstallPathHeaders(); + if (includeDir.isEmpty()) + { + includeDir = prefix + "/include"; + } + QString pluginsDir = qInstallPathPlugins(); + if (pluginsDir.isEmpty()) + { + pluginsDir = prefix + "/plugins"; + } + QString translationsDir = qInstallPathTranslations(); + if (translationsDir.isEmpty()) + { + translationsDir = prefix + "/translations"; + } + + t << "prefix=" << prefix << endl + << "exec_prefix=${prefix}" << endl + << "libdir=" << pkgConfigFixPath(libDir) << endl + << "includedir=" << pkgConfigFixPath(includeDir) << endl + // non-standard entry. Provides path for plugins + << "pluginsdir=" << pkgConfigFixPath(pluginsDir) << endl + // non-standard entry. Provides path for translations + << "translationsdir=" << pkgConfigFixPath(translationsDir) << endl + << endl; + // non-standard entry. Provides useful info normally only // contained in the internal .qmake.cache file t << varGlue("CONFIG", "qt_config=", " ", "") << endl << endl; |