Release GNU make 3.81.
Update NEWS docs.
Enhance the manual to use automake version.texi, and use the canonical
FSF copyright features and statement.
Some $(realpath ...) tests won't work on Windows; leave them out
The jobserver filedescriptor test might fail if some FDs are reserved,
so for now comment out that check.
diff --git a/.cvsignore b/.cvsignore
index 54d5923..fd278e9 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -30,3 +30,5 @@
 customs
 
 install-sh mkinstalldirs
+
+.directive.asc
diff --git a/ChangeLog b/ChangeLog
index 0440f3e..df6a509 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+2006-04-01  Paul D. Smith  <psmith@gnu.org>
+
+	Version 3.81 released.
+
+	* NEWS: Updated for 3.81.
+
+	* README.cvs: Mention that vpath builds are not supported out of
+	CVS.  Fixes Savannah bug #16236.
+	Remove update of make.texi from the list of things to do; we use
+	version.texi now.
+
+2006-03-26  Paul D. Smith  <psmith@gnu.org>
+
+	* doc/make.texi: Clean up licensing.  Use @copying and version.texi
+	support from automake, as described in the Texinfo manual.
+
+2006-03-25  Eli Zaretskii  <eliz@gnu.org>
+
+	* implicit.c (pattern_search) [HAVE_DOS_PATHS]: Don't compare b
+	with lastslash, since the latter points to filename, not to
+	target.
+	* job.c (construct_command_argv_internal) [HAVE_DOS_PATHS]:
+	Declare and define sh_chars_sh[].
+
+2006-03-23  Paul D. Smith  <psmith@gnu.org>
+
+	* configure.in: Look for build.sh.in in $srcdir so it will be
+	built for remote configurations as well.
+
+	* Makefile.am: Make sure to clean up build.sh during distclean.
+	Fixes Savannah bug #16166.
+
+	* misc.c (log_access): Takes a const char *.
+	* function.c (fold_newlines): Takes an unsigned int *.
+	Both fixes for Savannah bug #16170.
+
 2006-03-22  Boris Kolpackov  <boris@kolpackov.net>
 
 	* implicit.c (pattern_search): Call set_file_variables only
diff --git a/Makefile.am b/Makefile.am
index d741360..82274bb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,6 +19,8 @@
 AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news ansi2knr
 ACLOCAL_AMFLAGS	=  -I config
 
+MAKE_HOST =	@MAKE_HOST@
+
 # Only process if target is MS-Windows
 if WINDOWSENV
   MAYBE_W32 =	w32
@@ -65,9 +67,6 @@
 
 
 # Extra stuff to include in the distribution.
-# Note we need all the glob stuff here, rather than in glob/Makefile.am,
-# because often that directory isn't built on the systems used by the
-# maintainers.
 
 EXTRA_DIST =	README build.sh.in $(man_MANS) \
 		README.customs README.OS2 \
@@ -79,8 +78,9 @@
 		readme.vms makefile.vms makefile.com config.h-vms \
 		vmsdir.h vmsfunctions.c vmsify.c
 
-MAKE_HOST =	@MAKE_HOST@
+# This is built during configure, but behind configure's back
 
+DISTCLEANFILES = build.sh
 
 # Forward targets
 
diff --git a/NEWS b/NEWS
index 1449e1b..fdeb5be 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
 GNU make NEWS                                               -*-indented-text-*-
   History of user-visible changes.
-  19 March 2006
+  1 April 2006
 
 See the end of this file for copyrights and conditions.
 
@@ -9,7 +9,7 @@
 See the README file and the GNU make manual for instructions for
 reporting bugs.
 
-Version 3.81rc2
+Version 3.81
 
 * GNU make is ported to OS/2.
 
@@ -147,7 +147,7 @@
 
 A complete list of bugs fixed in this version is available here:
 
-  http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101
+  http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=103
 
 
 Version 3.80
