Changeset 357
- Timestamp:
- Nov 28, 2009, 8:49:40 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.cmd
r315 r357 299 299 G.CFG_GRAPHICS_SYSTEM = "default" 300 300 301 /* initalize variables used for installation*/301 /* variables used for locating installed Qt components */ 302 302 G.QT_INSTALL_PREFIX = "" 303 303 G.QT_INSTALL_DOCS = "" … … 545 545 /* prefix */ 546 546 if (G.QT_INSTALL_PREFIX == "") then 547 G.QT_INSTALL_PREFIX = G.OutPath547 G.QT_INSTALL_PREFIX = "." 548 548 /* docs */ 549 549 if (G.QT_INSTALL_DOCS == "") then 550 G.QT_INSTALL_DOCS = FixDirNoSlash(G.QT_INSTALL_PREFIX)"\docs"550 G.QT_INSTALL_DOCS = "doc" 551 551 /* headers */ 552 552 if (G.QT_INSTALL_HEADERS == "") then 553 G.QT_INSTALL_HEADERS = FixDirNoSlash(G.QT_INSTALL_PREFIX)"\include"553 G.QT_INSTALL_HEADERS = "include" 554 554 /* libs */ 555 555 if (G.QT_INSTALL_LIBS == "") then 556 G.QT_INSTALL_LIBS = FixDirNoSlash(G.QT_INSTALL_PREFIX)"\lib"556 G.QT_INSTALL_LIBS = "lib" 557 557 /* bins */ 558 558 if (G.QT_INSTALL_BINS == "") then 559 G.QT_INSTALL_BINS = FixDirNoSlash(G.QT_INSTALL_PREFIX)"\bin"559 G.QT_INSTALL_BINS = "bin" 560 560 /* plugins */ 561 561 if (G.QT_INSTALL_PLUGINS == "") then 562 G.QT_INSTALL_PLUGINS = FixDirNoSlash(G.QT_INSTALL_PREFIX)"\plugins"562 G.QT_INSTALL_PLUGINS = "plugins" 563 563 /* data */ 564 564 if (G.QT_INSTALL_DATA == "") then 565 G.QT_INSTALL_DATA = FixDirNoSlash(G.QT_INSTALL_PREFIX)565 G.QT_INSTALL_DATA = "." 566 566 /* translations */ 567 567 if (G.QT_INSTALL_TRANSLATIONS == "") then 568 G.QT_INSTALL_TRANSLATIONS = FixDirNoSlash(G.QT_INSTALL_PREFIX)"\translations"568 G.QT_INSTALL_TRANSLATIONS = "translations" 569 569 /* settings */ 570 570 if (G.QT_INSTALL_SETTINGS == "") then 571 G.QT_INSTALL_SETTINGS = SysBootDrive()"\OS2\xdg"571 G.QT_INSTALL_SETTINGS = "$(ETC)\qt" 572 572 /* examples */ 573 573 if (G.QT_INSTALL_EXAMPLES == "") then 574 G.QT_INSTALL_EXAMPLES = FixDirNoSlash(G.QT_INSTALL_PREFIX)"\examples"574 G.QT_INSTALL_EXAMPLES = "examples" 575 575 /* demos */ 576 576 if (G.QT_INSTALL_DEMOS == "") then 577 G.QT_INSTALL_DEMOS = FixDirNoSlash(G.QT_INSTALL_PREFIX)"\demos"577 G.QT_INSTALL_DEMOS = "demos" 578 578 579 579 /*-------------------------------------------------------------------------- … … 634 634 --------------------------------------------------------------------------*/ 635 635 636 if (\DirExists(G.OutPath"\src\corelib\global")) then 637 call MakeDir G.OutPath"\src\corelib\global" 636 call MakeDir G.OutPath"\src\corelib\global" 638 637 639 638 qconfig_cpp = G.OutPath"\src\corelib\global\qconfig.cpp" … … 641 640 config_cpp_str =, 642 641 '/* License Info */'G.EOL||, 643 'static const char qt_configure_licensee_str [260 + 12] = "qt_lcnsuser='CPPPath(MaxLen(G.Licensee,259))'";'G.EOL||, 644 'static const char qt_configure_licensed_products_str [260 + 12] = "qt_lcnsprod='CPPPath(MaxLen(G.Edition,259))'";'G.EOL||, 645 '/* Installation Info */'G.EOL||, 646 'static const char qt_configure_prefix_path_str [260 + 12] = "qt_prfxpath='CPPPath(MaxLen(G.QT_INSTALL_PREFIX,259))'";'G.EOL||, 647 'static const char qt_configure_documentation_path_str[260 + 12] = "qt_docspath='CPPPath(MaxLen(G.QT_INSTALL_DOCS,259))'";'G.EOL||, 648 'static const char qt_configure_headers_path_str [260 + 12] = "qt_hdrspath='CPPPath(MaxLen(G.QT_INSTALL_HEADERS,259))'";'G.EOL||, 649 'static const char qt_configure_libraries_path_str [260 + 12] = "qt_libspath='CPPPath(MaxLen(G.QT_INSTALL_LIBS,259))'";'G.EOL||, 650 'static const char qt_configure_binaries_path_str [260 + 12] = "qt_binspath='CPPPath(MaxLen(G.QT_INSTALL_BINS,259))'";'G.EOL||, 651 'static const char qt_configure_plugins_path_str [260 + 12] = "qt_plugpath='CPPPath(MaxLen(G.QT_INSTALL_PLUGINS,259))'";'G.EOL||, 652 'static const char qt_configure_data_path_str [260 + 12] = "qt_datapath='CPPPath(MaxLen(G.QT_INSTALL_DATA,259))'";'G.EOL||, 653 'static const char qt_configure_translations_path_str [260 + 12] = "qt_trnspath='CPPPath(MaxLen(G.QT_INSTALL_TRANSLATIONS,259))'";'G.EOL||, 654 'static const char qt_configure_settings_path_str [260 + 12] = "qt_stngpath='CPPPath(MaxLen(G.QT_INSTALL_SETTINGS,259))'";'G.EOL||, 655 'static const char qt_configure_examples_path_str [260 + 12] = "qt_xmplpath='CPPPath(MaxLen(G.QT_INSTALL_EXAMPLES,259))'";'G.EOL||, 656 'static const char qt_configure_demos_path_str [260 + 12] = "qt_demopath='CPPPath(MaxLen(G.QT_INSTALL_DEMOS,259))'";'G.EOL||, 657 '/* strlen( "qt_lcnsxxxx" ) == 12 */'G.EOL||, 658 '#define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12;'G.EOL||, 659 '#define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12;'G.EOL||, 660 '#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12;'G.EOL||, 661 '#define QT_CONFIGURE_DOCUMENTATION_PATH qt_configure_documentation_path_str + 12;'G.EOL||, 662 '#define QT_CONFIGURE_HEADERS_PATH qt_configure_headers_path_str + 12;'G.EOL||, 663 '#define QT_CONFIGURE_LIBRARIES_PATH qt_configure_libraries_path_str + 12;'G.EOL||, 664 '#define QT_CONFIGURE_BINARIES_PATH qt_configure_binaries_path_str + 12;'G.EOL||, 665 '#define QT_CONFIGURE_PLUGINS_PATH qt_configure_plugins_path_str + 12;'G.EOL||, 666 '#define QT_CONFIGURE_DATA_PATH qt_configure_data_path_str + 12;'G.EOL||, 667 '#define QT_CONFIGURE_TRANSLATIONS_PATH qt_configure_translations_path_str + 12;'G.EOL||, 668 '#define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12;'G.EOL||, 669 '#define QT_CONFIGURE_EXAMPLES_PATH qt_configure_examples_path_str + 12;'G.EOL||, 670 '#define QT_CONFIGURE_DEMOS_PATH qt_configure_demos_path_str + 12;'G.EOL||, 642 '#define QT_CONFIGURE_LICENSEE "'CPPPath(MaxLen(G.Licensee,259))'"'G.EOL||, 643 '#define QT_CONFIGURE_LICENSED_PRODUCTS "'CPPPath(MaxLen(G.Edition,259))'"'G.EOL||, 644 '/* Installation Info */'G.EOL 645 646 if (G.QT_INSTALL_PREFIX == ".") then 647 /* make the prefix path be the directory where the module containing 648 * core Qt classes (in particular, QLibraryInfo) resides. Normally, it 649 * will be the path to QtCore4.DLL which is useful for separate Qt runtime 650 * distros that will have all components along in the same directory */ 651 config_cpp_str = config_cpp_str||, 652 '#define QT_CONFIGURE_PREFIX_PATH qt_module_path()'G.EOL 653 else 654 config_cpp_str = config_cpp_str||, 655 '#define QT_CONFIGURE_PREFIX_PATH "'CPPPath(G.QT_INSTALL_PREFIX)'"'G.EOL 656 657 config_cpp_str = config_cpp_str||, 658 '#define QT_CONFIGURE_DOCUMENTATION_PATH "'CPPPath(G.QT_INSTALL_DOCS)'"'G.EOL||, 659 '#define QT_CONFIGURE_HEADERS_PATH "'CPPPath(G.QT_INSTALL_HEADERS)'"'G.EOL||, 660 '#define QT_CONFIGURE_LIBRARIES_PATH "'CPPPath(G.QT_INSTALL_LIBS)'"'G.EOL||, 661 '#define QT_CONFIGURE_BINARIES_PATH "'CPPPath(G.QT_INSTALL_BINS)'"'G.EOL||, 662 '#define QT_CONFIGURE_PLUGINS_PATH "'CPPPath(G.QT_INSTALL_PLUGINS)'"'G.EOL||, 663 '#define QT_CONFIGURE_DATA_PATH "'CPPPath(G.QT_INSTALL_DATA)'"'G.EOL||, 664 '#define QT_CONFIGURE_TRANSLATIONS_PATH "'CPPPath(G.QT_INSTALL_TRANSLATIONS)'"'G.EOL||, 665 '#define QT_CONFIGURE_SETTINGS_PATH "'CPPPath(G.QT_INSTALL_SETTINGS)'"'G.EOL||, 666 '#define QT_CONFIGURE_EXAMPLES_PATH "'CPPPath(G.QT_INSTALL_EXAMPLES)'"'G.EOL||, 667 '#define QT_CONFIGURE_DEMOS_PATH "'CPPPath(G.QT_INSTALL_DEMOS)'"'G.EOL||, 671 668 G.EOL 672 669 … … 679 676 call charout qconfig_cpp 680 677 end 678 679 /* create qt.conf in the bin\ subdirectory with the correct paths to the 680 * Qt components we will build. This is necessary because the default paths 681 * in qconfig.cpp generated above will be relative to QtCore4.DLL while in 682 * the development environment they need to be relative to the output tree 683 * of the Qt library */ 684 call MakeDir G.OutPath"\bin" 685 qt_conf = G.OutPath"\bin\qt.conf" 686 call charout qt_conf, '[Paths]'G.EOL'Prefix = ..'G.EOL 687 call charout qt_conf 681 688 682 689 /*-------------------------------------------------------------------------- … … 1829 1836 1830 1837 MakeDir: procedure expose (Globals) 1831 /* @todo teach it to create all non-existing intermediate dirs */1832 1838 parse arg aDir 1833 rc = SysMkDir(aDir) 1834 if (rc \= 0) then do 1835 call SayErr 'FATAL: Could not create directory '''aDir'''!' 1836 call SayErr 'SysMkDir returned 'rc 1837 call Done 1 1839 aDir = translate(aDir, '\', '/') 1840 curdir = directory() 1841 base = aDir 1842 todo.0 = 0 1843 do while 1 1844 d = directory(base) 1845 if (d \== '') then 1846 leave 1847 i = todo.0 + 1 1848 todo.i = filespec('N', base) 1849 todo.0 = i 1850 drv = filespec('D', base) 1851 path = filespec('P', base) 1852 if (path == '\' | path == '') then do 1853 base = drv||path 1854 leave 1855 end 1856 base = drv||strip(path, 'T', '\') 1857 end 1858 call directory curdir 1859 do i = todo.0 to 1 by -1 1860 if (i < todo.0 | (base \== '' & right(base,1) \== '\' &, 1861 right(base,1) \== ':')) then 1862 base = base'\' 1863 base = base||todo.i 1864 rc = SysMkDir(base) 1865 if (rc \= 0) then do 1866 call SayErr 'FATAL: Could not create directory '''base'''!' 1867 call SayErr 'SysMkDir returned 'rc 1868 call Done 1 1869 end 1838 1870 end 1839 1871 return … … 2238 2270 2239 2271 /** 2240 * Returns the name ofthe temporary directory.2272 * Returns the absolute path to the temporary directory. 2241 2273 * The returned value doesn't end with a slash. 2242 2274 */ -
trunk/doc/src/qt-conf.qdoc
r2 r357 58 58 libraries look elsewhere. 59 59 60 Note that on OS/2, the libraries do not use the hard-coded paths 61 by default. Instead, they look for plugins and other components in a 62 directory that contains the QtCore DLL library (or the application 63 executable if Qt is built as a static library). This behavior may 64 also be overridden using the \c qt.conf file. 65 60 66 QLibraryInfo will load \c qt.conf from one of the following locations: 61 67 … … 72 78 \endlist 73 79 80 On OS/2, if neither of the above locations contains \c qt.conf, 81 QLibraryInfo will additionally try the following two locations: 82 83 \list 1 84 85 \o \c qt.conf in the directory containing the QtCore DLL library 86 (or the application executable if Qt is built as a static library) 87 88 \o \c %ETC%\qt\qtsys.conf 89 90 \endlist 91 74 92 The \c qt.conf file is an INI text file, as described in the \l 75 93 {QSettings::Format}{QSettings} documentation. The file should have … … 106 124 need to be placed in specific sub-directories under the 107 125 \c{plugins} directory (see \l{How to Create Qt Plugins} for 108 details). 109 126 details). On OS/2, the \c Prefix is always relative to the directory 127 where \c qt.conf or \c qtsys.conf is loaded from. 128 110 129 For example, a \c qt.conf file could contain the following: 111 130 -
trunk/src/corelib/global/qlibraryinfo.cpp
r2 r357 41 41 42 42 #include "qdir.h" 43 #include "qfile.h" 43 #include "qfile.h" 44 44 #include "qconfig.h" 45 45 #include "qsettings.h" … … 58 58 # include "private/qcore_mac_p.h" 59 59 #endif 60 61 #ifdef Q_OS_OS2 62 63 #include "qt_os2.h" 64 65 static const char *qt_module_path() 66 { 67 static char path[CCHMAXPATH] = {'\0'}; 68 if (!path[0]) { 69 HMODULE hmod; 70 ULONG objNum, offset; 71 DosQueryModFromEIP(&hmod, &objNum, sizeof(path), path, &offset, 72 (ULONG)qt_module_path); 73 DosQueryModuleName(hmod, sizeof(path), path); 74 char *slash = strrchr(path, '\\'); 75 if (slash) 76 *slash = '\0'; 77 } 78 return path; 79 } 80 81 #endif // Q_OS_OS2 60 82 61 83 #include "qconfig.cpp" … … 137 159 qtconfig = pwd.filePath(QLatin1String("qt.conf")); 138 160 } 161 #ifdef Q_OS_OS2 162 if (!QFile::exists(qtconfig)) { 163 // search in the directory that contains the DLL or EXE where this 164 // code is located (e.g. QtCore.dll or app.exe if Qt is a static lib) 165 qtconfig = QString::fromLocal8Bit(qt_module_path()); 166 qtconfig = QDir::fromNativeSeparators(qtconfig) + 167 QLatin1String("/qt.conf"); 168 qtconfig = QDir::cleanPath(qtconfig); 169 170 if (!QFile::exists(qtconfig)) { 171 // search in the system-wide location 172 qtconfig = QString::fromLocal8Bit(qgetenv("ETC")); 173 if (qtconfig.isEmpty()) 174 qtconfig = QDir::rootPath(); 175 qtconfig = QDir::fromNativeSeparators(qtconfig) + 176 QLatin1String("/qt/qtsys.conf"); 177 qtconfig = QDir::cleanPath(qtconfig); 178 } 179 } 180 #endif 139 181 } 140 182 #endif … … 296 338 } 297 339 298 if (path) 340 if (path) { 299 341 ret = QString::fromLocal8Bit(path); 342 #ifdef Q_OS_OS2 343 // expand environment variables in the form $(ENVVAR) 344 int rep; 345 QRegExp reg_var(QLatin1String("\\$\\(.*\\)")); 346 reg_var.setMinimal(true); 347 while((rep = reg_var.indexIn(ret)) != -1) { 348 ret.replace(rep, reg_var.matchedLength(), 349 QString::fromLocal8Bit(qgetenv(ret.mid(rep + 2, 350 reg_var.matchedLength() - 3).toLatin1().constData()).constData())); 351 } 352 #endif 353 } 300 354 } else { 301 355 QString key; … … 431 485 // we make the prefix path absolute to the executable's directory 432 486 #ifdef QT_BUILD_QMAKE 433 return QFileInfo(qmake_libraryInfoFile()).absolutePath(); 487 QFileInfo fi(qmake_libraryInfoFile()); 488 return QDir::cleanPath(QDir(fi.absolutePath()).absoluteFilePath(ret)); 434 489 #else 490 #ifdef Q_OS_OS2 491 QSettings *config = QLibraryInfoPrivate::configuration(); 492 if (config) { 493 // if we read paths from qt[sys].conf, the Prefix is relative to 494 // the directory we load qt[sys].conf from 495 QFileInfo fi(config->fileName()); 496 return QDir::cleanPath(QDir(fi.absolutePath()).absoluteFilePath(ret)); 497 } 498 else 499 #endif 435 500 if (QCoreApplication::instance()) { 436 501 #ifdef Q_OS_MAC … … 444 509 } 445 510 #endif 446 return QDir (QCoreApplication::applicationDirPath()).absoluteFilePath(ret);511 return QDir::cleanPath(QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(ret)); 447 512 } else { 448 513 return QDir::current().absoluteFilePath(ret); … … 451 516 } else { 452 517 // we make any other path absolute to the prefix directory 453 return QDir (location(PrefixPath)).absoluteFilePath(ret);518 return QDir::cleanPath(QDir(location(PrefixPath)).absoluteFilePath(ret)); 454 519 } 455 520 } 456 return ret;521 return QDir::cleanPath(ret); 457 522 } 458 523
Note:
See TracChangeset
for help on using the changeset viewer.