Changeset 29 for trunk/qmake/option.cpp


Ignore:
Timestamp:
Jun 12, 2009, 1:32:11 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

qmake: More OS/2-specific fixes. Enabled GNUMakefileGenerator (turned on by MAKEFILE_GENERATOR=GNUMAKE).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qmake/option.cpp

    r27 r29  
    343343}
    344344
    345 #ifdef Q_OS_WIN
     345#if defined(Q_OS_WIN)
    346346static QStringList detectShellPath()
    347347{
     
    356356    }
    357357    return paths;
     358}
     359#elif defined(Q_OS_OS2)
     360static QStringList detectShellPath()
     361{
     362    /* @todo check if sh is actually the active shell of the process; relying on
     363     * the presence of sh.exe in PATH as done for Windows above is obviously not
     364     * enough */
     365    return QStringList();
    358366}
    359367#endif
     
    375383    Option::h_ext << ".h" << ".hpp" << ".hh" << ".hxx";
    376384    Option::c_ext << ".c";
    377 #ifndef Q_OS_WIN
     385#if !defined(Q_OS_WIN) && !defined(Q_OS_OS2)
    378386    Option::h_ext << ".H";
    379387#endif
     
    381389    Option::h_moc_ext = ".cpp";
    382390    Option::cpp_ext << ".cpp" << ".cc" << ".cxx";
    383 #ifndef Q_OS_WIN
     391#if !defined(Q_OS_WIN) && !defined(Q_OS_OS2)
    384392    Option::cpp_ext << ".C";
    385393#endif
     
    387395    Option::yacc_ext = ".y";
    388396    Option::pro_ext = ".pro";
    389 #ifdef Q_OS_WIN
     397#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    390398    Option::dirlist_sep = ";";
    391399    Option::shellPath = detectShellPath();
     
    404412            Option::qmake_abslocation = argv0;
    405413        } else if (argv0.contains(QLatin1Char('/'))
    406 #ifdef Q_OS_WIN
     414#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    407415                   || argv0.contains(QLatin1Char('\\'))
    408416#endif
     
    412420            QByteArray pEnv = qgetenv("PATH");
    413421            QDir currentDir = QDir::current();
    414 #ifdef Q_OS_WIN
     422#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    415423            QStringList paths = QString::fromLocal8Bit(pEnv).split(QLatin1String(";"));
    416424#else
     
    421429                    continue;
    422430                QString candidate = currentDir.absoluteFilePath(*p + QLatin1Char('/') + argv0);
    423 #ifdef Q_OS_WIN
     431#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    424432                candidate += ".exe";
    425433#endif
     
    625633    Q_ASSERT(!((flags & Option::FixPathToLocalSeparators) && (flags & Option::FixPathToTargetSeparators)));
    626634    if(flags & Option::FixPathToLocalSeparators) {
    627 #if defined(Q_OS_WIN32)
     635#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    628636        string = string.replace('/', '\\');
    629637#else
     
    719727#endif
    720728
     729#ifdef Q_OS_OS2
     730# include <qt_os2.h>
     731
     732QT_USE_NAMESPACE
     733#endif
     734
    721735QString qmake_libraryInfoFile()
    722736{
    723737    QString ret;
    724 #if defined( Q_OS_WIN )
     738#if defined(Q_OS_WIN)
    725739    QFileInfo filePath;
    726740    QT_WA({
     
    733747        filePath = QString::fromLocal8Bit(module_name);
    734748    });
     749    ret = filePath.filePath();
     750#elif defined(Q_OS_OS2)
     751    QFileInfo filePath;
     752    static char appFileName[CCHMAXPATH] = "\0";
     753    if (!appFileName[0]) {
     754        PPIB ppib;
     755        DosGetInfoBlocks(NULL, &ppib);
     756        DosQueryModuleName(ppib->pib_hmte, sizeof(appFileName), appFileName);
     757    }
     758    filePath = QString::fromLocal8Bit(appFileName);
    735759    ret = filePath.filePath();
    736760#else
Note: See TracChangeset for help on using the changeset viewer.