diff -apruNU3 texinfo-4.7.orig/djgpp/config.bat texinfo-4.7.djgpp/djgpp/config.bat
--- texinfo-4.7.orig/djgpp/config.bat	2003-12-06 01:35:56.000000000 +0000
+++ texinfo-4.7.djgpp/djgpp/config.bat	2004-04-30 17:15:52.000000000 +0000
@@ -105,6 +105,12 @@ set CONFIG_SITE=%XSRC%/djgpp/config.site
 if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto small_env
 
 Rem Make sure crucial file names are not munged by unpacking
+test -f %XSRC%/m4/inttypes-pri.m4
+if not errorlevel 1 mv -f %XSRC%/m4/inttypes-pri.m4 %XSRC%/m4/inttype-pri.m4
+test -f %XSRC%/m4/inttypes_h.m4
+if not errorlevel 1 mv -f %XSRC%/m4/inttypes_h.m4 %XSRC%/m4/inttype_h.m4
+test -f %XSRC%/m4/onceonly_2_57.m4
+if not errorlevel 1 mv -f %XSRC%/m4/onceonly_2_57.m4 %XSRC%/m4/2_57_onceonly.m4
 test -f %XSRC%/po/Makefile.in.in
 if not errorlevel 1 mv -f %XSRC%/po/Makefile.in.in %XSRC%/po/Makefile.in-in
 test -f %XSRC%/po/Makefile.am.in
@@ -227,6 +233,7 @@ if not errorlevel 1 goto no_ren1
 test -f %XSRC%/install-sh
 if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh
 :no_ren1
+redir -e /dev/null rm ./co*.tmp
 if "%HOME%" == "%XSRC%/djgpp" set HOME=
 set ARGS=
 set CONFIG_SITE=
diff -apruNU3 texinfo-4.7.orig/djgpp/config.sed texinfo-4.7.djgpp/djgpp/config.sed
--- texinfo-4.7.orig/djgpp/config.sed	2003-12-06 01:35:56.000000000 +0000
+++ texinfo-4.7.djgpp/djgpp/config.sed	2004-04-30 16:02:20.000000000 +0000
@@ -12,17 +12,20 @@
   s,Makefile\\.in\\.in,Makefile.in-in,g;t t\
   s,Makefile\\.am\\.in,Makefile.am-in,g;t t\
   /^install-info-am:/,/^$/ {\
-    /@list=.\\\$(INFO_DEPS)\[^ \]/s,DEPS),& texinf- texin- info-stn.i info.inf,\
+    /@list=.\\\$(INFO_DEPS)\[^ \]/s,DEPS),& texinf- texin- info-stn.i,\
     s,\\(\\\$\\\$d/\\\$\\\$file-\\[0-9\\]\\[0-9\\]\\)\\(\[^ \]\\),\\1 \\$\\$d/\\$\\$file[0-9] \\$\\$d/\\$\\$file[0-9][0-9]\\2,\
     s,\\( \\\$\\\$file-\\[0-9\\]\\[0-9\\]\\)\\(\[^ \]\\),\\1 \\$\\$file[0-9] \\$\\$file[0-9][0-9]\\2,\
   }\
   /^uninstall-info-am:/,/^$/ {\
-    /@list=.\\\$(INFO_DEPS)\[^ \]/s,DEPS),& texinf- texin- info-stn.i info.inf,\
+    /@list=.\\\$(INFO_DEPS)\[^ \]/s,DEPS),& texinf- texin- info-stn.i,\
     s,\\(file-\\[0-9\\]\\[0-9\\]\\)\\(\[^ \]\\),\\1 \\$\\$file[0-9] \\$\\$file[0-9][0-9]\\2,\
-  }
+  }\
+  s,inttypes-pri\\.m4,inttype-pri.m4,\
+  s,inttypes_h\\.m4,inttype_h.m4,\
+  s,onceonly_2_57\\.m4,2_57_onceonly.m4,
 
 # Makefile.in.in is renamed to Makefile.in-in.
-/^ac_config_files=/,/_ACEOF/ {
+/ac_config_files=/,/_ACEOF/ {
   s|po/Makefile\.in|&:po/Makefile.in-in|
 }
 /CONFIG_FILES=/ s|po/Makefile\.in|&:po/Makefile.in-in|2
diff -apruNU3 texinfo-4.7.orig/djgpp/config.site texinfo-4.7.djgpp/djgpp/config.site
--- texinfo-4.7.orig/djgpp/config.site	2003-12-06 01:35:56.000000000 +0000
+++ texinfo-4.7.djgpp/djgpp/config.site	2004-04-30 16:48:08.000000000 +0000
@@ -43,6 +43,7 @@ ac_cv_prog_CC=${CC='gcc'}
 NM=${NM='nm'}
 LD=${LD='ld'}
 MAKEINFO=${MAKEINFO='makeinfo'}
+HELP2MAN=${HELP2MAN='/dev/env/DJDIR/bin/perl /dev/env/DJDIR/bin/help2man'}
 
 # Force the test for 'ln -s' to report 'cp -pf'.
 ac_cv_prog_LN_S='cp -pf'
diff -apruNU3 texinfo-4.7.orig/lib/system.h texinfo-4.7.djgpp/lib/system.h
--- texinfo-4.7.orig/lib/system.h	2004-03-26 18:22:16.000000000 +0000
+++ texinfo-4.7.djgpp/lib/system.h	2004-04-30 15:11:10.000000000 +0000
@@ -198,6 +198,15 @@ extern int strcoll ();
 # ifdef __MSDOS__
 #  include <limits.h>
 #  ifdef __DJGPP__
+   /*
+      Not all DJGPP installations have an actual port
+      port of GNU gettext installed, so do not relay
+      on the fact that LC_MESSAGES will be defined
+      in libintl.h.
+   */
+#   ifndef HAVE_LC_MESSAGES
+#    define LC_MESSAGES (-1)
+#   endif
 #   define HAVE_LONG_FILENAMES(dir)  (pathconf (dir, _PC_NAME_MAX) > 12)
 #   define NULL_DEVICE	"/dev/null"
 #   define DEFAULT_INFOPATH "c:/djgpp/info;/usr/local/info;/usr/info;."
diff -apruNU3 texinfo-4.7.orig/makeinfo/node.c texinfo-4.7.djgpp/makeinfo/node.c
--- texinfo-4.7.orig/makeinfo/node.c	2004-03-01 08:20:30.000000000 +0000
+++ texinfo-4.7.djgpp/makeinfo/node.c	2004-04-30 15:47:28.000000000 +0000
@@ -1621,7 +1621,7 @@ static char *
 enumerate_filename (char *pathname, char *basename, int number)
 {
   /* Do we need to generate names of subfiles which don't exceed 8+3 limits? */
-  static const int dos_file_names = !HAVE_LONG_FILENAMES (pathname ? pathname : ".");
+  const int dos_file_names = !HAVE_LONG_FILENAMES (pathname ? pathname : ".");
   unsigned name_len = strlen (basename);
   char *filename = xmalloc (10 + strlen (pathname) + name_len);
   char *base_filename = xmalloc (10 + name_len);
