Hi Maurice
These are the chances i did for the most simple build with X11. There were additional issues when enabling tiff, ..., but i think we should fix these first. I also had a first try with pascal headers compatible with freepascal. But this is quite involved and i did not manage to finish the job and left it for later.
****** the apple linker ld has no option -s. ****** No urgent need, it gives a warning only.
diff -r '-x*.*o' ../grx249 2/makedefs.grx ./makedefs.grx 77c77 < LDOPT = -s ---
LDOPT =
****** The linker does not find the X11 libraries and it does not have the -soname option. ****** Libs on macosx do not have .so, but .dylib. ****** I do not completely understand in detail, what's done here with the renaming and ****** how to do this in the same way on macosx. I guess, these changes have a bad smell. ****** If you have some suggestions, i can try to figure out, how to achieve that.
diff -r '-x*.*o' ../grx249 2/src/makefile.x11 ./src/makefile.x11 42c58 < GRX20SH = ../lib/$(GRX_LIB_SUBDIR)/libgrx20X.so ---
GRX20SH = ../lib/$(GRX_LIB_SUBDIR)/libgrx20X.a
44c60 < GRX20SHna = $(GRX20SH).$(GRX_VERSION) ---
GRX20SHna = $(GRX20SH)
146c164 < $(CC) $(LDOPT) -shared -Wl,-soname,$(notdir $(GRX20SHli)) -o $(GRX20SHna) $(LO) ---
$(CC) $(LDOPT) -shared -lX11 -L/usr/X11/lib -o $(GRX20SHna) $(LO)
****** unix does not seem to be set. Could that be achieved? My hack: simply remove the conditions ****** in case you need another switch, darwin is commonly used and can be obtained with uname or similar
diff -r '-x*.*o' ../grx249 2/src/mouse/input.h ./src/mouse/input.h 139c139 < #if !defined(real_time) && defined(unix) ---
#if !defined(real_time)
diff -r '-x*.*o' ../grx249 2/include/grx20.h ./include/grx20.h 112d111 < #if defined(unix) || defined(__unix) || defined(__unix__) || defined(_AIX) 114d112 < #endif
****** the rest are easy and straight forward changes:
****** change of include files: malloc.h -> stdlib.h; values.h -> limits.h
diff -r '-x*.*o' ../grx249 2/src/bgi/bccgrx00.h ./src/bgi/bccgrx00.h 29d28 < #include <malloc.h> 30a30
#include <stdlib.h>
diff -r '-x*.*o' ../grx249 2/src/utilprog/bin2c.c ./src/utilprog/bin2c.c 29c29 < #include <malloc.h> ---
#include <stdlib.h>
diff -r '-x*.*o' ../grx249 2/test/life.c ./test/life.c 23c23 < #include <malloc.h> ---
#include <stdlib.h>
diff -r '-x*.*o' ../grx249 2/test/speedtst.c ./test/speedtst.c 32c32 < #include <values.h> ---
#include <limits.h>
****** rename setmode, because there is already one in a system header file
diff -r '-x*.*o' ../grx249 2/src/vdrivers/vd_xwin.c ./src/vdrivers/vd_xwin.c 73c73 < static int setmode(GrVideoMode *mp,int noclear); ---
static int mysetmode(GrVideoMode *mp,int noclear);
82c82 < setmode, /* mode set */ ---
mysetmode, /* mode set */
97c97 < setmode, /* mode set */ ---
mysetmode, /* mode set */
181c181 < static int setmode(GrVideoMode *mp,int noclear) ---
static int mysetmode(GrVideoMode *mp,int noclear)