2008-11-04  Juan Manuell Guerrero  <juan.guerrero@gmx.de>

	* djgpp/config.bat: Edit ./config.h and ./gnulib/lib/Makefile to use
	libsupp.a

	* djgpp/config.site: Include libsupp.a in the library list to be linked.

	* djgpp/config_h.sed: Include libsupp.h when compiling to make functions
	prototypes available.

	* djgpp/g_mkfile.sed: Make libsupp.a available.

	* djgpp/argz.h: New file.  Include libsupp.h when compiling to make
	functions prototypes available.

	* info/window.c (process_node_text): Use the right type for cur_len and
	replen; must be size_t instead of int.
	(clean_manpage): ditto.
	(window_scan_line): ditto.






diff -aprNU5 texinfo-4.13.orig/djgpp/argz.h texinfo-4.13/djgpp/argz.h
--- texinfo-4.13.orig/djgpp/argz.h	1970-01-01 00:00:00 +0000
+++ texinfo-4.13/djgpp/argz.h	2008-04-30 13:44:52 +0000
@@ -0,0 +1,15 @@
+/*  argz.h -- DJGPP dummy header.
+
+    Will be removed as soon as the implementation of the
+    argz functions has been checked in CVS and a new release
+    of DJGPP becomes available.
+*/
+
+#if defined __DJGPP__
+
+/*
+ *  The argz functionality is provided by libsupp.a
+ */
+
+# include <libsupp.h>
+#endif
diff -aprNU5 texinfo-4.13.orig/djgpp/config.bat texinfo-4.13/djgpp/config.bat
--- texinfo-4.13.orig/djgpp/config.bat	2007-12-25 23:57:16 +0000
+++ texinfo-4.13/djgpp/config.bat	2008-09-24 08:31:22 +0000
@@ -108,10 +108,13 @@ Rem Make sure crucial file names are not
 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
 if not errorlevel 1 mv -f %XSRC%/po/Makefile.am.in %XSRC%/po/Makefile.am-in
 
+Rem Install DJGPP specific argz.h.
+cp -v djgpp/argz.h gnulib/lib/argz.h
+
 Rem This is required because DOS/Windows are case-insensitive
 Rem to file names, and "make install" will do nothing if Make
 Rem finds a file called `install'.
 if exist INSTALL ren INSTALL INSTALL.txt
 
@@ -205,16 +208,35 @@ echo --disable-nls >> args
 echo Running the ./configure script...
 sh ./configure @args
 if errorlevel 1 goto cfg_error
 rm args
 echo Done.
+echo Editing config.h...
+test -f ./config_h.org
+if errorlevel 1 update ./config.h ./config_h.org
+sed -f %XSRC%/djgpp/config_h.sed ./config_h.org > config.h
+if errorlevel 1 goto SedError2
+echo Editing gnulib/lib/Makefile...
+test -f ./gnulib/lib/Makefile.org
+if errorlevel 1 update ./gnulib/lib/Makefile ./gnulib/lib/Makefile.org
+sed -f %XSRC%/djgpp/g_mkfile.sed ./gnulib/lib/Makefile.org > Makefile.tmp
+if errorlevel 1 goto SedError3
+mv -vf Makefile.tmp gnulib/lib/Makefile
 goto End
 
 :sed_error
 echo ./configure script editing failed!
 goto End
 
+:SedError2
+echo config.h fixing failed!
+goto End
+
+:SedError3
+echo ./gnulib/lib/Makefile fixing failed!
+goto End
+
 :cfg_error
 echo ./configure script exited abnormally!
 goto End
 
 :small_env
diff -aprNU5 texinfo-4.13.orig/djgpp/config.sed texinfo-4.13/djgpp/config.sed
--- texinfo-4.13.orig/djgpp/config.sed	2008-05-22 12:11:30 +0000
+++ texinfo-4.13/djgpp/config.sed	2008-09-21 16:51:42 +0000
@@ -1,8 +1,8 @@
 # DJGPP specific configuration file.
 # Sed script for additional DJGPP specific editing
-# of the configure script generated by autoconf 2.62.
+# of the configure script generated by autoconf 2.63.
 
 
 # Additional editing of Makefiles
 /^eval sed.*ac_file_inputs.*tmp\/out \\$/ {
 :loop
diff -aprNU5 texinfo-4.13.orig/djgpp/config.site texinfo-4.13/djgpp/config.site
--- texinfo-4.13.orig/djgpp/config.site	2007-12-25 23:57:16 +0000
+++ texinfo-4.13/djgpp/config.site	2008-04-30 10:22:12 +0000
@@ -58,5 +58,11 @@ ac_cv_prog_LN_S='cp -pf'
 
 # We have `fork', but it always fails.  Don't trust Autoconf to be
 # smart enough to detect that...
 ac_cv_func_fork=no
 ac_cv_func_vfork=no
