PageRenderTime 161ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 2ms

/src/qt/qtbase/tools/configure/configureapp.cpp

https://code.google.com/
C++ | 4512 lines | 3833 code | 465 blank | 214 comment | 2073 complexity | 10eb3a88818ca1a56732242298772915 MD5 | raw file
Possible License(s): LGPL-3.0, CC-BY-SA-4.0, MIT, AGPL-3.0, BSD-3-Clause, LGPL-2.1, CC0-1.0, GPL-2.0, LGPL-2.0, GPL-3.0

Large files files are truncated, but you can click here to view the full file

  1. /****************************************************************************
  2. **
  3. ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
  4. ** Copyright (C) 2013 Intel Corporation
  5. ** Contact: http://www.qt-project.org/legal
  6. **
  7. ** This file is part of the tools applications of the Qt Toolkit.
  8. **
  9. ** $QT_BEGIN_LICENSE:LGPL$
  10. ** Commercial License Usage
  11. ** Licensees holding valid commercial Qt licenses may use this file in
  12. ** accordance with the commercial license agreement provided with the
  13. ** Software or, alternatively, in accordance with the terms contained in
  14. ** a written agreement between you and Digia. For licensing terms and
  15. ** conditions see http://qt.digia.com/licensing. For further information
  16. ** use the contact form at http://qt.digia.com/contact-us.
  17. **
  18. ** GNU Lesser General Public License Usage
  19. ** Alternatively, this file may be used under the terms of the GNU Lesser
  20. ** General Public License version 2.1 as published by the Free Software
  21. ** Foundation and appearing in the file LICENSE.LGPL included in the
  22. ** packaging of this file. Please review the following information to
  23. ** ensure the GNU Lesser General Public License version 2.1 requirements
  24. ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
  25. **
  26. ** In addition, as a special exception, Digia gives you certain additional
  27. ** rights. These rights are described in the Digia Qt LGPL Exception
  28. ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
  29. **
  30. ** GNU General Public License Usage
  31. ** Alternatively, this file may be used under the terms of the GNU
  32. ** General Public License version 3.0 as published by the Free Software
  33. ** Foundation and appearing in the file LICENSE.GPL included in the
  34. ** packaging of this file. Please review the following information to
  35. ** ensure the GNU General Public License version 3.0 requirements will be
  36. ** met: http://www.gnu.org/copyleft/gpl.html.
  37. **
  38. **
  39. ** $QT_END_LICENSE$
  40. **
  41. ****************************************************************************/
  42. #include "configureapp.h"
  43. #include "environment.h"
  44. #ifdef COMMERCIAL_VERSION
  45. # include "tools.h"
  46. #endif
  47. #include <qdatetime.h>
  48. #include <qdir.h>
  49. #include <qdiriterator.h>
  50. #include <qtemporaryfile.h>
  51. #include <qstandardpaths.h>
  52. #include <qstack.h>
  53. #include <qdebug.h>
  54. #include <qfileinfo.h>
  55. #include <qtextstream.h>
  56. #include <qregexp.h>
  57. #include <qhash.h>
  58. #include <iostream>
  59. #include <string>
  60. #include <fstream>
  61. #include <windows.h>
  62. #include <conio.h>
  63. QT_BEGIN_NAMESPACE
  64. enum Platforms {
  65. WINDOWS,
  66. WINDOWS_CE,
  67. WINDOWS_RT,
  68. QNX,
  69. BLACKBERRY,
  70. ANDROID
  71. };
  72. std::ostream &operator<<(std::ostream &s, const QString &val) {
  73. s << val.toLocal8Bit().data();
  74. return s;
  75. }
  76. using namespace std;
  77. // Macros to simplify options marking
  78. #define MARK_OPTION(x,y) ( dictionary[ #x ] == #y ? "*" : " " )
  79. static inline void promptKeyPress()
  80. {
  81. cout << "(Press any key to continue...)";
  82. if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
  83. exit(0); // Exit cleanly for Ctrl+C
  84. }
  85. Configure::Configure(int& argc, char** argv)
  86. {
  87. // Default values for indentation
  88. optionIndent = 4;
  89. descIndent = 25;
  90. outputWidth = 0;
  91. // Get console buffer output width
  92. CONSOLE_SCREEN_BUFFER_INFO info;
  93. HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
  94. if (GetConsoleScreenBufferInfo(hStdout, &info))
  95. outputWidth = info.dwSize.X - 1;
  96. outputWidth = qMin(outputWidth, 79); // Anything wider gets unreadable
  97. if (outputWidth < 35) // Insanely small, just use 79
  98. outputWidth = 79;
  99. int i;
  100. /*
  101. ** Set up the initial state, the default
  102. */
  103. dictionary[ "CONFIGCMD" ] = argv[ 0 ];
  104. for (i = 1; i < argc; i++)
  105. configCmdLine += argv[ i ];
  106. if (configCmdLine.size() >= 2 && configCmdLine.at(0) == "-srcdir") {
  107. sourcePath = QDir::cleanPath(configCmdLine.at(1));
  108. sourceDir = QDir(sourcePath);
  109. configCmdLine.erase(configCmdLine.begin(), configCmdLine.begin() + 2);
  110. } else {
  111. // Get the path to the executable
  112. wchar_t module_name[MAX_PATH];
  113. GetModuleFileName(0, module_name, sizeof(module_name) / sizeof(wchar_t));
  114. QFileInfo sourcePathInfo = QString::fromWCharArray(module_name);
  115. sourcePath = sourcePathInfo.absolutePath();
  116. sourceDir = sourcePathInfo.dir();
  117. }
  118. buildPath = QDir::currentPath();
  119. #if 0
  120. const QString installPath = QString("C:\\Qt\\%1").arg(QT_VERSION_STR);
  121. #else
  122. const QString installPath = buildPath;
  123. #endif
  124. if (sourceDir != buildDir) { //shadow builds!
  125. QDir(buildPath).mkpath("bin");
  126. buildDir.mkpath("mkspecs");
  127. }
  128. defaultBuildParts << QStringLiteral("libs") << QStringLiteral("tools") << QStringLiteral("examples");
  129. allBuildParts = defaultBuildParts;
  130. allBuildParts << QStringLiteral("tests");
  131. dictionary[ "QT_INSTALL_PREFIX" ] = installPath;
  132. dictionary[ "QMAKESPEC" ] = getenv("QMAKESPEC");
  133. if (dictionary[ "QMAKESPEC" ].size() == 0) {
  134. dictionary[ "QMAKESPEC" ] = Environment::detectQMakeSpec();
  135. dictionary[ "QMAKESPEC_FROM" ] = "detected";
  136. } else {
  137. dictionary[ "QMAKESPEC_FROM" ] = "env";
  138. }
  139. dictionary[ "QCONFIG" ] = "full";
  140. dictionary[ "EMBEDDED" ] = "no";
  141. dictionary[ "BUILD_QMAKE" ] = "yes";
  142. dictionary[ "VCPROJFILES" ] = "yes";
  143. dictionary[ "QMAKE_INTERNAL" ] = "no";
  144. dictionary[ "PROCESS" ] = "partial";
  145. dictionary[ "WIDGETS" ] = "yes";
  146. dictionary[ "GUI" ] = "yes";
  147. dictionary[ "RTTI" ] = "yes";
  148. dictionary[ "STRIP" ] = "yes";
  149. dictionary[ "SSE2" ] = "auto";
  150. dictionary[ "SSE3" ] = "auto";
  151. dictionary[ "SSSE3" ] = "auto";
  152. dictionary[ "SSE4_1" ] = "auto";
  153. dictionary[ "SSE4_2" ] = "auto";
  154. dictionary[ "AVX" ] = "auto";
  155. dictionary[ "AVX2" ] = "auto";
  156. dictionary[ "IWMMXT" ] = "auto";
  157. dictionary[ "SYNCQT" ] = "auto";
  158. dictionary[ "CE_CRT" ] = "no";
  159. dictionary[ "CETEST" ] = "auto";
  160. dictionary[ "CE_SIGNATURE" ] = "no";
  161. dictionary[ "AUDIO_BACKEND" ] = "auto";
  162. dictionary[ "WMF_BACKEND" ] = "auto";
  163. dictionary[ "WMSDK" ] = "auto";
  164. dictionary[ "QML_DEBUG" ] = "yes";
  165. dictionary[ "PLUGIN_MANIFESTS" ] = "no";
  166. dictionary[ "DIRECTWRITE" ] = "no";
  167. dictionary[ "DIRECT2D" ] = "no";
  168. dictionary[ "NIS" ] = "no";
  169. dictionary[ "NEON" ] = "auto";
  170. dictionary[ "LARGE_FILE" ] = "yes";
  171. dictionary[ "FONT_CONFIG" ] = "no";
  172. dictionary[ "POSIX_IPC" ] = "no";
  173. dictionary[ "QT_GLIB" ] = "no";
  174. dictionary[ "QT_ICONV" ] = "auto";
  175. dictionary[ "QT_EVDEV" ] = "auto";
  176. dictionary[ "QT_MTDEV" ] = "auto";
  177. dictionary[ "QT_INOTIFY" ] = "auto";
  178. dictionary[ "QT_EVENTFD" ] = "auto";
  179. dictionary[ "QT_CUPS" ] = "auto";
  180. dictionary[ "CFG_GCC_SYSROOT" ] = "yes";
  181. dictionary[ "SLOG2" ] = "no";
  182. dictionary[ "QNX_IMF" ] = "no";
  183. dictionary[ "PPS" ] = "no";
  184. dictionary[ "LGMON" ] = "no";
  185. dictionary[ "SYSTEM_PROXIES" ] = "no";
  186. dictionary[ "WERROR" ] = "auto";
  187. dictionary[ "QREAL" ] = "double";
  188. //Only used when cross compiling.
  189. dictionary[ "QT_INSTALL_SETTINGS" ] = "/etc/xdg";
  190. QString version;
  191. QFile qglobal_h(sourcePath + "/src/corelib/global/qglobal.h");
  192. if (qglobal_h.open(QFile::ReadOnly)) {
  193. QTextStream read(&qglobal_h);
  194. QRegExp version_regexp("^# *define *QT_VERSION_STR *\"([^\"]*)\"");
  195. QString line;
  196. while (!read.atEnd()) {
  197. line = read.readLine();
  198. if (version_regexp.exactMatch(line)) {
  199. version = version_regexp.cap(1).trimmed();
  200. if (!version.isEmpty())
  201. break;
  202. }
  203. }
  204. qglobal_h.close();
  205. }
  206. if (version.isEmpty())
  207. version = QString("%1.%2.%3").arg(QT_VERSION>>16).arg(((QT_VERSION>>8)&0xff)).arg(QT_VERSION&0xff);
  208. dictionary[ "VERSION" ] = version;
  209. {
  210. QRegExp version_re("([0-9]*)\\.([0-9]*)\\.([0-9]*)(|-.*)");
  211. if (version_re.exactMatch(version)) {
  212. dictionary[ "VERSION_MAJOR" ] = version_re.cap(1);
  213. dictionary[ "VERSION_MINOR" ] = version_re.cap(2);
  214. dictionary[ "VERSION_PATCH" ] = version_re.cap(3);
  215. }
  216. }
  217. dictionary[ "REDO" ] = "no";
  218. dictionary[ "DEPENDENCIES" ] = "no";
  219. dictionary[ "BUILD" ] = "debug";
  220. dictionary[ "BUILDALL" ] = "auto"; // Means yes, but not explicitly
  221. dictionary[ "FORCEDEBUGINFO" ] = "no";
  222. dictionary[ "BUILDTYPE" ] = "none";
  223. dictionary[ "BUILDDEV" ] = "no";
  224. dictionary[ "COMPILE_EXAMPLES" ] = "yes";
  225. dictionary[ "C++11" ] = "auto";
  226. dictionary[ "SHARED" ] = "yes";
  227. dictionary[ "ZLIB" ] = "auto";
  228. dictionary[ "PCRE" ] = "auto";
  229. dictionary[ "ICU" ] = "auto";
  230. dictionary[ "ANGLE" ] = "auto";
  231. dictionary[ "DYNAMICGL" ] = "auto";
  232. dictionary[ "GIF" ] = "auto";
  233. dictionary[ "JPEG" ] = "auto";
  234. dictionary[ "PNG" ] = "auto";
  235. dictionary[ "LIBJPEG" ] = "auto";
  236. dictionary[ "LIBPNG" ] = "auto";
  237. dictionary[ "FREETYPE" ] = "yes";
  238. dictionary[ "HARFBUZZ" ] = "no";
  239. dictionary[ "ACCESSIBILITY" ] = "yes";
  240. dictionary[ "OPENGL" ] = "yes";
  241. dictionary[ "OPENGL_ES_2" ] = "yes";
  242. dictionary[ "OPENVG" ] = "no";
  243. dictionary[ "OPENSSL" ] = "auto";
  244. dictionary[ "DBUS" ] = "auto";
  245. dictionary[ "STYLE_WINDOWS" ] = "yes";
  246. dictionary[ "STYLE_WINDOWSXP" ] = "auto";
  247. dictionary[ "STYLE_WINDOWSVISTA" ] = "auto";
  248. dictionary[ "STYLE_FUSION" ] = "yes";
  249. dictionary[ "STYLE_WINDOWSCE" ] = "no";
  250. dictionary[ "STYLE_WINDOWSMOBILE" ] = "no";
  251. dictionary[ "STYLE_GTK" ] = "no";
  252. dictionary[ "SQL_MYSQL" ] = "no";
  253. dictionary[ "SQL_ODBC" ] = "no";
  254. dictionary[ "SQL_OCI" ] = "no";
  255. dictionary[ "SQL_PSQL" ] = "no";
  256. dictionary[ "SQL_TDS" ] = "no";
  257. dictionary[ "SQL_DB2" ] = "no";
  258. dictionary[ "SQL_SQLITE" ] = "auto";
  259. dictionary[ "SQL_SQLITE_LIB" ] = "qt";
  260. dictionary[ "SQL_SQLITE2" ] = "no";
  261. dictionary[ "SQL_IBASE" ] = "no";
  262. QString tmp = dictionary[ "QMAKESPEC" ];
  263. if (tmp.contains("\\")) {
  264. tmp = tmp.mid(tmp.lastIndexOf("\\") + 1);
  265. } else {
  266. tmp = tmp.mid(tmp.lastIndexOf("/") + 1);
  267. }
  268. dictionary[ "QMAKESPEC" ] = tmp;
  269. dictionary[ "INCREDIBUILD_XGE" ] = "auto";
  270. dictionary[ "LTCG" ] = "no";
  271. dictionary[ "NATIVE_GESTURES" ] = "yes";
  272. dictionary[ "MSVC_MP" ] = "no";
  273. }
  274. Configure::~Configure()
  275. {
  276. for (int i=0; i<3; ++i) {
  277. QList<MakeItem*> items = makeList[i];
  278. for (int j=0; j<items.size(); ++j)
  279. delete items[j];
  280. }
  281. }
  282. QString Configure::formatPath(const QString &path)
  283. {
  284. QString ret = QDir::cleanPath(path);
  285. // This amount of quoting is deemed sufficient.
  286. if (ret.contains(QLatin1Char(' '))) {
  287. ret.prepend(QLatin1Char('"'));
  288. ret.append(QLatin1Char('"'));
  289. }
  290. return ret;
  291. }
  292. QString Configure::formatPaths(const QStringList &paths)
  293. {
  294. QString ret;
  295. foreach (const QString &path, paths) {
  296. if (!ret.isEmpty())
  297. ret += QLatin1Char(' ');
  298. ret += formatPath(path);
  299. }
  300. return ret;
  301. }
  302. // We could use QDir::homePath() + "/.qt-license", but
  303. // that will only look in the first of $HOME,$USERPROFILE
  304. // or $HOMEDRIVE$HOMEPATH. So, here we try'em all to be
  305. // more forgiving for the end user..
  306. QString Configure::firstLicensePath()
  307. {
  308. QStringList allPaths;
  309. allPaths << "./.qt-license"
  310. << QString::fromLocal8Bit(getenv("HOME")) + "/.qt-license"
  311. << QString::fromLocal8Bit(getenv("USERPROFILE")) + "/.qt-license"
  312. << QString::fromLocal8Bit(getenv("HOMEDRIVE")) + QString::fromLocal8Bit(getenv("HOMEPATH")) + "/.qt-license";
  313. for (int i = 0; i< allPaths.count(); ++i)
  314. if (QFile::exists(allPaths.at(i)))
  315. return allPaths.at(i);
  316. return QString();
  317. }
  318. // #### somehow I get a compiler error about vc++ reaching the nesting limit without
  319. // undefining the ansi for scoping.
  320. #ifdef for
  321. #undef for
  322. #endif
  323. void Configure::parseCmdLine()
  324. {
  325. if (configCmdLine.size() && configCmdLine.at(0) == "-top-level") {
  326. dictionary[ "TOPLEVEL" ] = "yes";
  327. configCmdLine.removeAt(0);
  328. }
  329. int argCount = configCmdLine.size();
  330. int i = 0;
  331. const QStringList imageFormats = QStringList() << "gif" << "png" << "jpeg";
  332. if (argCount < 1) // skip rest if no arguments
  333. ;
  334. else if (configCmdLine.at(i) == "-redo") {
  335. dictionary[ "REDO" ] = "yes";
  336. configCmdLine.clear();
  337. reloadCmdLine();
  338. }
  339. else if (configCmdLine.at(i) == "-loadconfig") {
  340. ++i;
  341. if (i != argCount) {
  342. dictionary[ "REDO" ] = "yes";
  343. dictionary[ "CUSTOMCONFIG" ] = "_" + configCmdLine.at(i);
  344. configCmdLine.clear();
  345. reloadCmdLine();
  346. } else {
  347. dictionary[ "DONE" ] = "error";
  348. }
  349. i = 0;
  350. }
  351. argCount = configCmdLine.size();
  352. bool isDeviceMkspec = false;
  353. // Look first for XQMAKESPEC
  354. for (int j = 0 ; j < argCount; ++j)
  355. {
  356. if ((configCmdLine.at(j) == "-xplatform") || (configCmdLine.at(j) == "-device")) {
  357. isDeviceMkspec = (configCmdLine.at(j) == "-device");
  358. ++j;
  359. if (j == argCount)
  360. break;
  361. dictionary["XQMAKESPEC"] = configCmdLine.at(j);
  362. applySpecSpecifics();
  363. break;
  364. }
  365. }
  366. for (; i<configCmdLine.size(); ++i) {
  367. bool continueElse[] = {false, false};
  368. if (configCmdLine.at(i) == "-help"
  369. || configCmdLine.at(i) == "-h"
  370. || configCmdLine.at(i) == "-?")
  371. dictionary[ "HELP" ] = "yes";
  372. else if (configCmdLine.at(i) == "-qconfig") {
  373. ++i;
  374. if (i == argCount)
  375. break;
  376. dictionary[ "QCONFIG" ] = configCmdLine.at(i);
  377. }
  378. else if (configCmdLine.at(i) == "-qreal") {
  379. ++i;
  380. if (i == argCount)
  381. break;
  382. dictionary[ "QREAL" ] = configCmdLine.at(i);
  383. }
  384. else if (configCmdLine.at(i) == "-release") {
  385. dictionary[ "BUILD" ] = "release";
  386. if (dictionary[ "BUILDALL" ] == "auto")
  387. dictionary[ "BUILDALL" ] = "no";
  388. } else if (configCmdLine.at(i) == "-debug") {
  389. dictionary[ "BUILD" ] = "debug";
  390. if (dictionary[ "BUILDALL" ] == "auto")
  391. dictionary[ "BUILDALL" ] = "no";
  392. } else if (configCmdLine.at(i) == "-debug-and-release")
  393. dictionary[ "BUILDALL" ] = "yes";
  394. else if (configCmdLine.at(i) == "-force-debug-info")
  395. dictionary[ "FORCEDEBUGINFO" ] = "yes";
  396. else if (configCmdLine.at(i) == "-compile-examples") {
  397. dictionary[ "COMPILE_EXAMPLES" ] = "yes";
  398. } else if (configCmdLine.at(i) == "-no-compile-examples") {
  399. dictionary[ "COMPILE_EXAMPLES" ] = "no";
  400. }
  401. else if (configCmdLine.at(i) == "-c++11")
  402. dictionary[ "C++11" ] = "yes";
  403. else if (configCmdLine.at(i) == "-no-c++11")
  404. dictionary[ "C++11" ] = "no";
  405. else if (configCmdLine.at(i) == "-shared")
  406. dictionary[ "SHARED" ] = "yes";
  407. else if (configCmdLine.at(i) == "-static")
  408. dictionary[ "SHARED" ] = "no";
  409. else if (configCmdLine.at(i) == "-developer-build")
  410. dictionary[ "BUILDDEV" ] = "yes";
  411. else if (configCmdLine.at(i) == "-opensource") {
  412. dictionary[ "BUILDTYPE" ] = "opensource";
  413. }
  414. else if (configCmdLine.at(i) == "-commercial") {
  415. dictionary[ "BUILDTYPE" ] = "commercial";
  416. }
  417. else if (configCmdLine.at(i) == "-ltcg") {
  418. dictionary[ "LTCG" ] = "yes";
  419. }
  420. else if (configCmdLine.at(i) == "-no-ltcg") {
  421. dictionary[ "LTCG" ] = "no";
  422. }
  423. else if (configCmdLine.at(i) == "-mp") {
  424. dictionary[ "MSVC_MP" ] = "yes";
  425. }
  426. else if (configCmdLine.at(i) == "-no-mp") {
  427. dictionary[ "MSVC_MP" ] = "no";
  428. }
  429. else if (configCmdLine.at(i) == "-force-asserts") {
  430. dictionary[ "FORCE_ASSERTS" ] = "yes";
  431. }
  432. else if (configCmdLine.at(i) == "-target") {
  433. ++i;
  434. if (i == argCount)
  435. break;
  436. const QString option = configCmdLine.at(i);
  437. if (option != "xp") {
  438. cout << "ERROR: invalid argument for -target option" << endl;
  439. dictionary["DONE"] = "error";
  440. return;
  441. }
  442. dictionary["TARGET_OS"] = option;
  443. }
  444. else if (configCmdLine.at(i) == "-platform") {
  445. ++i;
  446. if (i == argCount)
  447. break;
  448. dictionary[ "QMAKESPEC" ] = configCmdLine.at(i);
  449. dictionary[ "QMAKESPEC_FROM" ] = "commandline";
  450. } else if (configCmdLine.at(i) == "-arch") {
  451. ++i;
  452. if (i == argCount)
  453. break;
  454. dictionary["OBSOLETE_ARCH_ARG"] = "yes";
  455. } else if (configCmdLine.at(i) == "-embedded") {
  456. dictionary[ "EMBEDDED" ] = "yes";
  457. } else if (configCmdLine.at(i) == "-xplatform"
  458. || configCmdLine.at(i) == "-device") {
  459. ++i;
  460. // do nothing
  461. } else if (configCmdLine.at(i) == "-device-option") {
  462. ++i;
  463. const QString option = configCmdLine.at(i);
  464. QString &devOpt = dictionary["DEVICE_OPTION"];
  465. if (!devOpt.isEmpty())
  466. devOpt.append("\n").append(option);
  467. else
  468. devOpt = option;
  469. }
  470. else if (configCmdLine.at(i) == "-no-zlib") {
  471. // No longer supported since Qt 4.4.0
  472. // But save the information for later so that we can print a warning
  473. //
  474. // If you REALLY really need no zlib support, you can still disable
  475. // it by doing the following:
  476. // add "no-zlib" to mkspecs/qconfig.pri
  477. // #define QT_NO_COMPRESS (probably by adding to src/corelib/global/qconfig.h)
  478. //
  479. // There's no guarantee that Qt will build under those conditions
  480. dictionary[ "ZLIB_FORCED" ] = "yes";
  481. } else if (configCmdLine.at(i) == "-qt-zlib") {
  482. dictionary[ "ZLIB" ] = "qt";
  483. } else if (configCmdLine.at(i) == "-system-zlib") {
  484. dictionary[ "ZLIB" ] = "system";
  485. }
  486. else if (configCmdLine.at(i) == "-qt-pcre") {
  487. dictionary[ "PCRE" ] = "qt";
  488. } else if (configCmdLine.at(i) == "-system-pcre") {
  489. dictionary[ "PCRE" ] = "system";
  490. }
  491. else if (configCmdLine.at(i) == "-icu") {
  492. dictionary[ "ICU" ] = "yes";
  493. } else if (configCmdLine.at(i) == "-no-icu") {
  494. dictionary[ "ICU" ] = "no";
  495. }
  496. else if (configCmdLine.at(i) == "-angle") {
  497. dictionary[ "ANGLE" ] = "yes";
  498. dictionary[ "ANGLE_FROM" ] = "commandline";
  499. } else if (configCmdLine.at(i) == "-angle-d3d11") {
  500. dictionary[ "ANGLE" ] = "d3d11";
  501. dictionary[ "ANGLE_FROM" ] = "commandline";
  502. } else if (configCmdLine.at(i) == "-no-angle") {
  503. dictionary[ "ANGLE" ] = "no";
  504. dictionary[ "ANGLE_FROM" ] = "commandline";
  505. }
  506. // Image formats --------------------------------------------
  507. else if (configCmdLine.at(i) == "-no-gif")
  508. dictionary[ "GIF" ] = "no";
  509. else if (configCmdLine.at(i) == "-no-libjpeg") {
  510. dictionary[ "JPEG" ] = "no";
  511. dictionary[ "LIBJPEG" ] = "no";
  512. } else if (configCmdLine.at(i) == "-qt-libjpeg") {
  513. dictionary[ "LIBJPEG" ] = "qt";
  514. } else if (configCmdLine.at(i) == "-system-libjpeg") {
  515. dictionary[ "LIBJPEG" ] = "system";
  516. }
  517. else if (configCmdLine.at(i) == "-no-libpng") {
  518. dictionary[ "PNG" ] = "no";
  519. dictionary[ "LIBPNG" ] = "no";
  520. } else if (configCmdLine.at(i) == "-qt-libpng") {
  521. dictionary[ "LIBPNG" ] = "qt";
  522. } else if (configCmdLine.at(i) == "-system-libpng") {
  523. dictionary[ "LIBPNG" ] = "system";
  524. }
  525. // Text Rendering --------------------------------------------
  526. else if (configCmdLine.at(i) == "-no-freetype")
  527. dictionary[ "FREETYPE" ] = "no";
  528. else if (configCmdLine.at(i) == "-qt-freetype")
  529. dictionary[ "FREETYPE" ] = "yes";
  530. else if (configCmdLine.at(i) == "-system-freetype")
  531. dictionary[ "FREETYPE" ] = "system";
  532. else if (configCmdLine.at(i) == "-no-harfbuzz")
  533. dictionary[ "HARFBUZZ" ] = "no";
  534. else if (configCmdLine.at(i) == "-qt-harfbuzz")
  535. dictionary[ "HARFBUZZ" ] = "yes";
  536. else if (configCmdLine.at(i) == "-system-harfbuzz")
  537. dictionary[ "HARFBUZZ" ] = "system";
  538. // CE- C runtime --------------------------------------------
  539. else if (configCmdLine.at(i) == "-crt") {
  540. ++i;
  541. if (i == argCount)
  542. break;
  543. QDir cDir(configCmdLine.at(i));
  544. if (!cDir.exists())
  545. cout << "WARNING: Could not find directory (" << qPrintable(configCmdLine.at(i)) << ")for C runtime deployment" << endl;
  546. else
  547. dictionary[ "CE_CRT" ] = QDir::toNativeSeparators(cDir.absolutePath());
  548. } else if (configCmdLine.at(i) == "-qt-crt") {
  549. dictionary[ "CE_CRT" ] = "yes";
  550. } else if (configCmdLine.at(i) == "-no-crt") {
  551. dictionary[ "CE_CRT" ] = "no";
  552. }
  553. // cetest ---------------------------------------------------
  554. else if (configCmdLine.at(i) == "-no-cetest") {
  555. dictionary[ "CETEST" ] = "no";
  556. dictionary[ "CETEST_REQUESTED" ] = "no";
  557. } else if (configCmdLine.at(i) == "-cetest") {
  558. // although specified to use it, we stay at "auto" state
  559. // this is because checkAvailability() adds variables
  560. // we need for crosscompilation; but remember if we asked
  561. // for it.
  562. dictionary[ "CETEST_REQUESTED" ] = "yes";
  563. }
  564. // Qt/CE - signing tool -------------------------------------
  565. else if (configCmdLine.at(i) == "-signature") {
  566. ++i;
  567. if (i == argCount)
  568. break;
  569. QFileInfo info(configCmdLine.at(i));
  570. if (!info.exists())
  571. cout << "WARNING: Could not find signature file (" << qPrintable(configCmdLine.at(i)) << ")" << endl;
  572. else
  573. dictionary[ "CE_SIGNATURE" ] = QDir::toNativeSeparators(info.absoluteFilePath());
  574. }
  575. // Styles ---------------------------------------------------
  576. else if (configCmdLine.at(i) == "-qt-style-windows")
  577. dictionary[ "STYLE_WINDOWS" ] = "yes";
  578. else if (configCmdLine.at(i) == "-no-style-windows")
  579. dictionary[ "STYLE_WINDOWS" ] = "no";
  580. else if (configCmdLine.at(i) == "-qt-style-windowsce")
  581. dictionary[ "STYLE_WINDOWSCE" ] = "yes";
  582. else if (configCmdLine.at(i) == "-no-style-windowsce")
  583. dictionary[ "STYLE_WINDOWSCE" ] = "no";
  584. else if (configCmdLine.at(i) == "-qt-style-windowsmobile")
  585. dictionary[ "STYLE_WINDOWSMOBILE" ] = "yes";
  586. else if (configCmdLine.at(i) == "-no-style-windowsmobile")
  587. dictionary[ "STYLE_WINDOWSMOBILE" ] = "no";
  588. else if (configCmdLine.at(i) == "-qt-style-windowsxp")
  589. dictionary[ "STYLE_WINDOWSXP" ] = "yes";
  590. else if (configCmdLine.at(i) == "-no-style-windowsxp")
  591. dictionary[ "STYLE_WINDOWSXP" ] = "no";
  592. else if (configCmdLine.at(i) == "-qt-style-windowsvista")
  593. dictionary[ "STYLE_WINDOWSVISTA" ] = "yes";
  594. else if (configCmdLine.at(i) == "-no-style-windowsvista")
  595. dictionary[ "STYLE_WINDOWSVISTA" ] = "no";
  596. else if (configCmdLine.at(i) == "-qt-style-fusion")
  597. dictionary[ "STYLE_FUSION" ] = "yes";
  598. else if (configCmdLine.at(i) == "-no-style-fusion")
  599. dictionary[ "STYLE_FUSION" ] = "no";
  600. // Work around compiler nesting limitation
  601. else
  602. continueElse[1] = true;
  603. if (!continueElse[1]) {
  604. }
  605. // OpenGL Support -------------------------------------------
  606. else if (configCmdLine.at(i) == "-no-opengl") {
  607. dictionary[ "OPENGL" ] = "no";
  608. dictionary[ "OPENGL_ES_2" ] = "no";
  609. } else if (configCmdLine.at(i) == "-opengl-es-2") {
  610. dictionary[ "OPENGL" ] = "yes";
  611. dictionary[ "OPENGL_ES_2" ] = "yes";
  612. } else if (configCmdLine.at(i) == "-opengl") {
  613. dictionary[ "OPENGL" ] = "yes";
  614. i++;
  615. if (i == argCount)
  616. break;
  617. dictionary[ "OPENGL_ES_2" ] = "no";
  618. if ( configCmdLine.at(i) == "es2" ) {
  619. dictionary[ "OPENGL_ES_2" ] = "yes";
  620. } else if ( configCmdLine.at(i) == "desktop" ) {
  621. // OPENGL=yes suffices
  622. } else if ( configCmdLine.at(i) == "dynamic" ) {
  623. dictionary[ "DYNAMICGL" ] = "yes";
  624. } else {
  625. cout << "Argument passed to -opengl option is not valid." << endl;
  626. dictionary[ "DONE" ] = "error";
  627. break;
  628. }
  629. }
  630. // OpenVG Support -------------------------------------------
  631. else if (configCmdLine.at(i) == "-openvg") {
  632. dictionary[ "OPENVG" ] = "yes";
  633. } else if (configCmdLine.at(i) == "-no-openvg") {
  634. dictionary[ "OPENVG" ] = "no";
  635. }
  636. // Databases ------------------------------------------------
  637. else if (configCmdLine.at(i) == "-qt-sql-mysql")
  638. dictionary[ "SQL_MYSQL" ] = "yes";
  639. else if (configCmdLine.at(i) == "-plugin-sql-mysql")
  640. dictionary[ "SQL_MYSQL" ] = "plugin";
  641. else if (configCmdLine.at(i) == "-no-sql-mysql")
  642. dictionary[ "SQL_MYSQL" ] = "no";
  643. else if (configCmdLine.at(i) == "-qt-sql-odbc")
  644. dictionary[ "SQL_ODBC" ] = "yes";
  645. else if (configCmdLine.at(i) == "-plugin-sql-odbc")
  646. dictionary[ "SQL_ODBC" ] = "plugin";
  647. else if (configCmdLine.at(i) == "-no-sql-odbc")
  648. dictionary[ "SQL_ODBC" ] = "no";
  649. else if (configCmdLine.at(i) == "-qt-sql-oci")
  650. dictionary[ "SQL_OCI" ] = "yes";
  651. else if (configCmdLine.at(i) == "-plugin-sql-oci")
  652. dictionary[ "SQL_OCI" ] = "plugin";
  653. else if (configCmdLine.at(i) == "-no-sql-oci")
  654. dictionary[ "SQL_OCI" ] = "no";
  655. else if (configCmdLine.at(i) == "-qt-sql-psql")
  656. dictionary[ "SQL_PSQL" ] = "yes";
  657. else if (configCmdLine.at(i) == "-plugin-sql-psql")
  658. dictionary[ "SQL_PSQL" ] = "plugin";
  659. else if (configCmdLine.at(i) == "-no-sql-psql")
  660. dictionary[ "SQL_PSQL" ] = "no";
  661. else if (configCmdLine.at(i) == "-qt-sql-tds")
  662. dictionary[ "SQL_TDS" ] = "yes";
  663. else if (configCmdLine.at(i) == "-plugin-sql-tds")
  664. dictionary[ "SQL_TDS" ] = "plugin";
  665. else if (configCmdLine.at(i) == "-no-sql-tds")
  666. dictionary[ "SQL_TDS" ] = "no";
  667. else if (configCmdLine.at(i) == "-qt-sql-db2")
  668. dictionary[ "SQL_DB2" ] = "yes";
  669. else if (configCmdLine.at(i) == "-plugin-sql-db2")
  670. dictionary[ "SQL_DB2" ] = "plugin";
  671. else if (configCmdLine.at(i) == "-no-sql-db2")
  672. dictionary[ "SQL_DB2" ] = "no";
  673. else if (configCmdLine.at(i) == "-qt-sql-sqlite")
  674. dictionary[ "SQL_SQLITE" ] = "yes";
  675. else if (configCmdLine.at(i) == "-plugin-sql-sqlite")
  676. dictionary[ "SQL_SQLITE" ] = "plugin";
  677. else if (configCmdLine.at(i) == "-no-sql-sqlite")
  678. dictionary[ "SQL_SQLITE" ] = "no";
  679. else if (configCmdLine.at(i) == "-system-sqlite")
  680. dictionary[ "SQL_SQLITE_LIB" ] = "system";
  681. else if (configCmdLine.at(i) == "-qt-sql-sqlite2")
  682. dictionary[ "SQL_SQLITE2" ] = "yes";
  683. else if (configCmdLine.at(i) == "-plugin-sql-sqlite2")
  684. dictionary[ "SQL_SQLITE2" ] = "plugin";
  685. else if (configCmdLine.at(i) == "-no-sql-sqlite2")
  686. dictionary[ "SQL_SQLITE2" ] = "no";
  687. else if (configCmdLine.at(i) == "-qt-sql-ibase")
  688. dictionary[ "SQL_IBASE" ] = "yes";
  689. else if (configCmdLine.at(i) == "-plugin-sql-ibase")
  690. dictionary[ "SQL_IBASE" ] = "plugin";
  691. else if (configCmdLine.at(i) == "-no-sql-ibase")
  692. dictionary[ "SQL_IBASE" ] = "no";
  693. // Image formats --------------------------------------------
  694. else if (configCmdLine.at(i).startsWith("-qt-imageformat-") &&
  695. imageFormats.contains(configCmdLine.at(i).section('-', 3)))
  696. dictionary[ configCmdLine.at(i).section('-', 3).toUpper() ] = "yes";
  697. else if (configCmdLine.at(i).startsWith("-plugin-imageformat-") &&
  698. imageFormats.contains(configCmdLine.at(i).section('-', 3)))
  699. dictionary[ configCmdLine.at(i).section('-', 3).toUpper() ] = "plugin";
  700. else if (configCmdLine.at(i).startsWith("-no-imageformat-") &&
  701. imageFormats.contains(configCmdLine.at(i).section('-', 3)))
  702. dictionary[ configCmdLine.at(i).section('-', 3).toUpper() ] = "no";
  703. // IDE project generation -----------------------------------
  704. else if (configCmdLine.at(i) == "-no-vcproj")
  705. dictionary[ "VCPROJFILES" ] = "no";
  706. else if (configCmdLine.at(i) == "-vcproj")
  707. dictionary[ "VCPROJFILES" ] = "yes";
  708. else if (configCmdLine.at(i) == "-no-incredibuild-xge")
  709. dictionary[ "INCREDIBUILD_XGE" ] = "no";
  710. else if (configCmdLine.at(i) == "-incredibuild-xge")
  711. dictionary[ "INCREDIBUILD_XGE" ] = "yes";
  712. else if (configCmdLine.at(i) == "-native-gestures")
  713. dictionary[ "NATIVE_GESTURES" ] = "yes";
  714. else if (configCmdLine.at(i) == "-no-native-gestures")
  715. dictionary[ "NATIVE_GESTURES" ] = "no";
  716. // Others ---------------------------------------------------
  717. else if (configCmdLine.at(i) == "-widgets")
  718. dictionary[ "WIDGETS" ] = "yes";
  719. else if (configCmdLine.at(i) == "-no-widgets")
  720. dictionary[ "WIDGETS" ] = "no";
  721. else if (configCmdLine.at(i) == "-gui")
  722. dictionary[ "GUI" ] = "yes";
  723. else if (configCmdLine.at(i) == "-no-gui")
  724. dictionary[ "GUI" ] = "no";
  725. else if (configCmdLine.at(i) == "-rtti")
  726. dictionary[ "RTTI" ] = "yes";
  727. else if (configCmdLine.at(i) == "-no-rtti")
  728. dictionary[ "RTTI" ] = "no";
  729. else if (configCmdLine.at(i) == "-strip")
  730. dictionary[ "STRIP" ] = "yes";
  731. else if (configCmdLine.at(i) == "-no-strip")
  732. dictionary[ "STRIP" ] = "no";
  733. else if (configCmdLine.at(i) == "-accessibility")
  734. dictionary[ "ACCESSIBILITY" ] = "yes";
  735. else if (configCmdLine.at(i) == "-no-accessibility") {
  736. dictionary[ "ACCESSIBILITY" ] = "no";
  737. cout << "Setting accessibility to NO" << endl;
  738. }
  739. else if (configCmdLine.at(i) == "-no-sse2")
  740. dictionary[ "SSE2" ] = "no";
  741. else if (configCmdLine.at(i) == "-sse2")
  742. dictionary[ "SSE2" ] = "yes";
  743. else if (configCmdLine.at(i) == "-no-sse3")
  744. dictionary[ "SSE3" ] = "no";
  745. else if (configCmdLine.at(i) == "-sse3")
  746. dictionary[ "SSE3" ] = "yes";
  747. else if (configCmdLine.at(i) == "-no-ssse3")
  748. dictionary[ "SSSE3" ] = "no";
  749. else if (configCmdLine.at(i) == "-ssse3")
  750. dictionary[ "SSSE3" ] = "yes";
  751. else if (configCmdLine.at(i) == "-no-sse4.1")
  752. dictionary[ "SSE4_1" ] = "no";
  753. else if (configCmdLine.at(i) == "-sse4.1")
  754. dictionary[ "SSE4_1" ] = "yes";
  755. else if (configCmdLine.at(i) == "-no-sse4.2")
  756. dictionary[ "SSE4_2" ] = "no";
  757. else if (configCmdLine.at(i) == "-sse4.2")
  758. dictionary[ "SSE4_2" ] = "yes";
  759. else if (configCmdLine.at(i) == "-no-avx")
  760. dictionary[ "AVX" ] = "no";
  761. else if (configCmdLine.at(i) == "-avx")
  762. dictionary[ "AVX" ] = "yes";
  763. else if (configCmdLine.at(i) == "-no-avx2")
  764. dictionary[ "AVX2" ] = "no";
  765. else if (configCmdLine.at(i) == "-avx2")
  766. dictionary[ "AVX2" ] = "yes";
  767. else if (configCmdLine.at(i) == "-no-iwmmxt")
  768. dictionary[ "IWMMXT" ] = "no";
  769. else if (configCmdLine.at(i) == "-iwmmxt")
  770. dictionary[ "IWMMXT" ] = "yes";
  771. else if (configCmdLine.at(i) == "-no-openssl") {
  772. dictionary[ "OPENSSL"] = "no";
  773. } else if (configCmdLine.at(i) == "-openssl") {
  774. dictionary[ "OPENSSL" ] = "yes";
  775. } else if (configCmdLine.at(i) == "-openssl-linked") {
  776. dictionary[ "OPENSSL" ] = "linked";
  777. } else if (configCmdLine.at(i) == "-no-qdbus") {
  778. dictionary[ "DBUS" ] = "no";
  779. } else if (configCmdLine.at(i) == "-qdbus") {
  780. dictionary[ "DBUS" ] = "yes";
  781. } else if (configCmdLine.at(i) == "-no-dbus") {
  782. dictionary[ "DBUS" ] = "no";
  783. } else if (configCmdLine.at(i) == "-dbus") {
  784. dictionary[ "DBUS" ] = "yes";
  785. } else if (configCmdLine.at(i) == "-dbus-linked") {
  786. dictionary[ "DBUS" ] = "linked";
  787. } else if (configCmdLine.at(i) == "-audio-backend") {
  788. dictionary[ "AUDIO_BACKEND" ] = "yes";
  789. } else if (configCmdLine.at(i) == "-no-audio-backend") {
  790. dictionary[ "AUDIO_BACKEND" ] = "no";
  791. } else if (configCmdLine.at(i) == "-wmf-backend") {
  792. dictionary[ "WMF_BACKEND" ] = "yes";
  793. } else if (configCmdLine.at(i) == "-no-wmf-backend") {
  794. dictionary[ "WMF_BACKEND" ] = "no";
  795. } else if (configCmdLine.at(i) == "-no-qml-debug") {
  796. dictionary[ "QML_DEBUG" ] = "no";
  797. } else if (configCmdLine.at(i) == "-qml-debug") {
  798. dictionary[ "QML_DEBUG" ] = "yes";
  799. } else if (configCmdLine.at(i) == "-no-plugin-manifests") {
  800. dictionary[ "PLUGIN_MANIFESTS" ] = "no";
  801. } else if (configCmdLine.at(i) == "-plugin-manifests") {
  802. dictionary[ "PLUGIN_MANIFESTS" ] = "yes";
  803. } else if (configCmdLine.at(i) == "-no-slog2") {
  804. dictionary[ "SLOG2" ] = "no";
  805. } else if (configCmdLine.at(i) == "-slog2") {
  806. dictionary[ "SLOG2" ] = "yes";
  807. } else if (configCmdLine.at(i) == "-no-imf") {
  808. dictionary[ "QNX_IMF" ] = "no";
  809. } else if (configCmdLine.at(i) == "-imf") {
  810. dictionary[ "QNX_IMF" ] = "yes";
  811. } else if (configCmdLine.at(i) == "-no-pps") {
  812. dictionary[ "PPS" ] = "no";
  813. } else if (configCmdLine.at(i) == "-pps") {
  814. dictionary[ "PPS" ] = "yes";
  815. } else if (configCmdLine.at(i) == "-no-lgmon") {
  816. dictionary[ "LGMON" ] = "no";
  817. } else if (configCmdLine.at(i) == "-lgmon") {
  818. dictionary[ "LGMON" ] = "yes";
  819. } else if (configCmdLine.at(i) == "-no-system-proxies") {
  820. dictionary[ "SYSTEM_PROXIES" ] = "no";
  821. } else if (configCmdLine.at(i) == "-system-proxies") {
  822. dictionary[ "SYSTEM_PROXIES" ] = "yes";
  823. } else if (configCmdLine.at(i) == "-warnings-are-errors" ||
  824. configCmdLine.at(i) == "-Werror") {
  825. dictionary[ "WERROR" ] = "yes";
  826. } else if (configCmdLine.at(i) == "-no-warnings-are-errors") {
  827. dictionary[ "WERROR" ] = "no";
  828. } else if (configCmdLine.at(i) == "-no-eventfd") {
  829. dictionary[ "QT_EVENTFD" ] = "no";
  830. } else if (configCmdLine.at(i) == "-eventfd") {
  831. dictionary[ "QT_EVENTFD" ] = "yes";
  832. }
  833. // Work around compiler nesting limitation
  834. else
  835. continueElse[0] = true;
  836. if (!continueElse[0]) {
  837. }
  838. else if (configCmdLine.at(i) == "-internal")
  839. dictionary[ "QMAKE_INTERNAL" ] = "yes";
  840. else if (configCmdLine.at(i) == "-no-syncqt")
  841. dictionary[ "SYNCQT" ] = "no";
  842. else if (configCmdLine.at(i) == "-no-qmake")
  843. dictionary[ "BUILD_QMAKE" ] = "no";
  844. else if (configCmdLine.at(i) == "-qmake")
  845. dictionary[ "BUILD_QMAKE" ] = "yes";
  846. else if (configCmdLine.at(i) == "-dont-process")
  847. dictionary[ "PROCESS" ] = "no";
  848. else if (configCmdLine.at(i) == "-process")
  849. dictionary[ "PROCESS" ] = "partial";
  850. else if (configCmdLine.at(i) == "-fully-process")
  851. dictionary[ "PROCESS" ] = "full";
  852. else if (configCmdLine.at(i) == "-no-qmake-deps")
  853. dictionary[ "DEPENDENCIES" ] = "no";
  854. else if (configCmdLine.at(i) == "-qmake-deps")
  855. dictionary[ "DEPENDENCIES" ] = "yes";
  856. else if (configCmdLine.at(i) == "-qtnamespace") {
  857. ++i;
  858. if (i == argCount)
  859. break;
  860. dictionary[ "QT_NAMESPACE" ] = configCmdLine.at(i);
  861. } else if (configCmdLine.at(i) == "-qtlibinfix") {
  862. ++i;
  863. if (i == argCount)
  864. break;
  865. dictionary[ "QT_LIBINFIX" ] = configCmdLine.at(i);
  866. } else if (configCmdLine.at(i) == "-D") {
  867. ++i;
  868. if (i == argCount)
  869. break;
  870. qmakeDefines += configCmdLine.at(i);
  871. } else if (configCmdLine.at(i) == "-I") {
  872. ++i;
  873. if (i == argCount)
  874. break;
  875. qmakeIncludes += configCmdLine.at(i);
  876. } else if (configCmdLine.at(i) == "-L") {
  877. ++i;
  878. if (i == argCount)
  879. break;
  880. QFileInfo checkDirectory(configCmdLine.at(i));
  881. if (!checkDirectory.isDir()) {
  882. cout << "Argument passed to -L option is not a directory path. Did you mean the -l option?" << endl;
  883. dictionary[ "DONE" ] = "error";
  884. break;
  885. }
  886. qmakeLibs += QString("-L" + configCmdLine.at(i));
  887. } else if (configCmdLine.at(i) == "-l") {
  888. ++i;
  889. if (i == argCount)
  890. break;
  891. qmakeLibs += QString("-l" + configCmdLine.at(i));
  892. } else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS=")) {
  893. opensslLibs = configCmdLine.at(i);
  894. } else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS_DEBUG=")) {
  895. opensslLibsDebug = configCmdLine.at(i);
  896. } else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS_RELEASE=")) {
  897. opensslLibsRelease = configCmdLine.at(i);
  898. } else if (configCmdLine.at(i).startsWith("OPENSSL_PATH=")) {
  899. opensslPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1));
  900. } else if (configCmdLine.at(i).startsWith("PSQL_LIBS=")) {
  901. psqlLibs = configCmdLine.at(i);
  902. } else if (configCmdLine.at(i).startsWith("SYBASE=")) {
  903. sybase = configCmdLine.at(i);
  904. } else if (configCmdLine.at(i).startsWith("SYBASE_LIBS=")) {
  905. sybaseLibs = configCmdLine.at(i);
  906. } else if (configCmdLine.at(i).startsWith("DBUS_PATH=")) {
  907. dbusPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1));
  908. } else if (configCmdLine.at(i).startsWith("MYSQL_PATH=")) {
  909. mysqlPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1));
  910. } else if (configCmdLine.at(i).startsWith("ZLIB_LIBS=")) {
  911. zlibLibs = QDir::fromNativeSeparators(configCmdLine.at(i));
  912. }
  913. else if ((configCmdLine.at(i) == "-override-version") || (configCmdLine.at(i) == "-version-override")){
  914. ++i;
  915. if (i == argCount)
  916. break;
  917. dictionary[ "VERSION" ] = configCmdLine.at(i);
  918. }
  919. else if (configCmdLine.at(i) == "-saveconfig") {
  920. ++i;
  921. if (i == argCount)
  922. break;
  923. dictionary[ "CUSTOMCONFIG" ] = "_" + configCmdLine.at(i);
  924. }
  925. else if (configCmdLine.at(i) == "-confirm-license") {
  926. dictionary["LICENSE_CONFIRMED"] = "yes";
  927. }
  928. else if (configCmdLine.at(i) == "-make") {
  929. ++i;
  930. if (i == argCount)
  931. break;
  932. QString part = configCmdLine.at(i);
  933. if (!allBuildParts.contains(part)) {
  934. cout << "Unknown part " << part << " passed to -make." << endl;
  935. dictionary["DONE"] = "error";
  936. }
  937. buildParts += part;
  938. } else if (configCmdLine.at(i) == "-nomake") {
  939. ++i;
  940. if (i == argCount)
  941. break;
  942. QString part = configCmdLine.at(i);
  943. if (!allBuildParts.contains(part)) {
  944. cout << "Unknown part " << part << " passed to -nomake." << endl;
  945. dictionary["DONE"] = "error";
  946. }
  947. nobuildParts += part;
  948. }
  949. else if (configCmdLine.at(i) == "-skip") {
  950. ++i;
  951. if (i == argCount)
  952. break;
  953. QString mod = configCmdLine.at(i);
  954. if (!mod.startsWith(QStringLiteral("qt")))
  955. mod.insert(0, QStringLiteral("qt"));
  956. if (!QFileInfo(sourcePath + "/../" + mod).isDir()) {
  957. cout << "Attempting to skip non-existent module " << mod << "." << endl;
  958. dictionary["DONE"] = "error";
  959. }
  960. skipModules += mod;
  961. }
  962. // Directories ----------------------------------------------
  963. else if (configCmdLine.at(i) == "-prefix") {
  964. ++i;
  965. if (i == argCount)
  966. break;
  967. dictionary[ "QT_INSTALL_PREFIX" ] = configCmdLine.at(i);
  968. }
  969. else if (configCmdLine.at(i) == "-bindir") {
  970. ++i;
  971. if (i == argCount)
  972. break;
  973. dictionary[ "QT_INSTALL_BINS" ] = configCmdLine.at(i);
  974. }
  975. else if (configCmdLine.at(i) == "-libexecdir") {
  976. ++i;
  977. if (i == argCount)
  978. break;
  979. dictionary[ "QT_INSTALL_LIBEXECS" ] = configCmdLine.at(i);
  980. }
  981. else if (configCmdLine.at(i) == "-libdir") {
  982. ++i;
  983. if (i == argCount)
  984. break;
  985. dictionary[ "QT_INSTALL_LIBS" ] = configCmdLine.at(i);
  986. }
  987. else if (configCmdLine.at(i) == "-docdir") {
  988. ++i;
  989. if (i == argCount)
  990. break;
  991. dictionary[ "QT_INSTALL_DOCS" ] = configCmdLine.at(i);
  992. }
  993. else if (configCmdLine.at(i) == "-headerdir") {
  994. ++i;
  995. if (i == argCount)
  996. break;
  997. dictionary[ "QT_INSTALL_HEADERS" ] = configCmdLine.at(i);
  998. }
  999. else if (configCmdLine.at(i) == "-plugindir") {
  1000. ++i;
  1001. if (i == argCount)
  1002. break;
  1003. dictionary[ "QT_INSTALL_PLUGINS" ] = configCmdLine.at(i);
  1004. }
  1005. else if (configCmdLine.at(i) == "-importdir") {
  1006. ++i;
  1007. if (i == argCount)
  1008. break;
  1009. dictionary[ "QT_INSTALL_IMPORTS" ] = configCmdLine.at(i);
  1010. }
  1011. else if (configCmdLine.at(i) == "-qmldir") {
  1012. ++i;
  1013. if (i == argCount)
  1014. break;
  1015. dictionary[ "QT_INSTALL_QML" ] = configCmdLine.at(i);
  1016. }
  1017. else if (configCmdLine.at(i) == "-archdatadir") {
  1018. ++i;
  1019. if (i == argCount)
  1020. break;
  1021. dictionary[ "QT_INSTALL_ARCHDATA" ] = configCmdLine.at(i);
  1022. }
  1023. else if (configCmdLine.at(i) == "-datadir") {
  1024. ++i;
  1025. if (i == argCount)
  1026. break;
  1027. dictionary[ "QT_INSTALL_DATA" ] = configCmdLine.at(i);
  1028. }
  1029. else if (configCmdLine.at(i) == "-translationdir") {
  1030. ++i;
  1031. if (i == argCount)
  1032. break;
  1033. dictionary[ "QT_INSTALL_TRANSLATIONS" ] = configCmdLine.at(i);
  1034. }
  1035. else if (configCmdLine.at(i) == "-examplesdir") {
  1036. ++i;
  1037. if (i == argCount)
  1038. break;
  1039. dictionary[ "QT_INSTALL_EXAMPLES" ] = configCmdLine.at(i);
  1040. }
  1041. else if (configCmdLine.at(i) == "-testsdir") {
  1042. ++i;
  1043. if (i == argCount)
  1044. break;
  1045. dictionary[ "QT_INSTALL_TESTS" ] = configCmdLine.at(i);
  1046. }
  1047. else if (configCmdLine.at(i) == "-sysroot") {
  1048. ++i;
  1049. if (i == argCount)
  1050. break;
  1051. dictionary[ "CFG_SYSROOT" ] = configCmdLine.at(i);
  1052. }
  1053. else if (configCmdLine.at(i) == "-no-gcc-sysroot") {
  1054. dictionary[ "CFG_GCC_SYSROOT" ] = "no";
  1055. }
  1056. else if (configCmdLine.at(i) == "-hostprefix") {
  1057. ++i;
  1058. if (i == argCount || configCmdLine.at(i).startsWith('-'))
  1059. dictionary[ "QT_HOST_PREFIX" ] = buildPath;
  1060. else
  1061. dictionary[ "QT_HOST_PREFIX" ] = configCmdLine.at(i);
  1062. }
  1063. else if (configCmdLine.at(i) == "-hostbindir") {
  1064. ++i;
  1065. if (i == argCount)
  1066. break;
  1067. dictionary[ "QT_HOST_BINS" ] = configCmdLine.at(i);
  1068. }
  1069. else if (configCmdLine.at(i) == "-hostlibdir") {
  1070. ++i;
  1071. if (i == argCount)
  1072. break;
  1073. dictionary[ "QT_HOST_LIBS" ] = configCmdLine.at(i);
  1074. }
  1075. else if (configCmdLine.at(i) == "-hostdatadir") {
  1076. ++i;
  1077. if (i == argCount)
  1078. break;
  1079. dictionary[ "QT_HOST_DATA" ] = configCmdLine.at(i);
  1080. }
  1081. else if (configCmdLine.at(i) == "-extprefix") {
  1082. ++i;
  1083. if (i == argCount)
  1084. break;
  1085. dictionary[ "QT_EXT_PREFIX" ] = configCmdLine.at(i);
  1086. }
  1087. else if (configCmdLine.at(i) == "-make-tool") {
  1088. ++i;
  1089. if (i == argCount)
  1090. break;
  1091. dictionary[ "MAKE" ] = configCmdLine.at(i);
  1092. }
  1093. else if (configCmdLine.at(i).indexOf(QRegExp("^-(en|dis)able-")) != -1) {
  1094. // Scan to see if any specific modules and drivers are enabled or disabled
  1095. for (QStringList::Iterator module = modules.begin(); module != modules.end(); ++module) {
  1096. if (configCmdLine.at(i) == QString("-enable-") + (*module)) {
  1097. enabledModules += (*module);
  1098. break;
  1099. }
  1100. else if (configCmdLine.at(i) == QString("-disable-") + (*module)) {
  1101. disabledModules += (*module);
  1102. break;
  1103. }
  1104. }
  1105. }
  1106. else if (configCmdLine.at(i) == "-directwrite") {
  1107. dictionary["DIRECTWRITE"] = "yes";
  1108. } else if (configCmdLine.at(i) == "-no-directwrite") {
  1109. dictionary["DIRECTWRITE"] = "no";
  1110. }
  1111. else if (configCmdLine.at(i) == "-direct2d") {
  1112. dictionary["DIRECT2D"] = "yes";
  1113. } else if (configCmdLine.at(i) == "-no-direct2d") {
  1114. dictionary["DIRECT2D"] = "no";
  1115. }
  1116. else if (configCmdLine.at(i) == "-nis") {
  1117. dictionary["NIS"] = "yes";
  1118. } else if (configCmdLine.at(i) == "-no-nis") {
  1119. dictionary["NIS"] = "no";
  1120. }
  1121. else if (configCmdLine.at(i) == "-cups") {
  1122. dictionary["QT_CUPS"] = "yes";
  1123. } else if (configCmdLine.at(i) == "-no-cups") {
  1124. dictionary["QT_CUPS"] = "no";
  1125. }
  1126. else if (configCmdLine.at(i) == "-iconv") {
  1127. dictionary["QT_ICONV"] = "yes";
  1128. } else if (configCmdLine.at(i) == "-no-iconv") {
  1129. dictionary["QT_ICONV"] = "no";
  1130. } else if (configCmdLine.at(i) == "-sun-iconv") {
  1131. dictionary["QT_ICONV"] = "sun";
  1132. } else if (configCmdLine.at(i) == "-gnu-iconv") {
  1133. dictionary["QT_ICONV"] = "gnu";
  1134. }
  1135. else if (configCmdLine.at(i) == "-no-evdev") {
  1136. dictionary[ "QT_EVDEV" ] = "no";
  1137. } else if (configCmdLine.at(i) == "-evdev") {
  1138. dictionary[ "QT_EVDEV" ] = "yes";
  1139. }
  1140. else if (configCmdLine.at(i) == "-no-mtdev") {
  1141. dictionary[ "QT_MTDEV" ] = "no";
  1142. } else if (configCmdLine.at(i) == "-mtdev") {
  1143. dictionary[ "QT_MTDEV" ] = "yes";
  1144. }
  1145. else if (configCmdLine.at(i) == "-inotify") {
  1146. dictionary["QT_INOTIFY"] = "yes";
  1147. } else if (configCmdLine.at(i) == "-no-inotify") {
  1148. dictionary["QT_INOTIFY"] = "no";
  1149. }
  1150. else if (configCmdLine.at(i) == "-neon") {
  1151. dictionary["NEON"] = "yes";
  1152. } else if (configCmdLine.at(i) == "-no-neon") {
  1153. dictionary["NEON"] = "no";
  1154. }
  1155. else if (configCmdLine.at(i) == "-largefile") {
  1156. dictionary["LARGE_FILE"] = "yes";
  1157. }
  1158. else if (configCmdLine.at(i)

Large files files are truncated, but you can click here to view the full file