Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/qmake/generators/makefile.cpp

    r535 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the qmake application of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    122122    if(path.startsWith(QDir::separator())) {
    123123        d.cd(QString(QDir::separator()));
    124         path = path.right(path.length() - 1);
     124        path.remove(0, 1);
    125125    }
    126126    bool ret = true;
     
    130130        if(QFile::exists(path.left(3))) {
    131131            d.cd(path.left(3));
    132             path = path.right(path.length() - 3);
     132            path.remove(0, 3);
    133133        } else {
    134134            warn_msg(WarnLogic, "Cannot access drive '%s' (%s)",
     
    202202           v.contains("QMAKE_ABSOLUTE_SOURCE_ROOT")) {
    203203            QString root = v["QMAKE_ABSOLUTE_SOURCE_ROOT"].first();
    204             root = Option::fixPathToTargetOS(root);
     204            root = QDir::fromNativeSeparators(root);
    205205            if(!root.isEmpty()) {
    206206                QFileInfo fi = fileInfo(Option::mkfile::cachefile);
     
    208208                    QString cache_r = fi.path(), pwd = Option::output_dir;
    209209                    if(pwd.startsWith(cache_r) && !pwd.startsWith(root)) {
    210                         pwd = Option::fixPathToTargetOS(root + pwd.mid(cache_r.length()));
     210                        pwd = root + pwd.mid(cache_r.length());
    211211                        if(exists(pwd))
    212212                            v.insert("QMAKE_ABSOLUTE_SOURCE_PATH", QStringList(pwd));
     
    218218    if(!v["QMAKE_ABSOLUTE_SOURCE_PATH"].isEmpty()) {
    219219        QString &asp = v["QMAKE_ABSOLUTE_SOURCE_PATH"].first();
    220         asp = Option::fixPathToTargetOS(asp);
     220        asp = QDir::fromNativeSeparators(asp);
    221221        if(asp.isEmpty() || asp == Option::output_dir) //if they're the same, why bother?
    222222            v["QMAKE_ABSOLUTE_SOURCE_PATH"].clear();
     
    244244#endif
    245245        {
    246             if(pathRef.right(Option::dir_sep.length()) != Option::dir_sep)
     246            if(!pathRef.endsWith(Option::dir_sep))
    247247                pathRef += Option::dir_sep;
    248248        }
     
    276276                if(slash != -1) {
    277277                    path = path.left(slash);
    278                     if(path != "." &&
    279                        !mkdir(fileFixify(path, qmake_getpwd(), Option::output_dir)))
    280                         warn_msg(WarnLogic, "%s: Cannot access directory '%s'",
    281                                  (*it).toLatin1().constData(), path.toLatin1().constData());
     278                    // Make out path only if it does not contain makefile variables
     279                    if(!path.contains("${"))
     280                        if(path != "." &&
     281                           !mkdir(fileFixify(path, qmake_getpwd(), Option::output_dir)))
     282                            warn_msg(WarnLogic, "%s: Cannot access directory '%s'",
     283                                     (*it).toLatin1().constData(), path.toLatin1().constData());
    282284                }
    283285            }
     
    290292            v.remove("DESTDIR");
    291293    }
    292     QDir::current().cd(currentDir);
    293294}
    294295
     
    346347                    if(exists(real_dir + QDir::separator() + val)) {
    347348                        QString dir = (*vpath_it);
    348                         if(dir.right(Option::dir_sep.length()) != Option::dir_sep)
     349                        if(!dir.endsWith(Option::dir_sep))
    349350                            dir += Option::dir_sep;
    350351                        val = dir + val;
     
    365366                    if(!(flags & VPATH_NoFixify))
    366367                        real_dir = fileFixify(real_dir, qmake_getpwd(), Option::output_dir);
    367                     regex = regex.right(regex.length() - dir.length());
     368                    regex.remove(0, dir.length());
    368369                }
    369370                if(real_dir.isEmpty() || exists(real_dir)) {
     
    725726            QString cache_file;
    726727            if(!project->isEmpty("QMAKE_INTERNAL_CACHE_FILE")) {
    727                 cache_file = Option::fixPathToLocalOS(project->first("QMAKE_INTERNAL_CACHE_FILE"));
     728                cache_file = QDir::fromNativeSeparators(project->first("QMAKE_INTERNAL_CACHE_FILE"));
    728729            } else {
    729730                cache_file = ".qmake.internal.cache";
     
    731732                    cache_file += ".BUILD." + project->first("BUILD_PASS");
    732733            }
    733             if(cache_file.indexOf(QDir::separator()) == -1)
    734                 cache_file.prepend(Option::output_dir + QDir::separator());
     734            if(cache_file.indexOf('/') == -1)
     735                cache_file.prepend(Option::output_dir + '/');
    735736            QMakeSourceFileInfo::setCacheFile(cache_file);
    736737        }
     
    789790                        if(regex.lastIndexOf(Option::dir_sep) != -1) {
    790791                            dir = regex.left(regex.lastIndexOf(Option::dir_sep) + 1);
    791                             regex = regex.right(regex.length() - dir.length());
     792                            regex.remove(0, dir.length());
    792793                        }
    793794                        QStringList files = QDir(dir).entryList(QStringList(regex));
     
    939940    int slsh = target.lastIndexOf(Option::dir_sep);
    940941    if(slsh != -1)
    941         target = target.right(target.length() - slsh - 1);
     942        target.remove(0, slsh + 1);
    942943    QString bdir = Option::output_dir;
    943944    if(bdir.isEmpty())
     
    968969    if(project->isActiveConfig("staticlib") || project->isActiveConfig("explicitlib") ||
    969970       !project->isEmpty("PRL_EXPORT_LIBS")) {
     971        if(project->isActiveConfig("staticlib"))
     972            libs << "QMAKE_LIBS_PRIVATE";
    970973        t << "QMAKE_PRL_LIBS = ";
    971974        if (!project->isEmpty("PRL_EXPORT_LIBS")) {
     
    10661069    int slsh = ret.lastIndexOf(Option::dir_sep);
    10671070    if(slsh != -1)
    1068         ret = ret.right(ret.length() - slsh);
     1071        ret.remove(0, slsh);
    10691072    if(!ret.endsWith(Option::prl_ext)) {
    10701073        int dot = ret.indexOf('.');
    10711074        if(dot != -1)
    1072             ret = ret.left(dot);
     1075            ret.truncate(dot);
    10731076        ret += Option::prl_ext;
    10741077    }
     
    12691272                if(slsh != -1) {
    12701273                    dirstr = filestr.left(slsh+1);
    1271                     filestr = filestr.right(filestr.length() - slsh - 1);
    1272                 }
    1273                 if(dirstr.right(Option::dir_sep.length()) != Option::dir_sep)
     1274                    filestr.remove(0, slsh+1);
     1275                }
     1276                if(!dirstr.endsWith(Option::dir_sep))
    12741277                    dirstr += Option::dir_sep;
    12751278                if(exists(wild)) { //real file
     
    13711374            for(QStringList::ConstIterator pit = dirs.begin(); pit != dirs.end(); ++pit) {
    13721375                QString tmp_dst = fileFixify((*pit), FileFixifyAbsolute, false);
    1373                 if (!isDosLikeShell() && tmp_dst.right(1) != Option::dir_sep)
     1376                if (!isDosLikeShell() && !tmp_dst.endsWith(Option::dir_sep))
    13741377                    tmp_dst += Option::dir_sep;
    13751378                t << mkdir_p_asstring(filePrefixRoot(root, tmp_dst)) << "\n\t";
     
    15221525        }
    15231526        if(val.isEmpty() && var.startsWith(QLatin1String("QMAKE_VAR_FIRST_"))) {
    1524             const QString varname = var.mid(12);
     1527            const QString varname = var.mid(16);
    15251528            val += project->first(varname);
    15261529        }
     
    16101613        if(!file.isNull()) {
    16111614            QMakeSourceFileInfo::addSourceFile(file, QMakeSourceFileInfo::SEEK_MOCS);
    1612             if(!mocable(file))
     1615            if(!mocable(file)) {
    16131616                return false;
     1617            } else {
     1618                project->values("MOCABLES").append(file);
     1619            }
    16141620        }
    16151621    } else if(project->values(comp + ".CONFIG").indexOf("function_verify") != -1) {
     
    17281734            t << "\n\t" << cmd;
    17291735        t << endl << endl;
     1736
     1737                project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(targ);
     1738                project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(targ)) << deps.split(" ", QString::SkipEmptyParts);
     1739                project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(targ)) << cmd;
    17301740    }
    17311741}
     
    18171827            const QString del_suffix =
    18181828                Option::target_mode == Option::TARG_OS2_MODE ?
    1819                     QString(" >nul 2>&1"): // reduce noise
     1829                    QString(" >nul 2>&1") : // reduce noise
     1830                isForSymbian() ?
     1831                    QString(" 2> NUL") :
    18201832                    QString::null;
    18211833
    18221834            if(tmp_clean.indexOf("${QMAKE_") == -1) {
    18231835                t << "\n\t" << del_statement << " " << tmp_clean << del_suffix;
     1836                if (isForSymbian())
     1837                    t << " 2> NUL"; // Eliminate unnecessary warnings
    18241838                wrote_clean = true;
    18251839            }
     
    19271941                continue;
    19281942
    1929             QString cmd = replaceExtraCompilerVariables(tmp_cmd, escapeFilePaths(inputs), QStringList(tmp_out));
     1943            QString cmd;
     1944            if (isForSymbianSbsv2()) {
     1945                // In sbsv2 the command inputs and outputs need to use absolute paths
     1946                cmd = replaceExtraCompilerVariables(tmp_cmd,
     1947                    fileFixify(escapeFilePaths(inputs), FileFixifyAbsolute),
     1948                    fileFixify(QStringList(tmp_out), FileFixifyAbsolute));
     1949            } else {
     1950                cmd = replaceExtraCompilerVariables(tmp_cmd, escapeFilePaths(inputs), QStringList(tmp_out));
     1951            }
     1952
    19301953            t << escapeDependencyPath(tmp_out) << ":";
     1954            project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(tmp_out);
    19311955            // compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies
    19321956            if(project->values((*it) + ".CONFIG").indexOf("explicit_dependencies") != -1) {
    19331957                t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, Option::output_dir, Option::output_dir)));
     1958                project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(tmp_out)) << tmp_dep;
    19341959            } else {
    19351960                t << " " << valList(escapeDependencyPaths(inputs)) << " " << valList(escapeDependencyPaths(deps));
     1961                project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(tmp_out)) << inputs << deps;
    19361962            }
    19371963            t << "\n\t" << cmd << endl << endl;
     1964            project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(tmp_out)) << cmd;
    19381965            continue;
    19391966        }
     
    19491976            }
    19501977            QString cmd = replaceExtraCompilerVariables(tmp_cmd, (*input), out);
     1978            // NOTE: The var -> QMAKE_COMP_var replace feature is unsupported, do not use!
     1979            if (isForSymbianSbsv2()) {
     1980                // In sbsv2 the command inputs and outputs need to use absolute paths
     1981                cmd = replaceExtraCompilerVariables(tmp_cmd,
     1982                    fileFixify((*input), FileFixifyAbsolute),
     1983                    fileFixify(out, FileFixifyAbsolute));
     1984            } else {
     1985                cmd = replaceExtraCompilerVariables(tmp_cmd, (*input), out);
     1986            }
    19511987            for(QStringList::ConstIterator it3 = vars.constBegin(); it3 != vars.constEnd(); ++it3)
    19521988                cmd.replace("$(" + (*it3) + ")", "$(QMAKE_COMP_" + (*it3)+")");
     
    20382074            t << escapeDependencyPath(out) << ": " << valList(escapeDependencyPaths(deps)) << "\n\t"
    20392075              << cmd << endl << endl;
     2076            project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(out);
     2077            project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(out)) << deps;
     2078            project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(out)) << cmd;
    20402079        }
    20412080    }
     
    21532192    else if(Option::target_mode == Option::TARG_OS2_MODE)
    21542193        ret += " -os2";
    2155     else if(Option::target_mode == Option::TARG_QNX6_MODE)
    2156         ret += " -qnx6";
    21572194
    21582195    //configs
     
    22132250}
    22142251
    2215 void
    2216 MakefileGenerator::writeSubDirs(QTextStream &t)
     2252QList<MakefileGenerator::SubTarget*>
     2253MakefileGenerator::findSubDirsSubTargets() const
    22172254{
    22182255    QList<SubTarget*> targets;
     
    22562293                st->in_directory = file;
    22572294            }
    2258             while(st->in_directory.right(1) == Option::dir_sep)
    2259                 st->in_directory = st->in_directory.left(st->in_directory.length() - 1);
     2295            while(st->in_directory.endsWith(Option::dir_sep))
     2296                st->in_directory.chop(1);
    22602297            if(fileInfo(st->in_directory).isRelative())
    22612298                st->out_directory = st->in_directory;
     
    23112348        }
    23122349    }
     2350    return targets;
     2351}
     2352
     2353void
     2354MakefileGenerator::writeSubDirs(QTextStream &t)
     2355{
     2356    QList<SubTarget*> targets = findSubDirsSubTargets();
    23132357    t << "first: make_default" << endl;
    23142358    int flags = SubTargetInstalls;
     
    23272371        t << "include " << (*qeui_it) << endl;
    23282372
    2329     QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
    2330     if(ofile.lastIndexOf(Option::dir_sep) != -1)
    2331         ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1);
    2332     t << "MAKEFILE      = " << ofile << endl;
    2333     /* Calling Option::fixPathToTargetOS() is necessary for MinGW/MSYS, which requires
    2334      * back-slashes to be turned into slashes. */
    2335     t << "QMAKE         = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl;
    2336     t << "DEL_FILE      = " << var("QMAKE_DEL_FILE") << endl;
    2337     t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
    2338     t << "MKDIR         = " << var("QMAKE_MKDIR") << endl;
    2339     t << "COPY          = " << var("QMAKE_COPY") << endl;
    2340     t << "COPY_FILE     = " << var("QMAKE_COPY_FILE") << endl;
    2341     t << "COPY_DIR      = " << var("QMAKE_COPY_DIR") << endl;
    2342     t << "INSTALL_FILE  = " << var("QMAKE_INSTALL_FILE") << endl;
    2343     t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
    2344     t << "INSTALL_DIR   = " << var("QMAKE_INSTALL_DIR") << endl;
    2345     t << "DEL_FILE      = " << var("QMAKE_DEL_FILE") << endl;
    2346     t << "SYMLINK       = " << var("QMAKE_SYMBOLIC_LINK") << endl;
    2347     t << "DEL_DIR       = " << var("QMAKE_DEL_DIR") << endl;
    2348     t << "MOVE          = " << var("QMAKE_MOVE") << endl;
    2349     t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
    2350     t << "MKDIR         = " << var("QMAKE_MKDIR") << endl;
     2373    if (!(flags & SubTargetSkipDefaultVariables)) {
     2374        QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
     2375        if(ofile.lastIndexOf(Option::dir_sep) != -1)
     2376            ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1);
     2377        t << "MAKEFILE      = " << ofile << endl;
     2378        /* Calling Option::fixPathToTargetOS() is necessary for MinGW/MSYS, which requires
     2379         * back-slashes to be turned into slashes. */
     2380        t << "QMAKE         = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl;
     2381        t << "DEL_FILE      = " << var("QMAKE_DEL_FILE") << endl;
     2382        t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
     2383        t << "MKDIR         = " << var("QMAKE_MKDIR") << endl;
     2384        t << "COPY          = " << var("QMAKE_COPY") << endl;
     2385        t << "COPY_FILE     = " << var("QMAKE_COPY_FILE") << endl;
     2386        t << "COPY_DIR      = " << var("QMAKE_COPY_DIR") << endl;
     2387        t << "INSTALL_FILE  = " << var("QMAKE_INSTALL_FILE") << endl;
     2388        t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
     2389        t << "INSTALL_DIR   = " << var("QMAKE_INSTALL_DIR") << endl;
     2390        t << "DEL_FILE      = " << var("QMAKE_DEL_FILE") << endl;
     2391        t << "SYMLINK       = " << var("QMAKE_SYMBOLIC_LINK") << endl;
     2392        t << "DEL_DIR       = " << var("QMAKE_DEL_DIR") << endl;
     2393        t << "MOVE          = " << var("QMAKE_MOVE") << endl;
     2394        t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
     2395        t << "MKDIR         = " << var("QMAKE_MKDIR") << endl;
     2396        t << "SUBTARGETS    = ";     // subtargets are sub-directory
     2397        for(int target = 0; target < targets.size(); ++target)
     2398            t << " \\\n\t\t" << targets.at(target)->target;
     2399        t << endl << endl;
     2400    }
    23512401    writeExtraVariables(t);
    2352     t << "SUBTARGETS    = ";     // subtargets are sub-directory
    2353     for(int target = 0; target < targets.size(); ++target)
    2354         t << " \\\n\t\t" << targets.at(target)->target;
    2355     t << endl << endl;
    23562402
    23572403    QStringList targetSuffixes;
    23582404    const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH");
    2359     targetSuffixes << "make_default" << "make_first" << "all" << "clean" << "distclean"
    2360                    << QString((flags & SubTargetInstalls) ? "install_subtargets" : "install")
    2361                    << QString((flags & SubTargetInstalls) ? "uninstall_subtargets" : "uninstall");
     2405    if (!(flags & SubTargetSkipDefaultTargets)) {
     2406        targetSuffixes << "make_default" << "make_first" << "all" << "clean" << "distclean"
     2407                       << QString((flags & SubTargetInstalls) ? "install_subtargets" : "install")
     2408                       << QString((flags & SubTargetInstalls) ? "uninstall_subtargets" : "uninstall");
     2409    }
    23622410
    23632411    // generate target rules
     
    24792527    t << endl;
    24802528
    2481     if(project->values("QMAKE_INTERNAL_QMAKE_DEPS").indexOf("qmake_all") == -1)
    2482         project->values("QMAKE_INTERNAL_QMAKE_DEPS").append("qmake_all");
    2483 
    2484     writeMakeQmake(t);
    2485 
    2486     t << "qmake_all:";
    2487     if(!targets.isEmpty()) {
    2488         for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it) {
    2489             if(!(*it)->profile.isEmpty())
    2490                 t << " " << (*it)->target << "-" << "qmake_all";
    2491         }
    2492     }
    2493     if(project->isEmpty("QMAKE_NOFORCE"))
    2494         t <<  " FORCE";
    2495     if(project->isActiveConfig("no_empty_targets"))
    2496         t << "\n\t" << "@cd .";
    2497     t << endl << endl;
     2529    if (!(flags & SubTargetSkipDefaultTargets)) {
     2530        if(project->values("QMAKE_INTERNAL_QMAKE_DEPS").indexOf("qmake_all") == -1)
     2531            project->values("QMAKE_INTERNAL_QMAKE_DEPS").append("qmake_all");
     2532
     2533        writeMakeQmake(t);
     2534
     2535        t << "qmake_all:";
     2536        if(!targets.isEmpty()) {
     2537            for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it) {
     2538                if(!(*it)->profile.isEmpty())
     2539                    t << " " << (*it)->target << "-" << "qmake_all";
     2540            }
     2541        }
     2542        if(project->isEmpty("QMAKE_NOFORCE"))
     2543            t <<  " FORCE";
     2544        if(project->isActiveConfig("no_empty_targets"))
     2545            t << "\n\t" << "@cd .";
     2546        t << endl << endl;
     2547    }
    24982548
    24992549    for(int s = 0; s < targetSuffixes.size(); ++s) {
     
    25042554        t << suffix << ":";
    25052555        for(int target = 0; target < targets.size(); ++target) {
    2506             QString targetRule = targets.at(target)->target + "-" + suffix;
     2556            SubTarget *subTarget = targets.at(target);
     2557            if((suffix == "make_first" || suffix == "make_default")
     2558                && project->values(subTarget->name + ".CONFIG").indexOf("no_default_target") != -1) {
     2559                continue;
     2560            }
     2561            QString targetRule = subTarget->target + "-" + suffix;
    25072562            if(flags & SubTargetOrdered)
    25082563                targetRule += "-ordered";
     
    27682823
    27692824    //do the fixin'
    2770     const QString pwd = qmake_getpwd() + "/";
     2825    QString pwd = qmake_getpwd();
     2826    if (!pwd.endsWith('/'))
     2827        pwd += '/';
    27712828    QString orig_file = ret;
    27722829    if(ret.startsWith(QLatin1Char('~'))) {
    27732830        if(ret.startsWith(QLatin1String("~/")))
    2774             ret = QDir::homePath() + Option::dir_sep + ret.mid(1);
     2831            ret = QDir::homePath() + ret.mid(1);
    27752832        else
    27762833            warn_msg(WarnLogic, "Unable to expand ~ in %s", ret.toLatin1().constData());
     
    28612918    int slsh = f.lastIndexOf(Option::dir_sep);
    28622919    if(slsh != -1)
    2863         file = file.right(file.length() - slsh - 1);
     2920        file.remove(0, slsh + 1);
    28642921    QStringList &l = project->values(w);
    28652922    for(QStringList::Iterator val_it = l.begin(); val_it != l.end(); ++val_it) {
     
    28672924        slsh = file2.lastIndexOf(Option::dir_sep);
    28682925        if(slsh != -1)
    2869             file2 = file2.right(file2.length() - slsh - 1);
     2926            file2.remove(0, slsh + 1);
    28702927        if(file2 == file) {
    28712928            warn_msg(WarnLogic, "Found potential symbol conflict of %s (%s) in %s",
     
    30213078            QFileInfo fi(fileInfo(file.fileName()));
    30223079            if(fi.isDir())
    3023                 outdir = file.fileName() + QDir::separator();
     3080                outdir = file.fileName() + '/';
    30243081        }
    30253082        if(!outdir.isEmpty() || file.fileName().isEmpty()) {
     
    30413098    if(project->isEmpty("QMAKE_MAKEFILE"))
    30423099        project->values("QMAKE_MAKEFILE").append(file.fileName());
    3043     int slsh = file.fileName().lastIndexOf(Option::dir_sep);
     3100    int slsh = file.fileName().lastIndexOf('/');
    30443101    if(slsh != -1)
    30453102        mkdir(file.fileName().left(slsh));
     
    30513108        else
    30523109            od = fi.path();
    3053         od = Option::fixPathToTargetOS(od);
    3054         if(QDir::isRelativePath(od))
    3055             od.prepend(Option::output_dir);
     3110        od = QDir::fromNativeSeparators(od);
     3111        if(QDir::isRelativePath(od)) {
     3112            QString dir = Option::output_dir;
     3113            if (!dir.endsWith('/') && !od.isEmpty())
     3114                dir += '/';
     3115            od.prepend(dir);
     3116        }
    30563117        Option::output_dir = od;
    30573118        return true;
Note: See TracChangeset for help on using the changeset viewer.