diff --git a/build.sh b/build.sh index ae3bc3d8..c751885c 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/mkfiles/gcc.mak b/mkfiles/gcc.mak index 96be88ab..8da8f45e 100644 --- a/mkfiles/gcc.mak +++ b/mkfiles/gcc.mak @@ -27,7 +27,7 @@ CFLAGS1 = -Os -Wall -Werror -Wno-pointer-to-int-cast -Wno-incompatible-pointer-t .SUFFIXES: .c .asm .com .exe .obj ifeq ($(UTILS_BUILD),1) .c.exe: - gcc -x c -Og -g -Wall -DGCC -D__GETOPT_H -I../suppl $< -o $@ + gcc -x c -Og -g -Wall -DTARGET_USE_GCC_IA16 -D__GETOPT_H -I../suppl $< -o $@ else ifeq ($(COMPACT_MODEL),1) .c.obj .c.exe: @echo ------------------------------------------------------ diff --git a/mkfiles/watcom.mak b/mkfiles/watcom.mak index 86393cf0..427a376e 100644 --- a/mkfiles/watcom.mak +++ b/mkfiles/watcom.mak @@ -36,7 +36,13 @@ CFLAGS1 = -os-s-wx $(CL) -ms -I$(WATCOM)$(DIRSEP)h $< -fm -fe=$@ -I..$(DIRSEP)suppl ! endif ! else ifdef __OSX__ - clang -x c -Og -g -Wall -Wno-pragma-pack -DGCC -D__GETOPT_H -I../suppl $< -o $@ + clang -x c -Og -g -Wall -Wno-pragma-pack -D__GETOPT_H -I../suppl $< -o $@ +! else ifdef __FREEBSD__ + clang -x c -Og -g -Wall -Wno-pragma-pack -D__GETOPT_H -I../suppl $< -o $@ +! else ifdef __OPENBSD__ + clang -x c -Og -g -Wall -Wno-pragma-pack -D__GETOPT_H -I../suppl $< -o $@ +! else ifdef __NETBSD__ + gcc -x c -Og -g -Wall -Wno-pragma-pack -D__GETOPT_H -I../suppl $< -o $@ ! else $(CL386) -I$(WATCOM)$(DIRSEP)h $< -fm -fe=$@ -I..$(DIRSEP)suppl ! endif diff --git a/tools/ptchsize.c b/tools/ptchsize.c index dd7866ac..c86633b4 100644 --- a/tools/ptchsize.c +++ b/tools/ptchsize.c @@ -230,7 +230,7 @@ int main(int argc, char **argv) } if(argc == 2 -#ifndef GCC +#ifndef TARGET_USE_GCC_IA16 || ival.heapPos == ~0 #endif ) { @@ -275,7 +275,7 @@ int main(int argc, char **argv) , argv[1], tosize); /* Watcom already has extraMin minimal and dynamically adjusts its MCB*/ if(tosize) { -#ifdef GCC +#ifdef TARGET_USE_GCC_IA16 /* need to adjust SP */ unsigned startbss = 0x10000 - exe.extraMax * 16; exe.fSP = startbss + ival.extraSpace * 16 + tosize; @@ -293,7 +293,7 @@ int main(int argc, char **argv) return 77; } -#ifndef GCC +#ifndef TARGET_USE_GCC_IA16 if(fseek(freecom, ival.heapPos, SEEK_SET) != 0) { printf("Failed to seek to heap size offset in %s\n", argv[1]); return 42; diff --git a/utils/mkinfres.c b/utils/mkinfres.c index 7eb6842a..9eabe540 100644 --- a/utils/mkinfres.c +++ b/utils/mkinfres.c @@ -130,7 +130,7 @@ int addImageDisplacement(const char * const fnam *extraSpace += (stacksize+15)/16; } fclose(f); -#ifdef GCC +#ifdef TARGET_USE_GCC_IA16 stacksize = 4*1024; *extraSpace += stacksize / 16; #else