RamonUnch / GreenPad

Fork from roytam1 fork from original GreenPad
22 stars 0 forks source link

Support OpenWatcomv2 compiler #72

Closed RamonUnch closed 1 year ago

RamonUnch commented 1 year ago

@roytam1 I am sure you know the OpenWatcomv2 compiler. https://github.com/open-watcom/open-watcom-v2/

Would be great to support building GreenPad with it. I have not tried yet. Headers should pretty good but maybe C++ support is not up to the task.

However openwatcom is powerfull enough to compile cpython version 3.4 http://lightningpython.org/

roytam1 commented 1 year ago

OpenWatcom's RC compiler has some problems

RamonUnch commented 1 year ago

It does not like the manifest file, then it can be built without JP support with -DTARGET_VER=310.

RamonUnch commented 1 year ago

Actually you just need to move up the manifest include above the #include <winresrc.h> and it works fine for me.

RamonUnch commented 1 year ago

With wrc -r -zk0 for ShiftJS support I still have error E149: X is a duplicate string identifier I guess we can stick to English only build.

roytam1 commented 1 year ago

created a branch for this: https://github.com/roytam1/rtoss/compare/greenpad-wcc

RamonUnch commented 1 year ago

Wow, amazing... I just ported it to my fork, works like a charm; I will try with SUPERTINY mode too.

roytam1 commented 1 year ago

With wrc -r -zk0 for ShiftJS support I still have error E149: X is a duplicate string identifier

maybe related: https://github.com/open-watcom/open-watcom-v2/issues/863

roytam1 commented 1 year ago

With wrc -r -zk0 for ShiftJS support I still have error E149: X is a duplicate string identifier

my Version 2.0 beta Jan 6 2022 00:35:12 (32-bit) wcc build works without omitting Japanese resources (by removing /DTARGET_VER=310 in ROPT line in wcc.mak), but you may need installing papploc.msi and create a cmd.exe shortcut to create a CP932 environment.

(P.S.: my host is still win7, don't know if papploc.msi is still working in win10/11 or not)

you'll need a file for setting charset for child programs:

rem cmd0411.bat
set AppLocaleID=0411
set __COMPAT_LAYER=# ApplicationLocale

and create a shortcut to this batch file (i.e. c:\windows\syswow64\cmd.exe /k path-to-cmd0411.bat), and set its code page to 932.

and you need to create a batch file for setting up openwatcom build environment variables:

rem owsetenv.bat
@echo off
echo Open Watcom Build Environment
SET WATCOM=C:\WATCOM
PATH %WATCOM%\BINNT;%WATCOM%\BINW;%PATH%
SET INCLUDE=%WATCOM%\H;%WATCOM%\H\NT;%WATCOM%\H\NT\DIRECTX;%WATCOM%\H\NT\DDK;%INCLUDE%
SET FINCLUDE=%WATCOM%\SRC\FORTRAN;%WATCOM%\SRC\FORTRAN\WIN;%FINCLUDE%
SET EDPATH=%WATCOM%\EDDAT
SET WWINHELP=%WATCOM%\BINW
SET WHTMLHELP=%WATCOM%\BINNT\HELP
SET WIPFC=%WATCOM%\WIPFC

in this command prompt, you need to call owsetenv.bat and then nmake wcc in greenpad's directory.

RamonUnch commented 1 year ago

Nice finding, I do use AppLocale all the time (my daily driver is Window Server 2003) On Win11 you can specify a locale in the manifest file of any program (including utf8 psedo-locale), so I guess it is just a matter of creating a shortcut to cmd.exe and setting the compatibility options, otherwise current locale is inherited by child processes, so it should be trivial to make a clone of AppLocale.

This should be reported to the main OpenWatcom thread, I think, Should be easy fix to call SetThreadLocale() in nmake.

roytam1 commented 1 year ago

This should be reported to the main OpenWatcom thread, I think, Should be easy fix to call SetThreadLocale() in nmake.

actually the problem is RC and WRC should accept /L <0x-locale-ID> and use #pragma code_page(932) inside rc file to convert to target resource binary format.