--- grx246.orig/configure	Sun Jun  6 21:11:25 2004
+++ grx246.new/configure	Sun Jun  6 21:15:45 2004
@@ -202,15 +202,16 @@
   *)              echo "$0: invalid target" >&2; exit 1;;
 esac
 
-if echo "$target" | tr A-Z a-z | grep "[a-z0-9]-[a-z0-9]" > /dev/null; then
-  CROSS_PLATFORM="`echo "$target" | tr A-Z a-z`-"
-  installdir="$prefix/$target"
-  # Cross-compiling is usually done from a Unix-like platform.
-  HAVE_UNIX_TOOLS=y
-else
-  CROSS_PLATFORM=""
-  installdir="$prefix"
-fi
+case "$target" in
+  *[A-Za-z0-9]-[A-Za-z0-9]*|mingw32)
+     CROSS_PLATFORM="`echo "$target" | tr A-Z a-z`-"
+     installdir="$prefix/$target"
+     # Cross-compiling is usually done from a Unix-like platform.
+     HAVE_UNIX_TOOLS=y;;
+  *)
+     CROSS_PLATFORM=""
+     installdir="$prefix";;
+esac
 
 if [ $USE_SVGALIB_DRIVER != y ] && [ $USE_FRAMEBUFFER_DRIVER != y ]; then
   echo "$0: either \`--enable-svgalib' or \`--enable-framebuffer' must be set" >&2
--- grx246.orig/makedefs.grx	Sun Jun  6 21:11:25 2004
+++ grx246.new/makedefs.grx	Sun Jun  6 21:12:54 2004
@@ -46,6 +46,7 @@
 ### SYSTEM SETTINGS ##################################################
 
 CC     = $(CROSS_PLATFORM)gcc
+PC     = $(CROSS_PLATFORM)gpc
 AR     = $(CROSS_PLATFORM)ar
 RANLIB = $(CROSS_PLATFORM)ranlib
 STRIP  = $(CROSS_PLATFORM)strip
--- grx246.orig/pascal/bgi/makefile.dj2	Sun Jun  6 21:11:25 2004
+++ grx246.new/pascal/bgi/makefile.dj2	Sun Jun  6 21:13:23 2004
@@ -16,7 +16,7 @@
 LIBS= $(GRXLIBPATH) $(GRXLIB)
 
 # Compiler and options on your system  
-COMPILER = gpc --automake
+COMPILER = $(PC) --automake
 
 PROGS= 			\
 	allmodes.exe	\
--- grx246.orig/pascal/bgi/makefile.lnx	Sun Dec 23 02:32:40 2001
+++ grx246.new/pascal/bgi/makefile.lnx	Sun Jun  6 21:13:28 2004
@@ -15,7 +15,7 @@
 LIBS= $(GRXLIBPATH) $(GRXLIB) -lvga -lm
 
 # Compiler and options on your system  
-COMPILER = gpc --automake
+COMPILER = $(PC) --automake
 
 PROGS= 			\
 	allmodes	\
--- grx246.orig/pascal/bgi/makefile.w32	Sun Jun  6 21:11:25 2004
+++ grx246.new/pascal/bgi/makefile.w32	Sun Jun  6 21:35:43 2004
@@ -16,7 +16,7 @@
 LIBS= $(GRXLIBPATH) $(GRXLIB) -mwindows -mconsole
 
 # Compiler and options on your system  
-COMPILER = gpc --autobuild  --gpc-main=GRXMain
+COMPILER = $(PC) --autobuild
 
 
 PROGS= 		\
--- grx246.orig/pascal/bgi/makefile.x11	Sun Dec 23 02:31:34 2001
+++ grx246.new/pascal/bgi/makefile.x11	Sun Jun  6 21:13:28 2004
@@ -15,7 +15,7 @@
 LIBS= $(GRXLIBPATH) $(GRXLIB) $(X11LIBS) -lm
 
 # Compiler and options on your system  
-COMPILER = gpc --automake
+COMPILER = $(PC) --automake
 
 PROGS= 			\
 	xallmodes	\
--- grx246.orig/pascal/makefile	Wed Jun 11 00:21:24 2003
+++ grx246.new/pascal/makefile	Sun Jun  6 21:35:33 2004
@@ -9,7 +9,7 @@
 GRAPHICSLIB = -L/usr/lib
 
 # Compiler and options on your system  
-COMPILER = gpc --automake -Wall
+COMPILER = $(PC) --automake -Wall
 
 # --------------------------------------------
 # I Think, you don't need to change from here
--- grx246.orig/pascal/makefile.dj2	Sun Jun  6 21:11:25 2004
+++ grx246.new/pascal/makefile.dj2	Sun Jun  6 21:13:19 2004
@@ -15,7 +15,7 @@
 LIBS= $(GRXLIBPATH) $(GRXLIB)
 
 # Compiler and options on your system  
