Ticket #196: gnumake.diff

File gnumake.diff, 3.6 KB (added by rudi, 13 years ago)

Change for gnumake.cpp

  • gnumake.cpp

     
    213213    QStringList seen;
    214214
    215215    for (QStringList::Iterator it = libs.begin(); it != libs.end(); /*below*/) {
    216         QString &lib = *it;
     216        QString &lib = *it;
    217217
     218        if (lib.startsWith("\"") && lib.endsWith("\""))
     219            lib = lib.mid(1, lib.length()-2);
     220       
    218221        if (lib.startsWith("-L")) {
    219222            // this is a library path
    220             dirs.append(QMakeLocalFileName((*it).mid(2)));
     223            dirs.append(QMakeLocalFileName(lib.mid(2)));
    221224            ++it;
    222225            continue;
    223226        }
     
    423426    if (!project->first("PRECOMPILED_HEADER").isEmpty()
    424427        && project->isActiveConfig("precompile_header")) {
    425428        QString preCompHeader = var("PRECOMPILED_DIR")
    426                          + QFileInfo(project->first("PRECOMPILED_HEADER")).fileName();
     429                         + QFileInfo(project->first("PRECOMPILED_HEADER")).fileName();
    427430        preCompHeaderOut = preCompHeader + ".gch";
    428431        project->values("QMAKE_CLEAN").append(preCompHeaderOut + Option::dir_sep + "c");
    429432        project->values("QMAKE_CLEAN").append(preCompHeaderOut + Option::dir_sep + "c++");
    430433
    431434        project->values("QMAKE_RUN_CC").clear();
    432             project->values("QMAKE_RUN_CC").append("$(CC) -c -include " + preCompHeader +
     435            project->values("QMAKE_RUN_CC").append("$(CC) -c -include " + preCompHeader +
    433436                                               " $(CFLAGS) $(INCPATH) -o $obj $src");
    434437        project->values("QMAKE_RUN_CC_IMP").clear();
    435438        project->values("QMAKE_RUN_CC_IMP").append("$(CC)  -c -include " + preCompHeader +
     
    489492        foreach(const QString &libVar, libVars) {
    490493            QStringList libs = project->values(libVar);
    491494            for(QStringList::Iterator it = libs.begin(); it != libs.end(); ++it) {
    492                 QString lib = escapeFilePath(*it);
     495                QString &lib = *it;
     496
     497                if (lib.startsWith("\"") && lib.endsWith("\""))
     498                   lib = lib.mid(1, lib.length()-2);
     499
    493500                /* lib may be prefixed with -l which is commonly used in e.g. PRF
    494501                 * (feature) files on all platforms; remove it before prepending
    495502                 * the compiler-specific option. There is even more weird case
     
    497504                 * this as well and replace it with the proper option. */
    498505                if (lib.startsWith("-L")) {
    499506                    lib = lib.mid(2);
    500                     t << " " << optL << lib;
     507                    t << " " << escapeFilePath(optL + lib);
    501508                } else {
    502509                    if (lib.startsWith("-l"))
    503510                        lib = lib.mid(2);
    504                     t << " " << opt << lib;
     511                    t << " " << escapeFilePath(opt + lib);
    505512                }
    506513            }
    507514        }
     
    638645            fprintf(stderr, "Please specify one of them, not both.");
    639646            exit(1);
    640647        }
    641         project->values("RES_FILE").prepend(escapeFilePath(QString("$(OBJECTS_DIR)") +
     648        project->values("RES_FILE").prepend(escapeFilePath(QString("$(OBJECTS_DIR)") +
    642649                                                           QDir::separator() +
    643650                                                           QFileInfo(var("RC_FILE")).baseName() +
    644651                                                           ".res"));
    645         project->values("CLEAN_FILES") += "$(RES_FILE)";
     652        project->values("CLEAN_FILES") += "$(RES_FILE)";
    646653    }
    647654
    648655    if (!project->isEmpty("RES_FILE"))