diff --git a/README.cvs b/README.cvs
index 017f65c..a1ef7fb 100644
--- a/README.cvs
+++ b/README.cvs
@@ -45,6 +45,11 @@
 etc.).  See the configure.in file to find the minimum versions of each
 of these tools.  You will also need a copy of wget.
 
+When building from CVS you must build in the source directory: "VPATH
+builds" from remote directories are not supported.  Once you've created
+a distribution, of course, you can unpack it and do a VPATH build from
+there.
+
 After checking out the code, you will need to perform these steps to get
 to the point where you can run "make".
 
@@ -127,8 +132,6 @@
 
   * Update the configure.in file with the new release number.
   * Update the NEWS file with the release number and date.
-  * Update the doc/make.texi file with the release number and date.
-    Check the variables EDITION, VERSION, UPDATED, and UPDATE-MONTH.
   * Create the new release in the Savannah "Bugs" Administration for
     both the "Component Version" and "Fixed Release" fields.
   * Create the new release in the Savannah "Patches" Administration for
@@ -169,8 +172,11 @@
 Where to Announce
 -----------------
 
-Create the announcement in a text file, then sign it with GPG.  Upload
-to gnu.org, then login and send from my account there.
+Create the announcement in a text file, then sign it with GPG.
+
+  gpg --clearsign <announcement.txt>
+
+Upload to gnu.org, then login and send from my account there.
 
 Email to: make-alpha@gnu.org, bug-make@gnu.org, help-make@gnu.org, make-w32@gnu.org.
 Email to: info-gnu@gnu.org
diff --git a/config.h.W32.template b/config.h.W32.template
index 1007540..e1d92ca 100644
--- a/config.h.W32.template
+++ b/config.h.W32.template
@@ -469,13 +469,13 @@
  * Define if you have the Cygnus "Cygwin" GNU Windows32 tool set.
  * Do NOT define BATCH_MODE_ONLY_SHELL if you define HAVE_CYGWIN_SHELL
  */
-/*#define HAVE_CYGWIN_SHELL*/
+/*#define HAVE_CYGWIN_SHELL 1 */
 
 /*
  * Define if you have the MKS tool set or shell. Do NOT define
  * BATCH_MODE_ONLY_SHELL if you define HAVE_MKS_SHELL
  */
