Changeset 363 for trunk/qmake


Ignore:
Timestamp:
Nov 30, 2009, 6:52:30 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

global: Reverted r355, r356, r361, r362 (see #78).

Location:
trunk/qmake
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/qmake/cachekeys.h

    r362 r363  
    4848#include <qfile.h>
    4949#include <qfileinfo.h>
    50 #include <qdir.h>
    5150#include <qhash.h>
    5251
     
    108107            return true;
    109108
    110 #ifdef Q_OS_OS2
    111         return QDir::isRelativePath(file);
    112 #else
    113109        const QChar c0 = file.at(0);
    114110        const QChar c1 = length >= 2 ? file.at(1) : QChar(0);
     
    118114                || (c0 == QLatin1Char('/') && c1 == QLatin1Char('/'))
    119115                || (c0 == QLatin1Char('\\') && c1 == QLatin1Char('\\')));
    120 #endif   
    121116    }
    122117};
  • trunk/qmake/generators/makefile.cpp

    r362 r363  
    125125    }
    126126    bool ret = true;
    127 #if defined(Q_OS_WIN)
     127#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    128128    bool driveExists = true;
    129129    if(!QDir::isRelativePath(path)) {
     
    138138    }
    139139    if(driveExists)
    140 #elif defined(Q_OS_OS2)
    141     path = QFileInfo(path).absoluteFilePath();
    142     QString drv = path.left(3);
    143     if (!QFile::exists(drv))
    144         warn_msg(WarnLogic, "Cannot access drive '%s' (%s)",
    145                  drv.toLocal8Bit().data(), path.toLocal8Bit().data());
    146     else
    147140#endif
    148141    {
     
    348341                        vpath += Option::output_dir;
    349342                }
    350                 foreach(const QString &vp, vpath) {
    351                     QString real_val = QDir(vp).absoluteFilePath(val);
    352                     if (exists(real_val)) {
    353                         val = real_val;
     343                for(QStringList::Iterator vpath_it = vpath.begin();
     344                    vpath_it != vpath.end(); ++vpath_it) {
     345                    QString real_dir = Option::fixPathToLocalOS((*vpath_it));
     346                    if(exists(real_dir + QDir::separator() + val)) {
     347                        QString dir = (*vpath_it);
     348                        if(dir.right(Option::dir_sep.length()) != Option::dir_sep)
     349                            dir += Option::dir_sep;
     350                        val = dir + val;
    354351                        if(!(flags & VPATH_NoFixify))
    355352                            val = fileFixify(val);
     
    853850                    file = libinfo.first("QMAKE_PRL_TARGET");
    854851                    if(QDir::isRelativePath(file))
    855                         file = QDir(dir).absoluteFilePath(file);
     852                        file.prepend(dir);
    856853                }
    857854            }
     
    27372734}
    27382735
    2739 inline static bool pathEquals(const QString &path1, const QString &path2)
    2740 {
    2741 #if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    2742     return path1.compare(path2, Qt::CaseInsensitive) == 0;
    2743 #else
    2744     return path1 == path2;
    2745 #endif
    2746 }
    2747 
    2748 inline static bool pathStartsWith(const QString &path1, const QString &path2)
    2749 {
    2750 #if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    2751     return path1.toLower().startsWith(path2.toLower());
    2752 #else
    2753     return path1.startsWith(path2);
    2754 #endif
    2755 }
    2756 
    27572736QString
    27582737MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const QString &in_d,
     
    27852764    if(fix == FileFixifyAbsolute || (fix == FileFixifyDefault && project->isActiveConfig("no_fixpath"))) {
    27862765        if(fix == FileFixifyAbsolute && QDir::isRelativePath(ret)) //already absolute
    2787             ret = QDir(pwd).absoluteFilePath(ret);
     2766            ret.prepend(pwd);
    27882767        ret = Option::fixPathToTargetOS(ret, false, canon);
    27892768    } else { //fix it..
     
    28032782        if(out_dir != in_dir || !qfileinfo.isRelative()) {
    28042783            if(qfileinfo.isRelative()) {
    2805                 ret = QDir(in_dir).absoluteFilePath(qfile);
     2784                ret = in_dir + "/" + qfile;
    28062785                qfileinfo.setFile(ret);
    28072786            }
    28082787            ret = Option::fixPathToTargetOS(ret, false, canon);
    28092788            if(canon && qfileinfo.exists() &&
    2810                pathEquals(file, Option::fixPathToTargetOS(ret, true, canon)))
     2789               file == Option::fixPathToTargetOS(ret, true, canon))
    28112790                ret = Option::fixPathToTargetOS(qfileinfo.canonicalFilePath());
    28122791            QString match_dir = Option::fixPathToTargetOS(out_dir, false, canon);
    2813             if(pathEquals(ret, match_dir)) {
     2792            if(ret == match_dir) {
    28142793                ret = "";
    2815             } else if(pathStartsWith(ret, match_dir + Option::dir_sep)) {
     2794            } else if(ret.startsWith(match_dir + Option::dir_sep)) {
    28162795                ret = ret.mid(match_dir.length() + Option::dir_sep.length());
    28172796            } else {
     
    28342813                    if(match_dir.isEmpty())
    28352814                        break;
    2836                     if(pathStartsWith(ret, match_dir + Option::dir_sep)) {
     2815                    if(ret.startsWith(match_dir + Option::dir_sep)) {
    28372816                        //concat
    28382817                        int remlen = ret.length() - (match_dir.length() + 1);
     
    30253004        if(!file.fileName().isEmpty()) {
    30263005            if(QDir::isRelativePath(file.fileName()))
    3027                 file.setFileName(QDir(Option::output_dir).absoluteFilePath(file.fileName())); //pwd when qmake was run
     3006                file.setFileName(Option::output_dir + "/" + file.fileName()); //pwd when qmake was run
    30283007            QFileInfo fi(fileInfo(file.fileName()));
    30293008            if(fi.isDir())
     
    30383017    }
    30393018    if(QDir::isRelativePath(file.fileName())) {
    3040         file.setFileName(QDir(Option::output_dir).absoluteFilePath(file.fileName())); //pwd when qmake was run
     3019        QString fname = Option::output_dir;  //pwd when qmake was run
     3020        if(!fname.endsWith("/"))
     3021            fname += "/";
     3022        fname += file.fileName();
     3023        file.setFileName(fname);
    30413024    }
    30423025    if(!build.isEmpty())
     
    30563039        od = Option::fixPathToTargetOS(od);
    30573040        if(QDir::isRelativePath(od))
    3058             od = QDir(Option::output_dir).absoluteFilePath(od);
     3041            od.prepend(Option::output_dir);
    30593042        Option::output_dir = od;
    30603043        return true;
  • trunk/qmake/generators/makefiledeps.cpp

    r362 r363  
    625625                    if(try_local) {
    626626                        QString dir = findFileInfo(file->file).path();
    627                         QMakeLocalFileName f(QDir(dir).absoluteFilePath(lfn.local()));
     627                        if(QDir::isRelativePath(dir))
     628                            dir.prepend(qmake_getpwd() + "/");
     629                        if(!dir.endsWith("/"))
     630                            dir += "/";
     631                        QMakeLocalFileName f(dir + lfn.local());
    628632                        if(findFileInfo(f).exists()) {
    629633                            lfn = fixPathForFile(f);
     
    632636                    }
    633637                    if(!exists) { //path lookup
    634                         foreach(const QMakeLocalFileName &dd, depdirs) {
    635                             QMakeLocalFileName f(QDir(dd.real()).absoluteFilePath(lfn.real()));
     638                        for(QList<QMakeLocalFileName>::Iterator it = depdirs.begin(); it != depdirs.end(); ++it) {
     639                            QMakeLocalFileName f((*it).real() + Option::dir_sep + lfn.real());
    636640                            QFileInfo fi(findFileInfo(f));
    637641                            if(fi.exists() && !fi.isDir()) {
  • trunk/qmake/generators/metamakefile.cpp

    r362 r363  
    325325            sub->input_dir = subdir.absolutePath();
    326326            if(subdir.isRelative() && old_output_dir != oldpwd) {
    327                 sub->output_dir = QDir(old_output_dir).absoluteFilePath(subdir.path());
     327                sub->output_dir = old_output_dir + "/" + subdir.path();
    328328                printf("Reading %s [%s]\n", subdir.absoluteFilePath().toLatin1().constData(), sub->output_dir.toLatin1().constData());
    329329            } else { //what about shadow builds?
  • trunk/qmake/generators/win32/winmakefile.cpp

    r362 r363  
    246246                        tmp = opt;
    247247                    for(QList<QMakeLocalFileName>::Iterator it = libdirs.begin(); it != libdirs.end(); ++it) {
    248                         QString prl = QDir((*it).local()).absoluteFilePath(tmp);
     248                        QString prl = (*it).local() + Option::dir_sep + tmp;
    249249                        // the original is used as the key
    250250                        QString orgprl = prl;
  • trunk/qmake/main.cpp

    r362 r363  
    127127            Option::output_dir = dir;
    128128        if(QDir::isRelativePath(Option::output_dir))
    129             Option::output_dir = QDir(oldpwd).absoluteFilePath(Option::output_dir);
     129            Option::output_dir.prepend(oldpwd);
    130130        Option::output_dir = QDir::cleanPath(Option::output_dir);
    131131    }
  • trunk/qmake/meta.cpp

    r362 r363  
    163163                        QString targ = dirs[i] + (*lst_it);
    164164                        if(QDir::isRelativePath(targ))
    165                             targ = QDir(qmake_getpwd()).absoluteFilePath(targ);
     165                            targ.prepend(qmake_getpwd() + QDir::separator());
    166166                        vars["QMAKE_PRL_TARGET"] << targ;
    167167                        found = true;
  • trunk/qmake/project.cpp

    r362 r363  
    14571457                if (QFile::exists(qmakespec+"/qmake.conf")) {
    14581458                    Option::mkfile::qmakespec = QFileInfo(Option::mkfile::qmakespec).absoluteFilePath();
     1459                } else if (QFile::exists(Option::output_dir+"/"+qmakespec+"/qmake.conf")) {
     1460                    qmakespec = Option::mkfile::qmakespec = QFileInfo(Option::output_dir+"/"+qmakespec).absoluteFilePath();
    14591461                } else {
    1460                     QString tmp = QDir(Option::output_dir).absoluteFilePath(qmakespec);
    1461                     if (QFile::exists(tmp+"/qmake.conf"))
    1462                         qmakespec = Option::mkfile::qmakespec = tmp;
    1463                     else {
    1464                         bool found_mkspec = false;
    1465                         foreach(const QString &root, mkspec_roots) {
    1466                             QString mkspec = QDir(root).absoluteFilePath(qmakespec);
    1467                             if(QFile::exists(mkspec)) {
    1468                                 found_mkspec = true;
    1469                                 Option::mkfile::qmakespec = qmakespec = mkspec;
    1470                                 break;
    1471                             }
     1462                    bool found_mkspec = false;
     1463                    for(QStringList::ConstIterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) {
     1464                        QString mkspec = (*it) + QDir::separator() + qmakespec;
     1465                        if(QFile::exists(mkspec)) {
     1466                            found_mkspec = true;
     1467                            Option::mkfile::qmakespec = qmakespec = mkspec;
     1468                            break;
    14721469                        }
    1473                         if(!found_mkspec) {
    1474                             fprintf(stderr, "Could not find mkspecs for your QMAKESPEC(%s) after trying:\n\t%s\n",
    1475                                     qmakespec.toLatin1().constData(), mkspec_roots.join("\n\t").toLatin1().constData());
    1476                             return false;
    1477                         }
     1470                    }
     1471                    if(!found_mkspec) {
     1472                        fprintf(stderr, "Could not find mkspecs for your QMAKESPEC(%s) after trying:\n\t%s\n",
     1473                                qmakespec.toLatin1().constData(), mkspec_roots.join("\n\t").toLatin1().constData());
     1474                        return false;
    14781475                    }
    14791476                }
     
    17781775            include_roots << qmake_getpwd();
    17791776        include_roots << Option::output_dir;
    1780         foreach(const QString &root, include_roots) {
    1781             QString testName = QDir(root).absoluteFilePath(file);
     1777        for(int root = 0; root < include_roots.size(); ++root) {
     1778            QString testName = QDir::toNativeSeparators(include_roots[root]);
     1779            if (!testName.endsWith(QString(QDir::separator())))
     1780                testName += QDir::separator();
     1781            testName += file;
    17821782            if(QFile::exists(testName)) {
    17831783                file = testName;
Note: See TracChangeset for help on using the changeset viewer.