Tried to build grx-2.4 for DJGPP using gcc-3.0 20010314. After modifying src/bgi/text7.c (gcc-3.0 20010314 miscompiles it with -O3 -fomit-frame-pointer) to workaround problem, all seems to work.
Some comments about results.
It seems that it's better to check for __DJGPP__ instead of __GO32__ (I don't know about DJGPP v1, but we're removing support for it anyway). See patch.
gcc-3.0 20010314 miscompiles src/bgi/text7 with '-O3 -fomit-frame-pointer' . Do we really need to use -O6 -fomit--frame-pointer to build optimized library? How much we're getting from that? Maybe it would be enough to use simply -O2? I sent bug report about this problem to gcc-bugs mailing list.
grx24/makedefs contains definition of default font path (fortunatelly commented out ...) : strcat(getenv("DJDIR"),"/contrib/grx24/fonts") which modifies value returned bu getenv() (but it must not be modified).
Andris
--- grx24/include/grx20.h~1 Sat Mar 10 19:18:50 2001 +++ grx24/include/grx20.h Sat Mar 17 13:55:10 2001 @@ -51,7 +51,7 @@ #endif
#ifdef __GNUC__ -#ifdef __GO32__ +#ifdef __DJGPP__ #define GRX_VERSION GRX_VERSION_GCC_386_GO32 #endif #if defined(__linux__) && defined(__i386__) @@ -1468,7 +1468,7 @@ int kbhit(void); int getch(void); #endif -#ifndef __GO32__ +#ifndef __DJGPP__ int getkey(void); int getxkey(void); #endif --- grx24/src/fdrivers/svga16.c~1 Mon Nov 6 00:42:22 2000 +++ grx24/src/fdrivers/svga16.c Sat Mar 17 13:55:58 2001 @@ -153,7 +153,7 @@ }
-#if !defined(__WATCOMC__) && (defined(__GO32__) || defined(__TURBOC__)) +#if !defined(__WATCOMC__) && (defined(__DJGPP__) || defined(__TURBOC__)) /* The VGA banked frame buffer must start on a 64k boundary ** for this optimized assembler code. ** Linux: mmap may place the frame buffer on a 4k boundary :( --- grx24/src/fdrivers/svga8.c~1 Mon Nov 6 00:43:14 2000 +++ grx24/src/fdrivers/svga8.c Sat Mar 17 13:57:24 2001 @@ -154,7 +154,7 @@ }
-#if !defined(__WATCOMC__) && (defined(__GO32__) || defined(__TURBOC__)) +#if !defined(__WATCOMC__) && (defined(__DJGPP__) || defined(__TURBOC__)) /* The VGA banked frame buffer must start on a 64k boundary ** for this optimized assembler code. ** Linux: mmap may place the frame buffer on a 4k boundary :( --- grx24/src/mouse/input.h~1 Fri Mar 2 20:32:16 2001 +++ grx24/src/mouse/input.h Sat Mar 17 13:52:28 2001 @@ -98,7 +98,7 @@ #define MS_PER_TICK 55 #endif
-#ifdef __GO32__ +#ifdef __DJGPP__ #define user_time(tv) do { \ setup_far_selector(LINP_SEL(0x0000046c)); \ (tv) = peek_l_f(LINP_PTR(0x0000046c)); \ --- grx24/src/mouse/dosinput.c~1 Sat Mar 17 13:59:06 2001 +++ grx24/src/mouse/dosinput.c Sat Mar 17 13:59:24 2001 @@ -22,7 +22,7 @@ #include <conio.h> #endif
-#ifdef __GO32__ +#ifdef __DJGPP__ #include <pc.h> #endif
--- grx24/src/mouse/doskeys.c~1 Mon Nov 6 00:46:22 2000 +++ grx24/src/mouse/doskeys.c Sat Mar 17 13:59:40 2001 @@ -24,7 +24,7 @@ #include "int86.h" #include "memfill.h"
-#ifdef __GO32__ +#ifdef __DJGPP__ #include <pc.h> #endif
--- grx24/src/bgi/palette.c~1 Fri Jan 12 15:38:20 2001 +++ grx24/src/bgi/palette.c Sat Mar 17 14:00:10 2001 @@ -37,7 +37,7 @@
void __gr_setpalette(int colornum, int color) { -#ifdef __GO32__ +#ifdef __DJGPP__ # include <dpmi.h> # include <go32.h> _go32_dpmi_registers regs; --- grx24/test/keys.c~1 Sat Mar 10 18:12:58 2001 +++ grx24/test/keys.c Sat Mar 17 14:00:40 2001 @@ -39,7 +39,7 @@ /* ***************************************************************************/ #endif /* PENTIUM_CLOCK */
-#ifdef __GO32__ +#ifdef __DJGPP__ #include <conio.h> #include <pc.h> #endif --- grx24/test/linetest.c~1 Mon Jan 29 23:47:26 2001 +++ grx24/test/linetest.c Sat Mar 17 14:01:02 2001 @@ -18,7 +18,7 @@ **/
#include "test.h" -#ifdef __GO32__ +#ifdef __DJGPP__ #include <pc.h> #endif
--- grx24/test/modetest.c~1 Sat Mar 10 17:58:42 2001 +++ grx24/test/modetest.c Sat Mar 17 14:01:24 2001 @@ -26,7 +26,7 @@ #include <conio.h> #endif
-#ifdef __GO32__ +#ifdef __DJGPP__ #include <pc.h> #endif
--- grx24/test/speedtst.c~1 Sat Mar 10 17:58:00 2001 +++ grx24/test/speedtst.c Sat Mar 17 14:01:42 2001 @@ -28,7 +28,7 @@ #else #include <values.h> #endif -#ifdef __GO32__ +#ifdef __DJGPP__ #include <conio.h> #include <pc.h> #endif