Changeset 561 for trunk/tools/configure
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
-
. (modified) (1 prop)
-
tools/configure/configure.pro (modified) (4 diffs)
-
tools/configure/configure_pch.h (modified) (3 diffs)
-
tools/configure/configureapp.cpp (modified) (83 diffs)
-
tools/configure/configureapp.h (modified) (4 diffs)
-
tools/configure/environment.cpp (modified) (16 diffs)
-
tools/configure/environment.h (modified) (3 diffs)
-
tools/configure/main.cpp (modified) (4 diffs)
-
tools/configure/tools.cpp (modified) (8 diffs)
-
tools/configure/tools.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/tools/configure/configure.pro
r2 r561 4 4 CONFIG += console flat 5 5 CONFIG -= moc qt 6 DEFINES = QT_NODLL QT_NO_CODECS QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_LITE_COMPONENT QT_NO_STL QT_NO_COMPRESS QT_BUILD_QMAKE QT_NO_THREAD QT_NO_QOBJECT _CRT_SECURE_NO_DEPRECATE6 DEFINES = QT_NODLL QT_NO_CODECS QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_LITE_COMPONENT QT_NO_STL QT_NO_COMPRESS QT_BUILD_QMAKE QT_NO_THREAD QT_NO_QOBJECT _CRT_SECURE_NO_DEPRECATE 7 7 8 8 … … 13 13 win32-msvc* { 14 14 QMAKE_CFLAGS_RELEASE -= -MD 15 15 16 QMAKE_CFLAGS_DEBUG -= -MDd 17 16 18 QMAKE_CXXFLAGS_RELEASE -= -MD 19 17 20 QMAKE_CXXFLAGS_DEBUG -= -MDd 21 18 22 } 19 23 … … 33 37 $$QT_SOURCE_TREE/src/corelib/tools/qlocale.h \ 34 38 $$QT_SOURCE_TREE/src/corelib/tools/qvector.h \ 39 35 40 $$QT_SOURCE_TREE/src/corelib/codecs/qtextcodec.h \ 36 41 $$QT_SOURCE_TREE/src/corelib/global/qglobal.h \ … … 62 67 $$QT_SOURCE_TREE/src/corelib/tools/qchar.cpp \ 63 68 $$QT_SOURCE_TREE/src/corelib/tools/qhash.cpp \ 64 $$QT_SOURCE_TREE/src/corelib/tools/qlist data.cpp \69 $$QT_SOURCE_TREE/src/corelib/tools/qlist.cpp \ 65 70 $$QT_SOURCE_TREE/src/corelib/tools/qlocale.cpp \ 66 71 $$QT_SOURCE_TREE/src/corelib/tools/qvector.cpp \ 72 67 73 $$QT_SOURCE_TREE/src/corelib/codecs/qtextcodec.cpp \ 68 74 $$QT_SOURCE_TREE/src/corelib/global/qglobal.cpp \ -
trunk/tools/configure/configure_pch.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/configure/configureapp.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 117 117 118 118 // Get the path to the executable 119 QFileInfo sourcePathInfo; 120 QT_WA({ 121 unsigned short module_name[256]; 122 GetModuleFileNameW(0, reinterpret_cast<wchar_t *>(module_name), sizeof(module_name)); 123 sourcePathInfo = QString::fromUtf16(module_name); 124 }, { 125 char module_name[256]; 126 GetModuleFileNameA(0, module_name, sizeof(module_name)); 127 sourcePathInfo = QString::fromLocal8Bit(module_name); 128 }); 119 wchar_t module_name[MAX_PATH]; 120 GetModuleFileName(0, module_name, sizeof(module_name) / sizeof(wchar_t)); 121 QFileInfo sourcePathInfo = QString::fromWCharArray(module_name); 129 122 sourcePath = sourcePathInfo.absolutePath(); 130 123 sourceDir = sourcePathInfo.dir(); … … 249 242 dictionary[ "CETEST" ] = "auto"; 250 243 dictionary[ "CE_SIGNATURE" ] = "no"; 251 dictionary[ "SCRIPTTOOLS" ] = "yes"; 244 dictionary[ "SCRIPT" ] = "auto"; 245 dictionary[ "SCRIPTTOOLS" ] = "auto"; 252 246 dictionary[ "XMLPATTERNS" ] = "auto"; 253 247 dictionary[ "PHONON" ] = "auto"; 254 248 dictionary[ "PHONON_BACKEND" ] = "yes"; 249 250 255 251 dictionary[ "DIRECTSHOW" ] = "no"; 256 252 dictionary[ "WEBKIT" ] = "auto"; 253 257 254 dictionary[ "PLUGIN_MANIFESTS" ] = "yes"; 258 255 … … 311 308 dictionary[ "LIBPNG" ] = "auto"; 312 309 dictionary[ "LIBMNG" ] = "auto"; 310 313 311 314 312 dictionary[ "QT3SUPPORT" ] = "yes"; 315 313 dictionary[ "ACCESSIBILITY" ] = "yes"; 316 314 dictionary[ "OPENGL" ] = "yes"; 317 dictionary[ " DIRECT3D" ] = "auto";315 dictionary[ "o"; 318 316 dictionary[ "IPV6" ] = "yes"; // Always, dynamicly loaded 319 317 dictionary[ "OPENSSL" ] = "auto"; 320 318 dictionary[ "DBUS" ] = "auto"; 319 321 320 322 321 dictionary[ "STYLE_WINDOWS" ] = "yes"; … … 329 328 dictionary[ "STYLE_MOTIF" ] = "yes"; 330 329 dictionary[ "STYLE_CDE" ] = "yes"; 330 331 331 dictionary[ "STYLE_GTK" ] = "no"; 332 332 … … 352 352 353 353 dictionary[ "INCREDIBUILD_XGE" ] = "auto"; 354 355 354 356 } 355 357 … … 436 438 437 439 for( ; i<configCmdLine.size(); ++i ) { 438 bool continueElse = false;440 bool continueElse; 439 441 if( configCmdLine.at(i) == "-help" 440 442 || configCmdLine.at(i) == "-h" … … 475 477 dictionary[ "BUILDDEV" ] = "yes"; 476 478 else if( configCmdLine.at(i) == "-nokia-developer" ) { 479 480 481 477 482 dictionary[ "BUILDNOKIA" ] = "yes"; 478 483 dictionary[ "BUILDDEV" ] = "yes"; … … 484 489 else if( configCmdLine.at(i) == "-commercial" ) { 485 490 dictionary[ "BUILDTYPE" ] = "commercial"; 491 492 493 494 495 496 486 497 } 487 498 #endif … … 578 589 dictionary[ "LIBMNG" ] = "system"; 579 590 } 591 592 593 594 595 596 597 580 598 // CE- C runtime -------------------------------------------- 581 599 else if( configCmdLine.at(i) == "-crt" ) { … … 596 614 else if (configCmdLine.at(i) == "-no-cetest") { 597 615 dictionary[ "CETEST" ] = "no"; 616 598 617 } else if (configCmdLine.at(i) == "-cetest") { 599 618 // although specified to use it, we stay at "auto" state 600 619 // this is because checkAvailability() adds variables 601 // we need for crosscompilation 620 // we need for crosscompilation; but remember if we asked 621 // for it. 622 dictionary[ "CETEST_REQUESTED" ] = "yes"; 602 623 } 603 624 // Qt/CE - signing tool ------------------------------------- … … 657 678 dictionary[ "STYLE_CDE" ] = "no"; 658 679 680 681 682 683 684 659 685 // Qt 3 Support --------------------------------------------- 660 686 else if( configCmdLine.at(i) == "-no-qt3support" ) … … 663 689 // Work around compiler nesting limitation 664 690 else 665 continueElse = true;666 if (!continueElse ) {691 continueElse = true; 692 if (!continueElse) { 667 693 } 668 694 … … 676 702 dictionary[ "OPENGL" ] = "yes"; 677 703 dictionary[ "OPENGL_ES_CL" ] = "yes"; 678 } 704 } else if ( configCmdLine.at(i) == "-opengl-es-2" ) { 705 dictionary[ "OPENGL" ] = "yes"; 706 dictionary[ "OPENGL_ES_2" ] = "yes"; 707 } 708 709 // OpenVG Support ------------------------------------------- 710 else if( configCmdLine.at(i) == "-openvg" ) { 711 dictionary[ "OPENVG" ] = "yes"; 712 } else if( configCmdLine.at(i) == "-no-openvg" ) { 713 dictionary[ "OPENVG" ] = "no"; 714 } 715 679 716 // Databases ------------------------------------------------ 680 717 else if( configCmdLine.at(i) == "-qt-sql-mysql" ) … … 762 799 else if( configCmdLine.at(i) == "-incredibuild-xge" ) 763 800 dictionary[ "INCREDIBUILD_XGE" ] = "yes"; 801 802 803 804 764 805 #if !defined(EVAL) 765 806 // Others --------------------------------------------------- 807 808 809 810 811 812 813 814 815 816 817 818 819 820 766 821 else if (configCmdLine.at(i) == "-fast" ) 767 822 dictionary[ "FAST" ] = "yes"; … … 812 867 dictionary[ "IWMMXT" ] = "yes"; 813 868 814 else if (configCmdLine.at(i) == "-no-direct3d") { 815 dictionary["DIRECT3D"] = "no"; 816 }else if (configCmdLine.at(i) == "-direct3d") { 817 dictionary["DIRECT3D"] = "auto"; // have to pass auto detection to enable Direct3D 818 } else if( configCmdLine.at(i) == "-no-openssl" ) { 869 else if( configCmdLine.at(i) == "-no-openssl" ) { 819 870 dictionary[ "OPENSSL"] = "no"; 820 871 } else if( configCmdLine.at(i) == "-openssl" ) { … … 832 883 } else if( configCmdLine.at(i) == "-dbus-linked" ) { 833 884 dictionary[ "DBUS" ] = "linked"; 885 886 887 888 834 889 } else if( configCmdLine.at(i) == "-no-scripttools" ) { 835 890 dictionary[ "SCRIPTTOOLS" ] = "no"; … … 840 895 } else if( configCmdLine.at(i) == "-xmlpatterns" ) { 841 896 dictionary[ "XMLPATTERNS" ] = "yes"; 897 898 899 900 901 902 903 904 842 905 } else if( configCmdLine.at(i) == "-no-phonon" ) { 843 906 dictionary[ "PHONON" ] = "no"; … … 854 917 } else if( configCmdLine.at(i) == "-webkit" ) { 855 918 dictionary[ "WEBKIT" ] = "yes"; 919 920 921 922 856 923 } else if( configCmdLine.at(i) == "-no-plugin-manifests" ) { 857 924 dictionary[ "PLUGIN_MANIFESTS" ] = "no"; 858 925 } else if( configCmdLine.at(i) == "-plugin-manifests" ) { 859 926 dictionary[ "PLUGIN_MANIFESTS" ] = "yes"; 927 928 929 930 931 932 860 933 } 861 934 … … 884 957 break; 885 958 qmakeDefines += "QT_NAMESPACE="+configCmdLine.at(i); 959 960 961 962 963 886 964 } else if( configCmdLine.at(i) == "-D" ) { 887 965 ++i; … … 1029 1107 break; 1030 1108 QString system = configCmdLine.at(i); 1031 if (system == QLatin1String("raster") || system == QLatin1String("opengl")) 1109 if (system == QLatin1String("raster") 1110 || system == QLatin1String("opengl") 1111 || system == QLatin1String("openvg")) 1032 1112 dictionary["GRAPHICS_SYSTEM"] = configCmdLine.at(i); 1033 1113 } … … 1096 1176 } 1097 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1098 1192 // Ensure that -spec (XQMAKESPEC) exists in the mkspecs folder as well 1099 1193 if (dictionary.contains("XQMAKESPEC") && … … 1127 1221 useUnixSeparators = (dictionary["QMAKESPEC"] == "win32-g++"); 1128 1222 1223 1224 1225 1226 1129 1227 1130 1228 #if !defined(EVAL) … … 1149 1247 void Configure::validateArgs() 1150 1248 { 1151 QStringList configs;1152 1249 // Validate the specified config 1153 1250 1251 1154 1252 QDir dir; 1155 1253 QStringList filters; … … 1165 1263 allConfigs << "full"; 1166 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1167 1281 QStringList::Iterator config; 1168 1282 for( config = allConfigs.begin(); config != allConfigs.end(); ++config ) { 1169 configs += (*config) + "-config";1170 1283 if( (*config) == dictionary[ "QCONFIG" ] ) 1171 1284 break; … … 1176 1289 } 1177 1290 else 1178 qmakeConfig += configs;1291 qmakeConfig += ; 1179 1292 } 1180 1293 #endif … … 1297 1410 dictionary[ "STYLE_MOTIF" ] = "no"; 1298 1411 dictionary[ "STYLE_CDE" ] = "no"; 1412 1413 1299 1414 dictionary[ "QT3SUPPORT" ] = "no"; 1300 1415 dictionary[ "OPENGL" ] = "no"; … … 1310 1425 dictionary[ "IWMMXT" ] = "no"; 1311 1426 dictionary[ "CE_CRT" ] = "yes"; 1312 dictionary[ "DIRECT3D" ] = "no";1313 1427 dictionary[ "WEBKIT" ] = "no"; 1314 1428 dictionary[ "PHONON" ] = "yes"; … … 1322 1436 dictionary[ "QT_HOST_PREFIX" ] = dictionary[ "QT_INSTALL_PREFIX" ]; 1323 1437 dictionary[ "QT_INSTALL_PREFIX" ] = ""; 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1324 1484 1325 1485 } else if(dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong. … … 1409 1569 "[-no-libmng] [-qt-libmng] [-system-libmng] [-no-qt3support] [-mmx]\n" 1410 1570 "[-no-mmx] [-3dnow] [-no-3dnow] [-sse] [-no-sse] [-sse2] [-no-sse2]\n" 1411 "[-no-iwmmxt] [-iwmmxt] [- direct3d] [-openssl] [-openssl-linked]\n"1571 "[-no-iwmmxt] [-iwmmxt] [-openssl] [-openssl-linked]\n" 1412 1572 "[-no-openssl] [-no-dbus] [-dbus] [-dbus-linked] [-platform <spec>]\n" 1413 "[-qtnamespace <namespace>] [- no-phonon] [-phonon]\n"1414 "[- no-phonon-backend] [-phonon-backend]\n"1415 "[-no- webkit] [-webkit]\n"1416 "[-no-script tools] [-scripttools]\n"1417 "[- graphicssystem raster|opengl]\n\n", 0, 7);1573 "[-qtnamespace <namespace>] [--phonon]\n" 1574 "[-no-phonon-backend] [-phonon-backend]\n" 1575 "[-no-]\n" 1576 "[-no-scripttools] [-scripttools]\n" 1577 "[-]\n\n", 0, 7); 1418 1578 1419 1579 desc("Installation options:\n\n"); … … 1459 1619 desc("SHARED", "yes", "-shared", "Create and use shared Qt libraries."); 1460 1620 desc("SHARED", "no", "-static", "Create and use static Qt libraries.\n"); 1621 1622 1623 1461 1624 1462 1625 desc("FAST", "no", "-no-fast", "Configure Qt normally by generating Makefiles for all project files."); … … 1494 1657 desc("OPENGL", "no","-no-opengl", "Disables OpenGL functionality\n"); 1495 1658 1659 1660 1661 1662 1663 1496 1664 #endif 1497 1665 desc( "-platform <spec>", "The operating system and compiler you are building on.\n(default %QMAKESPEC%)\n"); … … 1500 1668 1501 1669 #if !defined(EVAL) 1502 desc( "-qtnamespace <namespace>", "Wraps all Qt library code in 'namespace name {...}\n"); 1670 desc( "-qtnamespace <namespace>", "Wraps all Qt library code in 'namespace name {...}"); 1671 desc( "-qtlibinfix <infix>", "Renames all Qt* libs to Qt*<infix>\n"); 1503 1672 desc( "-D <define>", "Add an explicit define to the preprocessor."); 1504 1673 desc( "-I <includepath>", "Add an explicit include path."); … … 1509 1678 "Available values for <sys>:"); 1510 1679 desc("GRAPHICS_SYSTEM", "raster", "", " raster - Software rasterizer", ' '); 1511 desc("GRAPHICS_SYSTEM", "opengl", "", " opengl - Using OpenGL accelleration, experimental!", ' '); 1680 desc("GRAPHICS_SYSTEM", "opengl", "", " opengl - Using OpenGL acceleration, experimental!", ' '); 1681 desc("GRAPHICS_SYSTEM", "openvg", "", " openvg - Using OpenVG acceleration, experimental!", ' '); 1512 1682 1513 1683 … … 1573 1743 desc("SSE2", "no", "-no-sse2", "Do not compile with use of SSE2 instructions"); 1574 1744 desc("SSE2", "yes", "-sse2", "Compile with use of SSE2 instructions"); 1575 desc("DIRECT3D", "yes", "-direct3d", "Compile in Direct3D support (experimental - see INSTALL for more info)");1576 1745 desc("OPENSSL", "no", "-no-openssl", "Do not compile in OpenSSL support"); 1577 1746 desc("OPENSSL", "yes", "-openssl", "Compile in run-time OpenSSL support"); … … 1584 1753 desc("PHONON_BACKEND","no", "-no-phonon-backend","Do not compile the platform-specific Phonon backend-plugin"); 1585 1754 desc("PHONON_BACKEND","yes","-phonon-backend", "Compile in the platform-specific Phonon backend-plugin"); 1755 1756 1757 1758 1586 1759 desc("WEBKIT", "no", "-no-webkit", "Do not compile in the WebKit module"); 1587 1760 desc("WEBKIT", "yes", "-webkit", "Compile in the WebKit module (WebKit is built if a decent C++ compiler is used.)"); 1761 1762 1588 1763 desc("SCRIPTTOOLS", "no", "-no-scripttools", "Do not build the QtScriptTools module."); 1589 1764 desc("SCRIPTTOOLS", "yes", "-scripttools", "Build the QtScriptTools module."); 1765 1766 1590 1767 1591 1768 desc( "-arch <arch>", "Specify an architecture.\n" … … 1593 1770 desc("ARCHITECTURE","windows", "", " windows", ' '); 1594 1771 desc("ARCHITECTURE","windowsce", "", " windowsce", ' '); 1772 1595 1773 desc("ARCHITECTURE","boundschecker", "", " boundschecker", ' '); 1596 1774 desc("ARCHITECTURE","generic", "", " generic\n", ' '); … … 1607 1785 desc("STYLE_CDE", "yes", "", " cde", ' '); 1608 1786 desc("STYLE_WINDOWSCE", "yes", "", " windowsce", ' '); 1609 desc("STYLE_WINDOWSMOBILE" , "yes", "", " windowsmobile\n", ' '); 1787 desc("STYLE_WINDOWSMOBILE" , "yes", "", " windowsmobile", ' '); 1788 desc("STYLE_S60" , "yes", "", " s60\n", ' '); 1789 desc("NATIVE_GESTURES", "no", "-no-native-gestures", "Do not use native gestures on Windows 7."); 1790 desc("NATIVE_GESTURES", "yes", "-native-gestures", "Use native gestures on Windows 7."); 1610 1791 1611 1792 /* We do not support -qconfig on Windows yet … … 1633 1814 desc("OPENGL_ES_CM", "no", "-opengl-es-cm", "Enable support for OpenGL ES Common"); 1634 1815 desc("OPENGL_ES_CL", "no", "-opengl-es-cl", "Enable support for OpenGL ES Common Lite"); 1816 1635 1817 desc("DIRECTSHOW", "no", "-phonon-wince-ds9", "Enable Phonon Direct Show 9 backend for Windows CE"); 1636 1818 1819 1820 1821 1822 1823 1824 1825 1637 1826 return true; 1638 1827 } … … 1640 1829 } 1641 1830 1642 bool Configure::findFileInPaths(const QString &fileName, const QStringList &paths) 1643 { 1644 QDir d; 1645 for( QStringList::ConstIterator it = paths.begin(); it != paths.end(); ++it ) { 1646 // Remove any leading or trailing ", this is commonly used in the environment 1647 // variables 1648 QString path = (*it); 1649 if ( path.startsWith( "\"" ) ) 1650 path = path.right( path.length() - 1 ); 1651 if ( path.endsWith( "\"" ) ) 1652 path = path.left( path.length() - 1 ); 1653 if( d.exists( path + QDir::separator() + fileName ) ) 1654 return true; 1655 } 1656 return false; 1657 } 1658 1659 bool Configure::findFile( const QString &fileName ) 1660 { 1661 QString file = fileName.toLower(); 1662 QStringList paths; 1831 QString Configure::findFileInPaths(const QString &fileName, const QString &paths) 1832 { 1663 1833 #if defined(Q_OS_WIN32) 1664 1834 QRegExp splitReg("[;,]"); … … 1666 1836 QRegExp splitReg("[:]"); 1667 1837 #endif 1668 if (file.endsWith(".h")) 1669 paths = QString::fromLocal8Bit(getenv("INCLUDE")).split(splitReg, QString::SkipEmptyParts); 1670 else if ( file.endsWith( ".lib" ) ) 1671 paths = QString::fromLocal8Bit(getenv("LIB")).split(splitReg, QString::SkipEmptyParts); 1672 else 1673 paths = QString::fromLocal8Bit(getenv("PATH")).split(splitReg, QString::SkipEmptyParts); 1674 return findFileInPaths(file, paths); 1838 QStringList pathList = paths.split(splitReg, QString::SkipEmptyParts); 1839 QDir d; 1840 for( QStringList::ConstIterator it = pathList.begin(); it != pathList.end(); ++it ) { 1841 // Remove any leading or trailing ", this is commonly used in the environment 1842 // variables 1843 QString path = (*it); 1844 if ( path.startsWith( '\"' ) ) 1845 path = path.right( path.length() - 1 ); 1846 if ( path.endsWith( '\"' ) ) 1847 path = path.left( path.length() - 1 ); 1848 if( d.exists( path + QDir::separator() + fileName ) ) 1849 return path; 1850 } 1851 return QString(); 1852 } 1853 1854 bool Configure::findFile( const QString &fileName ) 1855 { 1856 const QString file = fileName.toLower(); 1857 const QString pathEnvVar = QString::fromLocal8Bit(getenv("PATH")); 1858 const QString mingwPath = dictionary["QMAKESPEC"].endsWith("-g++") ? 1859 findFileInPaths("mingw32-g++.exe", pathEnvVar) : QString(); 1860 1861 QString paths; 1862 if (file.endsWith(".h")) { 1863 if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull()) 1864 return true; 1865 paths = QString::fromLocal8Bit(getenv("INCLUDE")); 1866 } else if ( file.endsWith( ".lib" ) || file.endsWith( ".a" ) ) { 1867 if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../lib")).isNull()) 1868 return true; 1869 paths = QString::fromLocal8Bit(getenv("LIB")); 1870 } else { 1871 paths = pathEnvVar; 1872 } 1873 return !findFileInPaths(file, paths).isNull(); 1675 1874 } 1676 1875 … … 1742 1941 bool available = false; 1743 1942 if (part == "STYLE_WINDOWSXP") 1744 available = ( dictionary.value("QMAKESPEC") == "win32-g++" ||findFile("uxtheme.h"));1943 available = (findFile("uxtheme.h")); 1745 1944 1746 1945 else if (part == "ZLIB") … … 1768 1967 available = findFile("sqlcli.h") && findFile("sqlcli1.h") && findFile("db2cli.lib"); 1769 1968 else if (part == "SQL_SQLITE") 1969 1970 1971 1770 1972 available = true; // Built in, we have a fork 1771 1973 else if (part == "SQL_SQLITE_LIB") { 1772 1974 if (dictionary[ "SQL_SQLITE_LIB" ] == "system") { 1773 available = findFile("sqlite3.h") && findFile("sqlite3.lib"); 1774 if (available) 1775 dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib"; 1975 // Symbian has multiple .lib/.dll files we need to find 1976 if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) { 1977 available = true; // There is sqlite_symbian plugin which exports the necessary stuff 1978 dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3"; 1979 } else { 1980 available = findFile("sqlite3.h") && findFile("sqlite3.lib"); 1981 if (available) 1982 dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib"; 1983 } 1776 1984 } else 1777 1985 available = true; … … 1785 1993 available = (dictionary[ "ARCHITECTURE" ] == "windowsce"); 1786 1994 else if (part == "OPENGL_ES_CL") 1995 1996 1787 1997 available = (dictionary[ "ARCHITECTURE" ] == "windowsce"); 1788 1998 else if (part == "DIRECTSHOW") … … 1806 2016 dictionary[ "QT_CE_RAPI_LIB" ] += QLatin1String("\"") + rapiLib + QLatin1String("\""); 1807 2017 } 2018 2019 2020 2021 2022 1808 2023 } 1809 2024 else if (part == "INCREDIBUILD_XGE") … … 1816 2031 && dictionary.value("QMAKESPEC") != "win32-msvc2002" 1817 2032 && dictionary.value("EXCEPTIONS") == "yes"; 1818 } else if (part == "DIRECT3D") {1819 QString sdk_dir(QString::fromLocal8Bit(getenv("DXSDK_DIR")));1820 QDir dir;1821 bool has_d3d = false;1822 1823 if (!sdk_dir.isEmpty() && dir.exists(sdk_dir))1824 has_d3d = true;1825 1826 if (has_d3d && !QFile::exists(sdk_dir + QLatin1String("\\include\\d3d9.h"))) {1827 cout << "No Direct3D version 9 SDK found." << endl;1828 has_d3d = false;1829 }1830 1831 // find the first dxguid.lib in the current LIB paths, if it is NOT1832 // the D3D SDK one, we're most likely in trouble..1833 if (has_d3d) {1834 has_d3d = false;1835 QString env_lib(QString::fromLocal8Bit(getenv("LIB")));1836 QStringList lib_paths = env_lib.split(';');1837 for (int i=0; i<lib_paths.size(); ++i) {1838 QString lib_path = lib_paths.at(i);1839 if (QFile::exists(lib_path + QLatin1String("\\dxguid.lib")))1840 {1841 if (lib_path.startsWith(sdk_dir)) {1842 has_d3d = true;1843 } else {1844 cout << "Your D3D/Platform SDK library paths seem to appear in the wrong order." << endl;1845 }1846 break;1847 }1848 }1849 }1850 1851 available = has_d3d;1852 if (!has_d3d) {1853 cout << "Setting Direct3D to NO, since the proper Direct3D SDK was not detected." << endl1854 << "Make sure you have the Direct3D SDK installed, and that you have run" << endl1855 << "the <path to SDK>\\Utilities\\Bin\\dx_setenv.cmd script." << endl1856 << "The D3D SDK library path *needs* to appear before the Platform SDK library" << endl1857 << "path in your LIB environment variable." << endl;1858 }1859 2033 } else if (part == "PHONON") { 1860 available = findFile("vmr9.h") && findFile("dshow.h") && findFile("strmiids.lib") && 1861 findFile("dmoguids.lib") && findFile("msdmo.lib") && findFile("d3d9.h"); 2034 available = findFile("vmr9.h") && findFile("dshow.h") && findFile("dmo.h") && findFile("dmodshow.h") 2035 && (findFile("strmiids.lib") || findFile("libstrmiids.a")) 2036 && (findFile("dmoguids.lib") || findFile("libdmoguids.a")) 2037 && (findFile("msdmo.lib") || findFile("libmsdmo.a")) 2038 && findFile("d3d9.h"); 1862 2039 1863 2040 if (!available) { 1864 2041 cout << "All the required DirectShow/Direct3D files couldn't be found." << endl 1865 << "Make sure you have either the platform SDK AND the DirectX SDK or the Windows SDK installed." << endl 1866 << "If you have the DirectX SDK installed, please make sure that you have run the <path to SDK>\\SetEnv.Cmd script." << endl; 1867 } 2042 << "Make sure you have either the platform SDK AND the DirectShow SDK or the Windows SDK installed." << endl 2043 << "If you have the DirectShow SDK installed, please make sure that you have run the <path to SDK>\\SetEnv.Cmd script." << endl; 2044 if (!findFile("vmr9.h")) cout << "vmr9.h not found" << endl; 2045 if (!findFile("dshow.h")) cout << "dshow.h not found" << endl; 2046 if (!findFile("strmiids.lib")) cout << "strmiids.lib not found" << endl; 2047 if (!findFile("dmoguids.lib")) cout << "dmoguids.lib not found" << endl; 2048 if (!findFile("msdmo.lib")) cout << "msdmo.lib not found" << endl; 2049 if (!findFile("d3d9.h")) cout << "d3d9.h not found" << endl; 2050 } 2051 } else if (part == "MULTIMEDIA" || part == "SCRIPT" || part == "SCRIPTTOOLS") { 2052 available = true; 1868 2053 } else if (part == "WEBKIT") { 1869 2054 available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-g++"); 1870 } else if (part == " SCRIPTTOOLS") {1871 available = true;2055 } else if (part == "") { 2056 available = ; 1872 2057 } 1873 2058 … … 1946 2131 if (dictionary["DBUS"] == "auto") 1947 2132 dictionary["DBUS"] = checkAvailability("DBUS") ? "yes" : "no"; 2133 2134 1948 2135 if (dictionary["SCRIPTTOOLS"] == "auto") 1949 2136 dictionary["SCRIPTTOOLS"] = checkAvailability("SCRIPTTOOLS") ? "yes" : "no"; 1950 2137 if (dictionary["XMLPATTERNS"] == "auto") 1951 2138 dictionary["XMLPATTERNS"] = checkAvailability("XMLPATTERNS") ? "yes" : "no"; 1952 if (dictionary["DIRECT3D"] == "auto")1953 dictionary["DIRECT3D"] = checkAvailability("DIRECT3D") ? "yes" : "no";1954 2139 if (dictionary["PHONON"] == "auto") 1955 2140 dictionary["PHONON"] = checkAvailability("PHONON") ? "yes" : "no"; 1956 2141 if (dictionary["WEBKIT"] == "auto") 1957 2142 dictionary["WEBKIT"] = checkAvailability("WEBKIT") ? "yes" : "no"; 2143 2144 1958 2145 1959 2146 // Qt/WinCE remote test application … … 1999 2186 exit(0); // Exit cleanly for Ctrl+C 2000 2187 } 2188 2189 2190 2191 2192 2193 2194 2195 2196 2001 2197 2002 2198 return true; … … 2021 2217 dll staticlib 2022 2218 2023 internal2024 2219 nocrosscompiler 2025 2220 GNUmake … … 2047 2242 if (!dictionary["QCONFIG"].isEmpty()) 2048 2243 build_options += dictionary["QCONFIG"] + "-config "; 2049 if (dictionary["STL"] == "no")2050 build_options += "no-stl";2051 2244 build_options.sort(); 2052 2245 … … 2148 2341 qtConfig += "system-mng"; 2149 2342 2343 2344 2345 2346 2150 2347 // Styles ------------------------------------------------------- 2151 2348 if ( dictionary[ "STYLE_WINDOWS" ] == "yes" ) … … 2178 2375 if ( dictionary[ "STYLE_CDE" ] == "yes" ) 2179 2376 qmakeStyles += "cde"; 2377 2378 2379 2180 2380 2181 2381 // Databases ---------------------------------------------------- … … 2263 2463 if ( dictionary["OPENGL_ES_CM"] == "yes" ) { 2264 2464 qtConfig += "opengles1"; 2465 2466 2467 2468 2469 2470 2265 2471 } 2266 2472 2267 2473 if ( dictionary["OPENGL_ES_CL"] == "yes" ) { 2268 2474 qtConfig += "opengles1cl"; 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2269 2485 } 2270 2486 2271 2487 if ( dictionary["DIRECTSHOW"] == "yes" ) 2272 2488 qtConfig += "directshow"; 2273 2274 if (dictionary[ "DIRECT3D" ] == "yes")2275 qtConfig += "direct3d";2276 2489 2277 2490 if (dictionary[ "OPENSSL" ] == "yes") … … 2293 2506 qtConfig += "cetest"; 2294 2507 2295 if (dictionary[ "SCRIPTTOOLS" ] == "yes") 2508 if (dictionary[ "SCRIPT" ] == "yes") 2509 qtConfig += "script"; 2510 2511 if (dictionary[ "SCRIPTTOOLS" ] == "yes") { 2512 if (dictionary[ "SCRIPT" ] == "no") { 2513 cout << "QtScriptTools was requested, but it can't be built due to QtScript being " 2514 "disabled." << endl; 2515 dictionary[ "DONE" ] = "error"; 2516 } 2296 2517 qtConfig += "scripttools"; 2518 2297 2519 2298 2520 if (dictionary[ "XMLPATTERNS" ] == "yes") … … 2305 2527 } 2306 2528 2529 2530 2531 2307 2532 if (dictionary["WEBKIT"] == "yes") 2308 2533 qtConfig += "webkit"; 2534 2535 2536 2537 2538 2539 2309 2540 2310 2541 // We currently have no switch for QtSvg, so add it unconditionally. … … 2327 2558 } 2328 2559 } 2560 2561 2562 2329 2563 2330 2564 // Directories and settings for .qmake.cache -------------------- … … 2368 2602 if (!opensslLibs.isEmpty()) 2369 2603 qmakeVars += opensslLibs; 2370 else if (dictionary[ "OPENSSL" ] == "linked") 2371 qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32"); 2604 else if (dictionary[ "OPENSSL" ] == "linked") { 2605 if(dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("symbian") ) 2606 qmakeVars += QString("OPENSSL_LIBS = -llibssl -llibcrypto"); 2607 else 2608 qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32"); 2609 } 2372 2610 if (!qmakeSql.isEmpty()) 2373 2611 qmakeVars += QString("sql-drivers += ") + qmakeSql.join( " " ); … … 2482 2720 configStream << " static"; 2483 2721 2722 2723 2484 2724 if( dictionary[ "STL" ] == "yes" ) 2485 2725 configStream << " stl"; … … 2526 2766 2527 2767 if(!dictionary["QMAKE_RPATHDIR"].isEmpty()) 2528 configStream<<"QMAKE_RPATHDIR += "<<dictionary["QMAKE_RPATHDIR"]; 2768 configStream << "QMAKE_RPATHDIR += " << dictionary["QMAKE_RPATHDIR"] << endl; 2769 2770 if (!dictionary["QT_LIBINFIX"].isEmpty()) 2771 configStream << "QT_LIBINFIX = " << dictionary["QT_LIBINFIX"] << endl; 2772 2773 if(!dictionary["ARM_FPU_TYPE"].isEmpty()) { 2774 configStream<<"QMAKE_CXXFLAGS.ARMCC += --fpu "<< dictionary["ARM_FPU_TYPE"]; 2775 } 2529 2776 2530 2777 configStream.flush(); … … 2636 2883 if(dictionary["STYLE_MOTIF"] != "yes") qconfigList += "QT_NO_STYLE_MOTIF"; 2637 2884 if(dictionary["STYLE_CDE"] != "yes") qconfigList += "QT_NO_STYLE_CDE"; 2885 2638 2886 if(dictionary["STYLE_WINDOWSCE"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSCE"; 2639 2887 if(dictionary["STYLE_WINDOWSMOBILE"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSMOBILE"; … … 2650 2898 } 2651 2899 2652 if(dictionary["QT3SUPPORT"] == "no") qconfigList += "QT_NO_QT3SUPPORT";2653 2900 if(dictionary["ACCESSIBILITY"] == "no") qconfigList += "QT_NO_ACCESSIBILITY"; 2654 2901 if(dictionary["EXCEPTIONS"] == "no") qconfigList += "QT_NO_EXCEPTIONS"; 2655 2902 if(dictionary["OPENGL"] == "no") qconfigList += "QT_NO_OPENGL"; 2656 if(dictionary[" DIRECT3D"] == "no") qconfigList += "QT_NO_DIRECT3D";2903 if(dictionary[""; 2657 2904 if(dictionary["OPENSSL"] == "no") qconfigList += "QT_NO_OPENSSL"; 2658 2905 if(dictionary["OPENSSL"] == "linked") qconfigList += "QT_LINKED_OPENSSL"; … … 2660 2907 if(dictionary["IPV6"] == "no") qconfigList += "QT_NO_IPV6"; 2661 2908 if(dictionary["WEBKIT"] == "no") qconfigList += "QT_NO_WEBKIT"; 2909 2662 2910 if(dictionary["PHONON"] == "no") qconfigList += "QT_NO_PHONON"; 2911 2663 2912 if(dictionary["XMLPATTERNS"] == "no") qconfigList += "QT_NO_XMLPATTERNS"; 2913 2664 2914 if(dictionary["SCRIPTTOOLS"] == "no") qconfigList += "QT_NO_SCRIPTTOOLS"; 2915 2916 2917 2665 2918 2666 2919 if(dictionary["OPENGL_ES_CM"] == "yes" || 2667 dictionary["OPENGL_ES_CL"] == "yes") qconfigList += "QT_OPENGL_ES"; 2920 dictionary["OPENGL_ES_CL"] == "yes" || 2921 dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES"; 2668 2922 2669 2923 if(dictionary["OPENGL_ES_CM"] == "yes") qconfigList += "QT_OPENGL_ES_1"; 2924 2670 2925 if(dictionary["OPENGL_ES_CL"] == "yes") qconfigList += "QT_OPENGL_ES_1_CL"; 2671 2926 … … 2680 2935 if(dictionary["SQL_IBASE"] == "yes") qconfigList += "QT_SQL_IBASE"; 2681 2936 2937 2682 2938 if (dictionary["GRAPHICS_SYSTEM"] == "opengl") qconfigList += "QT_GRAPHICSSYSTEM_OPENGL"; 2683 2939 if (dictionary["GRAPHICS_SYSTEM"] == "raster") qconfigList += "QT_GRAPHICSSYSTEM_RASTER"; 2940 2941 2942 2943 2944 2945 2946 2947 2948 2684 2949 2685 2950 qconfigList.sort(); … … 2743 3008 2744 3009 // Replace old qconfig.h with new one 2745 ::SetFileAttributes A(outName.toLocal8Bit(), FILE_ATTRIBUTE_NORMAL);3010 ::SetFileAttributes(), FILE_ATTRIBUTE_NORMAL); 2746 3011 QFile::remove(outName); 2747 3012 tmpFile.copy(outName); … … 2779 3044 2780 3045 outName = defSpec + "/qmake.conf"; 2781 ::SetFileAttributes A(outName.toLocal8Bit(), FILE_ATTRIBUTE_NORMAL );3046 ::SetFileAttributes(), FILE_ATTRIBUTE_NORMAL ); 2782 3047 QFile qmakeConfFile(outName); 2783 3048 if (qmakeConfFile.open(QFile::Append | QFile::WriteOnly | QFile::Text)) { … … 2798 3063 tmpStream << "/* Licensed */" << endl 2799 3064 << "static const char qt_configure_licensee_str [512 + 12] = \"qt_lcnsuser=" << licenseInfo["LICENSEE"] << "\";" << endl 2800 << "static const char qt_configure_licensed_products_str [512 + 12] = \"qt_lcnsprod=" << dictionary["EDITION"] << "\";" << endl; 3065 << "static const char qt_configure_licensed_products_str [512 + 12] = \"qt_lcnsprod=" << dictionary["EDITION"] << "\";" << endl 3066 << endl 3067 << "/* Build date */" << endl 3068 << "static const char qt_configure_installation [11 + 12] = \"qt_instdate=" << QDate::currentDate().toString(Qt::ISODate) << "\";" << endl 3069 << endl; 2801 3070 if(!dictionary[ "QT_HOST_PREFIX" ].isNull()) 2802 3071 tmpStream << "#if !defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE)" << endl; … … 2847 3116 2848 3117 // Replace old qconfig.cpp with new one 2849 ::SetFileAttributes A(outName.toLocal8Bit(), FILE_ATTRIBUTE_NORMAL );3118 ::SetFileAttributes(), FILE_ATTRIBUTE_NORMAL ); 2850 3119 QFile::remove( outName ); 2851 3120 tmpFile2.copy(outName); 2852 3121 tmpFile2.close(); 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 2853 3140 } 2854 3141 } … … 2902 3189 cout << "Maketool...................." << dictionary[ "MAKE" ] << endl; 2903 3190 cout << "Debug symbols..............." << (dictionary[ "BUILD" ] == "debug" ? "yes" : "no") << endl; 3191 2904 3192 cout << "Accessibility support......." << dictionary[ "ACCESSIBILITY" ] << endl; 2905 3193 cout << "STL support................." << dictionary[ "STL" ] << endl; … … 2912 3200 cout << "IWMMXT support.............." << dictionary[ "IWMMXT" ] << endl; 2913 3201 cout << "OpenGL support.............." << dictionary[ "OPENGL" ] << endl; 2914 cout << " Direct3D support............" << dictionary[ "DIRECT3D" ] << endl;3202 cout << "" ] << endl; 2915 3203 cout << "OpenSSL support............." << dictionary[ "OPENSSL" ] << endl; 2916 3204 cout << "QtDBus support.............." << dictionary[ "DBUS" ] << endl; 2917 3205 cout << "QtXmlPatterns support......." << dictionary[ "XMLPATTERNS" ] << endl; 2918 3206 cout << "Phonon support.............." << dictionary[ "PHONON" ] << endl; 3207 2919 3208 cout << "WebKit support.............." << dictionary[ "WEBKIT" ] << endl; 3209 3210 2920 3211 cout << "QtScriptTools support......." << dictionary[ "SCRIPTTOOLS" ] << endl; 2921 3212 cout << "Graphics System............." << dictionary[ "GRAPHICS_SYSTEM" ] << endl; … … 2928 3219 cout << " JPEG support............" << dictionary[ "JPEG" ] << endl; 2929 3220 cout << " PNG support............." << dictionary[ "PNG" ] << endl; 2930 cout << " MNG support............." << dictionary[ "MNG" ] << endl << endl; 3221 cout << " MNG support............." << dictionary[ "MNG" ] << endl; 3222 cout << " FreeType support........" << dictionary[ "FREETYPE" ] << endl << endl; 2931 3223 2932 3224 cout << "Styles:" << endl; … … 2939 3231 cout << " CDE....................." << dictionary[ "STYLE_CDE" ] << endl; 2940 3232 cout << " Windows CE.............." << dictionary[ "STYLE_WINDOWSCE" ] << endl; 2941 cout << " Windows Mobile.........." << dictionary[ "STYLE_WINDOWSMOBILE" ] << endl << endl; 3233 cout << " Windows Mobile.........." << dictionary[ "STYLE_WINDOWSMOBILE" ] << endl; 3234 cout << " S60....................." << dictionary[ "STYLE_S60" ] << endl << endl; 2942 3235 2943 3236 cout << "Sql Drivers:" << endl; … … 2969 3262 cout << "Cetest support.............." << dictionary[ "CETEST" ] << endl; 2970 3263 cout << "Signature..................." << dictionary[ "CE_SIGNATURE"] << endl << endl; 3264 3265 3266 3267 2971 3268 } 2972 3269 … … 3104 3401 void Configure::buildHostTools() 3105 3402 { 3403 3404 3405 3106 3406 if (!dictionary.contains("XQMAKESPEC")) 3107 3407 return; … … 3110 3410 QStringList hostToolsDirs; 3111 3411 hostToolsDirs 3112 << "src/tools /bootstrap"3113 << " src/tools/moc"3114 << "src/tools/rcc" 3115 << "src/tools/uic"3116 << "tools/checksdk";3412 << "src/tools" 3413 << " 3414 3415 3416 << "tools/checksdk"; 3117 3417 3118 3418 if (dictionary[ "CETEST" ] == "yes") … … 3327 3627 cout << "Processing of project files have been disabled." << endl; 3328 3628 cout << "Only use this option if you really know what you're doing." << endl << endl; 3329 dictionary[ "DONE" ] = "yes";3330 3629 return; 3331 3630 } … … 3335 3634 { 3336 3635 QString make = dictionary[ "MAKE" ]; 3337 cout << endl << endl << "Qt is now configured for building. Just run " << qPrintable(make) << "." << endl; 3338 cout << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl; 3636 if (!dictionary.contains("XQMAKESPEC")) { 3637 cout << endl << endl << "Qt is now configured for building. Just run " << qPrintable(make) << "." << endl; 3638 cout << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl; 3639 } else if(dictionary.value("QMAKESPEC").startsWith("wince")) { 3640 // we are cross compiling for Windows CE 3641 cout << endl << endl << "Qt is now configured for building. To start the build run:" << endl 3642 << "\tsetcepaths " << dictionary.value("XQMAKESPEC") << endl 3643 << "\t" << qPrintable(make) << endl 3644 << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl; 3645 } else { // Compiling for Symbian OS 3646 cout << endl << endl << "Qt is now configured for building. To start the build run:" << qPrintable(dictionary["QTBUILDINSTRUCTION"]) << "." << endl 3647 << "To reconfigure, run '" << qPrintable(dictionary["CONFCLEANINSTRUCTION"]) << "' and configure." << endl; 3648 } 3339 3649 } 3340 3650 … … 3378 3688 } 3379 3689 3690 3380 3691 QString licenseFile = orgLicenseFile; 3381 3692 QString theLicense; 3382 3693 if (dictionary["EDITION"] == "OpenSource" || dictionary["EDITION"] == "Snapshot") { 3383 theLicense = "GNU General Public License (GPL) version 3 \nor the GNU Lesser General Public License (LGPL) version 2.1"; 3694 haveGpl3 = QFile::exists(orgLicenseFile + "/LICENSE.GPL3"); 3695 theLicense = "GNU Lesser General Public License (LGPL) version 2.1"; 3696 if (haveGpl3) 3697 theLicense += "\nor the GNU General Public License (GPL) version 3"; 3384 3698 } else { 3385 3699 // the first line of the license file tells us which license it is … … 3398 3712 << endl; 3399 3713 if (dictionary["EDITION"] == "OpenSource" || dictionary["EDITION"] == "Snapshot") { 3400 cout << "Type '3' to view the GNU General Public License version 3 (GPLv3)." << endl; 3714 if (haveGpl3) 3715 cout << "Type '3' to view the GNU General Public License version 3 (GPLv3)." << endl; 3401 3716 cout << "Type 'L' to view the Lesser GNU General Public License version 2.1 (LGPLv2.1)." << endl; 3402 3717 } else { … … 3452 3767 void Configure::readLicense() 3453 3768 { 3454 dictionary[ "PLATFORM NAME" ] = (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/src/corelib/kernel/qfunctions_wince.h") 3455 && (dictionary.value("QMAKESPEC").startsWith("wince") || dictionary.value("XQMAKESPEC").startsWith("wince"))) 3456 ? "Qt for Windows CE" : "Qt for Windows"; 3769 if (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/src/corelib/kernel/qfunctions_wince.h") && 3770 (dictionary.value("QMAKESPEC").startsWith("wince") || dictionary.value("XQMAKESPEC").startsWith("wince"))) 3771 dictionary["PLATFORM NAME"] = "Qt for Windows CE"; 3772 else if (dictionary.value("XQMAKESPEC").startsWith("symbian")) 3773 dictionary["PLATFORM NAME"] = "Qt for Symbian"; 3774 else 3775 dictionary["PLATFORM NAME"] = "Qt for Windows"; 3776 dictionary["LICENSE FILE"] = sourcePath; 3777 3457 3778 bool openSource = false; 3779 3458 3780 if (dictionary["BUILDNOKIA"] == "yes" || dictionary["BUILDTYPE"] == "commercial") { 3459 3781 openSource = false; 3460 3782 } else if (dictionary["BUILDTYPE"] == "opensource") { 3461 3783 openSource = true; 3462 } else {3784 } else 3463 3785 forever { 3464 3786 char accept = '?'; … … 3478 3800 } 3479 3801 } 3480 if (openSource) { 3481 dictionary["LICENSE FILE"] = sourcePath; 3482 if (QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.GPL3") || QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.LGPL")) { 3483 cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl; 3484 licenseInfo["LICENSEE"] = "Open Source"; 3485 dictionary["EDITION"] = "OpenSource"; 3486 dictionary["QT_EDITION"] = "QT_EDITION_OPENSOURCE"; 3487 cout << endl; 3488 if (!showLicense(dictionary["LICENSE FILE"])) { 3489 cout << "Configuration aborted since license was not accepted"; 3490 dictionary["DONE"] = "error"; 3491 return; 3492 } 3802 if (hasOpenSource && openSource) { 3803 cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl; 3804 licenseInfo["LICENSEE"] = "Open Source"; 3805 dictionary["EDITION"] = "OpenSource"; 3806 dictionary["QT_EDITION"] = "QT_EDITION_OPENSOURCE"; 3807 cout << endl; 3808 if (!showLicense(dictionary["LICENSE FILE"])) { 3809 cout << "Configuration aborted since license was not accepted"; 3810 dictionary["DONE"] = "error"; 3493 3811 return; 3494 3812 } 3495 #ifndef COMMERCIAL_VERSION 3813 } else if (openSource) { 3814 cout << endl << "Cannot find the GPL license files! Please download the Open Source version of the library." << endl; 3815 dictionary["DONE"] = "error"; 3816 } 3817 #ifdef COMMERCIAL_VERSION 3496 3818 else { 3497 cout << endl << "Cannot find the GPL license files!" << endl;3498 dictionary["DONE"] = "error";3499 }3500 #else3501 } else {3502 3819 Tools::checkLicense(dictionary, licenseInfo, firstLicensePath()); 3503 if (dictionary["DONE"] != "error" ) {3820 if (dictionary["DONE"] != "error") { 3504 3821 // give the user some feedback, and prompt for license acceptance 3505 3822 cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " " << dictionary["EDITION"] << " Edition."<< endl << endl; … … 3511 3828 } 3512 3829 } 3513 #endif // COMMERCIAL_VERSION 3830 #else // !COMMERCIAL_VERSION 3831 else { 3832 cout << endl << "Cannot build commercial edition from the open source version of the library." << endl; 3833 dictionary["DONE"] = "error"; 3834 } 3835 #endif 3514 3836 } 3515 3837 -
trunk/tools/configure/configureapp.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 151 151 bool filesDiffer(const QString &file1, const QString &file2); 152 152 153 staticbool findFile(const QString &fileName);154 static bool findFileInPaths(const QString &fileName, const QStringList&paths);153 bool findFile(const QString &fileName); 154 static &paths); 155 155 #if !defined(EVAL) 156 156 void reloadCmdLine(); -
trunk/tools/configure/environment.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 147 147 148 148 HKEY handle = 0; 149 LONG res; 150 QT_WA( { 151 res = RegOpenKeyExW(parentHandle, (WCHAR*)rSubkeyPath.utf16(), 152 0, KEY_READ, &handle); 153 } , { 154 res = RegOpenKeyExA(parentHandle, rSubkeyPath.toLocal8Bit(), 155 0, KEY_READ, &handle); 156 } ); 157 149 LONG res = RegOpenKeyEx(parentHandle, (wchar_t*)rSubkeyPath.utf16(), 0, KEY_READ, &handle); 158 150 if (res != ERROR_SUCCESS) 159 151 return QString(); … … 162 154 DWORD dataType; 163 155 DWORD dataSize; 164 QT_WA( { 165 res = RegQueryValueExW(handle, (WCHAR*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize); 166 }, { 167 res = RegQueryValueExA(handle, rSubkeyName.toLocal8Bit(), 0, &dataType, 0, &dataSize); 168 } ); 156 res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize); 169 157 if (res != ERROR_SUCCESS) { 170 158 RegCloseKey(handle); … … 174 162 // get the value 175 163 QByteArray data(dataSize, 0); 176 QT_WA( { 177 res = RegQueryValueExW(handle, (WCHAR*)rSubkeyName.utf16(), 0, 0, 178 reinterpret_cast<unsigned char*>(data.data()), &dataSize); 179 }, { 180 res = RegQueryValueExA(handle, rSubkeyName.toLocal8Bit(), 0, 0, 181 reinterpret_cast<unsigned char*>(data.data()), &dataSize); 182 } ); 164 res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, 0, 165 reinterpret_cast<unsigned char*>(data.data()), &dataSize); 183 166 if (res != ERROR_SUCCESS) { 184 167 RegCloseKey(handle); … … 190 173 case REG_EXPAND_SZ: 191 174 case REG_SZ: { 192 QT_WA( { 193 result = QString::fromUtf16(((const ushort*)data.constData())); 194 }, { 195 result = QString::fromLatin1(data.constData()); 196 } ); 175 result = QString::fromWCharArray(((const wchar_t *)data.constData())); 197 176 break; 198 177 } … … 202 181 int i = 0; 203 182 for (;;) { 204 QString s; 205 QT_WA( { 206 s = QString::fromUtf16((const ushort*)data.constData() + i); 207 }, { 208 s = QString::fromLatin1(data.constData() + i); 209 } ); 183 QString s = QString::fromWCharArray((const wchar_t *)data.constData() + i); 210 184 i += s.length() + 1; 211 185 … … 214 188 l.append(s); 215 189 } 216 result = l.join(", ");190 result = l.join(", "); 217 191 break; 218 192 } … … 220 194 case REG_NONE: 221 195 case REG_BINARY: { 222 QT_WA( { 223 result = QString::fromUtf16((const ushort*)data.constData(), data.size()/2); 224 }, { 225 result = QString::fromLatin1(data.constData(), data.size()); 226 } ); 196 result = QString::fromWCharArray((const wchar_t *)data.constData(), data.size() / 2); 227 197 break; 228 198 } … … 233 203 int i; 234 204 memcpy((char*)&i, data.constData(), sizeof(int)); 235 result = QString::number(i);205 result = QString::number(i); 236 206 break; 237 207 } … … 351 321 memset(&procInfo, 0, sizeof(procInfo)); 352 322 353 bool couldExecute; 354 QT_WA({ 355 // Unicode version 356 STARTUPINFOW startInfo; 357 memset(&startInfo, 0, sizeof(startInfo)); 358 startInfo.cb = sizeof(startInfo); 359 360 couldExecute = CreateProcessW(0, (WCHAR*)executable.utf16(), 323 STARTUPINFO startInfo; 324 memset(&startInfo, 0, sizeof(startInfo)); 325 startInfo.cb = sizeof(startInfo); 326 327 bool couldExecute = CreateProcess(0, (wchar_t*)executable.utf16(), 361 328 0, 0, false, 362 329 CREATE_NO_WINDOW | CREATE_SUSPENDED, 363 330 0, 0, &startInfo, &procInfo); 364 365 }, {366 // Ansi version367 STARTUPINFOA startInfo;368 memset(&startInfo, 0, sizeof(startInfo));369 startInfo.cb = sizeof(startInfo);370 371 couldExecute = CreateProcessA(0, executable.toLocal8Bit().data(),372 0, 0, false,373 CREATE_NO_WINDOW | CREATE_SUSPENDED,374 0, 0, &startInfo, &procInfo);375 })376 331 377 332 if (couldExecute) { … … 422 377 423 378 /*! 424 Creates a QByteArray of the \a environment in either UNICODE or 425 ansi representation. 379 Creates a QByteArray of the \a environment. 426 380 */ 427 381 static QByteArray qt_create_environment(const QStringList &environment) 428 382 { 429 383 QByteArray envlist; 430 if (!environment.isEmpty()) { 431 int pos = 0; 432 // add PATH if necessary (for DLL loading) 433 QByteArray path = qgetenv("PATH"); 434 QT_WA({ 435 if (environment.filter(QRegExp("^PATH=",Qt::CaseInsensitive)).isEmpty() 436 && !path.isNull()) { 437 QString tmp = QString(QLatin1String("PATH=%1")).arg(QString::fromLocal8Bit(path)); 438 uint tmpSize = sizeof(TCHAR) * (tmp.length()+1); 439 envlist.resize(envlist.size() + tmpSize ); 440 memcpy(envlist.data()+pos, tmp.utf16(), tmpSize); 441 pos += tmpSize; 442 } 443 // add the user environment 444 for (QStringList::ConstIterator it = environment.begin(); it != environment.end(); it++ ) { 445 QString tmp = *it; 446 uint tmpSize = sizeof(TCHAR) * (tmp.length()+1); 447 envlist.resize(envlist.size() + tmpSize); 448 memcpy(envlist.data()+pos, tmp.utf16(), tmpSize); 449 pos += tmpSize; 450 } 451 // add the 2 terminating 0 (actually 4, just to be on the safe side) 452 envlist.resize( envlist.size()+4 ); 453 envlist[pos++] = 0; 454 envlist[pos++] = 0; 455 envlist[pos++] = 0; 456 envlist[pos++] = 0; 457 }, { 458 if (environment.filter(QRegExp("^PATH=",Qt::CaseInsensitive)).isEmpty() && !path.isNull()) { 459 QByteArray tmp = QString("PATH=%1").arg(QString::fromLocal8Bit(path)).toLocal8Bit(); 460 uint tmpSize = tmp.length() + 1; 461 envlist.resize(envlist.size() + tmpSize); 462 memcpy(envlist.data()+pos, tmp.data(), tmpSize); 463 pos += tmpSize; 464 } 465 // add the user environment 466 for (QStringList::ConstIterator it = environment.begin(); it != environment.end(); it++) { 467 QByteArray tmp = (*it).toLocal8Bit(); 468 uint tmpSize = tmp.length() + 1; 469 envlist.resize(envlist.size() + tmpSize); 470 memcpy(envlist.data()+pos, tmp.data(), tmpSize); 471 pos += tmpSize; 472 } 473 // add the terminating 0 (actually 2, just to be on the safe side) 474 envlist.resize(envlist.size()+2); 475 envlist[pos++] = 0; 476 envlist[pos++] = 0; 477 }) 478 } 384 if (environment.isEmpty()) 385 return envlist; 386 387 int pos = 0; 388 // add PATH if necessary (for DLL loading) 389 QByteArray path = qgetenv("PATH"); 390 if (environment.filter(QRegExp("^PATH=",Qt::CaseInsensitive)).isEmpty() && !path.isNull()) { 391 QString tmp = QString(QLatin1String("PATH=%1")).arg(QString::fromLocal8Bit(path)); 392 uint tmpSize = sizeof(wchar_t) * (tmp.length() + 1); 393 envlist.resize(envlist.size() + tmpSize); 394 memcpy(envlist.data() + pos, tmp.utf16(), tmpSize); 395 pos += tmpSize; 396 } 397 // add the user environment 398 for (QStringList::ConstIterator it = environment.begin(); it != environment.end(); it++ ) { 399 QString tmp = *it; 400 uint tmpSize = sizeof(wchar_t) * (tmp.length() + 1); 401 envlist.resize(envlist.size() + tmpSize); 402 memcpy(envlist.data() + pos, tmp.utf16(), tmpSize); 403 pos += tmpSize; 404 } 405 // add the 2 terminating 0 (actually 4, just to be on the safe side) 406 envlist.resize(envlist.size() + 4); 407 envlist[pos++] = 0; 408 envlist[pos++] = 0; 409 envlist[pos++] = 0; 410 envlist[pos++] = 0; 479 411 480 412 return envlist; … … 502 434 qDebug() << " " << removeEnv; 503 435 #endif 504 // GetEnvironmentStrings is defined to GetEnvironmentStringsW when505 // UNICODE is defined. We cannot use that, since we need to506 // destinguish between unicode and ansi versions of the functions.507 #if defined(UNICODE) && defined(GetEnvironmentStrings)508 #undef GetEnvironmentStrings509 #endif510 511 436 // Create the full environment from the current environment and 512 437 // the additionalEnv strings, then remove all variables defined 513 438 // in removeEnv 514 439 QMap<QString, QString> fullEnvMap; 515 QT_WA({ 516 LPWSTR envStrings = GetEnvironmentStringsW(); 517 if (envStrings) { 518 int strLen = 0; 519 for (LPWSTR envString = envStrings; *(envString); envString += strLen + 1) { 520 strLen = wcslen(envString); 521 QString str = QString((const QChar*)envString, strLen); 522 if (!str.startsWith("=")) { // These are added by the system 523 int sepIndex = str.indexOf('='); 524 fullEnvMap.insert(str.left(sepIndex).toUpper(), str.mid(sepIndex +1)); 525 } 440 LPWSTR envStrings = GetEnvironmentStrings(); 441 if (envStrings) { 442 int strLen = 0; 443 for (LPWSTR envString = envStrings; *(envString); envString += strLen + 1) { 444 strLen = wcslen(envString); 445 QString str = QString((const QChar*)envString, strLen); 446 if (!str.startsWith("=")) { // These are added by the system 447 int sepIndex = str.indexOf('='); 448 fullEnvMap.insert(str.left(sepIndex).toUpper(), str.mid(sepIndex +1)); 526 449 } 527 450 } 528 FreeEnvironmentStringsW(envStrings); 529 }, { 530 LPSTR envStrings = GetEnvironmentStrings(); 531 if (envStrings) { 532 int strLen = 0; 533 for (LPSTR envString = envStrings; *(envString); envString += strLen + 1) { 534 strLen = strlen(envString); 535 QString str = QLatin1String(envString); 536 if (!str.startsWith("=")) { // These are added by the system 537 int sepIndex = str.indexOf('='); 538 fullEnvMap.insert(str.left(sepIndex).toUpper(), str.mid(sepIndex +1)); 539 } 540 } 541 } 542 FreeEnvironmentStringsA(envStrings); 543 }) 451 } 452 FreeEnvironmentStrings(envStrings); 453 544 454 // Add additionalEnv variables 545 455 for (int i = 0; i < additionalEnv.count(); ++i) { … … 570 480 memset(&procInfo, 0, sizeof(procInfo)); 571 481 572 bool couldExecute; 573 QT_WA({ 574 // Unicode version 575 STARTUPINFOW startInfo; 576 memset(&startInfo, 0, sizeof(startInfo)); 577 startInfo.cb = sizeof(startInfo); 578 579 couldExecute = CreateProcessW(0, (WCHAR*)args.utf16(), 482 STARTUPINFO startInfo; 483 memset(&startInfo, 0, sizeof(startInfo)); 484 startInfo.cb = sizeof(startInfo); 485 486 bool couldExecute = CreateProcess(0, (wchar_t*)args.utf16(), 580 487 0, 0, true, CREATE_UNICODE_ENVIRONMENT, 581 488 envlist.isEmpty() ? 0 : envlist.data(), 582 489 0, &startInfo, &procInfo); 583 }, {584 // Ansi version585 STARTUPINFOA startInfo;586 memset(&startInfo, 0, sizeof(startInfo));587 startInfo.cb = sizeof(startInfo);588 589 couldExecute = CreateProcessA(0, args.toLocal8Bit().data(),590 0, 0, true, 0,591 envlist.isEmpty() ? 0 : envlist.data(),592 0, &startInfo, &procInfo);593 })594 490 595 491 if (couldExecute) { … … 655 551 QFile::remove(destFile); 656 552 intermediate = QFile::copy(entry.absoluteFilePath(), destFile); 657 SetFileAttributes A(destFile.toLocal8Bit(), FILE_ATTRIBUTE_NORMAL);553 SetFileAttributes(), FILE_ATTRIBUTE_NORMAL); 658 554 } 659 555 if(!intermediate) { -
trunk/tools/configure/environment.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/configure/main.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 93 93 if( !app.isDone() ) 94 94 app.buildQmake(); 95 if( !app.isOk() )96 return 2;97 95 #endif 98 96 if( !app.isDone() ) 99 97 app.generateMakefiles(); 100 if( app.isOk() )98 if( () ) 101 99 app.buildHostTools(); 102 100 if( !app.isDone() ) 103 101 app.showSummary(); 102 103 104 104 105 105 return 0; -
trunk/tools/configure/tools.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 59 59 const QString &path) 60 60 { 61 62 63 64 65 66 67 61 68 QString tpLicense = dictionary["QT_SOURCE_TREE"] + "/LICENSE.PREVIEW.OPENSOURCE"; 62 69 if (QFile::exists(tpLicense)) { … … 104 111 // Verify license info... 105 112 QString licenseKey = licenseInfo["LICENSEKEYEXT"]; 106 const char *clicenseKey = licenseKey.toLatin1();113 clicenseKey = licenseKey.toLatin1(); 107 114 //We check the licence 108 #ifndef _WIN32_WCE109 char *buffer = strdup(clicenseKey);110 #else111 char *buffer = (char*) malloc(strlen(clicenseKey) + 1);112 strcpy(buffer, clicenseKey);113 #endif114 115 static const char * const SEP = "-"; 115 116 char *licenseParts[NUMBER_OF_PARTS]; 116 117 int partNumber = 0; 117 for (char *part = strtok( buffer, SEP); part != 0; part = strtok(0, SEP))118 for (char *part = strtok(, SEP); part != 0; part = strtok(0, SEP)) 118 119 licenseParts[partNumber++] = part; 119 120 if (partNumber < (NUMBER_OF_PARTS-1)) { 120 121 dictionary["DONE"] = "error"; 121 122 cout << "License file does not contain proper license key." <<partNumber<< endl; 122 free(buffer);123 123 return; 124 124 } 125 125 126 126 char products = licenseParts[0][0]; 127 char platforms = licenseParts[1][0];127 char]; 128 128 char* licenseSchema = licenseParts[2]; 129 129 char licenseFeatures = licenseParts[3][0]; … … 143 143 dictionary["QT_EDITION"] = "QT_EDITION_DESKTOPLIGHT"; 144 144 } 145 146 if (platforms == 'X') {147 dictionary["LICENSE_EXTENSION"] = "-ALLOS";148 } else if (strchr("3679ACDEHJKMSUWX", platforms)) {149 dictionary["LICENSE_EXTENSION"] = "-EMBEDDED";150 } else if (strchr("4BFPQRTY", platforms)) {151 dictionary["LICENSE_EXTENSION"] = "-DESKTOP";152 }153 145 } else if (strcmp(licenseSchema,"Z4M") == 0 || strcmp(licenseSchema,"R4M") == 0 || strcmp(licenseSchema,"Q4M") == 0) { 154 146 if (products == 'B') { 155 147 dictionary["EDITION"] = "Evaluation"; 156 148 dictionary["QT_EDITION"] = "QT_EDITION_EVALUATION"; 157 dictionary["LICENSE_EXTENSION"] = "-EVALUATION"; 158 } 159 } 149 } 150 } 151 152 if (platforms[2] == 'L') { 153 static const char src[] = "8NPQRTZ"; 154 static const char dst[] = "UCWX9M7"; 155 const char *p = strchr(src, platforms[1]); 156 platforms[1] = dst[p - src]; 157 } 158 159 #define PL(a,b) (int(a)+int(b)*256) 160 int platformCode = PL(platforms[0],platforms[1]); 161 switch (platformCode) { 162 case PL('X','9'): 163 case PL('X','C'): 164 case PL('X','U'): 165 case PL('X','W'): 166 case PL('X','M'): // old license key 167 dictionary["LICENSE_EXTENSION"] = "-ALLOS"; 168 break; 169 170 case PL('6', 'M'): 171 case PL('8', 'M'): 172 case PL('K', 'M'): // old license key 173 case PL('N', '7'): 174 case PL('N', '9'): 175 case PL('N', 'X'): 176 case PL('S', '9'): 177 case PL('S', 'C'): 178 case PL('S', 'U'): 179 case PL('S', 'W'): 180 dictionary["LICENSE_EXTENSION"] = "-EMBEDDED"; 181 if (dictionary["PLATFORM NAME"].contains("Windows CE") 182 && platformCode != PL('6', 'M') && platformCode != PL('S', '9') 183 && platformCode != PL('S', 'C') && platformCode != PL('S', 'U') 184 && platformCode != PL('S', 'W') && platformCode != PL('K', 'M')) { 185 dictionary["DONE"] = "error"; 186 } else if (dictionary["PLATFORM NAME"].contains("Symbian") 187 && platformCode != PL('N', '9') && platformCode != PL('S', '9') 188 && platformCode != PL('S', 'C') && platformCode != PL('S', 'U') 189 && platformCode != PL('S', 'W')) { 190 dictionary["DONE"] = "error"; 191 } 192 break; 193 case PL('R', 'M'): 194 case PL('F', 'M'): 195 dictionary["LICENSE_EXTENSION"] = "-DESKTOP"; 196 if (!dictionary["PLATFORM NAME"].endsWith("Windows")) { 197 dictionary["DONE"] = "error"; 198 } 199 break; 200 default: 201 dictionary["DONE"] = "error"; 202 break; 203 } 204 #undef PL 205 206 if (dictionary.value("DONE") == "error") { 207 cout << "You are not licensed for the " << dictionary["PLATFORM NAME"] << " platform." << endl << endl; 208 cout << "Please contact [email protected] to upgrade your license" << endl; 209 cout << "to include the " << dictionary["PLATFORM NAME"] << " platform, or install the" << endl; 210 cout << "Qt Open Source Edition if you intend to develop free software." << endl; 211 return; 212 } 213 214 // Override for evaluation licenses 215 if (dictionary["Edition"] == "Evaluation") 216 dictionary["LICENSE_EXTENSION"] = "-EVALUATION"; 160 217 161 218 if (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/.LICENSE")) { … … 174 231 } 175 232 176 if (dictionary["PLATFORM NAME"].contains("Windows CE")) {177 // verify that we are licensed to use Qt for Windows CE178 if (dictionary["LICENSE_EXTENSION"] != "-EMBEDDED" && dictionary["LICENSE_EXTENSION"] != "-ALLOS") {179 cout << "You are not licensed for the " << dictionary["PLATFORM NAME"] << " platform." << endl << endl;180 cout << "Please contact [email protected] to upgrade your license" << endl;181 cout << "to include the " << dictionary["PLATFORM NAME"] << " platform, or install the" << endl;182 cout << "Qt Open Source Edition if you intend to develop free software." << endl;183 dictionary["DONE"] = "error";184 return;185 }186 }187 188 233 // copy one of .LICENSE-*(-US) to LICENSE 189 234 QString toLicenseFile = dictionary["QT_SOURCE_TREE"] + "/LICENSE"; 190 235 QString fromLicenseFile = dictionary["QT_SOURCE_TREE"] + "/.LICENSE" + dictionary["LICENSE_EXTENSION"]; 191 if (licenseFeatures == 'G') //US 236 if (licenseFeatures == 'B' || licenseFeatures == 'G' 237 || licenseFeatures == 'L' || licenseFeatures == 'Y') 192 238 fromLicenseFile += "-US"; 193 239 194 if (licenseFeatures == '5') //Floating 195 dictionary["METERED LICENSE"] = "true"; 196 197 if (!CopyFileA(QDir::toNativeSeparators(fromLicenseFile).toLocal8Bit(), 198 QDir::toNativeSeparators(toLicenseFile).toLocal8Bit(), FALSE)) { 240 if (!CopyFile((wchar_t*)QDir::toNativeSeparators(fromLicenseFile).utf16(), 241 (wchar_t*)QDir::toNativeSeparators(toLicenseFile).utf16(), FALSE)) { 199 242 cout << "Failed to copy license file (" << fromLicenseFile << ")"; 200 243 dictionary["DONE"] = "error"; … … 202 245 } 203 246 dictionary["LICENSE FILE"] = toLicenseFile; 204 free(buffer);205 247 } 206 248 -
trunk/tools/configure/tools.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 **
Note:
See TracChangeset
for help on using the changeset viewer.
