Open jmalak opened 5 years ago
Windows 95 VXDs use the same linear executable format as Windows 3.1 386 files.
I should really separate the Windows VXD code out so it doesn't fail the compile.
It's very experimental and shouldn't be built by default.
I don't expect everyone to have the same GCC 7.1.0 + OW setup I do.
Is code compiled with Open Watcom supposed to refer to dsound.h as <direct/dsound.h> or should it be accessible as
DOSAMP isn't compiling right now.
Open Watcom has nt/directx/dsound.h
It is fixed now by adding directx SDK to the include path list
I will fix -bt=... option, it must be always defined for proper value. It will be:
Win3.1 (16/32 bit) -> -bt=windows -> __WINDOWS__ $WATCOM/h;$WATCOM/h/win
Win32(s) -> -bt=nt -> __NT__ $WATCOM/h;$WATCOM/h/nt
WindowsNT -> -bt=nt -> __NT__ $WATCOM/h;$WATCOM/h/nt
16-bit OS/2 -> -bt=os2 -> __OS2__ $WATCOM/h;$WATCOM/h/os21x
32-bit OS/2 -> -bt=os2 -> __OS2__ $WATCOM/h;$WATCOM/h/os2
16-bit DOS -> -bt=dos -> __DOS__ $WATCOM/h
32-bit DOS -> -bt=dos -> __DOS__ $WATCOM/h
After fixing targets zlib code diagnose problem with multiple OS_CODE macro definition which are not same. It looks like some mismatch between AUTOMAKE environment (config.h) and OW definitions. Zlib code is not aware about OW compiler, that configuration (in config.h) is probably wrong. Please review it.
I think now main changes are finished. Following review/correction should be done.
@jmalak Will check. Thank you for your help. Does this help @sparky4 as well?
I suppose yes, now build of doslib shoud not depend on OW configured target (environment variables), only required executable on the PATH and defined WATCOM environment variable. Theoreticaly if your build system will be ported to other host OS then you don't need to change anything in doslib wmake make files and it should work (I mean OW related things).
One note about -zw
option.
If you use it for any target then it defines __WINDOWS__
macro and it completely confuse header files and can confuse conditionaly code if you use it for non-Windows 3.x environment.
I fixed appropriate make files to be used -zw
option only with -bt=windows
(Windows 3.x 16-bit or OW 32-bit extender). It could break some code which relate to something specific for 16-bit Windows even if it was non-Windows target as OS/2, NT or DOS.
@jmalak That makes sense, -zw means "generate code for Microsoft Windows".
Could the compiler print a warning if -zw is used for anything other than Windows?
I have a few ideas how you can improve/simplify OW wmake make files (compatible with both versions OW1.9 and OW2.0) and be more cross-platform independent (independent on host where run)
!include test/test/make.mak # it is correct for all host platforms`
library <name of library>
, better is to use only <name of library>
because such macros can be used for dependencies, to combine multiple libraries and also for linker by library {list of macros with libraries}
. The same note for object file.
LIBS = $(LIB1) $(LIB2) test.lib ...
OBJS = $(OBJ1) $(OBJ2) test.obj ...
test.exe : $(OBJS) $(LIBS) *wlink name test.exe library { $(LIBS) } file { $(OBJS) }
- macros for librarian, you have doubled list of object files, one for dependencies and one for library command list. Better is to use macro as template for both and expand it for differend macro values, see example below
OBJS = $(PRFX)obj1.obj $(PRFX)obj2.obj
PRFX =
test.lib : $(LIB_OBJS) *wlib test.lib $(LIB_CMDS)
OW has many options and it is not possible to restrict user to use some combination because it can be wanted, in your case you can still use -zw with non-Windows platforms but you must be aware of its behaviour Generaly OW supposes that user know what is doing
I think -zw option is historical for 16-bit Windows Be aware that similar option -zW is important for Windows 3.x code
there is also -zws option (all -z{w|W}* options are related only to 16-bit Windows or OW 32-bit extender) and should not be used with other targets
Note to VXD target definition file mak/vxd31.mak. I defined -bt=dos and -I"%WATCOM/h" to be relatively neutral as 32-bit DOS. Anyway you need VXD Development kit which has all necessary header files for VXD development (all function which can be used from other VXD modules) etc. I am not sure if use 32-bit extended DOS is possible in VXD module, but DPMI could be available. It is neutral flat memory model which can not use any 16-bit windows definition. It can be change, I have no experiencies with it.
Please what is purpose of linux-ow.sh and owenv.sh script files? I don't understand why it has complete messy INCLUDE environment variable. Why OW tools setup is for 32-bit Windows if you compile for different targets? It results in following wrong message in shell scripts
"# why is this even necessary? why does dumbshit Watcom insist on including the WINNT headers for Windows 3.1 builds?"
It is caused by previous wrong OW setup. in other files
<os>_INCLUDE
variables are used and wrongly combined withINCLUDE
variable.Such OW setup can cause some hiden mistakes etc.
You should handle cross-compilation one way only, don't mix multiple mechanism.
<os>_INCLUDE
andINCLUDE
variablesBy example OW build system is fully cross-compilation system and it uses "full handling by command line -I options" for flexibility. It requires to ignore all
..INCLUDE
variables, it is ensured by using -x compiler option. I thing for your project you could use aproach with<os>_INCLUDE
andINCLUDE
variables