tools/configure/environment.cpp
branchGCC_SURGE
changeset 31 5daf16870df6
parent 30 5dc02b23752f
child 37 758a864f9613
equal deleted inserted replaced
27:93b982ccede2 31:5daf16870df6
    71     const char *regKey;
    71     const char *regKey;
    72     const char *executable;
    72     const char *executable;
    73 } compiler_info[] = {
    73 } compiler_info[] = {
    74     // The compilers here are sorted in a reversed-preferred order
    74     // The compilers here are sorted in a reversed-preferred order
    75     {CC_BORLAND, "Borland C++",                                                    0, "bcc32.exe"},
    75     {CC_BORLAND, "Borland C++",                                                    0, "bcc32.exe"},
    76     {CC_MINGW,   "MinGW (Minimalist GNU for Windows)",                             0, "mingw32-gcc.exe"},
    76     {CC_MINGW,   "MinGW (Minimalist GNU for Windows)",                             0, "g++.exe"},
    77     {CC_INTEL,   "Intel(R) C++ Compiler for 32-bit applications",                  0, "icl.exe"}, // xilink.exe, xilink5.exe, xilink6.exe, xilib.exe
    77     {CC_INTEL,   "Intel(R) C++ Compiler for 32-bit applications",                  0, "icl.exe"}, // xilink.exe, xilink5.exe, xilink6.exe, xilib.exe
    78     {CC_MSVC6,   "Microsoft (R) 32-bit C/C++ Optimizing Compiler (6.x)",           "Software\\Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual C++\\ProductDir", "cl.exe"}, // link.exe, lib.exe
    78     {CC_MSVC6,   "Microsoft (R) 32-bit C/C++ Optimizing Compiler (6.x)",           "Software\\Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual C++\\ProductDir", "cl.exe"}, // link.exe, lib.exe
    79     {CC_NET2002, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2002 (7.0)",  "Software\\Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir", "cl.exe"}, // link.exe, lib.exe
    79     {CC_NET2002, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2002 (7.0)",  "Software\\Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir", "cl.exe"}, // link.exe, lib.exe
    80     {CC_NET2003, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2003 (7.1)",  "Software\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir", "cl.exe"}, // link.exe, lib.exe
    80     {CC_NET2003, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2003 (7.1)",  "Software\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir", "cl.exe"}, // link.exe, lib.exe
    81     {CC_NET2005, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2005 (8.0)",  "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\8.0", "cl.exe"}, // link.exe, lib.exe
    81     {CC_NET2005, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2005 (8.0)",  "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\8.0", "cl.exe"}, // link.exe, lib.exe
    82     {CC_NET2008, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2008 (9.0)",  "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\9.0", "cl.exe"}, // link.exe, lib.exe
    82     {CC_NET2008, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2008 (9.0)",  "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\9.0", "cl.exe"}, // link.exe, lib.exe
       
    83     {CC_NET2010, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2010 (10.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\10.0", "cl.exe"}, // link.exe, lib.exe
    83     {CC_UNKNOWN, "Unknown", 0, 0},
    84     {CC_UNKNOWN, "Unknown", 0, 0},
    84 };
    85 };
    85 
    86 
    86 
    87 
    87 // Initialize static variables
    88 // Initialize static variables
   103 */
   104 */
   104 QString Environment::detectQMakeSpec()
   105 QString Environment::detectQMakeSpec()
   105 {
   106 {
   106     QString spec;
   107     QString spec;
   107     switch (detectCompiler()) {
   108     switch (detectCompiler()) {
       
   109     case CC_NET2010:
       
   110         spec = "win32-msvc2010";
       
   111         break;
   108     case CC_NET2008:
   112     case CC_NET2008:
   109         spec = "win32-msvc2008";
   113         spec = "win32-msvc2008";
   110         break;
   114         break;
   111     case CC_NET2005:
   115     case CC_NET2005:
   112         spec = "win32-msvc2005";
   116         spec = "win32-msvc2005";
   355     // ----------------------------
   359     // ----------------------------
   356     QString program = arguments.takeAt(0);
   360     QString program = arguments.takeAt(0);
   357     QString args = qt_create_commandline(program, arguments);
   361     QString args = qt_create_commandline(program, arguments);
   358     QByteArray envlist = qt_create_environment(fullEnv);
   362     QByteArray envlist = qt_create_environment(fullEnv);
   359 
   363 
   360     DWORD exitCode = -1;
   364     DWORD exitCode = DWORD(-1);
   361     PROCESS_INFORMATION procInfo;
   365     PROCESS_INFORMATION procInfo;
   362     memset(&procInfo, 0, sizeof(procInfo));
   366     memset(&procInfo, 0, sizeof(procInfo));
   363 
   367 
   364     STARTUPINFO startInfo;
   368     STARTUPINFO startInfo;
   365     memset(&startInfo, 0, sizeof(startInfo));
   369     memset(&startInfo, 0, sizeof(startInfo));
   376         CloseHandle(procInfo.hThread);
   380         CloseHandle(procInfo.hThread);
   377         CloseHandle(procInfo.hProcess);
   381         CloseHandle(procInfo.hProcess);
   378     }
   382     }
   379 
   383 
   380 
   384 
   381     if (exitCode == -1) {
   385     if (exitCode == DWORD(-1)) {
   382         switch(GetLastError()) {
   386         switch(GetLastError()) {
   383         case E2BIG:
   387         case E2BIG:
   384             cerr << "execute: Argument list exceeds 1024 bytes" << endl;
   388             cerr << "execute: Argument list exceeds 1024 bytes" << endl;
   385             foreach(QString arg, arguments)
   389             foreach(QString arg, arguments)
   386                 cerr << "   (" << arg.toLocal8Bit().constData() << ")" << endl;
   390                 cerr << "   (" << arg.toLocal8Bit().constData() << ")" << endl;