-COMPILER = gpc --automake
+COMPILER = $(PC) --automake
 
 
 PROGS= 			\
--- grx246.orig/pascal/makefile.lnx	Wed Jun 11 00:21:24 2003
+++ grx246.new/pascal/makefile.lnx	Sun Jun  6 21:13:23 2004
@@ -14,7 +14,7 @@
 LIBS= $(GRXLIBPATH) $(GRXLIB) -lvga -lm
 
 # Compiler and options on your system  
-COMPILER = gpc --automake
+COMPILER = $(PC) --automake
 
 
 PROGS= 			\
--- grx246.orig/pascal/makefile.w32	Sun Jun  6 21:11:25 2004
+++ grx246.new/pascal/makefile.w32	Sun Jun  6 21:35:53 2004
@@ -15,7 +15,7 @@
 LIBS= $(GRXLIBPATH) $(GRXLIB) -mwindows -mconsole
 
 # Compiler and options on your system  
-COMPILER = gpc --autobuild --gpc-main=GRXMain
+COMPILER = $(PC) --autobuild
 
 
 PROGS= 			\
--- grx246.orig/pascal/makefile.x11	Wed Jun 11 00:21:24 2003
+++ grx246.new/pascal/makefile.x11	Sun Jun  6 21:13:19 2004
@@ -14,7 +14,7 @@
 LIBS= $(GRXLIBPATH) $(GRXLIB) $(X11LIBS) -lm
 
 # Compiler and options on your system  
-COMPILER = gpc --automake
+COMPILER = $(PC) --automake
 
 
 PROGS= 			\
--- grx246.orig/pascal/modetest.pas	Tue May 27 21:23:20 2003
+++ grx246.new/pascal/modetest.pas	Sun Jun  6 21:34:04 2004
@@ -21,7 +21,7 @@
       Write  (i:3);
       Write  (f:3);
       Write  (gvm.Mode:6);
-      Write  (gvm.Width:5, 'x',gvm.Height:4, 'x', Ord(gvm.BPP):3);
+      Write  (gvm.Width:5, 'x',gvm.Height:4, 'x', gvm.BPP:3);
       WriteLn;
       fivm := GrNextVideoMode(fivm)
     end
--- grx246.orig/src/makefile.dj2	Sun Jun  6 21:11:25 2004
+++ grx246.new/src/makefile.dj2	Sun Jun  6 21:12:47 2004
@@ -278,7 +278,7 @@
 else
 	if exist depend.tmp del depend.tmp
 endif
-	gcc -MM $(CCOPT) $(INCDIR) $(ALL_O:.o=.c) >depend.tmp
+	$(CC) -MM $(CCOPT) $(INCDIR) $(ALL_O:.o=.c) >depend.tmp
 	sed 's#^.*: \(.*\)\.c#\1.o: \1.c#g'   <depend.tmp >depend.dj2
 ifeq ($(HAVE_UNIX_TOOLS),y)
 	rm -f depend.tmp
--- grx246.orig/src/makefile.lnx	Mon Jun 23 18:13:22 2003
+++ grx246.new/src/makefile.lnx	Sun Jun  6 21:12:47 2004
@@ -263,7 +263,7 @@
 endif
 
 dep:
-	gcc -MM $(CCOPT) $(INCDIR) $(O:.o=.c) \
+	$(CC) -MM $(CCOPT) $(INCDIR) $(O:.o=.c) \
 	| sed 's#^.*: \(.*\)\.c#\1.o: \1.c#g' >depend.lnx
 
 $(O): %.o : %.c
--- grx246.orig/src/makefile.w32	Sun Jun  6 21:11:25 2004
+++ grx246.new/src/makefile.w32	Sun Jun  6 21:12:43 2004
@@ -233,7 +233,7 @@
 else
 	if exist depend.tmp del depend.tmp
 endif
-	gcc -MM $(CCOPT) $(INCDIR) $(ALL_O:.o=.c) >depend.tmp
+	$(CC) -MM $(CCOPT) $(INCDIR) $(ALL_O:.o=.c) >depend.tmp
 	sed 's#^.*: \(.*\)\.c#\1.o: \1.c#g'   <depend.tmp >depend.w32
 ifeq ($(HAVE_UNIX_TOOLS),y)
 	rm -f depend.tmp
--- grx246.orig/src/makefile.x11	Mon Jun 23 18:13:22 2003
+++ grx246.new/src/makefile.x11	Sun Jun  6 21:12:43 2004
@@ -255,7 +255,7 @@
 endif
 
 dep:
-	gcc -MM $(CCOPT) $(INCDIR) $(O:.o=.c) \
+	$(CC) -MM $(CCOPT) $(INCDIR) $(O:.o=.c) \
 	| sed 's#^.*: \(.*\)\.c#\1.o: \1.c#g' >depend.x11
 
 $(O): %.o : %.c