+
+#
+# Link with libsupp to provide
+# some required functions.
+#
+LIBS=-lsupp
diff -aprNU5 texinfo-4.13.orig/djgpp/config_h.sed texinfo-4.13/djgpp/config_h.sed
--- texinfo-4.13.orig/djgpp/config_h.sed	1970-01-01 00:00:00 +0000
+++ texinfo-4.13/djgpp/config_h.sed	2008-11-04 21:24:00 +0000
@@ -0,0 +1,45 @@
+# Sed script to add DJGPP specific issues to config.h.
+
+/^.*__error_t_defined.*/d
+
+/^#define error_t int$/d
+
+/.*#undef HAVE_ERROR_T.*/ c\
+#define HAVE_ERROR_T 1
+
+/.*#undef HAVE_ARGZ_H.*/ c\
+#define HAVE_ARGZ_H 1
+
+/.*#undef HAVE_WORKING_ARGZ.*/ c\
+#define HAVE_WORKING_ARGZ 1
+
+/.*HAVE_DECL_STRNDUP.*/ s/0$/1/
+
+/.*#undef HAVE_STRNDUP.*/ c\
+#define HAVE_STRNDUP 1
+
+/.*HAVE_DECL_STRNLEN.*/ s/0$/1/
+
+/.*#undef HAVE_STRNLEN.*/ c\
+#define HAVE_STRNLEN 1
+
+/.*HAVE_DECL_MEMMEM.*/ s/0$/1/
+
+/.*#undef HAVE_v.*/ c\
+#define HAVE_MEMMEM 1
+
+/.*#undef HAVE_MBSINIT.*/ c\
+#define HAVE_MBSINIT 1
+
+/.*#undef HAVE_MBRTOWC.*/ c\
+#define HAVE_MBRTOWC 1
+
+
+$ a\
+\
+/*\
+ *  Provide missing functions through libsupp.a.\
+ */\
+#ifdef __DJGPP__\
+# include <libsupp.h>\
+#endif
diff -aprNU5 texinfo-4.13.orig/djgpp/g_mkfile.sed texinfo-4.13/djgpp/g_mkfile.sed
--- texinfo-4.13.orig/djgpp/g_mkfile.sed	1970-01-01 00:00:00 +0000
+++ texinfo-4.13/djgpp/g_mkfile.sed	2008-09-24 08:45:50 +0000
@@ -0,0 +1,11 @@
+# Sed script for DJGPP specific editing of gnulib/lib/Makefile.
+
+# libsupp.a provides argz functionality.
+/^gl_L.* =/s/argz.o //
+
+# libsupp.a provides memmem().
+/^gl_L.* =/s/memmem.o //
+/GNULIB_MEMMEM/s/1/0/
+/HAVE_DECL_MEMMEM/s/0/1/
+
+
diff -aprNU5 texinfo-4.13.orig/info/window.c texinfo-4.13/info/window.c
--- texinfo-4.13.orig/info/window.c	2008-09-18 18:31:58 +0000
+++ texinfo-4.13/info/window.c	2008-11-04 22:38:40 +0000
@@ -1579,12 +1579,12 @@ process_node_text (WINDOW *win, char *st
        mbi_advance (iter))
     {
       const char *carried_over_ptr;
       size_t carried_over_len, carried_over_count;
       const char *cur_ptr = mbi_cur_ptr (iter);
-      int cur_len = mb_len (mbi_cur (iter));
-      int replen;
+      size_t cur_len = mb_len (mbi_cur (iter));
+      size_t replen;
       int delim = 0;
       int rc;
 
       if (mb_isprint (mbi_cur (iter)))
 	{
@@ -1752,11 +1752,11 @@ clean_manpage (char *manpage)
   for (mbi_init (iter, manpage, len);
        mbi_avail (iter);
        mbi_advance (iter))
     {
       const char *cur_ptr = mbi_cur_ptr (iter);
-      int cur_len = mb_len (mbi_cur (iter));
+      size_t cur_len = mb_len (mbi_cur (iter));
 
       if (cur_len == 1)
 	{
 	  if (*cur_ptr == '\b' || *cur_ptr == '\f')
 	    {
@@ -1850,12 +1850,12 @@ window_scan_line (WINDOW *win, int line,
 		   win->line_starts[line]);
        !delim && mbi_avail (iter);
        mbi_advance (iter))
     {
       const char *cur_ptr = mbi_cur_ptr (iter);
-      int cur_len = mb_len (mbi_cur (iter));
-      int replen;
+      size_t cur_len = mb_len (mbi_cur (iter));
+      size_t replen;
 
       if (cur_ptr >= endp)
 	break;
       
       if (mb_isprint (mbi_cur (iter)))
