Changeset 1030
- Timestamp:
- Aug 26, 2011, 7:48:22 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.cmd
r1020 r1030 350 350 G.QT_INSTALL_EXAMPLES = "" 351 351 G.QT_INSTALL_DEMOS = "" 352 G.QT_INSTALL_SYSCONFFILE = ""353 352 354 353 G.QT_LIBINFIX = "" … … 502 501 when (a == "-demosdir") then 503 502 opt = 'P G.QT_INSTALL_DEMOS' 504 when (a == "-sysconffile") then505 opt = 'P G.QT_INSTALL_SYSCONFFILE'506 503 507 504 when (a == "-nomake") then … … 907 904 --------------------------------------------------------------------------*/ 908 905 906 /* On OS/2 the hard-coded prefix path is given relative to the directory 907 * where the module containing QLibraryInfo resides. This will be either a 908 * directory of QtCore4.dll (normally) or a directory of the .EXE file (if 909 * Qt is a static library). Therefore, setting QT_INSTALL_PREFIX to ".." 910 * will make all other paths relative to the parent of that directory which 911 * in development builds contains "bin", "include", "plugins", etc. In the 912 * official release builds, these paths are hard-coded to the actually 913 * used system directories. In portable builds these hard-coded paths are 914 * overriden with qt.conf */ 915 909 916 /* prefix */ 910 917 if (G.QT_INSTALL_PREFIX == "") then 911 G.QT_INSTALL_PREFIX = ". "918 G.QT_INSTALL_PREFIX = ".." 912 919 /* docs */ 913 920 if (G.QT_INSTALL_DOCS == "") then … … 1011 1018 '/* Installation Info */'G.EOL 1012 1019 1013 if (G.QT_INSTALL_PREFIX == ".") then1014 /* make the prefix path be the directory where the module containing1015 * core Qt classes (in particular, QLibraryInfo) resides. Normally, it1016 * will be the path to QtCore4.DLL which is useful for separate Qt runtime1017 * distros that will have all components along in the same directory */1018 config_cpp_str = config_cpp_str||,1019 '#define QT_CONFIGURE_PREFIX_PATH qt_module_path()'G.EOL1020 else1021 config_cpp_str = config_cpp_str||,1022 '#define QT_CONFIGURE_PREFIX_PATH "'CPPPath(G.QT_INSTALL_PREFIX)'"'G.EOL1023 1024 1020 config_cpp_str = config_cpp_str||, 1021 '#define QT_CONFIGURE_PREFIX_PATH "'CPPPath(G.QT_INSTALL_PREFIX)'"'G.EOL||, 1025 1022 '#define QT_CONFIGURE_DOCUMENTATION_PATH "'CPPPath(G.QT_INSTALL_DOCS)'"'G.EOL||, 1026 1023 '#define QT_CONFIGURE_HEADERS_PATH "'CPPPath(G.QT_INSTALL_HEADERS)'"'G.EOL||, … … 1035 1032 '#define QT_CONFIGURE_DEMOS_PATH "'CPPPath(G.QT_INSTALL_DEMOS)'"'G.EOL 1036 1033 1037 if (G.QT_INSTALL_SYSCONFFILE \== '') then1038 config_cpp_str = config_cpp_str||,1039 '#define QT_CONFIGURE_QT_SYSCONF_FILE "'CPPPath(G.QT_INSTALL_SYSCONFFILE)'"'G.EOL1040 1041 1034 today = date('S') 1042 1035 today = insert('-', today, 4) … … 1055 1048 call charout qconfig_cpp 1056 1049 end 1057 1058 /* create qt.conf in the bin\ subdirectory with the correct paths to the1059 * Qt components we will build. This is necessary because the default paths1060 * in qconfig.cpp generated above will be relative to QtCore4.DLL while in1061 * the development environment they need to be relative to the output tree1062 * of the Qt library. Note that we also need to set Demos and Examples1063 * because for some strange reason they default to . when reading from a1064 * .conf file */1065 call MakeDir G.OutPath"\bin"1066 qt_conf = G.OutPath"\bin\qt.conf"1067 call DeleteFile qt_conf1068 call charout qt_conf,,1069 '[Paths]'G.EOL||,1070 'Prefix = ..'G.EOL||,1071 'Settings = $(ETC)/xdg'G.EOL||,1072 'Examples = examples'G.EOL||,1073 'Demos = demos'G.EOL1074 call charout qt_conf1075 1050 1076 1051 /*-------------------------------------------------------------------------- -
trunk/doc/src/deployment/qt-conf.qdoc
r846 r1030 43 43 libraries look elsewhere. 44 44 45 Note that on OS/2, the libraries do not use the hard-coded paths46 by default. Instead, they look for plugins and other components in a47 directory that contains the QtCore DLL library (or the application48 executable if Qt is built as a static library). This behavior may49 also be overridden using the \c qt.conf file.50 51 45 QLibraryInfo will load \c qt.conf from one of the following locations: 52 46 … … 61 55 QCoreApplication::applicationDirPath() + QDir::separator() + "qt.conf" 62 56 57 \o on OS/2, in the directory containing the QtCore dynamic library 58 (only after trying all of the above locations) 59 63 60 \endlist 64 61 65 On OS/2, if neither of the above locations contains \c qt.conf,66 QLibraryInfo will additionally try the following locations, in the67 given order:68 69 \list 170 71 \o \c qt.conf in the directory containing the QtCore DLL library72 (or the application executable if Qt is built as a static library)73 74 \o hard-coded system-wide \c .conf file (if set by the given build75 of the Qt library)76 77 \o \c %ETC%\qt.conf78 79 \endlist80 81 62 The \c qt.conf file is an INI text file, as described in the \l 82 63 {QSettings::Format}{QSettings} documentation. The file should have -
trunk/qmake/option.cpp
r847 r1030 774 774 QString qmake_libraryInfoFile() 775 775 { 776 // this is in sync with initBinaryDir() from tools/linguist/lrelease/main.cpp 776 777 QString ret; 777 778 #if defined(Q_OS_WIN) … … 788 789 DosQueryModuleName(ppib->pib_hmte, sizeof(appFileName), appFileName); 789 790 } 790 ret = QFileInfo(QString::fromLocal8Bit(appFileName)).absolutePath() + 791 QLatin1String("/qt.conf"); 792 if (!QFile::exists(ret)) { 793 // search in the system-wide location 794 ret = QString::fromLocal8Bit(qgetenv("ETC")); 795 if (ret.isEmpty()) 796 ret = QDir::rootPath(); 797 ret = ret + QLatin1String("/qtsys.conf"); 798 } 799 return QDir::cleanPath(ret); 791 ret = QFileInfo(QString::fromLocal8Bit(appFileName)).filePath(); 800 792 #else 801 793 QString argv0 = QFile::decodeName(QByteArray(Option::application_argv0)); … … 839 831 ret = fi.exists() ? fi.canonicalFilePath() : QString(); 840 832 #endif 841 #if !defined(Q_OS_OS2)842 833 if(!ret.isEmpty()) 843 834 ret = QDir(QFileInfo(ret).absolutePath()).filePath("qt.conf"); 844 835 return ret; 845 #endif846 836 } 847 837 -
trunk/src/corelib/global/qlibraryinfo.cpp
r901 r1030 176 176 if (!QFile::exists(qtconfig)) { 177 177 // search in the directory that contains the DLL or EXE where this 178 // code is located (e.g. QtCore .dll or app.exe if Qt is a static lib)178 // code is located (e.g. QtCore4.dll or app.exe if Qt is a static lib) 179 179 qtconfig = QString::fromLocal8Bit(qt_module_path()); 180 qtconfig = QDir::fromNativeSeparators(qtconfig) + 181 QLatin1String("/qt.conf"); 180 qtconfig = QDir::fromNativeSeparators(qtconfig) + QLatin1String("/qt.conf"); 182 181 qtconfig = QDir::cleanPath(qtconfig); 183 184 if (!QFile::exists(qtconfig)) {185 // search in the system-wide location186 #ifdef QT_CONFIGURE_QT_SYSCONF_FILE187 qtconfig = expandEnvVars(QString::fromLocal8Bit(QT_CONFIGURE_QT_SYSCONF_FILE));188 if (!QFile::exists(qtconfig))189 #endif190 {191 // search in %ETC% for backward compatibility192 QString etc = QString::fromLocal8Bit(qgetenv("ETC"));193 if (etc.isEmpty())194 etc = QDir::rootPath();195 etc = QDir::fromNativeSeparators(etc);196 qtconfig = QDir::cleanPath(etc + QLatin1String("/qt.conf"));197 if (!QFile::exists(qtconfig)) {198 qtconfig = QDir::cleanPath(etc + QLatin1String("/qtsys.conf"));199 }200 }201 }202 182 } 203 183 #endif … … 516 496 517 497 #ifdef Q_OS_OS2 518 519 // QDir::isRelativePath() isn't precise on OS/2 (see 520 // QDir::absoluteFilePath()) therefore we don't rely on it 498 // QDir::isRelativePath() isn't precise on OS/2 (see QDir::absoluteFilePath()) 499 // therefore we don't rely on it 521 500 if (loc == PrefixPath) { 522 501 #ifdef BOOTSTRAPPING … … 526 505 QSettings *config = QLibraryInfoPrivate::configuration(); 527 506 if (config) { 528 // if we read paths from qt [sys].conf, the Prefix is relative to529 // t he directory we load qt[sys].conf from507 // if we read paths from qt.conf, we make the prefix path absolute 508 // to this file's directory 530 509 QFileInfo fi(config->fileName()); 531 510 ret = QDir::cleanPath(QDir(fi.absolutePath()).absoluteFilePath(ret)); 532 511 } else { 533 // we make the prefix path absolute to the executable's directory 534 if (QCoreApplication::instance()) { 535 ret = QDir::cleanPath(QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(ret)); 536 } else { 537 ret = QDir::current().absoluteFilePath(ret); 538 } 512 // otherwise we make the prefix path absolute to the DLL/EXE directory 513 QString path = QString::fromLocal8Bit(qt_module_path()); 514 ret = QDir::cleanPath(QDir(path).absoluteFilePath(ret)); 539 515 } 540 516 #endif … … 543 519 ret = QDir::cleanPath(QDir(location(PrefixPath)).absoluteFilePath(ret)); 544 520 } 545 546 521 return QDir::toNativeSeparators(ret); 547 548 522 #else // Q_OS_OS2 549 550 523 if (QDir::isRelativePath(ret)) { 551 524 if (loc == PrefixPath) { … … 577 550 } 578 551 return QDir::cleanPath(ret); 579 580 552 #endif // Q_OS_OS2 581 553 } -
trunk/tools/linguist/lrelease/main.cpp
r846 r1030 329 329 ) 330 330 { 331 // this is in sync with qmake_libraryInfoFile() from qmake/option.cpp 331 332 #ifdef Q_OS_WIN 332 333 wchar_t module_name[MAX_PATH]; … … 334 335 QFileInfo filePath = QString::fromWCharArray(module_name); 335 336 binDir = filePath.filePath(); 337 #elif defined(Q_OS_OS2) 338 QFileInfo filePath; 339 static char appFileName[CCHMAXPATH] = "\0"; 340 if (!appFileName[0]) { 341 PPIB ppib; 342 DosGetInfoBlocks(NULL, &ppib); 343 DosQueryModuleName(ppib->pib_hmte, sizeof(appFileName), appFileName); 344 } 345 binDir = QFileInfo(QString::fromLocal8Bit(appFileName)).filePath(); 336 346 #else 337 347 QString argv0 = QFile::decodeName(QByteArray(_argv0));
Note:
See TracChangeset
for help on using the changeset viewer.