Changeset 29
- Timestamp:
- Jun 12, 2009, 1:32:11 PM (16 years ago)
- Location:
- trunk/qmake
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/qmake/generators/makefile.cpp
r27 r29 100 100 ret += dir; 101 101 ret += " "; 102 if(is WindowsShell())102 if(isDosLikeShell()) 103 103 ret += "$(MKDIR)"; 104 104 else … … 125 125 } 126 126 bool ret = true; 127 #if def Q_OS_WIN127 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 128 128 bool driveExists = true; 129 129 if(!QDir::isRelativePath(path)) { … … 1191 1191 { 1192 1192 QString rm_dir_contents("-$(DEL_FILE)"); 1193 if (!is WindowsShell()) //ick1193 if (!isDosLikeShell()) //ick 1194 1194 rm_dir_contents = "-$(DEL_FILE) -r"; 1195 1195 … … 1342 1342 for(QStringList::ConstIterator pit = dirs.begin(); pit != dirs.end(); ++pit) { 1343 1343 QString tmp_dst = fileFixify((*pit), FileFixifyAbsolute, false); 1344 if (!is WindowsShell() && tmp_dst.right(1) != Option::dir_sep)1344 if (!isDosLikeShell() && tmp_dst.right(1) != Option::dir_sep) 1345 1345 tmp_dst += Option::dir_sep; 1346 1346 t << mkdir_p_asstring(filePrefixRoot(root, tmp_dst)) << "\n\t"; -
trunk/qmake/generators/makefile.h
r2 r29 245 245 virtual bool mergeBuildProject(MakefileGenerator * /*other*/) { return false; } 246 246 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; } 248 249 }; 249 250 -
trunk/qmake/generators/metamakefile.cpp
r2 r29 421 421 #include "unixmake.h" 422 422 #include "mingw_make.h" 423 #include "gnumake.h" 423 424 #include "projectgenerator.h" 424 425 #include "pbuilder_pbx.h" … … 447 448 } else if(gen == "MINGW") { 448 449 mkfile = new MingwMakefileGenerator; 450 } else if(gen == "GNUMAKE") { 451 mkfile = new GNUMakefileGenerator; 449 452 } else if(gen == "PROJECTBUILDER" || gen == "XCODE") { 450 453 mkfile = new ProjectBuilderMakefileGenerator; -
trunk/qmake/generators/os2/gnumake.cpp
r21 r29 60 60 } 61 61 62 bool GNUMakefileGenerator::is WindowsShell() const63 { 64 #ifdef Q_OS_ WIN62 bool GNUMakefileGenerator::isDosLikeShell() const 63 { 64 #ifdef Q_OS_OS2 65 65 return Option::shellPath.isEmpty(); 66 66 #else 67 return Win32MakefileGenerator::is WindowsShell();67 return Win32MakefileGenerator::isDosLikeShell(); 68 68 #endif 69 69 } … … 162 162 } 163 163 164 /* @todo remove 164 165 void createLdObjectScriptFile(const QString &fileName, const QStringList &objList) 165 166 { … … 199 200 } 200 201 } 202 */ 201 203 202 204 void GNUMakefileGenerator::writeGNUParts(QTextStream &t) … … 368 370 ar_script_file += "." + var("BUILD_NAME"); 369 371 } 372 /* @todo remove 370 373 createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS")); 374 */ 371 375 objectsLinkLine = "ar -M < " + ar_script_file; 372 376 } else { … … 375 379 ld_script_file += "." + var("BUILD_NAME"); 376 380 } 381 /* @todo remove 377 382 createLdObjectScriptFile(ld_script_file, project->values("OBJECTS")); 383 */ 378 384 objectsLinkLine = ld_script_file; 379 385 } -
trunk/qmake/generators/os2/gnumake.h
r21 r29 58 58 QString getLibTarget(); 59 59 private: 60 bool is WindowsShell() const;60 bool isDosLikeShell() const; 61 61 void writeGNUParts(QTextStream &); 62 62 void writeIncPart(QTextStream &t); -
trunk/qmake/generators/win32/mingw_make.cpp
r2 r29 58 58 } 59 59 60 bool MingwMakefileGenerator::is WindowsShell() const60 bool MingwMakefileGenerator::isDosLikeShell() const 61 61 { 62 62 #ifdef Q_OS_WIN 63 63 return Option::shellPath.isEmpty(); 64 64 #else 65 return Win32MakefileGenerator::is WindowsShell();65 return Win32MakefileGenerator::isDosLikeShell(); 66 66 #endif 67 67 } -
trunk/qmake/generators/win32/mingw_make.h
r2 r29 56 56 QString getLibTarget(); 57 57 private: 58 bool is WindowsShell() const;58 bool isDosLikeShell() const; 59 59 void writeMingwParts(QTextStream &); 60 60 void writeIncPart(QTextStream &t); -
trunk/qmake/main.cpp
r2 r29 97 97 QString reporterPath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QDir::separator() 98 98 + "qtusagereporter"; 99 #if defined(Q_OS_WIN) 99 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 100 100 reporterPath += ".exe"; 101 101 #endif … … 105 105 106 106 QString oldpwd = qmake_getpwd(); 107 #if def Q_WS_WIN107 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 108 108 if(!(oldpwd.length() == 3 && oldpwd[0].isLetter() && oldpwd.endsWith(":/"))) 109 109 #endif -
trunk/qmake/option.cpp
r27 r29 343 343 } 344 344 345 #if def Q_OS_WIN345 #if defined(Q_OS_WIN) 346 346 static QStringList detectShellPath() 347 347 { … … 356 356 } 357 357 return paths; 358 } 359 #elif defined(Q_OS_OS2) 360 static 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(); 358 366 } 359 367 #endif … … 375 383 Option::h_ext << ".h" << ".hpp" << ".hh" << ".hxx"; 376 384 Option::c_ext << ".c"; 377 #if ndef Q_OS_WIN385 #if !defined(Q_OS_WIN) && !defined(Q_OS_OS2) 378 386 Option::h_ext << ".H"; 379 387 #endif … … 381 389 Option::h_moc_ext = ".cpp"; 382 390 Option::cpp_ext << ".cpp" << ".cc" << ".cxx"; 383 #if ndef Q_OS_WIN391 #if !defined(Q_OS_WIN) && !defined(Q_OS_OS2) 384 392 Option::cpp_ext << ".C"; 385 393 #endif … … 387 395 Option::yacc_ext = ".y"; 388 396 Option::pro_ext = ".pro"; 389 #if def Q_OS_WIN397 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 390 398 Option::dirlist_sep = ";"; 391 399 Option::shellPath = detectShellPath(); … … 404 412 Option::qmake_abslocation = argv0; 405 413 } else if (argv0.contains(QLatin1Char('/')) 406 #if def Q_OS_WIN414 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 407 415 || argv0.contains(QLatin1Char('\\')) 408 416 #endif … … 412 420 QByteArray pEnv = qgetenv("PATH"); 413 421 QDir currentDir = QDir::current(); 414 #if def Q_OS_WIN422 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 415 423 QStringList paths = QString::fromLocal8Bit(pEnv).split(QLatin1String(";")); 416 424 #else … … 421 429 continue; 422 430 QString candidate = currentDir.absoluteFilePath(*p + QLatin1Char('/') + argv0); 423 #if def Q_OS_WIN431 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 424 432 candidate += ".exe"; 425 433 #endif … … 625 633 Q_ASSERT(!((flags & Option::FixPathToLocalSeparators) && (flags & Option::FixPathToTargetSeparators))); 626 634 if(flags & Option::FixPathToLocalSeparators) { 627 #if defined(Q_OS_WIN 32)635 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 628 636 string = string.replace('/', '\\'); 629 637 #else … … 719 727 #endif 720 728 729 #ifdef Q_OS_OS2 730 # include <qt_os2.h> 731 732 QT_USE_NAMESPACE 733 #endif 734 721 735 QString qmake_libraryInfoFile() 722 736 { 723 737 QString ret; 724 #if defined( Q_OS_WIN)738 #if defined(Q_OS_WIN) 725 739 QFileInfo filePath; 726 740 QT_WA({ … … 733 747 filePath = QString::fromLocal8Bit(module_name); 734 748 }); 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); 735 759 ret = filePath.filePath(); 736 760 #else -
trunk/qmake/project.cpp
r28 r29 59 59 #elif defined(Q_OS_WIN32) 60 60 #include <Windows.h> 61 #elif defined(Q_OS_OS2) 62 #include <qt_os2.h> 61 63 #endif 62 64 #include <stdio.h> … … 3176 3178 } 3177 3179 } 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 } 3178 3211 #elif defined(Q_OS_UNIX) 3179 3212 struct utsname name;
Note:
See TracChangeset
for help on using the changeset viewer.