VirtualBox

Changeset 85652 in vbox


Ignore:
Timestamp:
Aug 9, 2020 10:00:27 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139777
Message:

configure.vbs: We no longer need mingw because the recompiler is gone.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.vbs

    r84726 r85652  
    14211421
    14221422''
    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, str
    1429    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 <> "") then
    1439       if CheckForMinGW32Sub(strOptMinGW32, strOptW32API) then
    1440          strPathMingW32 = strOptMinGW32
    1441          strPathW32API = strOptW32API
    1442       end if
    1443    end if
    1444 
    1445    ' The tools location (first).
    1446    if (strPathMingW32 = "") And (g_blnInternalFirst = True) then
    1447       str = g_strPathDev & "/win.x86/mingw32/v3.3.3"
    1448       str2 = g_strPathDev & "/win.x86/w32api/v2.5"
    1449       if CheckForMinGW32Sub(str, str2) then
    1450          strPathMingW32 = str
    1451          strPathW32API = str2
    1452       end if
    1453    end if
    1454 
    1455    ' See if there is any gcc around.
    1456    if strPathMingW32 = "" then
    1457       str = Which("mingw32-gcc.exe")
    1458       if (str <> "") then
    1459          str = PathParent(PathStripFilename(str))
    1460          if CheckForMinGW32Sub(str, str) then strPathMingW32 = str
    1461       end if
    1462    end if
    1463 
    1464    if strPathMingW32 = "" then
    1465       str = Which("gcc.exe")
    1466       if (str <> "") then
    1467          str = PathParent(PathStripFilename(str))
    1468          if CheckForMinGW32Sub(str, str) then strPathMingW32 = str
    1469       end if
    1470    end if
    1471 
    1472    ' The tools location (post).
    1473    if (strPathMingW32 = "") And (g_blnInternalFirst = False) then
    1474       str = g_strPathDev & "/win.x86/mingw32/v3.3.3"
    1475       str2 = g_strPathDev & "/win.x86/w32api/v2.5"
    1476       if CheckForMinGW32Sub(str, str2) then
    1477          strPathMingW32 = str
    1478          strPathW32API = str2
    1479       end if
    1480    end if
    1481 
    1482    ' Success?
    1483    if strPathMingW32 = "" then
    1484       if g_strTargetArch = "amd64" then
    1485          MsgWarning "Can't locate a suitable MinGW32 installation, ignoring since we're targeting AMD64 and won't need it."
    1486       elseif strOptMinGW32 = "" then
    1487          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       else
    1490          MsgError "Can't locate a suitable MinGW32 installation. Please consult the configure.log and the build requirements."
    1491       end if
    1492       exit sub
    1493    end if
    1494 
    1495    '
    1496    ' Emit the config.
    1497    '
    1498    strPathMingW32 = UnixSlashes(PathAbs(strPathMingW32))
    1499    CfgPrint "PATH_TOOL_MINGW32     := " & strPathMingW32
    1500    PrintResult "MinGW32 (GCC v" & g_strSubOutput & ")", strPathMingW32
    1501    if (strPathMingW32 = strPathW32API) Or strPathW32API = "" then
    1502       CfgPrint "PATH_SDK_W32API       := $(PATH_TOOL_MINGW32)"
    1503    else
    1504       CfgPrint "PATH_SDK_W32API       := " & strPathW32API
    1505       PrintResult "W32API", strPathW32API
    1506    end if
    1507 end sub
    1508 
    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 = strPathMingW32
    1514    LogPrint "trying: strPathMingW32="  &strPathMingW32 & " strPathW32API=" & strPathW32API
    1515 
    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       then
    1530       if Shell(DosSlashes(strPathMingW32 & "/bin/gcc.exe") & " --version", True) = 0 then
    1531          dim offVer, iMajor, iMinor, iPatch, strVer
    1532 
    1533          ' extract the version.
    1534          strVer = ""
    1535          offVer = InStr(1, g_strShellOutput, "(GCC) ")
    1536          if offVer > 0 then
    1537             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) = ".") then
    1541                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             else
    1545                LogPrint "Malformed version: '" & strVer & "'"
    1546                strVer = ""
    1547             end if
    1548          end if
    1549          if strVer <> "" then
    1550             if (iMajor = 3) And (iMinor = 3) then
    1551                CheckForMinGW32Sub = True
    1552                g_strSubOutput = strVer
    1553             else
    1554                LogPrint "MinGW32 version '" & iMajor & "." & iMinor & "." & iPatch & "' is not supported (or configure.vbs failed to parse it correctly)."
    1555             end if
    1556          else
    1557             LogPrint "Couldn't locate the GCC version in the output!"
    1558          end if
    1559 
    1560       else
    1561          LogPrint "Failed to run gcc.exe!"
    1562       end if
    1563    end if
    1564 end function
    1565 
    1566 
    1567 ''
    1568 ' Checks for a MinGW-w64 suitable for building the recompiler.
    1569 sub CheckForMinGWw64(strOptMinGWw64)
    1570    dim strPathMingWw64, str
    1571    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 <> "") then
    1580       if CheckForMinGWw64Sub(strOptMinGWw64) then
    1581          strPathMingWw64 = strOptMinGWw64
    1582       end if
    1583    end if
    1584 
    1585    ' The tools location (first).
    1586    if (strPathMinGWw64 = "") And (g_blnInternalFirst = True) then
    1587       str = g_strPathDev & "/win.amd64/mingw-w64/r1"
    1588       if CheckForMinGWw64Sub(str) then
    1589          strPathMinGWw64 = str
    1590       end if
    1591    end if
    1592 
    1593    ' See if there is any gcc around.
    1594    if strPathMinGWw64 = "" then
    1595       str = Which("x86_64-w64-mingw32-gcc.exe")
    1596       if (str <> "") then
    1597          str = PathParent(PathStripFilename(str))
    1598          if CheckForMinGWw64Sub(str) then strPathMinGWw64 = str
    1599       end if
    1600    end if
    1601 
    1602    if strPathMinGWw64 = "" then
    1603       str = Which("gcc.exe")
    1604       if (str <> "") then
    1605          str = PathParent(PathStripFilename(str))
    1606          if CheckForMinGWw64Sub(str) then strPathMinGWw64 = str
    1607       end if
    1608    end if
    1609 
    1610    ' The tools location (post).
    1611    if (strPathMinGWw64 = "") And (g_blnInternalFirst = False) then
    1612       str = g_strPathDev & "/win.amd64/mingw-w64/r1"
    1613       if CheckForMinGWw64Sub(str) then
    1614          strPathMinGWw64 = str
    1615       end if
    1616    end if
    1617 
    1618    ' Success?
    1619    if strPathMinGWw64 = "" then
    1620       if g_strTargetArch = "x86" then
    1621          MsgWarning "Can't locate a suitable MinGW-w64 installation, ignoring since we're targeting x86 and won't need it."
    1622       elseif strOptMinGWw64 = "" then
    1623          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       else
    1626          MsgError "Can't locate a suitable MinGW-w64 installation. Please consult the configure.log and the build requirements."
    1627       end if
    1628       exit sub
    1629    end if
    1630 
    1631    '
    1632    ' Emit the config.
    1633    '
    1634    strPathMinGWw64 = UnixSlashes(PathAbs(strPathMinGWw64))
    1635    CfgPrint "PATH_TOOL_MINGWW64    := " & strPathMinGWw64
    1636    PrintResult "MinGW-w64 (GCC v" & g_strSubOutput & ")", strPathMinGWw64
    1637 end sub
    1638 
    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="  &strPathMinGWw64
    1644 
    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       then
    1661       if Shell(DosSlashes(strPathMinGWw64 & "/bin/gcc.exe") & " -dumpversion", True) = 0 then
    1662          dim offVer, iMajor, iMinor, iPatch, strVer
    1663 
    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) = ".") then
    1668             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          else
    1672             LogPrint "Malformed version: '" & strVer & "'"
    1673             strVer = ""
    1674          end if
    1675          if strVer <> "" then
    1676             if (iMajor = 4) And (iMinor >= 4) then
    1677                CheckForMinGWw64Sub = True
    1678                g_strSubOutput = strVer
    1679             else
    1680                LogPrint "MinGW-w64 version '" & iMajor & "." & iMinor & "." & iPatch & "' is not supported (or configure.vbs failed to parse it correctly)."
    1681             end if
    1682          else
    1683             LogPrint "Couldn't locate the GCC version in the output!"
    1684          end if
    1685 
    1686       else
    1687          LogPrint "Failed to run gcc.exe!"
    1688       end if
    1689    end if
    1690 end function
    1691 
    1692 
    1693 ''
    16941423' Checks for any libSDL binaries.
    16951424sub CheckForlibSDL(strOptlibSDL)
     
    20981827   Print "  --with-kBuild=PATH    "
    20991828   Print "  --with-libSDL=PATH    "
    2100    Print "  --with-MinGW32=PATH   "
    2101    Print "  --with-MinGW-w64=PATH "
    21021829   Print "  --with-Qt5=PATH       "
    21031830   Print "  --with-DDK=PATH       "
     
    21361863   strOptkBuild = ""
    21371864   strOptlibSDL = ""
    2138    strOptMinGW32 = ""
    2139    strOptMinGWw64 = ""
    21401865   strOptQt5 = ""
    21411866   strOptSDK = ""
     
    21781903            strOptlibSDL = strPath
    21791904         case "--with-mingw32"
    2180             strOptMinGW32 = strPath
     1905            ' ignore
    21811906         case "--with-mingw-w64"
    2182             strOptMinGWw64 = strPath
     1907            ' ignore
    21831908         case "--with-qt5"
    21841909            strOptQt5 = strPath
     
    22641989   CheckForPlatformSDK strOptSDK
    22651990   CheckForMidl
    2266    CheckForMinGW32 strOptMinGW32, strOptW32API
    2267    CheckForMinGWw64 strOptMinGWw64
    22681991   CfgPrint "VBOX_WITH_OPEN_WATCOM := " '' @todo look for openwatcom 1.9+
    22691992   CfgPrint "VBOX_WITH_LIBVPX := " '' @todo look for libvpx 1.1.0+
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette