@@ -1384,83 +1384,85 @@ end sub
1384
1384
1385
1385
1386
1386
''
1387
- ' Checks for a MingW32 suitable for building the recompiler.
1387
+ ' Checks for a MinGW32 suitable for building the recompiler.
1388
1388
'
1389
1389
' strOptW32API is currently ignored.
1390
1390
'
1391
- sub CheckForMingW(strOptMingw , strOptW32API)
1392
- dim strPathMingW , strPathW32API, str
1393
- PrintHdr "MinGW GCC v3.3.x + Binutils + Runtime + W32API"
1391
+ sub CheckForMinGW32(strOptMinGW32 , strOptW32API)
1392
+ dim strPathMingW32 , strPathW32API, str
1393
+ PrintHdr "MinGW32 GCC v3.3.x + Binutils + Runtime + W32API"
1394
1394
1395
1395
'
1396
1396
' Find the MinGW and W32API tools.
1397
1397
'
1398
- strPathMingW = ""
1398
+ strPathMingW32 = ""
1399
1399
strPathW32API = ""
1400
1400
1401
1401
' The specified path.
1402
- if (strPathMingW = "" ) And (strOptMingW <> "" ) then
1403
- if CheckForMingWSub(strOptMingW , strOptW32API) then
1404
- strPathMingW = strOptMingW
1402
+ if (strPathMingW32 = "" ) And (strOptMinGW32 <> "" ) then
1403
+ if CheckForMinGW32Sub(strOptMinGW32 , strOptW32API) then
1404
+ strPathMingW32 = strOptMinGW32
1405
1405
strPathW32API = strOptW32API
1406
1406
end if
1407
1407
end if
1408
1408
1409
1409
' The tools location (first).
1410
- if (strPathMingW = "" ) And (g_blnInternalFirst = True ) then
1410
+ if (strPathMingW32 = "" ) And (g_blnInternalFirst = True ) then
1411
1411
str = g_strPathDev & "/win.x86/mingw32/v3.3.3"
1412
1412
str2 = g_strPathDev & "/win.x86/w32api/v2.5"
1413
- if CheckForMingWSub (str, str2) then
1414
- strPathMingW = str
1413
+ if CheckForMinGW32Sub (str, str2) then
1414
+ strPathMingW32 = str
1415
1415
strPathW32API = str2
1416
1416
end if
1417
1417
end if
1418
1418
1419
1419
' See if there is any gcc around.
1420
- if strPathMingW = "" then
1420
+ if strPathMingW32 = "" then
1421
1421
str = Which( "mingw32-gcc.exe" )
1422
1422
if (str <> "" ) then
1423
1423
str = PathParent(PathStripFilename(str))
1424
- if CheckForMingWSub (str, str) then strPathMingW = str
1424
+ if CheckForMinGW32Sub (str, str) then strPathMingW32 = str
1425
1425
end if
1426
1426
end if
1427
1427
1428
- if strPathMingW = "" then
1428
+ if strPathMingW32 = "" then
1429
1429
str = Which( "gcc.exe" )
1430
1430
if (str <> "" ) then
1431
1431
str = PathParent(PathStripFilename(str))
1432
- if CheckForMingWSub (str, str) then strPathMingW = str
1432
+ if CheckForMinGW32Sub (str, str) then strPathMingW32 = str
1433
1433
end if
1434
1434
end if
1435
1435
1436
1436
' The tools location (post).
1437
- if (strPathMingW = "" ) And (g_blnInternalFirst = False ) then
1437
+ if (strPathMingW32 = "" ) And (g_blnInternalFirst = False ) then
1438
1438
str = g_strPathDev & "/win.x86/mingw32/v3.3.3"
1439
1439
str2 = g_strPathDev & "/win.x86/w32api/v2.5"
1440
- if CheckForMingWSub (str, str2) then
1441
- strPathMingW = str
1440
+ if CheckForMinGW32Sub (str, str2) then
1441
+ strPathMingW32 = str
1442
1442
strPathW32API = str2
1443
1443
end if
1444
1444
end if
1445
1445
1446
1446
' Success?
1447
- if strPathMingW = "" then
1448
- if strOptMingw = "" then
1449
- MsgError "Can't locate a suitable MinGW installation. Try specify the path with " _
1450
- & "the --with-MinGW=<path> argument. If still no luck, consult the configure.log and the build requirements."
1447
+ if strPathMingW32 = "" then
1448
+ if g_strTargetArch = "amd64" then
1449
+ MsgWarning "Can't locate a suitable MinGW32 installation, ignoring since we're targetting AMD64 and won't need it."
1450
+ elseif strOptMinGW32 = "" then
1451
+ MsgError "Can't locate a suitable MinGW32 installation. Try specify the path with " _
1452
+ & "the --with-MinGW32=<path> argument. If still no luck, consult the configure.log and the build requirements."
1451
1453
else
1452
- MsgError "Can't locate a suitable MinGW installation. Please consult the configure.log and the build requirements."
1454
+ MsgError "Can't locate a suitable MinGW32 installation. Please consult the configure.log and the build requirements."
1453
1455
end if
1454
1456
exit sub
1455
1457
end if
1456
1458
1457
1459
'
1458
1460
' Emit the config.
1459
1461
'
1460
- strPathMingW = UnixSlashes(PathAbs(strPathMingW ))
1461
- CfgPrint "PATH_TOOL_MINGW32 := " & strPathMingW
1462
- PrintResult "MinGW (GCC v" & g_strSubOutput & ")" , strPathMingW
1463
- if (strPathMingW = strPathW32API) Or strPathW32API = "" then
1462
+ strPathMingW32 = UnixSlashes(PathAbs(strPathMingW32 ))
1463
+ CfgPrint "PATH_TOOL_MINGW32 := " & strPathMingW32
1464
+ PrintResult "MinGW32 (GCC v" & g_strSubOutput & ")" , strPathMingW32
1465
+ if (strPathMingW32 = strPathW32API) Or strPathW32API = "" then
1464
1466
CfgPrint "PATH_SDK_W32API := $(PATH_TOOL_MINGW32)"
1465
1467
else
1466
1468
CfgPrint "PATH_SDK_W32API := " & strPathW32API
@@ -1470,26 +1472,26 @@ end sub
1470
1472
1471
1473
''
1472
1474
' Checks if the specified path points to an usable MinGW or not.
1473
- function CheckForMingWSub(strPathMingW , strPathW32API)
1475
+ function CheckForMinGW32Sub(strPathMingW32 , strPathW32API)
1474
1476
g_strSubOutput = ""
1475
- if strPathW32API = "" then strPathW32API = strPathMingW
1476
- LogPrint "trying: strPathMingW =" &strPathMingW & " strPathW32API=" & strPathW32API
1477
-
1478
- if LogFileExists(strPathMingW , "bin/mingw32-gcc.exe" ) _
1479
- And LogFileExists(strPathMingW , "bin/ld.exe" ) _
1480
- And LogFileExists(strPathMingW , "bin/objdump.exe" ) _
1481
- And LogFileExists(strPathMingW , "bin/dllwrap.exe" ) _
1482
- And LogFileExists(strPathMingW , "bin/as.exe" ) _
1483
- And LogFileExists(strPathMingW , "include/string.h" ) _
1484
- And LogFileExists(strPathMingW , "include/_mingw.h" ) _
1485
- And LogFileExists(strPathMingW , "lib/dllcrt1.o" ) _
1486
- And LogFileExists(strPathMingW , "lib/dllcrt2.o" ) _
1487
- And LogFileExists(strPathMingW , "lib/libmsvcrt.a" ) _
1477
+ if strPathW32API = "" then strPathW32API = strPathMingW32
1478
+ LogPrint "trying: strPathMingW32 =" &strPathMingW32 & " strPathW32API=" & strPathW32API
1479
+
1480
+ if LogFileExists(strPathMingW32 , "bin/mingw32-gcc.exe" ) _
1481
+ And LogFileExists(strPathMingW32 , "bin/ld.exe" ) _
1482
+ And LogFileExists(strPathMingW32 , "bin/objdump.exe" ) _
1483
+ And LogFileExists(strPathMingW32 , "bin/dllwrap.exe" ) _
1484
+ And LogFileExists(strPathMingW32 , "bin/as.exe" ) _
1485
+ And LogFileExists(strPathMingW32 , "include/string.h" ) _
1486
+ And LogFileExists(strPathMingW32 , "include/_mingw.h" ) _
1487
+ And LogFileExists(strPathMingW32 , "lib/dllcrt1.o" ) _
1488
+ And LogFileExists(strPathMingW32 , "lib/dllcrt2.o" ) _
1489
+ And LogFileExists(strPathMingW32 , "lib/libmsvcrt.a" ) _
1488
1490
_
1489
1491
And LogFileExists(strPathW32API, "lib/libkernel32.a" ) _
1490
1492
And LogFileExists(strPathW32API, "include/windows.h" ) _
1491
1493
then
1492
- if Shell(DosSlashes(strPathMingW & "/bin/gcc.exe" ) & " --version" , True ) = 0 then
1494
+ if Shell(DosSlashes(strPathMingW32 & "/bin/gcc.exe" ) & " --version" , True ) = 0 then
1493
1495
dim offVer, iMajor, iMinor, iPatch, strVer
1494
1496
1495
1497
' extract the version.
@@ -1510,10 +1512,137 @@ function CheckForMingWSub(strPathMingW, strPathW32API)
1510
1512
end if
1511
1513
if strVer <> "" then
1512
1514
if (iMajor = 3 ) And (iMinor = 3 ) then
1513
- CheckForMingWSub = True
1515
+ CheckForMinGW32Sub = True
1514
1516
g_strSubOutput = strVer
1515
1517
else
1516
- LogPrint "MinGW version '" & iMajor & "." & iMinor & "." & iPatch & "' is not supported (or configure.vbs failed to parse it correctly)."
1518
+ LogPrint "MinGW32 version '" & iMajor & "." & iMinor & "." & iPatch & "' is not supported (or configure.vbs failed to parse it correctly)."
1519
+ end if
1520
+ else
1521
+ LogPrint "Couldn't locate the GCC version in the output!"
1522
+ end if
1523
+
1524
+ else
1525
+ LogPrint "Failed to run gcc.exe!"
1526
+ end if
1527
+ end if
1528
+ end function
1529
+
1530
+
1531
+ ''
1532
+ ' Checks for a MinGW-w64 suitable for building the recompiler.
1533
+ '
1534
+ sub CheckForMinGWw64(strOptMinGWw64)
1535
+ dim strPathMingWw64, str
1536
+ PrintHdr "MinGW-w64 GCC (unprefixed)"
1537
+
1538
+ '
1539
+ ' Find the MinGW-w64 tools.
1540
+ '
1541
+ strPathMingWw64 = ""
1542
+
1543
+ ' The specified path.
1544
+ if (strPathMingWw64 = "" ) And (strOptMinGWw64 <> "" ) then
1545
+ if CheckForMinGWw64Sub(strOptMinGWw64) then
1546
+ strPathMingWw64 = strOptMinGWw64
1547
+ end if
1548
+ end if
1549
+
1550
+ ' The tools location (first).
1551
+ if (strPathMinGWw64 = "" ) And (g_blnInternalFirst = True ) then
1552
+ str = g_strPathDev & "/win.amd64/mingw-w64/r1"
1553
+ if CheckForMinGWw64Sub(str) then
1554
+ strPathMinGWw64 = str
1555
+ end if
1556
+ end if
1557
+
1558
+ ' See if there is any gcc around.
1559
+ if strPathMinGWw64 = "" then
1560
+ str = Which( "x86_64-w64-mingw32-gcc.exe" )
1561
+ if (str <> "" ) then
1562
+ str = PathParent(PathStripFilename(str))
1563
+ if CheckForMinGWw64Sub(str) then strPathMinGWw64 = str
1564
+ end if
1565
+ end if
1566
+
1567
+ if strPathMinGWw64 = "" then
1568
+ str = Which( "gcc.exe" )
1569
+ if (str <> "" ) then
1570
+ str = PathParent(PathStripFilename(str))
1571
+ if CheckForMinGWw64Sub(str) then strPathMinGWw64 = str
1572
+ end if
1573
+ end if
1574
+
1575
+ ' The tools location (post).
1576
+ if (strPathMinGWw64 = "" ) And (g_blnInternalFirst = False ) then
1577
+ str = g_strPathDev & "/win.amd64/mingw-w64/r1"
1578
+ if CheckForMinGWw64Sub(str) then
1579
+ strPathMinGWw64 = str
1580
+ end if
1581
+ end if
1582
+
1583
+ ' Success?
1584
+ if strPathMinGWw64 = "" then
1585
+ if g_strTargetArch = "x86" then
1586
+ MsgWarning "Can't locate a suitable MinGW-w64 installation, ignoring since we're targetting x86 and won't need it."
1587
+ elseif strOptMinGWw64 = "" then
1588
+ MsgError "Can't locate a suitable MinGW-w64 installation. Try specify the path with " _
1589
+ & "the --with-MinGW-w64=<path> argument. If still no luck, consult the configure.log and the build requirements."
1590
+ else
1591
+ MsgError "Can't locate a suitable MinGW-w64 installation. Please consult the configure.log and the build requirements."
1592
+ end if
1593
+ exit sub
1594
+ end if
1595
+
1596
+ '
1597
+ ' Emit the config.
1598
+ '
1599
+ strPathMinGWw64 = UnixSlashes(PathAbs(strPathMinGWw64))
1600
+ CfgPrint "PATH_TOOL_MINGWW64 := " & strPathMinGWw64
1601
+ PrintResult "MinGW-w64 (GCC v" & g_strSubOutput & ")" , strPathMinGWw64
1602
+ end sub
1603
+
1604
+ ''
1605
+ ' Checks if the specified path points to an usable MinGW-w64 or not.
1606
+ function CheckForMinGWw64Sub(strPathMinGWw64)
1607
+ g_strSubOutput = ""
1608
+ LogPrint "trying: strPathMinGWw64=" &strPathMinGWw64
1609
+
1610
+ if LogFileExists(strPathMinGWw64, "bin/gcc.exe" ) _
1611
+ And LogFileExists(strPathMinGWw64, "bin/ld.exe" ) _
1612
+ And LogFileExists(strPathMinGWw64, "bin/objdump.exe" ) _
1613
+ And LogFileExists(strPathMinGWw64, "bin/dllwrap.exe" ) _
1614
+ And LogFileExists(strPathMinGWw64, "bin/dlltool.exe" ) _
1615
+ And LogFileExists(strPathMinGWw64, "bin/as.exe" ) _
1616
+ And LogFileExists(strPathMinGWw64, "include/bfd.h" ) _
1617
+ And LogFileExists(strPathMinGWw64, "lib64/libgcc_s.a" ) _
1618
+ And LogFileExists(strPathMinGWw64, "x86_64-w64-mingw32/lib/dllcrt1.o" ) _
1619
+ And LogFileExists(strPathMinGWw64, "x86_64-w64-mingw32/lib/dllcrt2.o" ) _
1620
+ And LogFileExists(strPathMinGWw64, "x86_64-w64-mingw32/lib/libmsvcrt.a" ) _
1621
+ And LogFileExists(strPathMinGWw64, "x86_64-w64-mingw32/lib/libmsvcr100.a" ) _
1622
+ And LogFileExists(strPathMinGWw64, "x86_64-w64-mingw32/include/_mingw.h" ) _
1623
+ And LogFileExists(strPathMinGWw64, "x86_64-w64-mingw32/include/stdint.h" ) _
1624
+ And LogFileExists(strPathMinGWw64, "x86_64-w64-mingw32/include/windows.h" ) _
1625
+ then
1626
+ if Shell(DosSlashes(strPathMinGWw64 & "/bin/gcc.exe" ) & " -dumpversion" , True ) = 0 then
1627
+ dim offVer, iMajor, iMinor, iPatch, strVer
1628
+
1629
+ ' extract the version.
1630
+ strVer = Trim(Replace(Replace(g_strShellOutput, vbCr, "" ), vbLf, "" ))
1631
+ if (Mid(strVer, 2 , 1 ) = "." ) _
1632
+ And (Mid(strVer, 4 , 1 ) = "." ) then
1633
+ iMajor = Int(Left(strVer, 1 )) ' Is Int() the right thing here? I want atoi()!!!
1634
+ iMinor = Int(Mid(strVer, 3 , 1 ))
1635
+ iPatch = Int(Mid(strVer, 5 ))
1636
+ else
1637
+ LogPrint "Malformed version: '" & strVer & "'"
1638
+ strVer = ""
1639
+ end if
1640
+ if strVer <> "" then
1641
+ if (iMajor = 4 ) And (iMinor >= 4 ) then
1642
+ CheckForMinGWw64Sub = True
1643
+ g_strSubOutput = strVer
1644
+ else
1645
+ LogPrint "MinGW-w64 version '" & iMajor & "." & iMinor & "." & iPatch & "' is not supported (or configure.vbs failed to parse it correctly)."
1517
1646
end if
1518
1647
else
1519
1648
LogPrint "Couldn't locate the GCC version in the output!"
@@ -2011,7 +2140,8 @@ sub usage
2011
2140
Print " --with-DXSDK=PATH "
2012
2141
Print " --with-kBuild=PATH "
2013
2142
Print " --with-libSDL=PATH "
2014
- Print " --with-MinGW=PATH "
2143
+ Print " --with-MinGW32=PATH "
2144
+ Print " --with-MinGW-w64=PATH "
2015
2145
Print " --with-Qt4=PATH "
2016
2146
Print " --with-SDK=PATH "
2017
2147
Print " --with-VC=PATH "
@@ -2046,7 +2176,8 @@ Sub Main
2046
2176
strOptDXDDK = ""
2047
2177
strOptkBuild = ""
2048
2178
strOptlibSDL = ""
2049
- strOptMingW = ""
2179
+ strOptMinGW32 = ""
2180
+ strOptMinGWw64 = ""
2050
2181
strOptQt4 = ""
2051
2182
strOptSDK = ""
2052
2183
strOptVC = ""
@@ -2085,8 +2216,10 @@ Sub Main
2085
2216
strOptkBuild = strPath
2086
2217
case "--with-libsdl"
2087
2218
strOptlibSDL = strPath
2088
- case "--with-mingw"
2089
- strOptMingW = strPath
2219
+ case "--with-mingw32"
2220
+ strOptMinGW32 = strPath
2221
+ case "--with-mingw-w64"
2222
+ strOptMinGWw64 = strPath
2090
2223
case "--with-qt4"
2091
2224
strOptQt4 = strPath
2092
2225
case "--with-sdk"
@@ -2167,7 +2300,8 @@ Sub Main
2167
2300
CheckForVisualCPP strOptVC, strOptVCCommon, blnOptVCExpressEdition
2168
2301
CheckForPlatformSDK strOptSDK
2169
2302
CheckForMidl
2170
- CheckForMingW strOptMingw, strOptW32API
2303
+ CheckForMinGW32 strOptMinGW32, strOptW32API
2304
+ CheckForMinGWw64 strOptMinGWw64
2171
2305
CfgPrint "VBOX_WITH_OPEN_WATCOM := " '' @todo look for openwatcom 1.9+
2172
2306
EnvPrint "set PATH=%PATH%;" & g_strPath& "/tools/win." & g_strTargetArch & "/bin;" '' @todo look for yasm
2173
2307
CheckForlibSDL strOptlibSDL
0 commit comments