-/*#define HAVE_MKS_SHELL */
+/*#define HAVE_MKS_SHELL 1 */
 
 /*
  * Enforce the mutual exclusivity restriction.
diff --git a/config/.cvsignore b/config/.cvsignore
index 33b30ed..8789912 100644
--- a/config/.cvsignore
+++ b/config/.cvsignore
@@ -2,5 +2,6 @@
 config.*
 mkinstalldirs
 texinfo.tex
+mdate-sh
 
 Makefile Makefile.in
diff --git a/configure.in b/configure.in
index 501187b..5b914bf 100644
--- a/configure.in
+++ b/configure.in
@@ -16,7 +16,7 @@
 # GNU Make; see the file COPYING.  If not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 
-AC_INIT([GNU make],[3.81rc2],[bug-make@gnu.org])
+AC_INIT([GNU make],[3.81],[bug-make@gnu.org])
 
 AC_PREREQ(2.59)
 AC_REVISION([[$Id$]])
@@ -450,7 +450,7 @@
 
 # We only generate the build.sh if we have a build.sh.in; we won't have
 # one before we've created a distribution.
-if test -f build.sh.in; then
+if test -f "$srcdir/build.sh.in"; then
   ./config.status --file build.sh
   chmod +x build.sh
 fi
diff --git a/doc/.cvsignore b/doc/.cvsignore
index 94240d6..49f3e9d 100644
--- a/doc/.cvsignore
+++ b/doc/.cvsignore
@@ -1,7 +1,8 @@
 Makefile Makefile.in
-fdl.texi make-stds.texi texinfo.tex
+version.texi fdl.texi make-stds.texi texinfo.tex
 make.info*
 make*.html
 make.aux make.cp make.cps make.fn make.fns make.ky
 make.pg make.toc make.tp make.vr make.log
 make.dvi make.ps make.pdf
+stamp-vti
diff --git a/doc/make.texi b/doc/make.texi
index c73649f..904d1c2 100644
--- a/doc/make.texi
+++ b/doc/make.texi
@@ -1,55 +1,60 @@
 \input texinfo                @c -*- Texinfo -*-
 @c %**start of header
 @setfilename make.info
+
+@include version.texi
+@set EDITION 0.70
+@set RCSID $Id$
+
 @settitle GNU @code{make}
 @setchapternewpage odd
-@c %**end of header
-
+@c Combine the variable and function indices:
+@syncodeindex vr fn
+@c Combine the program and concept indices:
+@syncodeindex pg cp
 @c FSF publishers: format makebook.texi instead of using this file directly.
-
-@set RCSID $Id$
-@set EDITION 0.70
-@set VERSION 3.81
-@set UPDATED 5 Feb 2006
-@set UPDATE-MONTH Feb 2006
 @c ISBN provided by Lisa M. Opus Goldstein <opus@gnu.org>, 5 May 2004
 @set ISBN 1-882114-83-5
+@c %**end of header
+
+@copying
+This file documents the GNU @code{make} utility, which determines
+automatically which pieces of a large program need to be recompiled,
+and issues the commands to recompile them.
+
+This is Edition @value{EDITION}, last updated @value{UPDATED},
+of @cite{The GNU Make Manual}, for GNU @code{make} version @value{VERSION}.
+
+Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+Free Software Foundation, Inc.
+
+@quotation
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,''
+and with the Back-Cover Texts as in (a) below.  A copy of the
+license is included in the section entitled ``GNU Free Documentation
+License.''
+
+(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
+this GNU Manual, like GNU software.  Copies published by the Free
+Software Foundation raise funds for GNU development.''
+@end quotation
+@end copying
 
 @c finalout
 
 @c ISPELL CHECK: done, 10 June 1993 --roland
 @c ISPELL CHECK: done, 2000-06-25 --Martin Buchholz
 
-@c Combine the variable and function indices:
-@syncodeindex vr fn
-@c Combine the program and concept indices:
-@syncodeindex pg cp
 
 @dircategory GNU Packages
 @direntry
 * Make: (make).            Remake files automatically.
 @end direntry
 
-@ifnottex
-This file documents the GNU Make utility, which determines
-automatically which pieces of a large program need to be recompiled,
-and issues the commands to recompile them.
-
-This is Edition @value{EDITION}, last updated @value{UPDATED},
-of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.
-
-Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006
-Free Software Foundation, Inc.
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
-any later version published by the Free Software Foundation; with no
-Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
-Texts.  A copy of the license is included in the section entitled
-``GNU Free Documentation License''.
-@end ifnottex
-
 @iftex
 @shorttitlepage GNU Make
 @end iftex
@@ -57,52 +62,28 @@
 @title GNU Make
 @subtitle A Program for Directing Recompilation
 @subtitle GNU @code{make} Version @value{VERSION}
-@subtitle @value{UPDATE-MONTH}
+@subtitle @value{UPDATED-MONTH}
 @author Richard M. Stallman, Roland McGrath, Paul D. Smith
 @page
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-Free Software Foundation, Inc.
+@insertcopying
 @sp 2
 Published by the Free Software Foundation @*
 51 Franklin St. -- Fifth Floor @*
 Boston, MA 02110-1301 USA @*
 ISBN @value{ISBN} @*
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
-any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'', the Front-Cover
-Texts being ``A GNU Manual'', and with the Back-Cover Texts being as in
-(a) below.  A copy of the license is included in the section entitled
-``GNU Free Documentation License''.
-
-(a) The FSF's Back-Cover Text is:
-
-@quotation
-      You have freedom to copy and modify this GNU Manual, like GNU
-      software.  Copies published by the Free Software Foundation raise
-      funds for GNU development.
-@end quotation
 @sp 2
 Cover art by Etienne Suvasa.
 @end titlepage
-@page
+
+@summarycontents
+@contents
 
 @ifnottex
 @node Top, Overview, (dir), (dir)
-@top Make
+@top GNU @code{make}
 
-The GNU @code{make} utility automatically determines which pieces of a
-large program need to be recompiled, and issues the commands to
-recompile them.@refill
-
-This edition of the @cite{GNU Make Manual},
-last updated @value{UPDATED},
-documents GNU @code{make} Version @value{VERSION}.@refill
-
-This manual describes @code{make} and contains the following chapters:@refill
+@insertcopying
 @end ifnottex
 
 @menu
@@ -11120,6 +11101,4 @@
 
 @printindex fn
 
-@summarycontents
-@contents
 @bye
diff --git a/function.c b/function.c
index 07cbbff..c62f7ab 100644
--- a/function.c
+++ b/function.c
@@ -1390,8 +1390,8 @@
 /*
   \r  is replaced on UNIX as well. Is this desirable?
  */
