Changeset 29


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

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

Location:
trunk/qmake
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/qmake/generators/makefile.cpp

    r27 r29  
    100100        ret += dir;
    101101    ret += " ";
    102     if(isWindowsShell())
     102    if(isDosLikeShell())
    103103        ret += "$(MKDIR)";
    104104    else
     
    125125    }
    126126    bool ret = true;
    127 #ifdef Q_OS_WIN
     127#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    128128    bool driveExists = true;
    129129    if(!QDir::isRelativePath(path)) {
     
    11911191{
    11921192    QString rm_dir_contents("-$(DEL_FILE)");
    1193     if (!isWindowsShell()) //ick
     1193    if (!isDosLikeShell()) //ick
    11941194        rm_dir_contents = "-$(DEL_FILE) -r";
    11951195
     
    13421342            for(QStringList::ConstIterator pit = dirs.begin(); pit != dirs.end(); ++pit) {
    13431343                QString tmp_dst = fileFixify((*pit), FileFixifyAbsolute, false);
    1344                 if (!isWindowsShell() && tmp_dst.right(1) != Option::dir_sep)
     1344                if (!isDosLikeShell() && tmp_dst.right(1) != Option::dir_sep)
    13451345                    tmp_dst += Option::dir_sep;
    13461346                t << mkdir_p_asstring(filePrefixRoot(root, tmp_dst)) << "\n\t";
  • trunk/qmake/generators/makefile.h

    r2 r29  
    245245    virtual bool mergeBuildProject(MakefileGenerator * /*other*/) { return false; }
    246246    virtual bool openOutput(QFile &, const QString &build) const;
    247     virtual bool isWindowsShell() const { return Option::target_mode == Option::TARG_WIN_MODE; }
     247    virtual bool isDosLikeShell() const { return Option::target_mode == Option::TARG_WIN_MODE ||
     248                                                 Option::target_mode == Option::TARG_OS2_MODE; }
    248249};
    249250
  • trunk/qmake/generators/metamakefile.cpp

    r2 r29  
    421421#include "unixmake.h"
    422422#include "mingw_make.h"
     423#include "gnumake.h"
    423424#include "projectgenerator.h"
    424425#include "pbuilder_pbx.h"
     
    447448    } else if(gen == "MINGW") {
    448449        mkfile = new MingwMakefileGenerator;
     450    } else if(gen == "GNUMAKE") {
     451        mkfile = new GNUMakefileGenerator;
    449452    } else if(gen == "PROJECTBUILDER" || gen == "XCODE") {
    450453        mkfile = new ProjectBuilderMakefileGenerator;
  • trunk/qmake/generators/os2/gnumake.cpp

    r21 r29  
    6060}
    6161
    62 bool GNUMakefileGenerator::isWindowsShell() const
    63 {
    64 #ifdef Q_OS_WIN
     62bool GNUMakefileGenerator::isDosLikeShell() const
     63{
     64#ifdef Q_OS_OS2
    6565    return Option::shellPath.isEmpty();
    6666#else
    67     return Win32MakefileGenerator::isWindowsShell();
     67    return Win32MakefileGenerator::isDosLikeShell();
    6868#endif
    6969}
     
    162162 }
    163163
     164/* @todo remove
    164165void createLdObjectScriptFile(const QString &fileName, const QStringList &objList)
    165166{
     
    199200    }
    200201}
     202*/
    201203
    202204void GNUMakefileGenerator::writeGNUParts(QTextStream &t)
     
    368370            ar_script_file += "." + var("BUILD_NAME");
    369371        }
     372/* @todo remove
    370373        createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS"));
     374*/
    371375        objectsLinkLine = "ar -M < " + ar_script_file;
    372376    } else {
     
    375379            ld_script_file += "." + var("BUILD_NAME");
    376380        }
     381/* @todo remove
    377382        createLdObjectScriptFile(ld_script_file, project->values("OBJECTS"));
     383*/
    378384        objectsLinkLine = ld_script_file;
    379385    }
  • trunk/qmake/generators/os2/gnumake.h

    r21 r29  
    5858    QString getLibTarget();
    5959private:
    60     bool isWindowsShell() const;
     60    bool isDosLikeShell() const;
    6161    void writeGNUParts(QTextStream &);
    6262    void writeIncPart(QTextStream &t);
  • trunk/qmake/generators/win32/mingw_make.cpp

    r2 r29  
    5858}
    5959
    60 bool MingwMakefileGenerator::isWindowsShell() const
     60bool MingwMakefileGenerator::isDosLikeShell() const
    6161{
    6262#ifdef Q_OS_WIN
    6363    return Option::shellPath.isEmpty();
    6464#else
    65     return Win32MakefileGenerator::isWindowsShell();
     65    return Win32MakefileGenerator::isDosLikeShell();
    6666#endif
    6767}
  • trunk/qmake/generators/win32/mingw_make.h

    r2 r29  
    5656    QString getLibTarget();
    5757private:
    58     bool isWindowsShell() const;
     58    bool isDosLikeShell() const;
    5959    void writeMingwParts(QTextStream &);
    6060    void writeIncPart(QTextStream &t);
  • trunk/qmake/main.cpp

    r2 r29  
    9797    QString reporterPath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QDir::separator()
    9898                           + "qtusagereporter";
    99 #if defined(Q_OS_WIN)
     99#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    100100    reporterPath += ".exe";
    101101#endif
     
    105105
    106106    QString oldpwd = qmake_getpwd();
    107 #ifdef Q_WS_WIN
     107#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    108108    if(!(oldpwd.length() == 3 && oldpwd[0].isLetter() && oldpwd.endsWith(":/")))
    109109#endif
  • 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
  • trunk/qmake/project.cpp

    r28 r29  
    5959#elif defined(Q_OS_WIN32)
    6060#include <Windows.h>
     61#elif defined(Q_OS_OS2)
     62#include <qt_os2.h>
    6163#endif
    6264#include <stdio.h>
     
    31763178            }
    31773179        }
     3180#elif defined(Q_OS_OS2)
     3181        if(type == "os") {
     3182            ret = "OS2";
     3183        } else if(type == "name") {
     3184            ret = QString::fromLocal8Bit(qgetenv("HOSTNAME"));
     3185        } else if(type == "version" || type == "version_string") {
     3186            ULONG buf [3];
     3187            DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_VERSION_REVISION,
     3188                            &buf, sizeof(buf));
     3189            if(type == "version")
     3190                ret = QString().sprintf("%u.%u.%u", buf[0], buf[1], buf[2]);
     3191            else {
     3192                /* Warp 3 is reported as 20.30 */
     3193                /* Warp 4 is reported as 20.40 */
     3194                /* Aurora and eCS are reported as 20.45 */
     3195                if (buf[0] == 20 && buf[1] == 30)
     3196                    ret = "Warp3";
     3197                else if (buf[0] == 20 && buf[1] == 40)
     3198                    ret = "Warp4";
     3199                else if (buf[0] == 20 && buf[1] == 45) {
     3200                    if (QString::fromLocal8Bit(qgetenv("OS")) == "ecs")
     3201                        ret = "eComStation";
     3202                    else
     3203                        ret = "Aurora";
     3204                }
     3205                else
     3206                    ret = "Unknown";
     3207            }
     3208        } else if(type == "arch") {
     3209            ret = "x86";
     3210        }
    31783211#elif defined(Q_OS_UNIX)
    31793212        struct utsname name;
Note: See TracChangeset for help on using the changeset viewer.