Patch for DJGPP port of gawk-3.1.5


diff -aprNU5 gawk-3.1.5.orig/pc/Makefile gawk-3.1.5/pc/Makefile
--- gawk-3.1.5.orig/pc/Makefile	2005-06-26 06:31:28.000000000 +0000
+++ gawk-3.1.5/pc/Makefile	2006-01-12 02:03:48.000000000 +0000
@@ -71,10 +71,11 @@ MAK = $(MAKE) $(MAKEFILE)
 # Define the base directory for the install. "make install" will install
 # in bin, lib/awk, man, and info under $(prefix)/. Most likely, you should
 # edit config.h so that $(prefix)/lib/awk appears as part of DEFPATH.
 #prefix =
 prefix = c:/gnu
+pkgdatadir = $(prefix)/lib/awk
 #
 # Define the install method. Method 1 is Unix-like (and requires cat,
 # cp, mkdir, sed, and sh); method 2 uses gawk and batch files.
 install = 1
 #------------------------------------------------------------------------
@@ -104,10 +105,14 @@ DO_PBIND= $($(PBIND))
 
 #========================================================================
 #========================== DJGPP =======================================
 #========================================================================
 
+ifneq ($(DJGPP),)
+prefix = $(DJDIR)
+pkgdatadir = $(prefix)/share/awk
+endif
 LDJG = $(CC) $(LF) -o gawk.exe $(LDRSP) $(LF2)
 PLDJG = $(CC) $(LF) -o pgawk.exe $(PLDRSP) $(LF2)
 BDJG = stubify -g awk.exe | stubedit awk.exe runfile=gawk
 
 djgpp:
@@ -387,13 +392,13 @@ install1: 
 	echo extproc sh $(prefix)/bin/igawk.cmd > igawk.cmd
 	echo shift >> igawk.cmd
 	cat pc/awklib/igawk >> igawk.cmd
 	sed "s;igawk;$(prefix)/bin/igawk;" pc/awklib/igawk.bat > igawk.bat
 	sh mkinstal.sh $(prefix)/bin
-	sh mkinstal.sh $(prefix)/lib/awk $(prefix)/man/man1 $(prefix)/info
+	sh mkinstal.sh $(pkgdatadir) $(prefix)/man/man1 $(prefix)/info
 	cp *awk.exe igawk.bat igawk.cmd pc/awklib/igawk $(prefix)/bin
-	cp awklib/eg/lib/* pc/awklib/igawk.awk $(prefix)/lib/awk
+	cp awklib/eg/lib/* pc/awklib/igawk.awk $(pkgdatadir)
 	cp doc/*.1 $(prefix)/man/man1
 	cp doc/gawk.info $(prefix)/info
 
 # install2 is equivalent to install1, but doesn't require cp, sed, etc.
 install2:
diff -aprNU5 gawk-3.1.5.orig/pc/config.h gawk-3.1.5/pc/config.h
--- gawk-3.1.5.orig/pc/config.h	2005-07-26 18:07:42.000000000 +0000
+++ gawk-3.1.5/pc/config.h	2006-01-12 02:04:44.000000000 +0000
@@ -345,11 +345,15 @@
 #if ULONG_MAX == 4294967295UL
 # define SIZEOF_UNSIGNED_LONG 4
 #endif
 
 /* Library search path */
-#define DEFPATH  ".;c:/lib/awk;c:/gnu/lib/awk"
+#if defined(__DJGPP__) && (__DJGPP__ > 2 || __DJGPP_MINOR__ >= 3)
+# define DEFPATH  ".;/dev/env/DJDIR/share/awk"
+#else
+# define DEFPATH  ".;c:/lib/awk;c:/gnu/lib/awk"
+#endif
 
 #if defined (_MSC_VER)
 #if !defined(__STDC__)
 # define __STDC__ 1
 #endif