-void
-fold_newlines (char *buffer, int *length)
+static void
+fold_newlines (char *buffer, unsigned int *length)
 {
   char *dst = buffer;
   char *src = buffer;
@@ -1578,7 +1578,6 @@
 func_shell (char *o, char **argv, const char *funcname UNUSED)
 {
   char* batch_filename = NULL;
-  unsigned int i;
 
 #ifdef __MSDOS__
   FILE *fpipe;
@@ -1672,9 +1671,8 @@
 #endif
     {
       /* We are the parent.  */
-
       char *buffer;
-      unsigned int maxlen;
+      unsigned int maxlen, i;
       int cc;
 
       /* Record the PID for reap_children.  */
@@ -1737,17 +1735,15 @@
 
       if (shell_function_completed == -1)
 	{
-	  /* This most likely means that the execvp failed,
-	     so we should just write out the error message
-	     that came in over the pipe from the child.  */
+	  /* This likely means that the execvp failed, so we should just
+	     write the error message in the pipe from the child.  */
 	  fputs (buffer, stderr);
 	  fflush (stderr);
 	}
       else
 	{
-	  /* The child finished normally.  Replace all
-	     newlines in its output with spaces, and put
-	     that in the variable output buffer.  */
+	  /* The child finished normally.  Replace all newlines in its output
+	     with spaces, and put that in the variable output buffer.  */
 	  fold_newlines (buffer, &i);
 	  o = variable_buffer_output (o, buffer, i);
 	}
@@ -1779,8 +1775,8 @@
 
   BPTR child_stdout;
   char tmp_output[FILENAME_MAX];
-  unsigned int maxlen = 200;
-  int cc, i;
+  unsigned int maxlen = 200, i;
+  int cc;
   char * buffer, * ptr;
   char ** aptr;
   int len = 0;
diff --git a/implicit.c b/implicit.c
index 878d154..014828f 100644
--- a/implicit.c
+++ b/implicit.c
@@ -356,9 +356,8 @@
               /* Didn't find it yet: check for DOS-type directories.  */
               if (check_lastslash)
                 {
-                  char *b = strrchr (target, '\\');
-                  check_lastslash = !(b ? b > lastslash
-                                      : (target[0] && target[1] == ':'));
+                  char *b = strchr (target, '\\');
+                  check_lastslash = !(b || (target[0] && target[1] == ':'));
                 }
 #endif
 #endif
diff --git a/misc.c b/misc.c
index 082bcc6..07f3c01 100644
--- a/misc.c
+++ b/misc.c
@@ -634,7 +634,7 @@
 /* Under -d, write a message describing the current IDs.  */
 
 static void
-log_access (char *flavor)
+log_access (const char *flavor)
 {
   if (! ISDB (DB_JOBS))
     return;
diff --git a/tests/ChangeLog b/tests/ChangeLog
index e1241cf..3e3520f 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-01  Paul D. Smith  <psmith@gnu.org>
+
+	* scripts/functions/realpath: Don't run tests with multiple
+	initial slashes on Windows: those paths mean something different.
+
 2006-03-19  Paul D. Smith  <psmith@gnu.org>
 
 	* scripts/features/parallelism: Test that the jobserver is
diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism
index 9eb196d..abe49a5 100644
--- a/tests/scripts/features/parallelism
+++ b/tests/scripts/features/parallelism
@@ -128,31 +128,37 @@
 
 # Make sure that all jobserver FDs are closed if we need to re-exec the
 # master copy.
+#
+# First, find the "default" file descriptors we normally use
+# Then make sure they're still used.
+#
+# Right now we don't have a way to run a makefile and capture the output
+# without checking it, so we can't really write this test.
 
-run_make_test('
-submake: ; @$(MAKE) --no-print-directory -f #MAKEFILE# fdprint 5>output
+# run_make_test('
+# submake: ; @$(MAKE) --no-print-directory -f #MAKEFILE# fdprint 5>output
 
-dependfile: ; @echo FOO=bar > $@
+# dependfile: ; @echo FOO=bar > $@
 
-INCL := true
+# INCL := true
 
-FOO=foo
-ifeq ($(INCL),true)
--include dependfile
-endif
+# FOO=foo
+# ifeq ($(INCL),true)
+# -include dependfile
+# endif
 
-fdprint: ; @echo hi >&5 && echo "$(FOO)"
+# fdprint: ; @echo $(filter --jobserver%,$(MAKEFLAGS))
 
-recurse: ; @$(MAKE) --no-print-directory -f #MAKEFILE# submake INCL=true',
-              '-j2',
-              'bar');
+# recurse: ; @$(MAKE) --no-print-directory -f #MAKEFILE# submake INCL=true',
+#               '-j2 INCL=false fdprint',
+#               'bar');
 
-unlink('dependfile', 'output');
+# unlink('dependfile', 'output');
 
 
-# Do it again, this time where the include is done by the non-master make.
-run_make_test(undef, '-j2 recurse INCL=false', 'bar');
+# # Do it again, this time where the include is done by the non-master make.
+# run_make_test(undef, '-j2 recurse INCL=false', 'bar');
 
-unlink('dependfile', 'output');
+# unlink('dependfile', 'output');
 
 1;
diff --git a/tests/scripts/functions/realpath b/tests/scripts/functions/realpath
index 720af8b..9b503b4 100644
--- a/tests/scripts/functions/realpath
+++ b/tests/scripts/functions/realpath
@@ -20,18 +20,10 @@
   $(error )
 endif
 
-ifneq ($(realpath ///),/)
-  $(error )
-endif
-
 ifneq ($(realpath /.),/)
   $(error )
 endif
 
-ifneq ($(realpath ///.),/)
-  $(error )
-endif
-
 ifneq ($(realpath /./),/)
   $(error )
 endif
@@ -44,10 +36,6 @@
   $(error )
 endif
 
-ifneq ($(realpath ///..),/)
-  $(error )
-endif
-
 ifneq ($(realpath /../),/)
   $(error )
 endif
@@ -63,8 +51,31 @@
 .PHONY: all
 all: ; @:
 ',
-'',
-'');
+              '',
+              '');
+
+# On Windows platforms, "//" means something special.  So, don't do these
+# tests there.
+
+if ($port_type ne 'W32') {
+  run_make_test('
+ifneq ($(realpath ///),/)
+  $(error )
+endif
+
+ifneq ($(realpath ///.),/)
+  $(error )
+endif
+
+ifneq ($(realpath ///..),/)
+  $(error )
+endif
+
+.PHONY: all
+all: ; @:',
+                '',
+                '');
+}
 
 
 # This tells the test driver that the perl test script executed properly.