@@ -379,6 +379,11 @@ JAMBASEDATE = 2008.03.26 ;
379379
380380if $(NT)
381381{
382+ if ! [ GLOB $(PATH) : mt.exe ] {
383+ Echo "mt is NOT available!" ;
384+ WIN_UTF8 = false ;
385+ }
386+
382387 MV ?= move /y ;
383388 CP ?= copy ;
384389 RM ?= del /f/q ;
@@ -414,7 +419,11 @@ if $(NT)
414419 TPFX = "" ;
415420
416421 if [ GLOB $(MINGW)/bin : x86_64-w64-mingw32-gcc.exe ] {
417- MINGW64 = $(MINGW) ;
422+ if [ GLOB $(MINGW)/bin : gcc.exe ] {
423+ MINGW64 = $(MINGW) ;
424+ } else {
425+ MINGW64o32 = $(MINGW) ;
426+ }
418427 }
419428
420429 # This doesn't work on a 32 bit system because we're cross
@@ -423,11 +432,16 @@ if $(NT)
423432 # Will using -m32 for local exe's fix this ?
424433 # What is multi-lib option ???
425434 if $(MINGW64) {
426- ECHO "Compiler is MingW for 64 bit target" ;
435+ ECHO "Compiler is native MingW 64 bit target" ;
436+ TARGET64 = true ;
437+ TPFX1 = "" ; # Some tools
438+ TPFX2 = "" ; # Rest of tools
439+ } else if $(MINGW64o32) {
440+ ECHO "Compiler is MingW 64 bit target on 32 bit host" ;
427441 TARGET64 = true ;
428442 TPFX1 = x86_64-w64-mingw32- ; # Some tools
429443 TPFX2 = x86_64-w64-mingw32- ; # Rest of tools
430- MINGW64_LIB32 = $(MINGW)/mingw/lib32 ;
444+ # MINGW64_LIB32 = $(MINGW)/mingw/lib32 ;
431445 } else {
432446 ECHO "Compiler is MingW for 32 bit target" ;
433447 TPFX1 = "" ; # Some tools
@@ -439,7 +453,7 @@ if $(NT)
439453 AS ?= $(TPFX2)as ;
440454 CC ?= $(TPFX1)gcc ;
441455echo "CC = " $(CC) ;
442- CCFLAGS ?= -DNT -mwin32 -pipe ;
456+ CCFLAGS ?= -DNT -mwin32 -pipe ; # -fwrapv ??
443457 C++ ?= $(CC) ;
444458 C++FLAGS ?= $(CCFLAGS) ;
445459
@@ -448,7 +462,7 @@ echo "CC = " $(CC) ;
448462# WINLIBS ?= -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32
449463# -lodbc32 -ladvapi32 -lodbc32 -lwsock32 -lopengl32
450464# -lglu32 -lshlwapi -lsetupapi ;
451- WINLIBS ?= -lshlwapi -lsetupapi -lole32 -lws2_32 -lpsapi -lversion ;
465+ WINLIBS ?= -lshlwapi -lsetupapi -lole32 -lws2_32 -lpsapi -liphlpapi - lversion ;
452466 GUILIBS ?= -lgdi32 -lmscms ;
453467
454468 LINK ?= $(TPFX1)g++ ; # In case we link to C++ files
@@ -676,6 +690,7 @@ echo "CC = " $(CC) ;
676690 oleaut32.lib
677691 ws2_32.lib
678692 Wbemuuid.lib
693+ iphlpapi.lib
679694 Version.lib
680695# Winmm.lib
681696 ;
@@ -981,7 +996,7 @@ else if $(UNIX)
981996
982997 # UNIX defaults
983998
984- CCFLAGS ?= -DUNIX -D_THREAD_SAFE -pipe ;
999+ CCFLAGS ?= -DUNIX -D_THREAD_SAFE -pipe ; # -fwrapv ??
9851000 CCOPTFLAG ?= -O2 ;
9861001 CCDEBUGFLAG ?= -g ;
9871002 CCPROFFLAG ?= ;
@@ -2770,6 +2785,10 @@ rule GUIAPP
27702785{
27712786}
27722787
2788+ rule UTF8APP
2789+ {
2790+ }
2791+
27732792# /HdrMacroFile
27742793#
27752794# this rule is specific to FT-Jam. It is used to indicate that a given file
@@ -3432,6 +3451,12 @@ rule MainFromObjects
34323451 if [ geton $(_t) : GUIAPP ] = "true" {
34333452 GUIAPP $(_t) ;
34343453 }
3454+
3455+ # On MSWin10 we may want to use UTF-8 for text
3456+ if $(WIN_UTF8) = true {
3457+ UTF8APP $(_t) ;
3458+ }
3459+
34353460#Echo "MainFromObjects done" ;
34363461}
34373462
@@ -4443,6 +4468,22 @@ if $(NT)
44434468 {
44444469 $(CP) /b $(>) + nul $(<) > nul
44454470 }
4471+
4472+ # Allow MSWin10 apps to use UTF-8
4473+
4474+ actions UTF8APP
4475+ {
4476+ echo ^<?xml version="1.0" encoding="UTF-8" standalone="yes"?^>>$(<).tmp
4477+ echo ^<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"^>>>$(<).tmp
4478+ echo ^<assemblyIdentity type="win32" name="..." version="6.0.0.0"/^>>>$(<).tmp
4479+ echo ^<application xmlns="urn:schemas-microsoft-com:asm.v3"^>>>$(<).tmp
4480+ echo ^<windowsSettings^>>>$(<).tmp
4481+ echo ^<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings"^>UTF-8^</activeCodePage^>>>$(<).tmp
4482+ echo ^</windowsSettings^>>>$(<).tmp
4483+ echo ^</application^>>>$(<).tmp
4484+ echo ^</assembly^>>>$(<).tmp
4485+ mt.exe -nologo -manifest $(<).tmp -outputresource:$(<);#1
4486+ }
44464487}
44474488
44484489if $(NT) && $(MSVCNT)
0 commit comments