diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-05-04 17:40:58 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-05-04 18:27:47 +0300 |
commit | 997e2b2acb06b2645ce0797d7fc3a45a604193be (patch) | |
tree | 05e1c32944f6ab622b14cf8748d9818599d412d7 | |
parent | 23c7a694db66364fff81edbf93bbd318016f43b2 (diff) | |
download | videoteco-fork-997e2b2acb06b2645ce0797d7fc3a45a604193be.tar.gz |
moved the DOS-specific defines into teco.h, so we don't need the `@WCC_DEFS` workaround
Also, we increased the maximum size of objects to be put into the "far data" section,
which significantly decreases the DOS binary size.
-rw-r--r-- | Makefile.wcc | 13 | ||||
-rw-r--r-- | teco.h | 25 |
2 files changed, 31 insertions, 7 deletions
diff --git a/Makefile.wcc b/Makefile.wcc index 13ab749..8dda08f 100644 --- a/Makefile.wcc +++ b/Makefile.wcc @@ -24,22 +24,21 @@ CFLAGS = -d0 -onasx -oh # Perhaps it would be more elegant to have a DOS-specific config.h. # # Large data model: far code and data pointers -CFLAGS += -q -wx -ze -zm -j -0 -ml -bt=DOS @WCC_DEFS +CFLAGS += -q -wx -ze -zm -j -0 -ml -bt=DOS LDFLAGS += format dos option eliminate option map option stack=16k & libpath $(%WATCOM)/lib286:$(%WATCOM)/lib286/dos +# The `search_string` symbol is larger than 32kb. +# If it's allocated as far data, it will be needlessly included in the +# binary. +CFLAGS += -zt=65536 + .BEFORE !ifndef %WATCOM set WATCOM=/usr/bin/watcom !endif set include=$(%WATCOM)/h set lib=$(%WATCOM)/lib286;$(%WATCOM)/lib286/dos - set WCC_DEFS=-dSTDC_HEADERS=1 -dHAVE_STDIO_H -dHAVE_CTYPE_H -dHAVE_ERRNO_H & - -dHAVE_STRING_H -dHAVE_STRINGS_H -dHAVE_FCNTL_H -dHAVE_IO_H & - -dHAVE_SYS_STAT_H -dHAVE_SIGNAL_H -dHAVE_STDLIB_H -dHAVE_UNISTD_H & - -dHAVE_STDINT_H -dHAVE_DIRECT_H -dHAVE_I86_H -dHAVE_PROCESS_H -dHAVE_CONIO_H & - -dHAVE_MALLOC_H & - -dHAVE_SBRK -dHAVE_STRCHR -dTERMCAP -d__WATCOM_LFN__ all : teco.exe .SYMBOLIC @@ -72,6 +72,31 @@ #include "config.h" #endif +#ifdef MSDOS +#define __WATCOM_LFN__ +#define STDC_HEADERS 1 +#define HAVE_STDIO_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_ERRNO_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_FCNTL_H 1 +#define HAVE_IO_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_UNISTD_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_DIRECT_H 1 +#define HAVE_I86_H 1 +#define HAVE_PROCESS_H 1 +#define HAVE_CONIO_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_SBRK 1 +#define HAVE_STRCHR 1 +#define TERMCAP 1 +#endif /* MSDOS */ + #ifdef HAVE_SYS_IOCTL_H #include <sys/ioctl.h> #endif |