Changeset 85652 in vbox
- Timestamp:
- Aug 9, 2020 10:00:27 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139777
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.vbs
r84726 r85652 1421 1421 1422 1422 '' 1423 ' Checks for a MinGW32 suitable for building the recompiler.1424 '1425 ' strOptW32API is currently ignored.1426 '1427 sub CheckForMinGW32(strOptMinGW32, strOptW32API)1428 dim strPathMingW32, strPathW32API, str1429 PrintHdr "MinGW32 GCC v3.3.x + Binutils + Runtime + W32API"1430 1431 '1432 ' Find the MinGW and W32API tools.1433 '1434 strPathMingW32 = ""1435 strPathW32API = ""1436 1437 ' The specified path.1438 if (strPathMingW32 = "") And (strOptMinGW32 <> "") then1439 if CheckForMinGW32Sub(strOptMinGW32, strOptW32API) then1440 strPathMingW32 = strOptMinGW321441 strPathW32API = strOptW32API1442 end if1443 end if1444 1445 ' The tools location (first).1446 if (strPathMingW32 = "") And (g_blnInternalFirst = True) then1447 str = g_strPathDev & "/win.x86/mingw32/v3.3.3"1448 str2 = g_strPathDev & "/win.x86/w32api/v2.5"1449 if CheckForMinGW32Sub(str, str2) then1450 strPathMingW32 = str1451 strPathW32API = str21452 end if1453 end if1454 1455 ' See if there is any gcc around.1456 if strPathMingW32 = "" then1457 str = Which("mingw32-gcc.exe")1458 if (str <> "") then1459 str = PathParent(PathStripFilename(str))1460 if CheckForMinGW32Sub(str, str) then strPathMingW32 = str1461 end if1462 end if1463 1464 if strPathMingW32 = "" then1465 str = Which("gcc.exe")1466 if (str <> "") then1467 str = PathParent(PathStripFilename(str))1468 if CheckForMinGW32Sub(str, str) then strPathMingW32 = str1469 end if1470 end if1471 1472 ' The tools location (post).1473 if (strPathMingW32 = "") And (g_blnInternalFirst = False) then1474 str = g_strPathDev & "/win.x86/mingw32/v3.3.3"1475 str2 = g_strPathDev & "/win.x86/w32api/v2.5"1476 if CheckForMinGW32Sub(str, str2) then1477 strPathMingW32 = str1478 strPathW32API = str21479 end if1480 end if1481 1482 ' Success?1483 if strPathMingW32 = "" then1484 if g_strTargetArch = "amd64" then1485 MsgWarning "Can't locate a suitable MinGW32 installation, ignoring since we're targeting AMD64 and won't need it."1486 elseif strOptMinGW32 = "" then1487 MsgError "Can't locate a suitable MinGW32 installation. Try specify the path with " _1488 & "the --with-MinGW32=<path> argument. If still no luck, consult the configure.log and the build requirements."1489 else1490 MsgError "Can't locate a suitable MinGW32 installation. Please consult the configure.log and the build requirements."1491 end if1492 exit sub1493 end if1494 1495 '1496 ' Emit the config.1497 '1498 strPathMingW32 = UnixSlashes(PathAbs(strPathMingW32))1499 CfgPrint "PATH_TOOL_MINGW32 := " & strPathMingW321500 PrintResult "MinGW32 (GCC v" & g_strSubOutput & ")", strPathMingW321501 if (strPathMingW32 = strPathW32API) Or strPathW32API = "" then1502 CfgPrint "PATH_SDK_W32API := $(PATH_TOOL_MINGW32)"1503 else1504 CfgPrint "PATH_SDK_W32API := " & strPathW32API1505 PrintResult "W32API", strPathW32API1506 end if1507 end sub1508 1509 ''1510 ' Checks if the specified path points to an usable MinGW or not.1511 function CheckForMinGW32Sub(strPathMingW32, strPathW32API)1512 g_strSubOutput = ""1513 if strPathW32API = "" then strPathW32API = strPathMingW321514 LogPrint "trying: strPathMingW32=" &strPathMingW32 & " strPathW32API=" & strPathW32API1515 1516 if LogFileExists(strPathMingW32, "bin/mingw32-gcc.exe") _1517 And LogFileExists(strPathMingW32, "bin/ld.exe") _1518 And LogFileExists(strPathMingW32, "bin/objdump.exe") _1519 And LogFileExists(strPathMingW32, "bin/dllwrap.exe") _1520 And LogFileExists(strPathMingW32, "bin/as.exe") _1521 And LogFileExists(strPathMingW32, "include/string.h") _1522 And LogFileExists(strPathMingW32, "include/_mingw.h") _1523 And LogFileExists(strPathMingW32, "lib/dllcrt1.o") _1524 And LogFileExists(strPathMingW32, "lib/dllcrt2.o") _1525 And LogFileExists(strPathMingW32, "lib/libmsvcrt.a") _1526 _1527 And LogFileExists(strPathW32API, "lib/libkernel32.a") _1528 And LogFileExists(strPathW32API, "include/windows.h") _1529 then1530 if Shell(DosSlashes(strPathMingW32 & "/bin/gcc.exe") & " --version", True) = 0 then1531 dim offVer, iMajor, iMinor, iPatch, strVer1532 1533 ' extract the version.1534 strVer = ""1535 offVer = InStr(1, g_strShellOutput, "(GCC) ")1536 if offVer > 0 then1537 strVer = LTrim(Mid(g_strShellOutput, offVer + Len("(GCC) ")))1538 strVer = RTrim(Left(strVer, InStr(1, strVer, " ")))1539 if (Mid(strVer, 2, 1) = ".") _1540 And (Mid(strVer, 4, 1) = ".") then1541 iMajor = Int(Left(strVer, 1)) ' Is Int() the right thing here? I want atoi()!!!1542 iMinor = Int(Mid(strVer, 3, 1))1543 iPatch = Int(Mid(strVer, 5))1544 else1545 LogPrint "Malformed version: '" & strVer & "'"1546 strVer = ""1547 end if1548 end if1549 if strVer <> "" then1550 if (iMajor = 3) And (iMinor = 3) then1551 CheckForMinGW32Sub = True1552 g_strSubOutput = strVer1553 else1554 LogPrint "MinGW32 version '" & iMajor & "." & iMinor & "." & iPatch & "' is not supported (or configure.vbs failed to parse it correctly)."1555 end if1556 else1557 LogPrint "Couldn't locate the GCC version in the output!"1558 end if1559 1560 else1561 LogPrint "Failed to run gcc.exe!"1562 end if1563 end if1564 end function1565 1566 1567 ''1568 ' Checks for a MinGW-w64 suitable for building the recompiler.1569 sub CheckForMinGWw64(strOptMinGWw64)1570 dim strPathMingWw64, str1571 PrintHdr "MinGW-w64 GCC (unprefixed)"1572 1573 '1574 ' Find the MinGW-w64 tools.1575 '1576 strPathMingWw64 = ""1577 1578 ' The specified path.1579 if (strPathMingWw64 = "") And (strOptMinGWw64 <> "") then1580 if CheckForMinGWw64Sub(strOptMinGWw64) then1581 strPathMingWw64 = strOptMinGWw641582 end if1583 end if1584 1585 ' The tools location (first).1586 if (strPathMinGWw64 = "") And (g_blnInternalFirst = True) then1587 str = g_strPathDev & "/win.amd64/mingw-w64/r1"1588 if CheckForMinGWw64Sub(str) then1589 strPathMinGWw64 = str1590 end if1591 end if1592 1593 ' See if there is any gcc around.1594 if strPathMinGWw64 = "" then1595 str = Which("x86_64-w64-mingw32-gcc.exe")1596 if (str <> "") then1597 str = PathParent(PathStripFilename(str))1598 if CheckForMinGWw64Sub(str) then strPathMinGWw64 = str1599 end if1600 end if1601 1602 if strPathMinGWw64 = "" then1603 str = Which("gcc.exe")1604 if (str <> "") then1605 str = PathParent(PathStripFilename(str))1606 if CheckForMinGWw64Sub(str) then strPathMinGWw64 = str1607 end if1608 end if1609 1610 ' The tools location (post).1611 if (strPathMinGWw64 = "") And (g_blnInternalFirst = False) then1612 str = g_strPathDev & "/win.amd64/mingw-w64/r1"1613 if CheckForMinGWw64Sub(str) then1614 strPathMinGWw64 = str1615 end if1616 end if1617 1618 ' Success?1619 if strPathMinGWw64 = "" then1620 if g_strTargetArch = "x86" then1621 MsgWarning "Can't locate a suitable MinGW-w64 installation, ignoring since we're targeting x86 and won't need it."1622 elseif strOptMinGWw64 = "" then1623 MsgError "Can't locate a suitable MinGW-w64 installation. Try specify the path with " _1624 & "the --with-MinGW-w64=<path> argument. If still no luck, consult the configure.log and the build requirements."1625 else1626 MsgError "Can't locate a suitable MinGW-w64 installation. Please consult the configure.log and the build requirements."1627 end if1628 exit sub1629 end if1630 1631 '1632 ' Emit the config.1633 '1634 strPathMinGWw64 = UnixSlashes(PathAbs(strPathMinGWw64))1635 CfgPrint "PATH_TOOL_MINGWW64 := " & strPathMinGWw641636 PrintResult "MinGW-w64 (GCC v" & g_strSubOutput & ")", strPathMinGWw641637 end sub1638 1639 ''1640 ' Checks if the specified path points to an usable MinGW-w64 or not.1641 function CheckForMinGWw64Sub(strPathMinGWw64)1642 g_strSubOutput = ""1643 LogPrint "trying: strPathMinGWw64=" &strPathMinGWw641644 1645 if LogFileExists(strPathMinGWw64, "bin/gcc.exe") _1646 And LogFileExists(strPathMinGWw64, "bin/ld.exe") _1647 And LogFileExists(strPathMinGWw64, "bin/objdump.exe") _1648 And LogFileExists(strPathMinGWw64, "bin/dllwrap.exe") _1649 And LogFileExists(strPathMinGWw64, "bin/dlltool.exe") _1650 And LogFileExists(strPathMinGWw64, "bin/as.exe") _1651 And LogFileExists(strPathMinGWw64, "include/bfd.h") _1652 And LogFileExists(strPathMinGWw64, "lib64/libgcc_s.a") _1653 And LogFileExists(strPathMinGWw64, "x86_64-w64-mingw32/lib/dllcrt1.o") _1654 And LogFileExists(strPathMinGWw64, "x86_64-w64-mingw32/lib/dllcrt2.o") _1655 And LogFileExists(strPathMinGWw64, "x86_64-w64-mingw32/lib/libmsvcrt.a") _1656 And LogFileExists(strPathMinGWw64, "x86_64-w64-mingw32/lib/libmsvcr100.a") _1657 And LogFileExists(strPathMinGWw64, "x86_64-w64-mingw32/include/_mingw.h") _1658 And LogFileExists(strPathMinGWw64, "x86_64-w64-mingw32/include/stdint.h") _1659 And LogFileExists(strPathMinGWw64, "x86_64-w64-mingw32/include/windows.h") _1660 then1661 if Shell(DosSlashes(strPathMinGWw64 & "/bin/gcc.exe") & " -dumpversion", True) = 0 then1662 dim offVer, iMajor, iMinor, iPatch, strVer1663 1664 ' extract the version.1665 strVer = Trim(Replace(Replace(g_strShellOutput, vbCr, ""), vbLf, ""))1666 if (Mid(strVer, 2, 1) = ".") _1667 And (Mid(strVer, 4, 1) = ".") then1668 iMajor = Int(Left(strVer, 1)) ' Is Int() the right thing here? I want atoi()!!!1669 iMinor = Int(Mid(strVer, 3, 1))1670 iPatch = Int(Mid(strVer, 5))1671 else1672 LogPrint "Malformed version: '" & strVer & "'"1673 strVer = ""1674 end if1675 if strVer <> "" then1676 if (iMajor = 4) And (iMinor >= 4) then1677 CheckForMinGWw64Sub = True1678 g_strSubOutput = strVer1679 else1680 LogPrint "MinGW-w64 version '" & iMajor & "." & iMinor & "." & iPatch & "' is not supported (or configure.vbs failed to parse it correctly)."1681 end if1682 else1683 LogPrint "Couldn't locate the GCC version in the output!"1684 end if1685 1686 else1687 LogPrint "Failed to run gcc.exe!"1688 end if1689 end if1690 end function1691 1692 1693 ''1694 1423 ' Checks for any libSDL binaries. 1695 1424 sub CheckForlibSDL(strOptlibSDL) … … 2098 1827 Print " --with-kBuild=PATH " 2099 1828 Print " --with-libSDL=PATH " 2100 Print " --with-MinGW32=PATH "2101 Print " --with-MinGW-w64=PATH "2102 1829 Print " --with-Qt5=PATH " 2103 1830 Print " --with-DDK=PATH " … … 2136 1863 strOptkBuild = "" 2137 1864 strOptlibSDL = "" 2138 strOptMinGW32 = ""2139 strOptMinGWw64 = ""2140 1865 strOptQt5 = "" 2141 1866 strOptSDK = "" … … 2178 1903 strOptlibSDL = strPath 2179 1904 case "--with-mingw32" 2180 strOptMinGW32 = strPath1905 ' ignore 2181 1906 case "--with-mingw-w64" 2182 strOptMinGWw64 = strPath1907 ' ignore 2183 1908 case "--with-qt5" 2184 1909 strOptQt5 = strPath … … 2264 1989 CheckForPlatformSDK strOptSDK 2265 1990 CheckForMidl 2266 CheckForMinGW32 strOptMinGW32, strOptW32API2267 CheckForMinGWw64 strOptMinGWw642268 1991 CfgPrint "VBOX_WITH_OPEN_WATCOM := " '' @todo look for openwatcom 1.9+ 2269 1992 CfgPrint "VBOX_WITH_LIBVPX := " '' @todo look for libvpx 1.1.0+
Note:
See TracChangeset
for help on using the changeset viewer.