--- emacs20-20.7.orig/lisp/loaddefs.el
+++ emacs20-20.7/lisp/loaddefs.el
@@ -1,5 +1,7 @@
 ;;; loaddefs.el --- define autoloads from other files
 
+;; EL_MODIFIED_FOR_DEBIAN (make sure this file gets byte-compiled if needed)
+
 ;; Copyright (C) 1985,86,87,92,93,94,95,96,97,98 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -10338,7 +10340,7 @@
 
 (defvar rmail-primary-inbox-list nil "\
 *List of files which are inboxes for user's primary mail file `~/RMAIL'.
-`nil' means the default, which is (\"/usr/spool/mail/$USER\")
+`nil' means the default, which is something like (\"/usr/spool/mail/$USER\")
 \(the name varies depending on the operating system,
 and the value of the environment variable MAIL overrides it).")
 
--- emacs20-20.7.orig/lisp/paths.el
+++ emacs20-20.7/lisp/paths.el
@@ -1,5 +1,7 @@
 ;;; paths.el --- define pathnames for use by various Emacs commands.
 
+;; EL_MODIFIED_FOR_DEBIAN (make sure this file gets byte-compiled if needed)
+
 ;; Copyright (C) 1986, 1988, 1994, 1999 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -102,24 +104,7 @@
 (defvar rmail-file-name "~/RMAIL"
   "Name of user's primary mail file.")
 
-(defconst rmail-spool-directory
-  (cond ((string-match "^[^-]+-[^-]+-sco3.2v4" system-configuration)
-	 "/usr/spool/mail/")
-	;; On The Bull DPX/2 /usr/spool/mail is used although 
-	;; it is usg-unix-v.
-	((string-match "^m68k-bull-sysv3" system-configuration)
-	 "/usr/spool/mail/")
-	;; SVR4 and recent BSD are said to use this.
-	;; Rather than trying to know precisely which systems use it,
-	;; let's assume this dir is never used for anything else.
-	((file-exists-p "/var/mail")
-	 "/var/mail/")
-	;; Many GNU/Linux systems use this name.
-	((file-exists-p "/var/spool/mail")
-	 "/var/spool/mail/")
-	((memq system-type '(dgux hpux usg-unix-v unisoft-unix rtu irix))
-	 "/usr/mail/")
-	(t "/usr/spool/mail/"))
+(defconst rmail-spool-directory mail-spool-directory
   "Name of directory used by system mailer for delivering new mail.
 Its name should end with a slash.")
 
--- emacs20-20.7.orig/lisp/startup.el
+++ emacs20-20.7/lisp/startup.el
@@ -1,5 +1,7 @@
 ;;; startup.el --- process Emacs shell arguments
 
+;; EL_MODIFIED_FOR_DEBIAN (make sure this file gets byte-compiled if needed)
+
 ;; Copyright (C) 1985, 86, 92, 94, 95, 96, 97, 1998, 1999 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -351,6 +353,11 @@
 
 (defvar normal-top-level-add-subdirs-inode-list nil)
 
+;; This variable is going to move to emacsen-common, but for now it's here.
+(defconst debian-emacs-flavor 'emacs20
+  "A symbol representing the particular debian flavor of emacs running.
+Something like 'emacs20, 'xemacs20, etc.")
+
 (defun normal-top-level-add-subdirs-to-load-path ()
   "Add all subdirectories of current directory to `load-path'.
 More precisely, this uses only the subdirectories whose names
@@ -686,8 +693,18 @@
   ;; Run the site-start library if it exists.  The point of this file is
   ;; that it is run before .emacs.  There is no point in doing this after
   ;; .emacs; that is useless.
-  (if site-run-file 
-      (load site-run-file t t))
+  ;; (if site-run-file 
+  ;;     (load site-run-file t t))
+
+  ;; Debian version of site-start.
+  (if site-run-file
+      (progn
+        ;; Load all the debian package snippets.
+        ;; It's in here because we want -q to kill it too.
+        (if (load "debian-startup" t t nil)
+            (debian-startup debian-emacs-flavor))
+        ;; Now the normal site file...
+        (load site-run-file t t nil)))
 
   ;; Register available input methods by loading LEIM list file.
   (load "leim-list.el" 'noerror 'nomessage 'nosuffix)
--- emacs20-20.7.orig/lisp/vc-hooks.el
+++ emacs20-20.7/lisp/vc-hooks.el
@@ -55,8 +55,8 @@
   :group 'vc)
 
 (defcustom vc-path
-  (if (file-directory-p "/usr/sccs")
-      '("/usr/sccs")
+  (if (file-directory-p "/usr/lib/cssc")
+      '("/usr/lib/cssc")
     nil)
   "*List of extra directories to search for version control commands."
   :type '(repeat directory)
--- emacs20-20.7.orig/lisp/version.el
+++ emacs20-20.7/lisp/version.el
@@ -52,15 +52,16 @@
   (interactive "P")
   (let ((version-string 
          (format (if (not (interactive-p))
-		     "GNU Emacs %s (%s%s)\n of %s on %s"
-		   "GNU Emacs %s (%s%s) of %s on %s")
+		     "GNU Emacs %s (%s%s)\n of %s on %s %s"
+		   "GNU Emacs %s (%s%s) of %s on %s %s")
                  emacs-version
 		 system-configuration
 		 (cond ((featurep 'motif) ", Motif")
 		       ((featurep 'x-toolkit) ", X toolkit")
 		       (t ""))
 		 (format-time-string "%a %b %e %Y" emacs-build-time)
-                 emacs-build-system)))
+                 emacs-build-system
+                 "modified by Debian")))
     (if here 
         (insert version-string)
       (if (interactive-p)
--- emacs20-20.7.orig/lisp/mail/sendmail.el
+++ emacs20-20.7/lisp/mail/sendmail.el
@@ -1,5 +1,7 @@
 ;;; sendmail.el --- mail sending commands for Emacs.
 
+;; EL_MODIFIED_FOR_DEBIAN (make sure this file gets byte-compiled if needed)
+
 ;; Copyright (C) 1985, 86, 92, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -34,7 +36,7 @@
   :group 'mail)
 
 ;;;###autoload
-(defcustom mail-from-style 'angles "\
+(defcustom mail-from-style 'system-default "\
 *Specifies how \"From:\" fields look.
 
 If `nil', they contain just the return address like:
@@ -892,6 +894,8 @@
 			      ;; Always specify who from,
 			      ;; since some systems have broken sendmails.
 			      ;; unless user has said no.
+                              ;; (Debian's default is 'system-default.
+                              ;;  See mail-from-style def; trust the MTA)
 			      (if (memq mail-from-style '(angles parens nil))
 				  (list "-f" user-mail-address))
 ;;; 			      ;; Don't say "from root" if running under su.
--- emacs20-20.7.orig/lisp/gnus/message.el
+++ emacs20-20.7/lisp/gnus/message.el
@@ -1,6 +1,8 @@
 ;;; message.el --- composing mail and news messages
 ;; Copyright (C) 1996,97,98 Free Software Foundation, Inc.
 
+;; EL_MODIFIED_FOR_DEBIAN (make sure this file gets byte-compiled if needed)
+
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: mail, news
 
@@ -392,9 +394,15 @@
 		 (const ask)))
 
 ;; stuff relating to broken sendmail in MMDF
-(defcustom message-sendmail-f-is-evil nil
-  "*Non-nil means that \"-f username\" should not be added to the sendmail
-command line, because it is even more evil than leaving it out."
+;; message-sendmail-f-is-evil is nil here in the upstream source, but
+;; sendmail works right under Debian Linux, so we want t. [was
+;; orignally reported for emacs 19 as debian#7051]
+ 
+(defcustom message-sendmail-f-is-evil t
+  "*Non-nil means that \"-f username\" should not be added to the
+sendmail command line, because it is even more evil than leaving it
+out.  Under Debian/GNU/Linux, sendmail works right, so it should be
+safe for this to be set to true."
   :group 'message-sending
   :type 'boolean)
 
--- emacs20-20.7.orig/lisp/gnus/nnmail.el
+++ emacs20-20.7/lisp/gnus/nnmail.el
@@ -1,6 +1,8 @@
 ;;; nnmail.el --- mail support functions for the Gnus mail backends
 ;; Copyright (C) 1995,96,97,98 Free Software Foundation, Inc.
 
+;; EL_MODIFIED_FOR_DEBIAN (make sure this file gets byte-compiled if needed)
+
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news, mail
 
@@ -173,9 +175,9 @@
 
 (defcustom nnmail-spool-file
   (or (getenv "MAIL")
-      (concat "/usr/spool/mail/" (user-login-name)))
+      (concat mail-spool-directory (user-login-name)))
   "*Where the mail backends will look for incoming mail.
-This variable is \"/usr/spool/mail/$user\" by default.
+This is usually something like \"/usr/spool/mail/$user\" by default.
 If this variable is nil, no mail backends will read incoming mail.
 If this variable is a list, all files mentioned in this list will be
 used as incoming mailboxes.
--- emacs20-20.7.orig/lisp/site-init.el
+++ emacs20-20.7/lisp/site-init.el
@@ -0,0 +1,6 @@
+
+;; EL_MODIFIED_FOR_DEBIAN (make sure this file gets byte-compiled if needed
+
+(setq Info-default-directory-list
+      ;; the command line info doesn't seem to need this, but emacs does.
+      (append Info-default-directory-list '("/usr/share/info/emacs-20/")))
--- emacs20-20.7.orig/leim/makefile.nt
+++ emacs20-20.7/leim/makefile.nt
@@ -143,14 +143,12 @@
 # Rule to generate quail/*.el from CXTERM-DIC/*.tit.
 $(TIT):
 	if not exist quail $(MAKE) -f makefile.nt quail
-	set emacs_dir=$(INSTALL_DIR)
 	$(RUN_EMACS) -l $(buildlisppath)/international/titdic-cnv \
 	    --eval "(batch-titdic-convert t)" -dir quail $(srcdir)/CXTERM-DIC
 	$(RUN_EMACS)  -l $(buildlisppath)/international/quail \
 	    -f batch-byte-compile $(TIT)
 
 leim-list.el: $(SUBDIRS) $(WORLD)
-	set emacs_dir=$(INSTALL_DIR)
 	$(RUN_EMACS) -l $(buildlisppath)/international/quail \
 	    --eval "(update-leim-list-file \".\")"
 
--- emacs20-20.7.orig/leim/ChangeLog
+++ emacs20-20.7/leim/ChangeLog
@@ -1,13 +1,3 @@
-2000-06-13  Gerd Moellmann  <gerd@gnu.org>
-
-	* Version 20.7 released.
-	
-2000-05-23  Andrew Innes  <andrewi@gnu.org>
-
-	* makefile.nt ($(TIT)): Set emacs_dir in the environment before
-	running emacs, to ensure load-path is correct.
-	(leim-list.el): Ditto.
-
 2000-02-26  Gerd Moellmann  <gerd@gnu.org>
 
 	* Version 20.6 released.
--- emacs20-20.7.orig/src/m/ia64.h
+++ emacs20-20.7/src/m/ia64.h
@@ -0,0 +1,210 @@
+/* machine description file for the IA-64 architecture.
+   Copyright (C) 1999 Free Software Foundation, Inc.
+     Contributed by David Mosberger <davidm@hpl.hp.com>
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+
+/* The following line tells the configuration script what sort of 
+   operating system this machine is likely to run.
+   USUAL-OPSYS="note"
+
+NOTE-START
+Use -opsystem=linux
+NOTE-END
+
+*/
+
+#define BITS_PER_LONG		64
+#define BITS_PER_EMACS_INT	64
+
+/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+   is the most significant byte.  */
+
+#undef WORDS_BIG_ENDIAN
+
+/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
+ * group of arguments and treat it as an array of the arguments.  */
+
+#define NO_ARG_ARRAY
+
+/* Define WORD_MACHINE if addresses and such have
+ * to be corrected before they can be used as byte counts.  */
+
+/* #define WORD_MACHINE */
+
+/* Now define a symbol for the cpu type, if your compiler
+   does not define it automatically:
+   Ones defined so far include vax, m68000, ns16000, pyramid,
+   orion, tahoe, APOLLO and many others */
+
+/* __ia64__ defined automatically */
+
+
+/* Use type EMACS_INT rather than a union, to represent Lisp_Object */
+/* This is desirable for most machines.  */
+
+#define NO_UNION_TYPE
+
+/* Define the type to use.  */
+#define EMACS_INT		long
+#define EMACS_UINT		unsigned long
+#define SPECIAL_EMACS_INT
+
+/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
+   the 24-bit bit field into an int.  In other words, if bit fields
+   are always unsigned.
+
+   If you use NO_UNION_TYPE, this flag does not matter.  */
+
+#define EXPLICIT_SIGN_EXTEND
+
+/* Data type of load average, as read out of kmem.  */
+
+#define LOAD_AVE_TYPE		long
+
+/* Convert that into an integer that is 100 for a load average of 1.0  */
+
+#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
+
+/* Define CANNOT_DUMP on machines where unexec does not work.
+   Then the function dump-emacs will not be defined
+   and temacs will do (load "loadup") automatically unless told otherwise.  */
+#if 0
+#define CANNOT_DUMP
+#endif
+
+/* Define VIRT_ADDR_VARIES if the virtual addresses of
+   pure and impure space as loaded can vary, and even their
+   relative order cannot be relied on.
+
+   Otherwise Emacs assumes that text space precedes data space,
+   numerically.  */
+
+/* #define VIRT_ADDR_VARIES */
+
+/* Define C_ALLOCA if this machine does not support a true alloca
+   and the one written in C should be used instead.
+   Define HAVE_ALLOCA to say that the system provides a properly
+   working alloca function and it should be used.
+   Define neither one if an assembler-language alloca
+   in the file alloca.s should be used.  */
+
+#define HAVE_ALLOCA
+
+/* Define the following if GNU malloc and the relocating allocator do
+   not work together with X.  */
+
+/* #define SYSTEM_MALLOC */
+
+/* Define NO_REMAP if memory segmentation makes it not work well
+   to change the boundary between the text section and data section
+   when Emacs is dumped.  If you define this, the preloaded Lisp
+   code will not be sharable; but that's better than failing completely.  */
+
+/* #define NO_REMAP */
+
+/* Some really obscure 4.2-based systems (like Sequent DYNIX)
+ * do not support asynchronous I/O (using SIGIO) on sockets,
+ * even though it works fine on tty's.  If you have one of
+ * these systems, define the following, and then use it in
+ * config.h (or elsewhere) to decide when (not) to use SIGIO.
+ *
+ * You'd think this would go in an operating-system description file,
+ * but since it only occurs on some, but not all, BSD systems, the
+ * reasonable place to select for it is in the machine description
+ * file.
+ */
+
+/*#define NO_SOCK_SIGIO*/
+
+#ifdef __ELF__
+#undef UNEXEC
+#define UNEXEC unexelf.o
+#endif
+
+#define PNTR_COMPARISON_TYPE unsigned long
+
+/* On the 64 bit architecture, we can use 60 bits for addresses */
+
+#define VALBITS         60
+
+/* This definition of MARKBIT is necessary because of the comparison of
+   ARRAY_MARK_FLAG and MARKBIT in an #if in lisp.h, which cpp doesn't like. */
+
+#define MARKBIT         0x8000000000000000L
+
+/* Define XINT and XUINT so that they can take arguments of type int */
+
+#define XINT(a)  (((long) (a) << (BITS_PER_LONG - VALBITS)) >> (BITS_PER_LONG - VALBITS))
+#define XUINT(a) ((long) (a) & VALMASK)
+
+/* Declare malloc and realloc in a way that is clean.
+   But not in makefiles!  */
+
+#ifndef NOT_C_CODE
+/* We need these because pointers are larger than the default ints.  */
+# if !defined(__NetBSD__) && !defined(__OpenBSD__)
+#  include <alloca.h>
+# else
+#  include <stdlib.h>
+# endif
+
+/* Hack alert!  For reasons unknown to mankind the string.h file insists
+   on defining bcopy etc. as taking char pointers as arguments.  With
+   Emacs this produces an endless amount of warning which are harmless,
+   but tends to flood the real errors.  This hack works around this problem
+   by not prototyping.  */
+#define bcopy string_h_bcopy
+#define bzero string_h_bzero
+#define bcmp  string_h_bcmp
+#include <string.h>
+#undef bcopy
+#undef bzero
+#undef bcmp
+
+/* We need to prototype these for the lib-src programs even if we don't
+   use the system malloc for the Emacs proper.  */
+#ifdef _MALLOC_INTERNAL
+/* These declarations are designed to match the ones in gmalloc.c.  */
+#if defined (__STDC__) && __STDC__
+extern void *malloc (), *realloc (), *calloc ();
+#else
+extern char *malloc (), *realloc (), *calloc ();
+#endif
+#else /* not _MALLOC_INTERNAL */
+extern void *malloc (), *realloc (), *calloc ();
+#endif /* not _MALLOC_INTERNAL */
+
+extern long *xmalloc (), *xrealloc ();
+
+#ifdef REL_ALLOC
+#ifndef _MALLOC_INTERNAL
+/* "char *" because ralloc.c defines it that way.  gmalloc.c thinks it
+   is allowed to prototype these as "void *" so we don't prototype in
+   that case.  You're right: it stinks!  */
+extern char *r_alloc (), *r_re_alloc ();
+extern void r_alloc_free ();
+#endif /* not _MALLOC_INTERNAL */
+#endif /* REL_ALLOC */
+
+#endif /* not NOT_C_CODE */
+
+#define DATA_SEG_BITS	0x6000000000000000
+
+#define HAVE_TEXT_START
--- emacs20-20.7.orig/src/m/s390.h
+++ emacs20-20.7/src/m/s390.h
@@ -0,0 +1,121 @@
+/* machine description file template.
+   Copyright (C) 1985, 1986 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* The following line tells the configuration script what sort of
+   operating system this machine is likely to run.
+   USUAL-OPSYS="<name of system .h file here, without the s- or .h>"  */
+
+/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+   is the most significant byte.  */
+
+#define WORDS_BIG_ENDIAN
+
+/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
+ * group of arguments and treat it as an array of the arguments.  */
+
+#define NO_ARG_ARRAY
+
+/* Define WORD_MACHINE if addresses and such have
+ * to be corrected before they can be used as byte counts.  */
+
+/* #define WORD_MACHINE */
+
+/* Now define a symbol for the cpu type, if your compiler
+   does not define it automatically:
+   Ones defined so far include vax, m68000, ns16000, pyramid,
+   orion, tahoe, APOLLO and many others */
+
+/* __s390__ defined already */
+
+/* Use type int rather than a union, to represent Lisp_Object */
+/* This is desirable for most machines.  */
+
+#define NO_UNION_TYPE
+
+/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
+   the 24-bit bit field into an int.  In other words, if bit fields
+   are always unsigned.
+
+   If you use NO_UNION_TYPE, this flag does not matter.  */
+
+#define EXPLICIT_SIGN_EXTEND
+
+/* Data type of load average, as read out of kmem.  */
+
+#define LOAD_AVE_TYPE long
+
+/* Convert that into an integer that is 100 for a load average of 1.0  */
+
+#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
+
+/* Define CANNOT_DUMP on machines where unexec does not work.
+   Then the function dump-emacs will not be defined
+   and temacs will do (load "loadup") automatically unless told otherwise.  */
+
+/* #define CANNOT_DUMP */
+
+/* Define VIRT_ADDR_VARIES if the virtual addresses of
+   pure and impure space as loaded can vary, and even their
+   relative order cannot be relied on.
+
+   Otherwise Emacs assumes that text space precedes data space,
+   numerically.  */
+
+#define VIRT_ADDR_VARIES
+
+/* Define C_ALLOCA if this machine does not support a true alloca
+   and the one written in C should be used instead.
+   Define HAVE_ALLOCA to say that the system provides a properly
+   working alloca function and it should be used.
+   Define neither one if an assembler-language alloca
+   in the file alloca.s should be used.  */
+
+/* #define C_ALLOCA */
+#define HAVE_ALLOCA
+
+/* Define NO_REMAP if memory segmentation makes it not work well
+   to change the boundary between the text section and data section
+   when Emacs is dumped.  If you define this, the preloaded Lisp
+   code will not be sharable; but that's better than failing completely.  */
+
+/* #define NO_REMAP */
+
+/* Some really obscure 4.2-based systems (like Sequent DYNIX)
+ * do not support asynchronous I/O (using SIGIO) on sockets,
+ * even though it works fine on tty's.  If you have one of
+ * these systems, define the following, and then use it in
+ * config.h (or elsewhere) to decide when (not) to use SIGIO.
+ *
+ * You'd think this would go in an operating-system description file,
+ * but since it only occurs on some, but not all, BSD systems, the
+ * reasonable place to select for it is in the machine description
+ * file.
+ */
+
+/* #define NO_SOCK_SIGIO */
+
+/* After adding support for a new system, modify the large case
+   statement in the `configure' script to recognize reasonable
+   configuration names, and add a description of the system to
+   `etc/MACHINES'.
+
+   If you've just fixed a problem in an existing configuration file,
+   you should also check `etc/MACHINES' to make sure its descriptions
+   of known problems in that configuration should be updated.  */
--- emacs20-20.7.orig/src/m/mipsel.h
+++ emacs20-20.7/src/m/mipsel.h
@@ -0,0 +1,8 @@
+/* machine description file for Mipsel (mips little endian).  */
+
+#include "mips.h"
+
+/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+   is the most significant byte.  */
+
+#undef WORDS_BIG_ENDIAN
--- emacs20-20.7.orig/src/m/hp800.h
+++ emacs20-20.7/src/m/hp800.h
@@ -85,7 +85,7 @@
 #define bcmp		memcmp
 #endif
 
-#ifdef __hpux
+#if defined(__hpux) || defined(__linux__)
 /* Now define a symbol for the cpu type, if your compiler
    does not define it automatically:
    Ones defined so far include vax, m68000, ns16000, pyramid,
@@ -94,6 +94,15 @@
 #     define hp9000s800
 #endif
 
+#ifdef __linux__
+/* Data type of load average, as read out of kmem.  */
+
+#define LOAD_AVE_TYPE long
+
+/* Convert that into an integer that is 100 for a load average of 1.0  */
+
+#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
+#else
 /* Data type of load average, as read out of kmem.  */
 
 #define LOAD_AVE_TYPE double
@@ -101,7 +110,7 @@
 /* Convert that into an integer that is 100 for a load average of 1.0  */
 
 #define LOAD_AVE_CVT(x) ((int) (x * 100.0))
-
+#endif
 
 /* Define CANNOT_DUMP on machines where unexec does not work.
    Then the function dump-emacs will not be defined
@@ -116,6 +125,7 @@
    Otherwise Emacs assumes that text space precedes data space,
    numerically.  */
 
+#ifdef __hpux
 #define VIRT_ADDR_VARIES
 
 /* Define C_ALLOCA if this machine does not support a true alloca
@@ -134,6 +144,9 @@
 
 #define DATA_START    0x40000000
 #define TEXT_START    0x00000000
+#else
+#define HAVE_ALLOCA
+#endif
 
 #define STACK_DIRECTION 1 
 
@@ -147,6 +160,7 @@
 /* This machine requires completely different unexec code
    which lives in a separate file.  Specify the file name.  */
 
+#ifdef __hpux
 #define UNEXEC unexhp9k800.o
 
 #define LIBS_MACHINE
@@ -179,5 +193,5 @@
 
 #define index strchr
 #define rindex strrchr
-
-#endif /* __hpux */
+#endif
+#endif
--- emacs20-20.7.orig/src/m/powerpc.h
+++ emacs20-20.7/src/m/powerpc.h
@@ -0,0 +1,165 @@
+/* machine description file for Power PC
+   Copyright (C) 1987, 1994 Free Software Foundation, Inc.
+   Copyright (C) 1995 Board of Trustees, University of Illinois
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+XEmacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* The following line tells the configuration script what sort of 
+   operating system this machine is likely to run.
+   USUAL-OPSYS="solaris2-5" */
+
+#ifdef NOT_C_CODE
+# define POWERPC
+#else
+# ifndef powerpc
+#  define powerpc
+# endif
+#endif
+
+#define C_OPTIMIZE_SWITCH "-O2"
+
+/* XINT must explicitly sign-extend */
+
+#define EXPLICIT_SIGN_EXTEND
+
+/* Data type of load average, as read out of kmem.  */
+
+#define LOAD_AVE_TYPE long
+
+/* Convert that into an integer that is 100 for a load average of 1.0  */
+
+#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
+
+#if 0
+/* The following line tells the configuration script what sort of 
+   operating system this machine is likely to run.
+   USUAL-OPSYS="linux"  */
+#endif
+
+/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+   is the most significant byte.  */
+
+#define WORDS_BIG_ENDIAN
+
+/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
+ * group of arguments and treat it as an array of the arguments.  */
+
+#define NO_ARG_ARRAY
+
+/* Use type int rather than a union, to represent Lisp_Object */
+/* This is desirable for most machines.	 */
+
+#define NO_UNION_TYPE
+
+#define UNEXEC unexelf.o
+
+#if 0
+/* Now define a symbol for the cpu type, if your compiler
+   does not define it automatically.  */
+
+/* #define IBMR2AIX */
+
+
+/* Define CANNOT_DUMP on machines where unexec does not work.
+   Then the function dump-emacs will not be defined
+   and temacs will do (load "loadup") automatically unless told otherwise.  */
+
+/* #define CANNOT_DUMP */
+
+#endif
+
+/* Define addresses, macros, change some setup for dump */
+
+#define NO_REMAP
+
+#if 0
+#define TEXT_START 0x00001000
+#define TEXT_END 0
+#define DATA_START 0x01000000
+#define DATA_END 0
+
+/* The data segment in this machine always starts at address 0x10000000.
+   An address of data cannot be stored correctly in a Lisp object;
+   we always lose the high bits.  We must tell XPNTR to add them back.	*/
+
+#define DATA_SEG_BITS 0x10000000
+#endif
+
+/* Use type int rather than a union, to represent Lisp_Object */
+
+/* #define NO_UNION_TYPE */
+
+#ifdef CANNOT_DUMP
+/* Define shared memory segment symbols */
+
+#define PURE_SEG_BITS 0x30000000
+
+/* Use shared memory.  */
+/* This is turned off because it does not always work.	See etc/AIX.DUMP.  */
+/* #define HAVE_SHM */
+#define SHMKEY 5305035		/* used for shared memory code segments */
+#endif /* CANNOT_DUMP */
+
+#define N_BADMAG(x) BADMAG(x)
+#define N_TXTOFF(x) A_TEXTPOS(x)
+#define N_SYMOFF(x) A_SYMPOS(x)
+/* #define A_TEXT_OFFSET(HDR) sizeof(HDR) */
+/* #define ADJUST_EXEC_HEADER \
+    unexec_text_start += sizeof(hdr); \
+    unexec_data_start = ohdr.a_dbase
+*/
+#undef ADDR_CORRECT
+#define ADDR_CORRECT(x) ((int)(x))
+
+/* Define C_ALLOCA if this machine does not support a true alloca
+   and the one written in C should be used instead.
+   Define HAVE_ALLOCA to say that the system provides a properly
+   working alloca function and it should be used.
+   Define neither one if an assembler-language alloca
+   in the file alloca.s should be used.	 */
+
+#define HAVE_ALLOCA   
+
+/* Specify the font for X to use.
+   This used to be Rom14.500; that's nice on the X server shipped with
+   the RS/6000, but it's not available on other servers.  */
+#define X_DEFAULT_FONT "fixed"
+
+/* Here override various assumptions in ymakefile */
+
+#undef  START_FILES
+#define START_FILES
+ 
+/* #define HAVE_SYSVIPC */
+/* #define HAVE_GETWD */
+
+/* Don't try to include sioctl.h or ptem.h.  */
+#undef NEED_SIOCTL
+#undef NEED_PTEM_H
+
+#define ORDINARY_LINK
+
+#ifdef LINUX
+#define LINKER $(CC) -nostdlib
+#define LD_SWITCH_MACHINE -Xlinker -m -Xlinker elf32ppc
+/* s/gnu-linux.h defines this to `-z nocombreloc' which does not work here
+   because prefix-args is not used.  */
+#undef LD_SWITCH_SYSTEM_TEMACS
+#define LD_SWITCH_MACHINE_TEMACS -Xlinker -znocombreloc
+#endif
+
--- emacs20-20.7.orig/src/s/gnu.h
+++ emacs20-20.7/src/s/gnu.h
@@ -76,3 +76,8 @@
 #ifndef NOT_C_CODE
 #include <fcntl.h>
 #endif
+ 
+/* Use mmap directly for allocating larger buffers.  */
+#ifdef DOUG_LEA_MALLOC
+#undef REL_ALLOC
+#endif
--- emacs20-20.7.orig/src/s/gnu-linux.h
+++ emacs20-20.7/src/s/gnu-linux.h
@@ -131,7 +131,14 @@
    programs.  I assume that most people are using newer mailers that
    have heard of flock.  Change this if you need to. */
 
-#define MAIL_USE_FLOCK
+/* On Debian/GNU/Linux systems, configure gets the right answers, and
+   that means *NOT* using flock.  Using flock is guaranteed to be the
+   wrong thing. See Debian Policy for details. */
+#ifdef DEBIAN
+#  undef MAIL_USE_FLOCK
+#else
+#  define MAIL_USE_FLOCK
+#endif
 
 /* Define CLASH_DETECTION if you want lock files to be written
    so that Emacs can tell instantly when you try to modify
@@ -202,6 +209,14 @@
 #else
 #define LD_SWITCH_SYSTEM LD_SWITCH_X_SITE_AUX
 #endif /* __mips__ */
+
+/* Link temacs with -z nocombreloc so that unexec works right, whether or
+   not -z combreloc is the default.  GNU ld ignores unknown -z KEYWORD
+   switches, so this also works with older versions that don't implement
+   -z combreloc.  */
+/* Without the -Wl flag, gcc thinks that ``nocombreloc'' is a file to
+   be compiled. */
+#define LD_SWITCH_SYSTEM_TEMACS -z nocombreloc
 #endif /* __ELF__ */
 
 /* As of version 1.1.51, Linux did not actually implement SIGIO.
--- emacs20-20.7.orig/src/callproc.c
+++ emacs20-20.7/src/callproc.c
@@ -25,6 +25,8 @@
 #include <config.h>
 #include <stdio.h>
 
+#include "../lib-src/mailspool.h"
+
 extern int errno;
 extern char *strerror ();
 
@@ -104,6 +106,8 @@
 
 Lisp_Object Vprocess_environment;
 
+Lisp_Object Vmail_spool_directory;
+
 #ifdef DOS_NT
 Lisp_Object Qbuffer_file_type;
 #endif /* DOS_NT */
@@ -1428,6 +1432,17 @@
 Each element should be a string of the form ENVVARNAME=VALUE.\n\
 The environment which Emacs inherits is placed in this variable\n\
 when Emacs starts.");
+
+  DEFVAR_LISP ("mail-spool-directory", &Vmail_spool_directory,
+    "Location of the system mail spool.  This is normally a directory like\n\
+\"usr/spool/mail\".");
+#ifdef MAIL_SPOOL_DIRECTORY
+  Vmail_spool_directory =
+    Ffile_name_as_directory (build_string (MAIL_SPOOL_DIRECTORY));
+#else
+  Vmail_spool_directory = Qnil;
+#endif
+
 
 #ifndef VMS
   defsubr (&Scall_process);
--- emacs20-20.7.orig/src/sysdep.c
+++ emacs20-20.7/src/sysdep.c
@@ -232,6 +232,11 @@
   };
 #endif
 
+/* Fix for alpha problems from David Huggins-Daines <dhd@linuxcare.com>
+   we need to kill off */
+
+#if 0 /* before temp fix */
+
 #if defined (HAVE_LIBNCURSES) && ! defined (NCURSES_OSPEED_T)
 extern short ospeed;
 #else
@@ -245,6 +250,20 @@
 #endif
 #endif
 
+#else /* after temp fix */
+
+#if defined (HAVE_TERMIOS_H) && defined (LINUX)
+#include <termios.h>
+/* HJL's version of libc is said to need this on the Alpha.
+   On the other hand, DEC OSF1 on the Alpha needs ospeed to be a short.  */
+extern speed_t ospeed;
+#else
+extern short ospeed;
+#endif
+
+#endif /* before/after fix */
+
+
 /* The file descriptor for Emacs's input terminal.
    Under Unix, this is normally zero except when using X;
    under VMS, we place the input channel number here.  */
@@ -2404,6 +2423,7 @@
   }
 }
 
+#ifndef __powerpc__
 #ifndef MSDOS
 #ifndef VMS
 #if !defined (HAVE_SELECT) || defined (BROKEN_SELECT_NON_X)
@@ -2467,7 +2487,7 @@
   SIGTYPE (*old_trap) ();
   unsigned char buf;
 
-#if defined (HAVE_SELECT) && defined (HAVE_X_WINDOWS)
+#if (defined (HAVE_SELECT) && defined (HAVE_X_WINDOWS)) || defined(__powerpc__)
   /* If we're using X, then the native select will work; we only need the
      emulation for non-X usage.  */
   if (!NILP (Vwindow_system))
@@ -2660,6 +2680,8 @@
 #endif /* not HAVE_SELECT */
 #endif /* not VMS */
 #endif /* not MSDOS */
+#endif /* not PowerPC */
+
 
 #ifdef BSD4_1
 /*
--- emacs20-20.7.orig/src/termcap.c
+++ emacs20-20.7/src/termcap.c
@@ -284,7 +284,34 @@
 
 /* Outputting a string with padding.  */
 
-short ospeed;
+#if 0 /* before temp fix */
+
+#if defined (HAVE_LIBNCURSES) && ! defined (NCURSES_OSPEED_T)
+extern short ospeed;
+#else
+#if defined (HAVE_TERMIOS_H) && defined (LINUX)
+#include <termios.h>
+/* HJL's version of libc is said to need this on the Alpha.
+   On the other hand, DEC OSF1 on the Alpha needs ospeed to be a short.  */
+extern speed_t ospeed;
+#else
+extern short ospeed;
+#endif
+#endif
+
+#else /* after temp fix */
+
+#if defined (HAVE_TERMIOS_H) && defined (LINUX)
+#include <termios.h>
+/* HJL's version of libc is said to need this on the Alpha.
+   On the other hand, DEC OSF1 on the Alpha needs ospeed to be a short.  */
+extern speed_t ospeed;
+#else
+extern short ospeed;
+#endif
+
+#endif /* before/after fix */
+
 /* If OSPEED is 0, we use this as the actual baud rate.  */
 int tputs_baud_rate;
 char PC;
--- emacs20-20.7.orig/src/terminfo.c
+++ emacs20-20.7/src/terminfo.c
@@ -26,18 +26,33 @@
 
 char *UP, *BC, PC;
 
+#if 0 /* before temp fix */
+
 #if defined (HAVE_LIBNCURSES) && ! defined (NCURSES_OSPEED_T)
-short ospeed;
+extern short ospeed;
 #else
 #if defined (HAVE_TERMIOS_H) && defined (LINUX)
 #include <termios.h>
 /* HJL's version of libc is said to need this on the Alpha.
    On the other hand, DEC OSF1 on the Alpha needs ospeed to be a short.  */
-speed_t ospeed;
+extern speed_t ospeed;
 #else
-short ospeed;
+extern short ospeed;
 #endif
 #endif
+
+#else /* after temp fix */
+
+#if defined (HAVE_TERMIOS_H) && defined (LINUX)
+#include <termios.h>
+/* HJL's version of libc is said to need this on the Alpha.
+   On the other hand, DEC OSF1 on the Alpha needs ospeed to be a short.  */
+extern speed_t ospeed;
+#else
+extern short ospeed;
+#endif
+
+#endif /* before/after fix */
 
 /* Interface to curses/terminfo library.
    Turns out that all of the terminfo-level routines look
--- emacs20-20.7.orig/src/widget.c
+++ emacs20-20.7/src/widget.c
@@ -330,17 +330,17 @@
      treat that as the geometry of the frame.  (Is this bogus?
      I'm not sure.) */
   if (ew->emacs_frame.geometry == 0)
-    XtVaGetValues (wmshell, XtNgeometry, &ew->emacs_frame.geometry, 0);
+    XtVaGetValues (wmshell, XtNgeometry, &ew->emacs_frame.geometry, NULL);
 
   /* If the Shell is iconic, then the EmacsFrame is iconic.  (Is
      this bogus? I'm not sure.) */
   if (!ew->emacs_frame.iconic)
-    XtVaGetValues (wmshell, XtNiconic, &ew->emacs_frame.iconic, 0);
+    XtVaGetValues (wmshell, XtNiconic, &ew->emacs_frame.iconic, NULL);
   
   
   {
     char *geom = 0;
-    XtVaGetValues (app_shell, XtNgeometry, &geom, 0);
+    XtVaGetValues (app_shell, XtNgeometry, &geom, NULL);
     if (geom)
       app_flags = XParseGeometry (geom, &app_x, &app_y, &app_w, &app_h);
   }
@@ -390,7 +390,7 @@
 
       /* If the AppShell is iconic, then the EmacsFrame is iconic. */
       if (!ew->emacs_frame.iconic)
-	XtVaGetValues (app_shell, XtNiconic, &ew->emacs_frame.iconic, 0);
+	XtVaGetValues (app_shell, XtNiconic, &ew->emacs_frame.iconic, NULL);
 
       first_frame_p = False;
     }
@@ -464,7 +464,7 @@
 	len = strlen (shell_position) + 1;
 	tem = (char *) xmalloc (len);
 	strncpy (tem, shell_position, len);
-	XtVaSetValues (wmshell, XtNgeometry, tem, 0);
+	XtVaSetValues (wmshell, XtNgeometry, tem, NULL);
       }
     else if (flags & (WidthValue | HeightValue))
       {
@@ -474,7 +474,7 @@
 	len = strlen (shell_position) + 1;
 	tem = (char *) xmalloc (len);
 	strncpy (tem, shell_position, len);
-	XtVaSetValues (wmshell, XtNgeometry, tem, 0);
+	XtVaSetValues (wmshell, XtNgeometry, tem, NULL);
       }
 
     /* If the geometry spec we're using has W/H components, mark the size
@@ -484,7 +484,7 @@
 
     /* Also assign the iconic status of the frame to the Shell, so that
        the WM sees it. */
-    XtVaSetValues (wmshell, XtNiconic, ew->emacs_frame.iconic, 0);
+    XtVaSetValues (wmshell, XtNiconic, ew->emacs_frame.iconic, NULL);
 #endif /* 0 */
   }
 }
@@ -538,7 +538,7 @@
 		 XtNheightInc, ch,
 		 XtNminWidth, base_width + min_cols * cw,
 		 XtNminHeight, base_height + min_rows * ch,
-		 0);
+		 NULL);
 }
 
 static void
@@ -854,7 +854,7 @@
   if (cur->emacs_frame.iconic != new->emacs_frame.iconic)
     {
       Widget wmshell = get_wm_shell ((Widget) cur);
-      XtVaSetValues (wmshell, XtNiconic, new->emacs_frame.iconic, 0);
+      XtVaSetValues (wmshell, XtNiconic, new->emacs_frame.iconic, NULL);
     }
 
   return needs_a_refresh;
--- emacs20-20.7.orig/src/xmenu.c
+++ emacs20-20.7/src/xmenu.c
@@ -1500,7 +1500,7 @@
     {
       XtManageChild (x->menubar_widget);
       XtMapWidget (x->menubar_widget);
-      XtVaSetValues (x->menubar_widget, XtNmappedWhenManaged, 1, 0);
+      XtVaSetValues (x->menubar_widget, XtNmappedWhenManaged, 1, NULL);
     }
 
   /* Re-manage the text-area widget, and then thrash the sizes.  */
--- emacs20-20.7.orig/src/cm.h
+++ emacs20-20.7/src/cm.h
@@ -101,6 +101,11 @@
 extern struct cm Wcm;		/* Terminal capabilities */
 extern char PC;			/* Pad character */
 
+/* Fix for alpha problems from David Huggins-Daines <dhd@linuxcare.com>
+   we need to kill off */
+
+#if 0 /* before temp fix */
+
 #if defined (HAVE_LIBNCURSES) && ! defined (NCURSES_OSPEED_T)
 extern short ospeed;
 #else
@@ -113,6 +118,18 @@
 extern short ospeed;		/* Output speed (from sg_ospeed) */
 #endif
 #endif
+
+#else /* after temp fix */
+
+#if defined (HAVE_TERMIOS_H) && defined (LINUX)
+#include <termios.h>
+/* DEC OSF1 on the Alpha needs ospeed to be a short.  */
+extern speed_t ospeed;
+#else
+extern short ospeed;		/* Output speed (from sg_ospeed) */
+#endif
+
+#endif /* before/after fix */
 
 /* Shorthand */
 #ifndef NoCMShortHand
--- emacs20-20.7.orig/src/ppc.ldscript
+++ emacs20-20.7/src/ppc.ldscript
@@ -0,0 +1,127 @@
+OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
+	      "elf32-powerpc")
+OUTPUT_ARCH(powerpc)
+ENTRY(_start)
+SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/ppc-linux-elf/lib);
+/* Do we need any of these for elf?
+   __DYNAMIC = 0;    */
+PROVIDE (__stack = 0);
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = 0x200000 + SIZEOF_HEADERS;
+  .interp   : { *(.interp) }
+  .hash		  : { *(.hash)		}
+  .dynsym	  : { *(.dynsym)		}
+  .dynstr	  : { *(.dynstr)		}
+  .rela.text	  : { *(.rela.text) 	}
+  .rela.data	  : { *(.rela.data) 	}
+  .rela.rodata	  : { *(.rela.rodata) 	}
+  .rela.got	  : { *(.rela.got)	}
+  .rela.got1	  : { *(.rela.got1)	}
+  .rela.got2	  : { *(.rela.got2)	}
+  .rela.ctors	  : { *(.rela.ctors)	}
+  .rela.dtors	  : { *(.rela.dtors)	}
+  .rela.init	  : { *(.rela.init)	}
+  .rela.fini	  : { *(.rela.fini)	}
+  .rela.bss	  : { *(.rela.bss)	}
+  .rela.plt	  : { *(.rela.plt)	}
+  .rela.sdata	  : { *(.rela.sdata2)	}
+  .rela.sbss	  : { *(.rela.sbss2)	}
+  .rela.sdata2	  : { *(.rela.sdata2)	}
+  .rela.sbss2	  : { *(.rela.sbss2)	}
+  .text      :
+  {
+    *(.text)
+    /* .gnu.warning sections are handled specially by elf32.em.  */
+    *(.gnu.warning)
+  } =0
+  .init		  : { *(.init)		} =0
+  .fini		  : { *(.fini)		} =0
+  .rodata	  : { *(.rodata)  }
+  .rodata1	  : { *(.rodata1) }
+  _etext = .;
+  PROVIDE (etext = .);
+  .sdata2   : { *(.sdata2) }
+  .sbss2   : { *(.sbss2) }
+  /* Adjust the address for the data segment.  We want to adjust up to
+     the same address within the page on the next page up.  It would
+     be more correct to do this:
+       . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
+     The current expression does not correctly handle the case of a
+     text segment ending precisely at the end of a page; it causes the
+     data segment to skip a page.  The above expression does not have
+     this problem, but it will currently (2/95) cause BFD to allocate
+     a single segment, combining both text and data, for this case.
+     This will prevent the text segment from being shared among
+     multiple executions of the program; I think that is more
+     important than losing a page of the virtual address space (note
+     that no actual memory is lost; the page which is skipped can not
+     be referenced).  */
+  . =  ALIGN(8) + 0x40000;
+  .data    :
+  {
+    *(.data)
+    CONSTRUCTORS
+  }
+  .data1   : { *(.data1) }
+  .got1		  : { *(.got1) }
+  .plt   : { *(.plt) }
+  .dynamic	  : { *(.dynamic) }
+  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
+     get relocated with -mrelocatable. Also put in the .fixup pointers.
+     The current compiler no longer needs this, but keep it around for 2.7.2  */
+		PROVIDE (_GOT2_START_ = .);
+  .got2		  :  { *(.got2) }
+		PROVIDE (__CTOR_LIST__ = .);
+  .ctors	  : { *(.ctors) }
+		PROVIDE (__CTOR_END__ = .);
+		PROVIDE (__DTOR_LIST__ = .);
+  .dtors	  : { *(.dtors) }
+		PROVIDE (__DTOR_END__ = .);
+		PROVIDE (_FIXUP_START_ = .);
+  .fixup	  : { *(.fixup) }
+		PROVIDE (_FIXUP_END_ = .);
+		PROVIDE (_GOT2_END_ = .);
+		PROVIDE (_GOT_START_ = .);
+  .got		  : { *(.got) }
+  .got.plt	  : { *(.got.plt) }
+		PROVIDE (_GOT_END_ = .);
+  /* We want the small data sections together, so single-instruction offsets
+     can access them all, and initialized data all before uninitialized, so
+     we can shorten the on-disk segment size.  */
+  .sdata	  : { *(.sdata) }
+  _edata  =  .;
+  PROVIDE (edata = .);
+  .sbss      :
+  {
+  }
+  .bss       :
+  {
+    PROVIDE (__sbss_start = .);
+    *(.sbss)
+    *(.scommon)
+    PROVIDE (__sbss_end = .);
+   PROVIDE (__bss_start = .);
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+  _end = . ;
+  PROVIDE (end = .);
+  /* These are needed for ELF backends which have not yet been
+     converted to the new style linker.  */
+  .stab 0 : { *(.stab) }
+  .stabstr 0 : { *(.stabstr) }
+  /* DWARF debug sections.
+     Symbols in the .debug DWARF section are relative to the beginning of the
+     section so we begin .debug at 0.  It's not clear yet what needs to happen
+     for the others.   */
+  .debug          0 : { *(.debug) }
+  .debug_srcinfo  0 : { *(.debug_srcinfo) }
+  .debug_aranges  0 : { *(.debug_aranges) }
+  .debug_pubnames 0 : { *(.debug_pubnames) }
+  .debug_sfnames  0 : { *(.debug_sfnames) }
+  .line           0 : { *(.line) }
+  /* These must appear regardless of  .  */
+}
--- emacs20-20.7.orig/src/config.in
+++ emacs20-20.7/src/config.in
@@ -173,6 +173,13 @@
 #undef HAVE_MAILLOCK_H
 #undef HAVE_TOUCHLOCK
 
+/* Mail spool information from the configure process.  See lib-src/mailspool.h */
+#undef USE_MAIL_SPOOL_DIRECTORY
+#undef CONF_MAIL_SPOOL_DIRECTORY
+
+/* Mail spool information from the configure process.  See lib-src/fakemail.c */
+#undef CONF_MAIL_PROGRAM_NAME
+
 #undef HAVE_ALLOCA_H
 
 #undef HAVE_GETTIMEOFDAY
@@ -421,4 +428,12 @@
 #ifdef HAVE_STRING_H
 #include "string.h"
 #endif
+/* emacs uses bzero? Bad emacs, bad! */
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#  define bzero(data, size) memset(data, '\0', size)
+#  define bcmp memcmp
+#  define bcopy(a,b,c) memmove(b,a,c)
 #endif
+#endif
+
--- emacs20-20.7.orig/lib-src/yow.c
+++ emacs20-20.7/lib-src/yow.c
@@ -10,6 +10,8 @@
  * With dynamic memory allocation.
  */
 
+#include <string.h>
+#include <stdlib.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <../src/epaths.h>      /* For PATH_DATA.  */
@@ -33,7 +35,9 @@
     &res;})
 #endif
 
+/* This conflicts with glibc 2.2
 char *malloc(), *realloc();
+*/
 
 void yow();
 void setup_yow();
--- emacs20-20.7.orig/lib-src/fakemail.c
+++ emacs20-20.7/lib-src/fakemail.c
@@ -133,7 +133,11 @@
 #define INITIAL_LINE_SIZE 200
 
 #ifndef MAIL_PROGRAM_NAME
-#define MAIL_PROGRAM_NAME "/bin/mail"
+#ifdef CONF_MAIL_PROGRAM_NAME
+#define MAIL_PROGRAM_NAME CONF_MAIL_PROGRAM_NAME
+#else
+#error "MAIL_PROGRAM_NAME must be defined"
+#endif
 #endif
 
 static char *my_name;
--- emacs20-20.7.orig/lib-src/cvtmail.c
+++ emacs20-20.7/lib-src/cvtmail.c
@@ -33,11 +33,14 @@
  * Author: Larry Kolodney, 1985
  */
 
-
+#include <string.h>
+#include <stdlib.h>
 #include <stdio.h>
 
+/* These conflict with glibc 2.2
 char *malloc ();
 char *realloc ();
+*/
 char *getenv ();
 
 char *xmalloc ();
--- emacs20-20.7.orig/lib-src/Makefile.in
+++ emacs20-20.7/lib-src/Makefile.in
@@ -212,11 +212,10 @@
 /* If HESIOD is defined, set this to "-lhesiod". */
 HESIODLIB=
 
-MOVE_LIBS=$(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) $(COM_ERRLIB) $(HESIODLIB)
+MOVEMAIL_LOCK_LIBS=@MOVEMAIL_LOCK_LIBS@
 
-#ifdef HAVE_LIBMAIL
-LIBMAIL=-lmail
-#endif
+MOVE_LIBS=$(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) $(COM_ERRLIB) \
+  $(HESIODLIB) $(MOVEMAIL_LOCK_LIBS)
 
 LOADLIBES=LIBS_SYSTEM LIBS_MACHINE LIB_STANDARD_LIBSRC
 
--- emacs20-20.7.orig/lib-src/movemail.c
+++ emacs20-20.7/lib-src/movemail.c
@@ -54,6 +54,8 @@
  *
  */
 
+#include "mailspool.h"
+
 #define NO_SHORTNAMES   /* Tell config not to load remap.h */
 #include <../src/config.h>
 #include <sys/types.h>
@@ -142,15 +144,12 @@
 #endif
 
 #if !defined (MAIL_USE_SYSTEM_LOCK) && !defined (MAIL_USE_MMDF) && \
-	defined (HAVE_LIBMAIL) && defined (HAVE_MAILLOCK_H)
+     defined (HAVE_LIBMAIL) && defined (HAVE_MAILLOCK_H) && \
+     defined (MAIL_SPOOL_DIRECTORY)
 #include <maillock.h>
-/* We can't use maillock unless we know what directory system mail
-   files appear in. */
-#ifdef MAILDIR
 #define MAIL_USE_MAILLOCK
 static char *mail_spool_name ();
 #endif
-#endif
 
 #ifndef errno
 extern int errno;
@@ -578,7 +577,7 @@
 
   fname++;
 
-  if (stat (MAILDIR, &stat1) < 0)
+  if (stat (MAIL_SPOOL_DIRECTORY, &stat1) < 0)
     return NULL;
 
   indir = (char *) xmalloc (fname - inname + 1);
--- emacs20-20.7.orig/lib-src/mailspool.h
+++ emacs20-20.7/lib-src/mailspool.h
@@ -0,0 +1,46 @@
+/* mailspool.h -- record the location of the mail spool in MAIL_SPOOL_DIRECTORY
+   Copyright (C) 1986, 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#ifndef _MAILSPOOL_H
+#define _MAILSPOOL_H 1
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+#define NO_SHORTNAMES   /* Tell config not to load remap.h */
+#include <../src/config.h>
+  
+/* Final determination of mail spool location. */
+#ifdef USE_MAIL_SPOOL_DIRECTORY
+#define MAIL_SPOOL_DIRECTORY USE_MAIL_SPOOL_DIRECTORY
+#elif defined(SYSTEM_MAIL_SPOOL_DIRECTORY)
+#define MAIL_SPOOL_DIRECTORY SYSTEM_MAIL_SPOOL_DIRECTORY
+#elif defined(MAILDIR)
+#define MAIL_SPOOL_DIRECTORY MAILDIR
+#elif defined(CONF_MAIL_SPOOL_DIRECTORY)
+#define MAIL_SPOOL_DIRECTORY CONF_MAIL_SPOOL_DIRECTORY
+#endif
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif /* mailspool.h */
--- emacs20-20.7.orig/lib-src/sorted-doc.c
+++ emacs20-20.7/lib-src/sorted-doc.c
@@ -5,11 +5,17 @@
    This version sorts the output by function name.
    */
 
+#include <stdlib.h>
+#include <string.h>
+
 #include <stdio.h>
 #include <ctype.h>
 
+/* This conflicts with glibc 2.2 
 extern char *malloc ();
-char *xmalloc ();
+*/
+
+char *xmalloc();
 
 #define NUL	'\0'
 #define MARKER '\037'
--- emacs20-20.7.orig/lwlib/lwlib-Xaw.c
+++ emacs20-20.7/lwlib/lwlib-Xaw.c
@@ -69,7 +69,7 @@
 		     XtNy, &pos_y,
 		     XtNtopOfThumb, &widget_topOfThumb,
 		     XtNshown, &widget_shown,
-		     0);
+		     NULL);
 
       /*
        * First size and position the scrollbar widget.
@@ -84,7 +84,7 @@
 	  XtVaSetValues (widget,
 			 XtNlength, data->scrollbar_height,
 			 XtNthickness, width,
-			 0);
+			 NULL);
 	}
 
       /*
@@ -137,7 +137,7 @@
       Dimension bw = 0;
       Arg al[3];
 
-      XtVaGetValues (widget, XtNborderWidth, &bw, 0);
+      XtVaGetValues (widget, XtNborderWidth, &bw, NULL);
       if (bw == 0)
 	/* Don't let buttons end up with 0 borderwidth, that's ugly...
 	   Yeah, all this should really be done through app-defaults files
@@ -471,7 +471,7 @@
 
 #if 0
   user_data = NULL;
-  XtVaGetValues (widget, XtNuserData, &user_data, 0);
+  XtVaGetValues (widget, XtNuserData, &user_data, NULL);
 #else
   /* Damn!  Athena doesn't give us a way to hang our own data on the
      buttons, so we have to go find it...  I guess this assumes that
@@ -505,7 +505,7 @@
   Widget widget;
   if (! XtIsSubclass (shell, shellWidgetClass))
     abort ();
-  XtVaGetValues (shell, XtNchildren, &kids, 0);
+  XtVaGetValues (shell, XtNchildren, &kids, NULL);
   if (!kids || !*kids)
     abort ();
   widget = kids [0];
@@ -596,7 +596,7 @@
   Dimension width;
   Widget scrollbar;
 
-  XtVaGetValues (instance->parent, XtNwidth, &width, 0);
+  XtVaGetValues (instance->parent, XtNwidth, &width, NULL);
   
   XtSetArg (av[ac], XtNshowGrip, 0); ac++;
   XtSetArg (av[ac], XtNresizeToPreferred, 1); ac++;
@@ -611,7 +611,7 @@
 
   /* We have to force the border width to be 0 otherwise the
      geometry manager likes to start looping for awhile... */
-  XtVaSetValues (scrollbar, XtNborderWidth, 0, 0);
+  XtVaSetValues (scrollbar, XtNborderWidth, 0, NULL);
 
   XtRemoveAllCallbacks (scrollbar, "jumpProc");
   XtRemoveAllCallbacks (scrollbar, "scrollProc");
--- emacs20-20.7.orig/lwlib/lwlib-Xm.c
+++ emacs20-20.7/lwlib/lwlib-Xm.c
@@ -267,7 +267,7 @@
      Widget widget;
      widget_value* val;
 {
-  XtVaSetValues (widget, XmNalignment, XmALIGNMENT_CENTER, 0);
+  XtVaSetValues (widget, XmNalignment, XmALIGNMENT_CENTER, NULL);
   XtRemoveAllCallbacks (widget, XmNactivateCallback);
   XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance);
 }
@@ -295,7 +295,7 @@
   XtAddCallback (widget, XmNvalueChangedCallback,
 		 xm_internal_update_other_instances, instance);
   XtVaSetValues (widget, XmNset, val->selected,
-		 XmNalignment, XmALIGNMENT_BEGINNING, 0);
+		 XmNalignment, XmALIGNMENT_BEGINNING, NULL);
 }
 
 static void
@@ -323,11 +323,11 @@
       toggle = XtNameToWidget (widget, cur->value);
       if (toggle)
 	{
-	  XtVaSetValues (toggle, XmNsensitive, cur->enabled, 0);
+	  XtVaSetValues (toggle, XmNsensitive, cur->enabled, NULL);
 	  if (!val->value && cur->selected)
-	    XtVaSetValues (toggle, XmNset, cur->selected, 0);
+	    XtVaSetValues (toggle, XmNset, cur->selected, NULL);
 	  if (val->value && strcmp (val->value, cur->value))
-	    XtVaSetValues (toggle, XmNset, False, 0);
+	    XtVaSetValues (toggle, XmNset, False, NULL);
 	}
     }
 
@@ -336,7 +336,7 @@
     {
       toggle = XtNameToWidget (widget, val->value);
       if (toggle)
-	XtVaSetValues (toggle, XmNset, True, 0);
+	XtVaSetValues (toggle, XmNset, True, NULL);
     }
 }
 
@@ -491,7 +491,7 @@
   XtVaSetValues (widget,
 		 XmNsensitive, val->enabled,
 		 XmNuserData, val->call_data,
-		 0);
+		 NULL);
 
   /* update the menu button as a label. */
   if (val->this_one_change >= VISIBLE_CHANGE)
@@ -690,7 +690,7 @@
   XtVaSetValues (widget,
 		 XmNsensitive, val->enabled,
 		 XmNuserData, val->call_data,
-		 0);
+		 NULL);
   
   /* Common to all label like widgets */
   if (XtIsSubclass (widget, xmLabelWidgetClass))
@@ -760,7 +760,7 @@
   
   if (class == xmToggleButtonWidgetClass || class == xmToggleButtonGadgetClass)
     {
-      XtVaGetValues (widget, XmNset, &val->selected, 0);
+      XtVaGetValues (widget, XmNset, &val->selected, NULL);
       val->edited = True;
     }
   else if (class == xmTextWidgetClass)
@@ -795,7 +795,7 @@
 	      int set = False;
 	      Widget toggle = radio->composite.children [i];
 	      
-	      XtVaGetValues (toggle, XmNset, &set, 0);
+	      XtVaGetValues (toggle, XmNset, &set, NULL);
 	      if (set)
 		{
 		  if (val->value)
@@ -1175,9 +1175,9 @@
   Position x;
   Position y;
 
-  XtVaGetValues (widget, XtNwidth, &child_width, XtNheight, &child_height, 0);
+  XtVaGetValues (widget, XtNwidth, &child_width, XtNheight, &child_height, NULL);
   XtVaGetValues (parent, XtNwidth, &parent_width, XtNheight, &parent_height,
-		 0);
+		 NULL);
 
   x = (((Position)parent_width) - ((Position)child_width)) / 2;
   y = (((Position)parent_height) - ((Position)child_height)) / 2;
@@ -1194,7 +1194,7 @@
   if (y < 0)
     y = 0;
 
-  XtVaSetValues (widget, XtNx, x, XtNy, y, 0);
+  XtVaSetValues (widget, XtNx, x, XtNy, y, NULL);
 }
 
 static Widget
@@ -1225,7 +1225,7 @@
       /* shrink the separator label back to their original size */
       separator = XtNameToWidget (widget, "*separator_button");
       if (separator)
-	XtVaSetValues (separator, XtNwidth, 5, XtNheight, 5, 0);
+	XtVaSetValues (separator, XtNwidth, 5, XtNheight, 5, NULL);
 
       /* Center the dialog in its parent */
       recenter_widget (widget);
@@ -1561,7 +1561,7 @@
       else if (event->xbutton.state & Button3Mask) trans = "<Btn3Down>";
       else if (event->xbutton.state & Button2Mask) trans = "<Btn2Down>";
       else if (event->xbutton.state & Button1Mask) trans = "<Btn1Down>";
-      if (trans) XtVaSetValues (widget, XmNmenuPost, trans, 0);
+      if (trans) XtVaSetValues (widget, XmNmenuPost, trans, NULL);
       XmMenuPosition (widget, (XButtonPressedEvent *) event);
     }
   XtManageChild (widget);
@@ -1573,8 +1573,8 @@
 {
   short width;
   short height;
-  XtVaGetValues (w, XmNwidth, &width, XmNheight, &height, 0);
-  XtVaSetValues (w, XmNminWidth, width, XmNminHeight, height, 0);
+  XtVaGetValues (w, XmNwidth, &width, XmNheight, &height, NULL);
+  XtVaSetValues (w, XmNminWidth, width, XmNminHeight, height, NULL);
 }
 
 void
--- emacs20-20.7.orig/lwlib/lwlib.c
+++ emacs20-20.7/lwlib/lwlib.c
@@ -1298,11 +1298,11 @@
   XtVaGetValues (widget_to_invert,
 		 XtNforeground, &foreground,
 		 XtNbackground, &background,
-		 0);
+		 NULL);
   XtVaSetValues (widget_to_invert,
 		 XtNforeground, background,
 		 XtNbackground, foreground,
-		 0);
+		 NULL);
 }
 
 void
--- emacs20-20.7.orig/etc/NEWS
+++ emacs20-20.7/etc/NEWS
@@ -36,6 +36,43 @@
 
 * Changes in Emacs 20.4
 
+** The location of the mail spool has been centralized.
+
+[ This modification is currently only available in the Debian source,
+  but the upstream authors and I are in the process of working out the
+  appropriate upstream patch.  The internals may change, but the
+  user-visible bits should not (i.e the elisp level mail-spool-directory
+  variable and --with-mail-spool-directory should persist). ]
+
+Determination of the location of the mail spool has now been
+centralized.  There is a new lisp-level variable mail-spool-directory
+that should always contain the location of the mail spool (normally a
+directory like /usr/spool/mail).
+
+There is also related configure option --with-mail-spool-directory
+that allows you to override the default mail spool location detected,
+if any, at configure time.  The proper setting for a particular
+architecture may also be set in src/s/*.h with
+SYSTEM_MAIL_SPOOL_DIRECTORY, but note that --with-mail-spool-directory
+always takes precedence.
+
+At the C level, the mail spool directory is available from
+lib-src/mailspool.h which provides a MAIL_SPOOL_DIRECTORY definition.
+
+nnmail, rmail, and movemail have all been modified to respect this new
+arrangement.
+
+** Movemail lock library detection has been improved.
+
+[ This modification is currently only available in the Debian source,
+  but the upstream authors and I are in the process of working out the
+  appropriate upstream patch. ]
+
+Configure now looks for liblockfile before libmail (liblockfile is a
+free software replacement for libmail).  Either library, if found, is
+propagated to the movemail (lib-src) Makefile through the
+MOVEMAIL_LOCK_LIBS variable.
+
 ** Init file may be called .emacs.el.
 
 You can now call the Emacs init file `.emacs.el'.
--- emacs20-20.7.orig/etc/emacs.1
+++ emacs20-20.7/etc/emacs.1
@@ -150,7 +150,7 @@
 window in reverse video.
 .TP
 .B \-i
-Use the "kitchen sink" bitmap icon when iconifying the
+Use the Emacs icon when iconifying the
 .I Emacs
 window.
 .TP
@@ -392,29 +392,29 @@
 manual is also included in the Emacs source distribution.
 .PP
 .SH FILES
-/usr/local/info - files for the Info documentation browser
+/usr/info - files for the Info documentation browser
 (a subsystem of Emacs) to refer to.  Currently not much of Unix
 is documented here, but the complete text of the Emacs reference
 manual is included in a convenient tree structured form.
 
-/usr/local/share/emacs/$VERSION/src - C source files and object files
+/usr/share/emacs/$VERSION/src - C source files and object files
 
-/usr/local/share/emacs/$VERSION/lisp - Lisp source files and compiled files
+/usr/share/emacs/$VERSION/lisp - Lisp source files and compiled files
 that define most editing commands.  Some are preloaded;
 others are autoloaded from this directory when used.
   
-/usr/local/share/emacs/$VERSION/etc - various programs that are used with
+/usr/share/emacs/$VERSION/etc - various programs that are used with
 GNU Emacs, and some files of information.
 
-/usr/local/share/emacs/$VERSION/etc/DOC.* - contains the documentation
+/usr/share/emacs/$VERSION/etc/DOC.* - contains the documentation
 strings for the Lisp primitives and preloaded Lisp functions
 of GNU Emacs.  They are stored here to reduce the size of
 Emacs proper.
 
-/usr/local/share/emacs/$VERSION/etc/OTHER.EMACSES discusses GNU Emacs
+/usr/share/emacs/$VERSION/etc/OTHER.EMACSES discusses GNU Emacs
 vs. other versions of Emacs.
 .br
-/usr/local/share/emacs/$VERSION/etc/SERVICE lists people offering
+/usr/share/emacs/$VERSION/etc/SERVICE lists people offering
 various services to assist users of GNU Emacs, including education,
 troubleshooting, porting and customization.
 .br
@@ -422,7 +422,7 @@
 programs in the Emacs Lisp extension language, which has not yet been fully
 documented.
 
-/usr/local/com/emacs/lock - holds lock files that are made for all
+/usr/com/emacs/lock - holds lock files that are made for all
 files being modified in Emacs, to prevent simultaneous modification
 of one file by two users.
 
@@ -449,7 +449,7 @@
 Send requests to be added to mailing lists to the special list
 info-gnu-emacs-request@prep.ai.mit.edu (or the corresponding UUCP
 address).  For more information about Emacs mailing lists, see the
-file /usr/local/emacs/etc/MAILINGLISTS.  Bugs tend actually to be
+file /usr/emacs/etc/MAILINGLISTS.  Bugs tend actually to be
 fixed if they can be isolated, so it is in your interest to report
 them in such a way that they can be easily reproduced.
 .PP
--- emacs20-20.7.orig/man/emacs.texi
+++ emacs20-20.7/man/emacs.texi
@@ -119,7 +119,7 @@
 Emacs is the extensible, customizable, self-documenting real-time
 display editor.  This Info file describes how to edit with Emacs and
 some of how to customize it; it corresponds to GNU Emacs version 20.7.
-For information on extending Emacs, see @ref{,Emacs Lisp,, elisp, The
+For information on extending Emacs, see @ref{Top, Emacs Lisp,, elisp, The
 Emacs Lisp Reference Manual}.
 @end ifinfo
 
--- emacs20-20.7.orig/configure
+++ emacs20-20.7/configure
@@ -18,6 +18,8 @@
 ac_help="$ac_help
   --with-hesiod           support Hesiod to get the POP server host"
 ac_help="$ac_help
+  --with-mail-spool-directory=DIR   system mail spool is DIR"
+ac_help="$ac_help
   --with-x-toolkit=KIT    use an X toolkit (KIT = yes/lucid/athena/motif/no)"
 ac_help="$ac_help
   --with-x                use the X Window System"
@@ -565,6 +567,15 @@
 
 fi
 
+# Check whether --with-mail-spool-directory or --without-mail-spool-directory was given.
+if test "${with_mail_spool_directory+set}" = set; then
+  withval="$with_mail_spool_directory"
+  cat >> confdefs.h <<EOF
+#define USE_MAIL_SPOOL_DIRECTORY "${withval}"
+EOF
+
+fi
+
 # Check whether --with-x-toolkit or --without-x-toolkit was given.
 if test "${with_x_toolkit+set}" = set; then
   withval="$with_x_toolkit"
@@ -657,7 +668,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:661: checking host system type" >&5
+echo "configure:672: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -796,6 +807,11 @@
     machine=alpha opsys=gnu-linux
   ;;
 
+  ppc-*-linux | \
+  powerpc-*-linux* )
+    machine=powerpc opsys=gnu-linux
+  ;;
+
   arm*-*-linux-gnu* )
     machine=arm opsys=gnu-linux       
   ;;
@@ -1056,6 +1072,9 @@
   hppa*-*-nextstep* )
     machine=hp800 opsys=nextstep
   ;;
+  hppa*-*-linux-gnu* )
+    machine=hp800 opsys=gnu-linux
+  ;;
 
   ## Orion machines
   orion-orion-bsd* )
@@ -1118,6 +1137,10 @@
     machine=ibmrt-aix opsys=usg5-2-2
   ;;
 
+  s390*-*-linux-gnu* )
+    machine=s390 opsys=gnu-linux
+  ;;
+
   ## Integrated Solutions `Optimum V'
   m68*-isi-bsd4.2* )
     machine=isi-ov opsys=bsd4-2
@@ -1493,6 +1516,11 @@
     machine=wicat opsys=usg5-2
   ;;
 
+  ## IA-64
+  ia64*-*-linux* )
+    machine=ia64 opsys=gnu-linux
+  ;;
+
   ## Intel 386 machines where we don't care about the manufacturer
   i[3456]86-*-* )
     machine=intel386
@@ -1534,6 +1562,11 @@
     machine=mips opsys=gnu-linux
   ;;
 
+  ## Mipsel (little endian) Linux-based GNU system
+  mipsel-*-linux-gnu* )
+    machine=mipsel opsys=gnu-linux
+  ;;
+
   ## UXP/DS
   sparc-fujitsu-sysv4* )
     machine=sparc opsys=uxpds
@@ -1613,7 +1646,7 @@
   * ) # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1617: checking for $ac_word" >&5
+echo "configure:1650: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1643,7 +1676,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1647: checking for $ac_word" >&5
+echo "configure:1680: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1694,7 +1727,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1698: checking for $ac_word" >&5
+echo "configure:1731: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1726,7 +1759,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1730: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1763: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1737,12 +1770,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1741 "configure"
+#line 1774 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1768,12 +1801,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1772: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1805: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1777: checking whether we are using GNU C" >&5
+echo "configure:1810: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1782,7 +1815,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1801,7 +1834,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1805: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1838: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1881,7 +1914,7 @@
 #### #undef clause to src/config.h.in for autoconf to modify.
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1885: checking whether ln -s works" >&5
+echo "configure:1918: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1902,7 +1935,7 @@
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1906: checking how to run the C preprocessor" >&5
+echo "configure:1939: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1917,13 +1950,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1921 "configure"
+#line 1954 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1934,13 +1967,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1938 "configure"
+#line 1971 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1944: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1951,13 +1984,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1955 "configure"
+#line 1988 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1993,7 +2026,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1997: checking for a BSD compatible install" >&5
+echo "configure:2030: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2050,7 +2083,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2054: checking for $ac_word" >&5
+echo "configure:2087: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2082,9 +2115,9 @@
 
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:2086: checking for AIX" >&5
+echo "configure:2119: checking for AIX" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2088 "configure"
+#line 2121 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -2110,17 +2143,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2114: checking for $ac_hdr" >&5
+echo "configure:2147: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2119 "configure"
+#line 2152 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2147,12 +2180,12 @@
 done
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2151: checking for ANSI C header files" >&5
+echo "configure:2184: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2156 "configure"
+#line 2189 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2160,7 +2193,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2177,7 +2210,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2181 "configure"
+#line 2214 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2195,7 +2228,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2199 "configure"
+#line 2232 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2216,7 +2249,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2220 "configure"
+#line 2253 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2227,7 +2260,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2251,12 +2284,12 @@
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2255: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2288: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2260 "configure"
+#line 2293 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -2265,7 +2298,7 @@
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:2269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -2286,12 +2319,12 @@
 fi
 
 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
-echo "configure:2290: checking for sys_siglist declaration in signal.h or unistd.h" >&5
+echo "configure:2323: checking for sys_siglist declaration in signal.h or unistd.h" >&5
 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2295 "configure"
+#line 2328 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -2303,7 +2336,7 @@
 char *msg = *(sys_siglist + 1);
 ; return 0; }
 EOF
-if { (eval echo configure:2307: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_decl_sys_siglist=yes
 else
@@ -2325,12 +2358,12 @@
 
 
 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
-echo "configure:2329: checking for struct utimbuf" >&5
+echo "configure:2362: checking for struct utimbuf" >&5
 if eval "test \"`echo '$''{'emacs_cv_struct_utimbuf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2334 "configure"
+#line 2367 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -2349,7 +2382,7 @@
 static struct utimbuf x; x.actime = x.modtime;
 ; return 0; }
 EOF
-if { (eval echo configure:2353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   emacs_cv_struct_utimbuf=yes
 else
@@ -2370,12 +2403,12 @@
 fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2374: checking return type of signal handlers" >&5
+echo "configure:2407: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2379 "configure"
+#line 2412 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -2392,7 +2425,7 @@
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:2396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -2412,12 +2445,12 @@
 
 
 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
-echo "configure:2416: checking for struct timeval" >&5
+echo "configure:2449: checking for struct timeval" >&5
 if eval "test \"`echo '$''{'emacs_cv_struct_timeval'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2421 "configure"
+#line 2454 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -2433,7 +2466,7 @@
 static struct timeval x; x.tv_sec = x.tv_usec;
 ; return 0; }
 EOF
-if { (eval echo configure:2437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   emacs_cv_struct_timeval=yes
 else
@@ -2455,12 +2488,12 @@
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:2459: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:2492: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2464 "configure"
+#line 2497 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -2468,7 +2501,7 @@
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:2472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -2489,12 +2522,12 @@
 fi
 
 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:2493: checking for tm_zone in struct tm" >&5
+echo "configure:2526: checking for tm_zone in struct tm" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2498 "configure"
+#line 2531 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
@@ -2502,7 +2535,7 @@
 struct tm tm; tm.tm_zone;
 ; return 0; }
 EOF
-if { (eval echo configure:2506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm_zone=yes
 else
@@ -2522,12 +2555,12 @@
 
 else
   echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:2526: checking for tzname" >&5
+echo "configure:2559: checking for tzname" >&5
 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2531 "configure"
+#line 2564 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
@@ -2537,7 +2570,7 @@
 atoi(*tzname);
 ; return 0; }
 EOF
-if { (eval echo configure:2541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_var_tzname=yes
 else
@@ -2560,12 +2593,12 @@
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2564: checking for working const" >&5
+echo "configure:2597: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2569 "configure"
+#line 2602 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2614,7 +2647,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2636,7 +2669,7 @@
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:2640: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:2673: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2664,7 +2697,7 @@
 
 
 echo $ac_n "checking for long file names""... $ac_c" 1>&6
-echo "configure:2668: checking for long file names" >&5
+echo "configure:2701: checking for long file names" >&5
 if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2715,7 +2748,7 @@
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:2719: checking for X" >&5
+echo "configure:2752: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -2777,12 +2810,12 @@
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 2781 "configure"
+#line 2814 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2851,14 +2884,14 @@
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2855 "configure"
+#line 2888 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:2862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -3033,7 +3066,7 @@
 echo "checking the machine- and system-dependent files to find out
  - which libraries the lib-src programs will want, and
  - whether the GNU malloc routines are usable" 1>&6
-echo "configure:3037: checking the machine- and system-dependent files to find out
+echo "configure:3070: checking the machine- and system-dependent files to find out
  - which libraries the lib-src programs will want, and
  - whether the GNU malloc routines are usable" >&5
 
@@ -3163,12 +3196,12 @@
 GNU_MALLOC=yes
 doug_lea_malloc=yes
 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
-echo "configure:3167: checking for malloc_get_state" >&5
+echo "configure:3200: checking for malloc_get_state" >&5
 if eval "test \"`echo '$''{'ac_cv_func_malloc_get_state'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3172 "configure"
+#line 3205 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char malloc_get_state(); below.  */
@@ -3191,7 +3224,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_malloc_get_state=yes"
 else
@@ -3212,12 +3245,12 @@
 fi
 
 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
-echo "configure:3216: checking for malloc_set_state" >&5
+echo "configure:3249: checking for malloc_set_state" >&5
 if eval "test \"`echo '$''{'ac_cv_func_malloc_set_state'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3221 "configure"
+#line 3254 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char malloc_set_state(); below.  */
@@ -3240,7 +3273,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_malloc_set_state=yes"
 else
@@ -3261,19 +3294,19 @@
 fi
 
 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
-echo "configure:3265: checking whether __after_morecore_hook exists" >&5
+echo "configure:3298: checking whether __after_morecore_hook exists" >&5
 if eval "test \"`echo '$''{'emacs_cv_var___after_morecore_hook'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3270 "configure"
+#line 3303 "configure"
 #include "confdefs.h"
 extern void (* __after_morecore_hook)();
 int main() {
 __after_morecore_hook = 0
 ; return 0; }
 EOF
-if { (eval echo configure:3277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   emacs_cv_var___after_morecore_hook=yes
 else
@@ -3323,7 +3356,7 @@
 LIBS="$libsrc_libs $LIBS"
 
 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:3327: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:3360: checking for dnet_ntoa in -ldnet" >&5
 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3331,7 +3364,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3335 "configure"
+#line 3368 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3342,7 +3375,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:3346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3371,7 +3404,7 @@
 
 
 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
-echo "configure:3375: checking for main in -lXbsd" >&5
+echo "configure:3408: checking for main in -lXbsd" >&5
 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3379,14 +3412,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lXbsd  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3383 "configure"
+#line 3416 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3408,7 +3441,7 @@
 
 
 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
-echo "configure:3412: checking for cma_open in -lpthreads" >&5
+echo "configure:3445: checking for cma_open in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3416,7 +3449,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lpthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3420 "configure"
+#line 3453 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3427,7 +3460,7 @@
 cma_open()
 ; return 0; }
 EOF
-if { (eval echo configure:3431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3456,7 +3489,7 @@
 
 
 echo $ac_n "checking for XFree86 in /usr/X386""... $ac_c" 1>&6
-echo "configure:3460: checking for XFree86 in /usr/X386" >&5
+echo "configure:3493: checking for XFree86 in /usr/X386" >&5
 if test -d /usr/X386/include; then
   HAVE_XFREE386=yes
   : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
@@ -3485,16 +3518,16 @@
 
   if test "${opsys}" = "gnu-linux"; then
     echo $ac_n "checking whether X on GNU/Linux needs -b to link""... $ac_c" 1>&6
-echo "configure:3489: checking whether X on GNU/Linux needs -b to link" >&5
+echo "configure:3522: checking whether X on GNU/Linux needs -b to link" >&5
     cat > conftest.$ac_ext <<EOF
-#line 3491 "configure"
+#line 3524 "configure"
 #include "confdefs.h"
 
 int main() {
 XOpenDisplay ("foo");
 ; return 0; }
 EOF
-if { (eval echo configure:3498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   xlinux_first_failure=no
 else
@@ -3514,14 +3547,14 @@
       CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
       LIBS="$LIBS -b i486-linuxaout"
       cat > conftest.$ac_ext <<EOF
-#line 3518 "configure"
+#line 3551 "configure"
 #include "confdefs.h"
 
 int main() {
 XOpenDisplay ("foo");
 ; return 0; }
 EOF
-if { (eval echo configure:3525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   xlinux_second_failure=no
 else
@@ -3551,12 +3584,12 @@
 XScreenNumberOfScreen XSetWMProtocols
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3555: checking for $ac_func" >&5
+echo "configure:3588: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3560 "configure"
+#line 3593 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3579,7 +3612,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3607,12 +3640,12 @@
 
 if test "${window_system}" = "x11"; then
   echo $ac_n "checking X11 version 6""... $ac_c" 1>&6
-echo "configure:3611: checking X11 version 6" >&5
+echo "configure:3644: checking X11 version 6" >&5
   if eval "test \"`echo '$''{'emacs_cv_x11_version_6'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3616 "configure"
+#line 3649 "configure"
 #include "confdefs.h"
 #include <X11/Xlib.h>
 int main() {
@@ -3622,7 +3655,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   emacs_cv_x11_version_6=yes
 else
@@ -3647,12 +3680,12 @@
 
 if test "${window_system}" = "x11"; then
   echo $ac_n "checking X11 version 5""... $ac_c" 1>&6
-echo "configure:3651: checking X11 version 5" >&5
+echo "configure:3684: checking X11 version 5" >&5
   if eval "test \"`echo '$''{'emacs_cv_x11_version_5'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3656 "configure"
+#line 3689 "configure"
 #include "confdefs.h"
 #include <X11/Xlib.h>
 int main() {
@@ -3662,7 +3695,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   emacs_cv_x11_version_5=yes
 else
@@ -3690,12 +3723,12 @@
 if test x"${USE_X_TOOLKIT}" = xmaybe; then
   if test x"${HAVE_X11R5}" = xyes; then
     echo $ac_n "checking X11 version 5 with Xaw""... $ac_c" 1>&6
-echo "configure:3694: checking X11 version 5 with Xaw" >&5
+echo "configure:3727: checking X11 version 5 with Xaw" >&5
     if eval "test \"`echo '$''{'emacs_cv_x11_version_5_with_xaw'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3699 "configure"
+#line 3732 "configure"
 #include "confdefs.h"
 
 #include <X11/Intrinsic.h>
@@ -3704,7 +3737,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   emacs_cv_x11_version_5_with_xaw=yes
 else
@@ -3732,12 +3765,12 @@
 
 if test "${USE_X_TOOLKIT}" != "none"; then
   echo $ac_n "checking X11 toolkit version""... $ac_c" 1>&6
-echo "configure:3736: checking X11 toolkit version" >&5
+echo "configure:3769: checking X11 toolkit version" >&5
   if eval "test \"`echo '$''{'emacs_cv_x11_toolkit_version_6'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3741 "configure"
+#line 3774 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 int main() {
@@ -3747,7 +3780,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   emacs_cv_x11_toolkit_version_6=yes
 else
@@ -3777,7 +3810,7 @@
     LIBS="-lXt $LIBS"
   fi
   echo $ac_n "checking for XmuConvertStandardSelection in -lXmu""... $ac_c" 1>&6
-echo "configure:3781: checking for XmuConvertStandardSelection in -lXmu" >&5
+echo "configure:3814: checking for XmuConvertStandardSelection in -lXmu" >&5
 ac_lib_var=`echo Xmu'_'XmuConvertStandardSelection | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3785,7 +3818,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lXmu  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3789 "configure"
+#line 3822 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3796,7 +3829,7 @@
 XmuConvertStandardSelection()
 ; return 0; }
 EOF
-if { (eval echo configure:3800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3828,12 +3861,12 @@
 
 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
   echo $ac_n "checking for Motif version 2.1""... $ac_c" 1>&6
-echo "configure:3832: checking for Motif version 2.1" >&5
+echo "configure:3865: checking for Motif version 2.1" >&5
 if eval "test \"`echo '$''{'emacs_cv_motif_version_2_1'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3837 "configure"
+#line 3870 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 int main() {
@@ -3844,7 +3877,7 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   emacs_cv_motif_version_2_1=yes
 else
@@ -3864,7 +3897,7 @@
 EOF
 
     echo $ac_n "checking for XpCreateContext in -lXp""... $ac_c" 1>&6
-echo "configure:3868: checking for XpCreateContext in -lXp" >&5
+echo "configure:3901: checking for XpCreateContext in -lXp" >&5
 ac_lib_var=`echo Xp'_'XpCreateContext | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3872,7 +3905,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lXp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3876 "configure"
+#line 3909 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3883,7 +3916,7 @@
 XpCreateContext()
 ; return 0; }
 EOF
-if { (eval echo configure:3887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3915,19 +3948,19 @@
 
 # If netdb.h doesn't declare h_errno, we must declare it by hand.
 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
-echo "configure:3919: checking whether netdb declares h_errno" >&5
+echo "configure:3952: checking whether netdb declares h_errno" >&5
 if eval "test \"`echo '$''{'emacs_cv_netdb_declares_h_errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3924 "configure"
+#line 3957 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 return h_errno;
 ; return 0; }
 EOF
-if { (eval echo configure:3931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   emacs_cv_netdb_declares_h_errno=yes
 else
@@ -3950,19 +3983,19 @@
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:3954: checking for working alloca.h" >&5
+echo "configure:3987: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3959 "configure"
+#line 3992 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:3966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -3983,12 +4016,12 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:3987: checking for alloca" >&5
+echo "configure:4020: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3992 "configure"
+#line 4025 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -4016,7 +4049,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:4020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -4048,12 +4081,12 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:4052: checking whether alloca needs Cray hooks" >&5
+echo "configure:4085: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4057 "configure"
+#line 4090 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -4078,12 +4111,12 @@
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4082: checking for $ac_func" >&5
+echo "configure:4115: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4087 "configure"
+#line 4120 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4106,7 +4139,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4133,7 +4166,7 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:4137: checking stack direction for C alloca" >&5
+echo "configure:4170: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4141,7 +4174,7 @@
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 4145 "configure"
+#line 4178 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -4160,7 +4193,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:4164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -4185,7 +4218,7 @@
 # fmod, logb, and frexp are found in -lm on most systems.
 # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
 echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6
-echo "configure:4189: checking for sqrt in -lm" >&5
+echo "configure:4222: checking for sqrt in -lm" >&5
 ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4193,7 +4226,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4197 "configure"
+#line 4230 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4204,7 +4237,7 @@
 sqrt()
 ; return 0; }
 EOF
-if { (eval echo configure:4208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4232,9 +4265,138 @@
 fi
 
 
-# Check for mail-locking functions in a "mail" library
-echo $ac_n "checking for maillock in -lmail""... $ac_c" 1>&6
-echo "configure:4238: checking for maillock in -lmail" >&5
+# Check for mail-locking functions in a "mail" library Check for
+# lockfile first, a free replacement for -lmail.  We use AC_CHECK_LIB
+# for touchlock because we don't want to have to put the lock libs
+# into LIBS and AC_CHECK_FUNCS would require that.
+
+echo $ac_n "checking for maillock in -llockfile""... $ac_c" 1>&6
+echo "configure:4275: checking for maillock in -llockfile" >&5
+ac_lib_var=`echo lockfile'_'maillock | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-llockfile  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4283 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char maillock();
+
+int main() {
+maillock()
+; return 0; }
+EOF
+if { (eval echo configure:4294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+   cat >> confdefs.h <<\EOF
+#define HAVE_LIBMAIL 1
+EOF
+
+    MOVEMAIL_LOCK_LIBS="-llockfile"
+    echo $ac_n "checking for touchlock in -llockfile""... $ac_c" 1>&6
+echo "configure:4315: checking for touchlock in -llockfile" >&5
+ac_lib_var=`echo lockfile'_'touchlock | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-llockfile  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4323 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char touchlock();
+
+int main() {
+touchlock()
+; return 0; }
+EOF
+if { (eval echo configure:4334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_TOUCHLOCK 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    for ac_hdr in maillock.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4361: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4366 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ 
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+else
+  echo "$ac_t""no" 1>&6
+ echo $ac_n "checking for maillock in -lmail""... $ac_c" 1>&6
+echo "configure:4400: checking for maillock in -lmail" >&5
 ac_lib_var=`echo mail'_'maillock | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4242,7 +4404,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lmail  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4246 "configure"
+#line 4408 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4253,7 +4415,7 @@
 maillock()
 ; return 0; }
 EOF
-if { (eval echo configure:4257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4268,19 +4430,63 @@
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
+   cat >> confdefs.h <<\EOF
 #define HAVE_LIBMAIL 1
 EOF
 
-	     for ac_func in touchlock
+               MOVEMAIL_LOCK_LIBS="-lmail"
+               echo $ac_n "checking for touchlock in -lmail""... $ac_c" 1>&6
+echo "configure:4440: checking for touchlock in -lmail" >&5
+ac_lib_var=`echo mail'_'touchlock | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lmail  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4448 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char touchlock();
+
+int main() {
+touchlock()
+; return 0; }
+EOF
+if { (eval echo configure:4459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_TOUCHLOCK 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+	       for ac_func in touchlock
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4279: checking for $ac_func" >&5
+echo "configure:4485: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4284 "configure"
+#line 4490 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4303,7 +4509,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4327,21 +4533,21 @@
 fi
 done
 
-	     for ac_hdr in maillock.h
+	       for ac_hdr in maillock.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4335: checking for $ac_hdr" >&5
+echo "configure:4541: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4340 "configure"
+#line 4546 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4551: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4371,6 +4577,68 @@
   echo "$ac_t""no" 1>&6
 fi
 
+fi
+
+
+
+# Tests borrowed (and slightly rearranged) from old paths.el
+# rmail-spool-directory tests.  They should be in the order most
+# likely to get the right answer.  You can always override them on the
+# system level in src/s/* and on a one-shot basis with
+# --with-mail-spool-directory.
+
+echo $ac_n "checking for mail spool location""... $ac_c" 1>&6
+echo "configure:4592: checking for mail spool location" >&5
+if test "${with_mail_spool+set}" = set; then
+  echo "$ac_t""${with_mail_spool}" 1>&6
+elif test -d /var/mail/; then
+  cat >> confdefs.h <<EOF
+#define CONF_MAIL_SPOOL_DIRECTORY "/var/mail"
+EOF
+
+  echo "$ac_t"""/var/mail"" 1>&6
+elif test -d /var/spool/mail/; then
+  cat >> confdefs.h <<EOF
+#define CONF_MAIL_SPOOL_DIRECTORY "/var/spool/mail"
+EOF
+
+  echo "$ac_t"""/var/spool/mail"" 1>&6
+elif test -d /usr/mail/; then
+  cat >> confdefs.h <<EOF
+#define CONF_MAIL_SPOOL_DIRECTORY "/usr/mail"
+EOF
+
+  echo "$ac_t"""/usr/mail"" 1>&6
+elif test -d /usr/spool/mail/; then
+  cat >> confdefs.h <<EOF
+#define CONF_MAIL_SPOOL_DIRECTORY "/usr/spool/mail"
+EOF
+
+  echo "$ac_t"""/usr/spool/mail"" 1>&6
+else
+  echo "$ac_t""not found" 1>&6
+fi
+
+# Find the location of "mail".  This is critical for fakemail at
+# least.  before fakemail would silently fail if this was wrong, so
+# insist on finding it.
+echo $ac_n "checking for mail binary""... $ac_c" 1>&6
+echo "configure:4627: checking for mail binary" >&5
+if test -x /bin/mail; then
+  cat >> confdefs.h <<EOF
+#define CONF_MAIL_PROGRAM_NAME "/bin/mail"
+EOF
+
+  echo "$ac_t"""/bin/mail"" 1>&6
+elif test -x /usr/bin/mail; then
+  cat >> confdefs.h <<EOF
+#define CONF_MAIL_PROGRAM_NAME "/usr/bin/mail"
+EOF
+
+  echo "$ac_t"""/usr/bin/mail"" 1>&6
+else
+  { echo "configure: error: could not find mail binary" 1>&2; exit 1; }
+fi
 
 for ac_func in gettimeofday gethostname getdomainname dup2 \
 rename closedir mkdir rmdir sysinfo \
@@ -4379,12 +4647,12 @@
 utimes setrlimit setpgid getcwd shutdown strftime
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4383: checking for $ac_func" >&5
+echo "configure:4651: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4388 "configure"
+#line 4656 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4407,7 +4675,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4436,12 +4704,12 @@
 for ac_func in grantpt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4440: checking for $ac_func" >&5
+echo "configure:4708: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4445 "configure"
+#line 4713 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4464,7 +4732,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4493,12 +4761,12 @@
 for ac_func in getpt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4497: checking for $ac_func" >&5
+echo "configure:4765: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4502 "configure"
+#line 4770 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4521,7 +4789,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4551,7 +4819,7 @@
 # It's better to believe a function is not available
 # than to expect to find it in ncurses.
 echo $ac_n "checking for tparm in -lncurses""... $ac_c" 1>&6
-echo "configure:4555: checking for tparm in -lncurses" >&5
+echo "configure:4823: checking for tparm in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'tparm | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4559,7 +4827,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4563 "configure"
+#line 4831 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4570,7 +4838,7 @@
 tparm()
 ; return 0; }
 EOF
-if { (eval echo configure:4574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4601,7 +4869,7 @@
 # Solaris requires -lintl if you want strerror (which calls dgettext)
 # to return localized messages.
 echo $ac_n "checking for dgettext in -lintl""... $ac_c" 1>&6
-echo "configure:4605: checking for dgettext in -lintl" >&5
+echo "configure:4873: checking for dgettext in -lintl" >&5
 ac_lib_var=`echo intl'_'dgettext | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4609,7 +4877,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4613 "configure"
+#line 4881 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4620,7 +4888,7 @@
 dgettext()
 ; return 0; }
 EOF
-if { (eval echo configure:4624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4649,7 +4917,7 @@
 
 
 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
-echo "configure:4653: checking whether localtime caches TZ" >&5
+echo "configure:4921: checking whether localtime caches TZ" >&5
 if eval "test \"`echo '$''{'emacs_cv_localtime_cache'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4659,7 +4927,7 @@
 emacs_cv_localtime_cache=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 4663 "configure"
+#line 4931 "configure"
 #include "confdefs.h"
 #include <time.h>
 #if STDC_HEADERS
@@ -4694,7 +4962,7 @@
   exit (0);
 }
 EOF
-if { (eval echo configure:4698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   emacs_cv_localtime_cache=no
 else
@@ -4722,12 +4990,12 @@
 
 if test "x$HAVE_TIMEVAL" = xyes; then
 echo $ac_n "checking whether gettimeofday can accept two arguments""... $ac_c" 1>&6
-echo "configure:4726: checking whether gettimeofday can accept two arguments" >&5
+echo "configure:4994: checking whether gettimeofday can accept two arguments" >&5
 if eval "test \"`echo '$''{'emacs_cv_gettimeofday_two_arguments'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4731 "configure"
+#line 4999 "configure"
 #include "confdefs.h"
 
 #ifdef TIME_WITH_SYS_TIME
@@ -4749,7 +5017,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   emacs_cv_gettimeofday_two_arguments=yes
 else
@@ -4772,12 +5040,12 @@
 
 ok_so_far=yes
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:4776: checking for socket" >&5
+echo "configure:5044: checking for socket" >&5
 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4781 "configure"
+#line 5049 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -4800,7 +5068,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -4823,17 +5091,17 @@
 if test $ok_so_far = yes; then
   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
-echo "configure:4827: checking for netinet/in.h" >&5
+echo "configure:5095: checking for netinet/in.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4832 "configure"
+#line 5100 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4859,17 +5127,17 @@
 if test $ok_so_far = yes; then
   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
-echo "configure:4863: checking for arpa/inet.h" >&5
+echo "configure:5131: checking for arpa/inet.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4868 "configure"
+#line 5136 "configure"
 #include "confdefs.h"
 #include <arpa/inet.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4949,6 +5217,7 @@
 
 
 
+
 cat >> confdefs.h <<EOF
 #define EMACS_CONFIGURATION "${canonical}"
 EOF
@@ -5233,6 +5502,7 @@
 s%@machfile@%$machfile%g
 s%@opsysfile@%$opsysfile%g
 s%@RANLIB@%$RANLIB%g
+s%@MOVEMAIL_LOCK_LIBS@%$MOVEMAIL_LOCK_LIBS%g
 
 CEOF
 EOF
--- emacs20-20.7.orig/configure.in
+++ emacs20-20.7/configure.in
@@ -42,6 +42,9 @@
 AC_ARG_WITH(hesiod,
 [  --with-hesiod           support Hesiod to get the POP server host],
 [AC_DEFINE(HESIOD)])
+AC_ARG_WITH(mail-spool-directory,
+[  --with-mail-spool-directory=DIR   system mail spool is DIR],
+[AC_DEFINE_UNQUOTED(USE_MAIL_SPOOL_DIRECTORY,"${withval}")])
 dnl This should be the last --with option, because --with-x is
 dnl added later on when we find the path of X, and it's best to
 dnl keep them together visually.
@@ -236,6 +239,11 @@
     machine=alpha opsys=gnu-linux
   ;;
 
+  ppc-*-linux | \
+  powerpc-*-linux* )
+    machine=powerpc opsys=gnu-linux
+  ;;
+
   arm*-*-linux-gnu* )
     machine=arm opsys=gnu-linux       
   ;;
@@ -496,6 +504,9 @@
   hppa*-*-nextstep* )
     machine=hp800 opsys=nextstep
   ;;
+  hppa*-*-linux-gnu* )
+    machine=hp800 opsys=gnu-linux
+  ;;
 
   ## Orion machines
   orion-orion-bsd* )
@@ -558,6 +569,10 @@
     machine=ibmrt-aix opsys=usg5-2-2
   ;;
 
+  s390*-*-linux-gnu* )
+    machine=s390 opsys=gnu-linux
+  ;;
+
   ## Integrated Solutions `Optimum V'
   m68*-isi-bsd4.2* )
     machine=isi-ov opsys=bsd4-2
@@ -933,6 +948,11 @@
     machine=wicat opsys=usg5-2
   ;;
 
+  ## IA-64
+  ia64*-*-linux* )
+    machine=ia64 opsys=gnu-linux
+  ;;
+
   ## Intel 386 machines where we don't care about the manufacturer
   i[3456]86-*-* )
     machine=intel386
@@ -974,6 +994,11 @@
     machine=mips opsys=gnu-linux
   ;;
 
+  ## Mipsel (little endian) Linux-based GNU system
+  mipsel-*-linux-gnu* )
+    machine=mipsel opsys=gnu-linux
+  ;;
+
   ## UXP/DS
   sparc-fujitsu-sysv4* )
     machine=sparc opsys=uxpds
@@ -1629,11 +1654,62 @@
 # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
 AC_CHECK_LIB(m, sqrt)
 
-# Check for mail-locking functions in a "mail" library
-AC_CHECK_LIB(mail, maillock,
-	     AC_DEFINE(HAVE_LIBMAIL)
-	     AC_CHECK_FUNCS(touchlock)
-	     AC_CHECK_HEADERS(maillock.h))
+# Check for mail-locking functions in a "mail" library Check for
+# lockfile first, a free replacement for -lmail.  We use AC_CHECK_LIB
+# for touchlock because we don't want to have to put the lock libs
+# into LIBS and AC_CHECK_FUNCS would require that.
+
+AC_CHECK_LIB(lockfile, maillock,
+  [ AC_DEFINE(HAVE_LIBMAIL)
+    MOVEMAIL_LOCK_LIBS="-llockfile"
+    AC_CHECK_LIB(lockfile, touchlock, AC_DEFINE(HAVE_TOUCHLOCK))
+    AC_CHECK_HEADERS(maillock.h)],
+    [ AC_CHECK_LIB(mail, maillock,
+	     [ AC_DEFINE(HAVE_LIBMAIL)
+               MOVEMAIL_LOCK_LIBS="-lmail"
+               AC_CHECK_LIB(mail, touchlock, AC_DEFINE(HAVE_TOUCHLOCK))
+	       AC_CHECK_FUNCS(touchlock)
+	       AC_CHECK_HEADERS(maillock.h)])])
+
+
+# Tests borrowed (and slightly rearranged) from old paths.el
+# rmail-spool-directory tests.  They should be in the order most
+# likely to get the right answer.  You can always override them on the
+# system level in src/s/* and on a one-shot basis with
+# --with-mail-spool-directory.
+
+AC_MSG_CHECKING(for mail spool location)
+if test "${with_mail_spool+set}" = set; then
+  AC_MSG_RESULT(${with_mail_spool})
+elif test -d /var/mail/; then
+  AC_DEFINE_UNQUOTED(CONF_MAIL_SPOOL_DIRECTORY, "/var/mail")
+  AC_MSG_RESULT("/var/mail")
+elif test -d /var/spool/mail/; then
+  AC_DEFINE_UNQUOTED(CONF_MAIL_SPOOL_DIRECTORY, "/var/spool/mail")
+  AC_MSG_RESULT("/var/spool/mail")
+elif test -d /usr/mail/; then
+  AC_DEFINE_UNQUOTED(CONF_MAIL_SPOOL_DIRECTORY, "/usr/mail")
+  AC_MSG_RESULT("/usr/mail")
+elif test -d /usr/spool/mail/; then
+  AC_DEFINE_UNQUOTED(CONF_MAIL_SPOOL_DIRECTORY, "/usr/spool/mail")
+  AC_MSG_RESULT("/usr/spool/mail")
+else
+  AC_MSG_RESULT(not found)
+fi
+
+# Find the location of "mail".  This is critical for fakemail at
+# least.  before fakemail would silently fail if this was wrong, so
+# insist on finding it.
+AC_MSG_CHECKING(for mail binary)
+if test -x /bin/mail; then
+  AC_DEFINE_UNQUOTED(CONF_MAIL_PROGRAM_NAME, "/bin/mail")
+  AC_MSG_RESULT("/bin/mail")
+elif test -x /usr/bin/mail; then
+  AC_DEFINE_UNQUOTED(CONF_MAIL_PROGRAM_NAME, "/usr/bin/mail")
+  AC_MSG_RESULT("/usr/bin/mail")
+else
+  AC_MSG_ERROR(could not find mail binary)
+fi
 
 AC_CHECK_FUNCS(gettimeofday gethostname getdomainname dup2 \
 rename closedir mkdir rmdir sysinfo \
@@ -1791,6 +1867,7 @@
 AC_SUBST(machfile)
 AC_SUBST(opsysfile)
 AC_SUBST(RANLIB)
+AC_SUBST(MOVEMAIL_LOCK_LIBS)
 
 AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION,  "${canonical}")
 AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}")
--- emacs20-20.7.orig/config.guess
+++ emacs20-20.7/config.guess
@@ -1,8 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
 #   Free Software Foundation, Inc.
-#
+
+timestamp='2001-11-08'
+
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
@@ -22,52 +24,195 @@
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# Written by Per Bothner <bothner@cygnus.com>.
-# The master version of this file is at the FSF in /home/gd/gnu/lib.
-# Please send patches to the Autoconf mailing list <autoconf@gnu.org>.
+# Originally written by Per Bothner <bothner@cygnus.com>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
 #
 # This script attempts to guess a canonical system name similar to
 # config.sub.  If it succeeds, it prints the system name on stdout, and
 # exits with 0.  Otherwise, it exits with 1.
 #
 # The plan is that this can be called by configure scripts if you
-# don't specify an explicit system type (host/target name).
-#
-# Only a few systems have been added to this list; please add others
-# (but try to keep the structure clean).
-#
+# don't specify an explicit build system type.
 
-# Use $HOST_CC if defined. $CC may point to a cross-compiler
-if test x"$CC_FOR_BUILD" = x; then
-  if test x"$HOST_CC" != x; then
-    CC_FOR_BUILD="$HOST_CC"
-  else
-    if test x"$CC" != x; then
-      CC_FOR_BUILD="$CC"
-    else
-      CC_FOR_BUILD=cc
-    fi
-  fi
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
 fi
 
 
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script.
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int dummy(){}" > $dummy.c ;
+	for c in cc gcc c89 ; do
+	  ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
+	  if test $? = 0 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	rm -f $dummy.c $dummy.o $dummy.rel ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac'
+
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 8/24/94.)
+# (ghazi@noc.rutgers.edu 1994-08-24)
 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
 	PATH=$PATH:/.attbin ; export PATH
 fi
 
 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-dummy=dummy-$$
-trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
-
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# NetBSD (nbsd) targets should (where applicable) match one or
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	# Determine the machine/vendor (is the vendor relevant).
+	case "${UNAME_MACHINE}" in
+	    amiga) machine=m68k-unknown ;;
+	    arm32) machine=arm-unknown ;;
+	    atari*) machine=m68k-atari ;;
+	    sun3*) machine=m68k-sun ;;
+	    mac68k) machine=m68k-apple ;;
+	    macppc) machine=powerpc-apple ;;
+	    hp3[0-9][05]) machine=m68k-hp ;;
+	    ibmrt|romp-ibm) machine=romp-ibm ;;
+	    sparc*) machine=`uname -p`-unknown ;;
+	    *) machine=${UNAME_MACHINE}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE}" in
+	    i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep __ELF__ >/dev/null
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+	        os=netbsd
+		;;
+	esac
+	# The OS release
+	release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit 0 ;;
+    amiga:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    arc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    hp300:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mac68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    macppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme88k:OpenBSD:*:*)
+	echo m88k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvmeppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    pmax:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sgi:OpenBSD:*:*)
+	echo mipseb-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sun3:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    wgrisc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    *:OpenBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
     alpha:OSF1:*:*)
 	if test $UNAME_RELEASE = "V4.0"; then
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -77,41 +222,55 @@
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
 	cat <<EOF >$dummy.s
+	.data
+\$Lformat:
+	.byte 37,100,45,37,120,10,0	# "%d-%x\n"
+
+	.text
 	.globl main
+	.align 4
 	.ent main
 main:
-	.frame \$30,0,\$26,0
-	.prologue 0
-	.long 0x47e03d80 # implver $0
-	lda \$2,259
-	.long 0x47e20c21 # amask $2,$1
-	srl \$1,8,\$2
-	sll \$2,2,\$2
-	sll \$0,3,\$0
-	addl \$1,\$0,\$0
-	addl \$2,\$0,\$0
-	ret \$31,(\$26),1
+	.frame \$30,16,\$26,0
+	ldgp \$29,0(\$27)
+	.prologue 1
+	.long 0x47e03d80 # implver \$0
+	lda \$2,-1
+	.long 0x47e20c21 # amask \$2,\$1
+	lda \$16,\$Lformat
+	mov \$0,\$17
+	not \$1,\$18
+	jsr \$26,printf
+	ldgp \$29,0(\$26)
+	mov 0,\$16
+	jsr \$26,exit
 	.end main
 EOF
+	eval $set_cc_for_build
 	$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
 	if test "$?" = 0 ; then
-		./$dummy
-		case "$?" in
-			7)
+		case `./$dummy` in
+			0-0)
 				UNAME_MACHINE="alpha"
 				;;
-			15)
+			1-0)
 				UNAME_MACHINE="alphaev5"
 				;;
-			14)
+			1-1)
 				UNAME_MACHINE="alphaev56"
 				;;
-			10)
+			1-101)
 				UNAME_MACHINE="alphapca56"
 				;;
-			16)
+			2-303)
 				UNAME_MACHINE="alphaev6"
 				;;
+			2-307)
+				UNAME_MACHINE="alphaev67"
+				;;
+			2-1307)
+				UNAME_MACHINE="alphaev68"
+				;;
 		esac
 	fi
 	rm -f $dummy.s $dummy
@@ -127,42 +286,18 @@
 	echo alpha-dec-winnt3.5
 	exit 0 ;;
     Amiga*:UNIX_System_V:4.0:*)
-	echo m68k-cbm-sysv4
+	echo m68k-unknown-sysv4
 	exit 0;;
-    amiga:NetBSD:*:*)
-      echo m68k-cbm-netbsd${UNAME_RELEASE}
-      exit 0 ;;
-    amiga:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
     *:[Aa]miga[Oo][Ss]:*:*)
 	echo ${UNAME_MACHINE}-unknown-amigaos
 	exit 0 ;;
-    arc64:OpenBSD:*:*)
-	echo mips64el-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    arc:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    hkmips:OpenBSD:*:*)
-	echo mips-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    pmax:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sgi:OpenBSD:*:*)
-	echo mips-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    wgrisc:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
 	exit 0 ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
 	exit 0;;
-    arm32:NetBSD:*:*)
-	echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-	exit 0 ;;
-    SR2?01:HI-UX/MPP:*:*)
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
 	echo hppa1.1-hitachi-hiuxmpp
 	exit 0;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
@@ -218,15 +353,9 @@
     aushp:SunOS:*:*)
 	echo sparc-auspex-sunos${UNAME_RELEASE}
 	exit 0 ;;
-    atari*:NetBSD:*:*)
-	echo m68k-atari-netbsd${UNAME_RELEASE}
-	exit 0 ;;
-    atari*:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
-    # "atarist" or "atariste" at least should have a processor 
+    # "atarist" or "atariste" at least should have a processor
     # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
     # to the lowercase version "mint" (or "freemint").  Finally
     # the system name "TOS" denotes a system which is actually not
@@ -250,30 +379,9 @@
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
         echo m68k-unknown-mint${UNAME_RELEASE}
         exit 0 ;;
-    sun3*:NetBSD:*:*)
-	echo m68k-sun-netbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sun3*:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mac68k:NetBSD:*:*)
-	echo m68k-apple-netbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mac68k:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvme68k:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvme88k:OpenBSD:*:*)
-	echo m88k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
     powerpc:machten:*:*)
 	echo powerpc-apple-machten${UNAME_RELEASE}
 	exit 0 ;;
-    macppc:NetBSD:*:*)
-        echo powerpc-apple-netbsd${UNAME_RELEASE}
-        exit 0 ;;
     RISC*:Mach:*:*)
 	echo mips-dec-mach_bsd4.3
 	exit 0 ;;
@@ -287,8 +395,10 @@
 	echo clipper-intergraph-clix${UNAME_RELEASE}
 	exit 0 ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
 #ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
 	int main (int argc, char *argv[]) {
 #else
 	int main (argc, argv) int argc; char *argv[]; {
@@ -309,10 +419,13 @@
 EOF
 	$CC_FOR_BUILD $dummy.c -o $dummy \
 	  && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-	  && rm $dummy.c $dummy && exit 0
+	  && rm -f $dummy.c $dummy && exit 0
 	rm -f $dummy.c $dummy
 	echo mips-mips-riscos${UNAME_RELEASE}
 	exit 0 ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit 0 ;;
     Night_Hawk:Power_UNIX:*:*)
 	echo powerpc-harris-powerunix
 	exit 0 ;;
@@ -328,15 +441,18 @@
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
         UNAME_PROCESSOR=`/usr/bin/uname -p`
-        if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
-	if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-	     -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
 		echo m88k-dg-dgux${UNAME_RELEASE}
-	else
+	    else
 		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
 	fi
-        else echo i586-dg-dgux${UNAME_RELEASE}
-        fi
  	exit 0 ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 	echo m88k-dolphin-sysv3
@@ -357,11 +473,20 @@
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
 	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
 	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
-    i?86:AIX:*:*)
+    i*86:AIX:*:*)
 	echo i386-ibm-aix
 	exit 0 ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit 0 ;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
 		sed 's/^		//' << EOF >$dummy.c
 		#include <sys/systemcfg.h>
 
@@ -373,7 +498,7 @@
 			exit(0);
 			}
 EOF
-		$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+		$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
 		rm -f $dummy.c $dummy
 		echo rs6000-ibm-aix3.2.5
 	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
@@ -382,9 +507,9 @@
 		echo rs6000-ibm-aix3.2
 	fi
 	exit 0 ;;
-    *:AIX:*:4)
+    *:AIX:*:[45])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
-	if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
 	else
 		IBM_ARCH=powerpc
@@ -392,7 +517,7 @@
 	if [ -x /usr/bin/oslevel ] ; then
 		IBM_REV=`/usr/bin/oslevel`
 	else
-		IBM_REV=4.${UNAME_RELEASE}
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
 	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
 	exit 0 ;;
@@ -402,7 +527,7 @@
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
 	echo romp-ibm-bsd4.4
 	exit 0 ;;
-    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
 	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
 	exit 0 ;;                           # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
@@ -418,11 +543,30 @@
 	echo m68k-hp-bsd4.4
 	exit 0 ;;
     9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	case "${UNAME_MACHINE}" in
 	    9000/31? )            HP_ARCH=m68000 ;;
 	    9000/[34]?? )         HP_ARCH=m68k ;;
 	    9000/[678][0-9][0-9])
-              sed 's/^              //' << EOF >$dummy.c
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
               #include <stdlib.h>
               #include <unistd.h>
 
@@ -453,13 +597,19 @@
                   exit (0);
               }
 EOF
-	($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
-	rm -f $dummy.c $dummy
+		    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
+		    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+		    rm -f $dummy.c $dummy
+		fi ;;
 	esac
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
 	exit 0 ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit 0 ;;
     3050*:HI-UX:*:*)
+	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
 	#include <unistd.h>
 	int
@@ -485,7 +635,7 @@
 	  exit (0);
 	}
 EOF
-	$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+	$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
 	rm -f $dummy.c $dummy
 	echo unknown-hitachi-hiuxwe2
 	exit 0 ;;
@@ -495,7 +645,7 @@
     9000/8??:4.3bsd:*:*)
 	echo hppa1.0-hp-bsd
 	exit 0 ;;
-    *9??*:MPE/iX:*:*)
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
 	echo hppa1.0-hp-mpeix
 	exit 0 ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
@@ -504,7 +654,7 @@
     hp8??:OSF1:*:*)
 	echo hppa1.0-hp-osf
 	exit 0 ;;
-    i?86:OSF1:*:*)
+    i*86:OSF1:*:*)
 	if [ -x /usr/sbin/sysversion ] ; then
 	    echo ${UNAME_MACHINE}-unknown-osf1mk
 	else
@@ -514,9 +664,6 @@
     parisc*:Lites*:*:*)
 	echo hppa1.1-hp-lites
 	exit 0 ;;
-    hppa*:OpenBSD:*:*)
-	echo hppa-unknown-openbsd
-	exit 0 ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 	echo c1-convex-bsd
         exit 0 ;;
@@ -539,37 +686,36 @@
 	echo xmp-cray-unicos
         exit 0 ;;
     CRAY*Y-MP:*:*:*)
-	echo ymp-cray-unicos${UNAME_RELEASE}
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
     CRAY*[A-Z]90:*:*:*)
 	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
 	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
     CRAY*TS:*:*:*)
-	echo t90-cray-unicos${UNAME_RELEASE}
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*T3D:*:*:*)
+	echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
     CRAY*T3E:*:*:*)
-	echo t3e-cray-unicosmk${UNAME_RELEASE}
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
     CRAY-2:*:*:*)
 	echo cray2-cray-unicos
         exit 0 ;;
-    F300:UNIX_System_V:*:*)
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
         exit 0 ;;
-    F301:UNIX_System_V:*:*)
-       echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
-       exit 0 ;;
-    hp3[0-9][05]:NetBSD:*:*)
-	echo m68k-hp-netbsd${UNAME_RELEASE}
-	exit 0 ;;
-    hp300:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
 	exit 0 ;;
     sparc*:BSD/OS:*:*)
@@ -579,26 +725,17 @@
 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
 	exit 0 ;;
     *:FreeBSD:*:*)
-	if test -x /usr/bin/objformat; then
-	    if test "elf" = "`/usr/bin/objformat`"; then
-		echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
-		exit 0
-	    fi
-	fi
 	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 	exit 0 ;;
-    *:NetBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-	exit 0 ;;
-    *:OpenBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-	exit 0 ;;
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
 	exit 0 ;;
     i*:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit 0 ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit 0 ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -617,149 +754,99 @@
     *:GNU:*:*)
 	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 	exit 0 ;;
-    *:Linux:*:*)
-	# uname on the ARM produces all sorts of strangeness, and we need to
-	# filter it out.
-	case "$UNAME_MACHINE" in
-	  armv*)		      UNAME_MACHINE=$UNAME_MACHINE ;;
-	  arm* | sa110*)	      UNAME_MACHINE="arm" ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit 0 ;;
+    arm*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux
+	exit 0 ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    mips:Linux:*:*)
+	case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
+	  big)    echo mips-unknown-linux-gnu && exit 0 ;;
+	  little) echo mipsel-unknown-linux-gnu && exit 0 ;;
 	esac
-
+	;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit 0 ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit 0 ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit 0 ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit 0 ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit 0 ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit 0 ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit 0 ;;
+    i*86:Linux:*:*)
 	# The BFD linker knows what the default object file format is, so
 	# first see if it will tell us. cd to the root directory to prevent
 	# problems with other programs or directories called `ld' in the path.
-	ld_help_string=`cd /; ld --help 2>&1`
-	ld_supported_emulations=`echo $ld_help_string \
-			 | sed -ne '/supported emulations:/!d
+	ld_supported_targets=`cd /; ld --help 2>&1 \
+			 | sed -ne '/supported targets:/!d
 				    s/[ 	][ 	]*/ /g
-				    s/.*supported emulations: *//
+				    s/.*supported targets: *//
 				    s/ .*//
 				    p'`
-        case "$ld_supported_emulations" in
-	  i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
-	  i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
-	  sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-	  armlinux)   echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-	  m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-	  elf32ppc)
-		# Determine Lib Version
-		cat >$dummy.c <<EOF
-#include <features.h>
-#if defined(__GLIBC__)
-extern char __libc_version[];
-extern char __libc_release[];
-#endif
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
-#if defined(__GLIBC__)
-  printf("%s %s\n", __libc_version, __libc_release);
-#else
-  printf("unkown\n");
-#endif
-  return 0;
-}
-EOF
-		LIBC=""
-		$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
-		if test "$?" = 0 ; then
-			./$dummy | grep 1\.99 > /dev/null
-			if test "$?" = 0 ; then
-				LIBC="libc1"
-			fi
-		fi	
-		rm -f $dummy.c $dummy
-		echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
+        case "$ld_supported_targets" in
+	  elf32-i386)
+		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+		;;
+	  a.out-i386-linux)
+		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+		exit 0 ;;		
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		exit 0 ;;
+	  "")
+		# Either a pre-BFD a.out linker (linux-gnuoldld) or
+		# one that does not give us useful --help.
+		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+		exit 0 ;;
 	esac
-
-	if test "${UNAME_MACHINE}" = "alpha" ; then
-		sed 's/^	//'  <<EOF >$dummy.s
-		.globl main
-		.ent main
-	main:
-		.frame \$30,0,\$26,0
-		.prologue 0
-		.long 0x47e03d80 # implver $0
-		lda \$2,259
-		.long 0x47e20c21 # amask $2,$1
-		srl \$1,8,\$2
-		sll \$2,2,\$2
-		sll \$0,3,\$0
-		addl \$1,\$0,\$0
-		addl \$2,\$0,\$0
-		ret \$31,(\$26),1
-		.end main
-EOF
-		LIBC=""
-		$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
-		if test "$?" = 0 ; then
-			./$dummy
-			case "$?" in
-			7)
-				UNAME_MACHINE="alpha"
-				;;
-			15)
-				UNAME_MACHINE="alphaev5"
-				;;
-			14)
-				UNAME_MACHINE="alphaev56"
-				;;
-			10)
-				UNAME_MACHINE="alphapca56"
-				;;
-			16)
-				UNAME_MACHINE="alphaev6"
-				;;
-			esac
-
-			objdump --private-headers $dummy | \
-			  grep ld.so.1 > /dev/null
-			if test "$?" = 0 ; then
-				LIBC="libc1"
-			fi
-		fi
-		rm -f $dummy.s $dummy
-		echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
-	elif test "${UNAME_MACHINE}" = "mips" ; then
-	  cat >$dummy.c <<EOF
-#ifdef __cplusplus
-	int main (int argc, char *argv[]) {
-#else
-	int main (argc, argv) int argc; char *argv[]; {
-#endif
-#ifdef __MIPSEB__
-  printf ("%s-unknown-linux-gnu\n", argv[1]);
-#endif
-#ifdef __MIPSEL__
-  printf ("%sel-unknown-linux-gnu\n", argv[1]);
-#endif
-  return 0;
-}
-EOF
-	  $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
-	  rm -f $dummy.c $dummy
-	else
-	  # Either a pre-BFD a.out linker (linux-gnuoldld)
-	  # or one that does not give us useful --help.
-	  # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
-	  # If ld does not provide *any* "supported emulations:"
-	  # that means it is gnuoldld.
-	  echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
-	  test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
-
-	  case "${UNAME_MACHINE}" in
-	  i?86)
-	    VENDOR=pc;
-	    ;;
-	  *)
-	    VENDOR=unknown;
-	    ;;
-	  esac
-	  # Determine whether the default compiler is a.out or elf
-	  cat >$dummy.c <<EOF
+	# Determine whether the default compiler is a.out or elf
+	eval $set_cc_for_build
+	cat >$dummy.c <<EOF
 #include <features.h>
 #ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
 	int main (int argc, char *argv[]) {
 #else
 	int main (argc, argv) int argc; char *argv[]; {
@@ -767,28 +854,30 @@
 #ifdef __ELF__
 # ifdef __GLIBC__
 #  if __GLIBC__ >= 2
-    printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
+    printf ("%s-pc-linux-gnu\n", argv[1]);
 #  else
-    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+    printf ("%s-pc-linux-gnulibc1\n", argv[1]);
 #  endif
 # else
-   printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+   printf ("%s-pc-linux-gnulibc1\n", argv[1]);
 # endif
 #else
-  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
+  printf ("%s-pc-linux-gnuaout\n", argv[1]);
 #endif
   return 0;
 }
 EOF
-	  $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
-	  rm -f $dummy.c $dummy
-	fi ;;
-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
-# are messed up and put the nodename in both sysname and nodename.
-    i?86:DYNIX/ptx:4*:*)
+	$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
+	rm -f $dummy.c $dummy
+	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+	;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
 	echo i386-sequent-sysv4
 	exit 0 ;;
-    i?86:UNIX_SV:4.2MP:2.*)
+    i*86:UNIX_SV:4.2MP:2.*)
         # Unixware is an offshoot of SVR4, but it has its own version
         # number series starting with 2...
         # I am not positive that other SVR4 systems won't match this,
@@ -796,22 +885,23 @@
         # Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
 	exit 0 ;;
-    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-		echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
 	else
-		echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
 	fi
 	exit 0 ;;
-    i?86:*:5:7*)
-	UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
-	(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
-	(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
-	(/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
-	(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
-	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
+    i*86:*:5:[78]*)
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
 	exit 0 ;;
-    i?86:*:3.2:*)
+    i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
 		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
 		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
@@ -829,7 +919,11 @@
 		echo ${UNAME_MACHINE}-pc-sysv32
 	fi
 	exit 0 ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit 0 ;;
     pc:*:*:*)
+	# Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
         # the processor, so we play safe by assuming i386.
 	echo i386-pc-msdosdjgpp
@@ -853,7 +947,7 @@
 	exit 0 ;;
     M68*:*:R3V[567]*:*)
 	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
-    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
 	OS_REL=''
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -864,21 +958,24 @@
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
           && echo i486-ncr-sysv4 && exit 0 ;;
-    m68*:LynxOS:2.*:*)
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 	echo m68k-unknown-lynxos${UNAME_RELEASE}
 	exit 0 ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
 	exit 0 ;;
-    i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 	echo i386-unknown-lynxos${UNAME_RELEASE}
 	exit 0 ;;
     TSUNAMI:LynxOS:2.*:*)
 	echo sparc-unknown-lynxos${UNAME_RELEASE}
 	exit 0 ;;
-    rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
+    rs6000:LynxOS:2.*:*)
 	echo rs6000-unknown-lynxos${UNAME_RELEASE}
 	exit 0 ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
     SM[BE]S:UNIX_SV:*:*)
 	echo mips-dde-sysv${UNAME_RELEASE}
 	exit 0 ;;
@@ -896,8 +993,8 @@
 		echo ns32k-sni-sysv
 	fi
 	exit 0 ;;
-    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                           # says <Richard.M.Bartel@ccMail.Census.GOV>
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel@ccMail.Census.GOV>
         echo i586-unisys-sysv4
         exit 0 ;;
     *:UNIX_System_V:4*:FTX*)
@@ -909,10 +1006,14 @@
 	# From seanf@swdc.stratus.com.
 	echo i860-stratus-sysv4
 	exit 0 ;;
+    *:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo hppa1.1-stratus-vos
+	exit 0 ;;
     mc68*:A/UX:*:*)
 	echo m68k-apple-aux${UNAME_RELEASE}
 	exit 0 ;;
-    news*:NEWS-OS:*:6*)
+    news*:NEWS-OS:6*:*)
 	echo mips-sony-newsos6
 	exit 0 ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
@@ -943,11 +1044,76 @@
     *:Rhapsody:*:*)
 	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
 	exit 0 ;;
+    *:Darwin:*:*)
+	echo `uname -p`-apple-darwin${UNAME_RELEASE}
+	exit 0 ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	if test "${UNAME_MACHINE}" = "x86pc"; then
+		UNAME_MACHINE=pc
+	fi
+	echo `uname -p`-${UNAME_MACHINE}-nto-qnx
+	exit 0 ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit 0 ;;
+    NSR-[KW]:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit 0 ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit 0 ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit 0 ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit 0 ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit 0 ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit 0 ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit 0 ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit 0 ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit 0 ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit 0 ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit 0 ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit 0 ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit 0 ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit 0 ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
 
+eval $set_cc_for_build
 cat >$dummy.c <<EOF
 #ifdef _SEQUENT_
 # include <sys/types.h>
@@ -1034,11 +1200,24 @@
 #endif
 
 #if defined (vax)
-#if !defined (ultrix)
-  printf ("vax-dec-bsd\n"); exit (0);
-#else
-  printf ("vax-dec-ultrix\n"); exit (0);
-#endif
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
 #endif
 
 #if defined (alliant) && defined (i860)
@@ -1049,7 +1228,7 @@
 }
 EOF
 
-$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
 rm -f $dummy.c $dummy
 
 # Apollos put the system type in the environment.
@@ -1082,6 +1261,48 @@
     esac
 fi
 
-#echo '(Unable to guess system type)' 1>&2
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+    ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
 
 exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
--- emacs20-20.7.orig/config.sub
+++ emacs20-20.7/config.sub
@@ -1,6 +1,10 @@
 #! /bin/sh
-# Configuration validation subroutine script, version 1.1.
-#   Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+#   Free Software Foundation, Inc.
+
+timestamp='2001-11-08'
+
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
 # can handle that machine.  It does not imply ALL GNU software can.
@@ -25,6 +29,9 @@
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
 # If it is invalid, we print an error message on stderr and exit with code 1.
@@ -45,30 +52,73 @@
 #	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
 # It is wrong to echo any other type of specification.
 
-if [ x$1 = x ]
-then
-	echo Configuration name missing. 1>&2
-	echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
-	echo "or     $0 ALIAS" 1>&2
-	echo where ALIAS is a recognized configuration type. 1>&2
-	exit 1
-fi
+me=`echo "$0" | sed -e 's,.*/,,'`
 
-# First pass through any local machine types.
-case $1 in
-	*local*)
-		echo $1
-		exit 0
-		;;
-	*)
-	;;
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit 0;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
 esac
 
 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  linux-gnu*)
+  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -94,7 +144,7 @@
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple)
+	-apple | -axis)
 		os=
 		basic_machine=$1
 		;;
@@ -105,9 +155,17 @@
 	-scout)
 		;;
 	-wrs)
-		os=vxworks
+		os=-vxworks
 		basic_machine=$1
 		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
 	-hiux*)
 		os=-hiuxwe2
 		;;
@@ -156,33 +214,59 @@
 	-psos*)
 		os=-psos
 		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
 esac
 
 # Decode aliases for certain CPU-COMPANY combinations.
 case $basic_machine in
 	# Recognize the basic CPU types without company name.
 	# Some are omitted here because they have special meanings below.
-	tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
-		| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
-		| 580 | i960 | h8300 \
-		| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
-		| alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
-		| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
-		| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
-		| mips64orion | mips64orionel | mipstx39 | mipstx39el \
-		| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
-		| mips64vr5000 | miprs64vr5000el \
-		| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
-		| thumb | d10v)
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| c4x | clipper \
+	| d10v | d30v | dsp16xx \
+	| fr30 \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| m32r | m68000 | m68k | m88k | mcore \
+	| mips16 | mips64 | mips64el | mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el | mips64vr4300 \
+	| mips64vr4300el | mips64vr5000 | mips64vr5000el \
+	| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
+	| mipsisa32 \
+	| mn10200 | mn10300 \
+	| ns16k | ns32k \
+	| openrisc \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| sh | sh[34] | sh[34]eb | shbe | shle \
+	| sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
+	| strongarm \
+	| tahoe | thumb | tic80 | tron \
+	| v850 \
+	| we32k \
+	| x86 | xscale | xstormy16 \
+	| z8k)
 		basic_machine=$basic_machine-unknown
 		;;
-	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
+	m6811 | m68hc11 | m6812 | m68hc12)
+		# Motorola 68HC11/12.
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
 		;;
 
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
 	# (2) the word "unknown" tends to confuse beginning users.
-	i[34567]86)
+	i*86 | x86_64)
 	  basic_machine=$basic_machine-pc
 	  ;;
 	# Object if more than one company name word.
@@ -191,23 +275,43 @@
 		exit 1
 		;;
 	# Recognize the basic CPU types with company name.
-	vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
-	      | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
-	      | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
-	      | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
-	      | xmp-* | ymp-* \
-	      | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
-	      | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
-	      | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
-	      | clipper-* | orion-* \
-	      | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
-	      | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
-	      | mips64el-* | mips64orion-* | mips64orionel-* \
-	      | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
-	      | mipstx39-* | mipstx39el-* \
-	      | f301-* | armv*-* | t3e-* \
-	      | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
-	      | thumb-* | v850-* | d30v-* | tic30-* | c30-* )
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alphapca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armv*-* \
+	| avr-* \
+	| bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c54x-* \
+	| clipper-* | cray2-* | cydra-* \
+	| d10v-* | d30v-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fr30-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| m32r-* \
+	| m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | mcore-* \
+	| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
+	| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
+	| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* \
+	| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
+	| sparc-* | sparc64-* | sparc86x-* | sparclite-* \
+	| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \
+	| t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
+	| v850-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xmp-* | xps100-* | xscale-* | xstormy16-* \
+	| ymp-* \
+	| z8k-*)
 		;;
 	# Recognize the various machine names and aliases which stand
 	# for a CPU type and a company and sometimes even an OS.
@@ -244,14 +348,14 @@
 		os=-sysv
 		;;
 	amiga | amiga-*)
-		basic_machine=m68k-cbm
+		basic_machine=m68k-unknown
 		;;
 	amigaos | amigados)
-		basic_machine=m68k-cbm
+		basic_machine=m68k-unknown
 		os=-amigaos
 		;;
 	amigaunix | amix)
-		basic_machine=m68k-cbm
+		basic_machine=m68k-unknown
 		os=-sysv4
 		;;
 	apollo68)
@@ -298,13 +402,16 @@
 		basic_machine=cray2-cray
 		os=-unicos
 		;;
-	[ctj]90-cray)
-		basic_machine=c90-cray
+	[cjt]90)
+		basic_machine=${basic_machine}-cray
 		os=-unicos
 		;;
 	crds | unos)
 		basic_machine=m68k-crds
 		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
 	da30 | da30-*)
 		basic_machine=m68k-da30
 		;;
@@ -352,6 +459,10 @@
 		basic_machine=tron-gmicro
 		os=-sysv
 		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
 	h3050r* | hiux*)
 		basic_machine=hppa1.1-hitachi
 		os=-hiuxwe2
@@ -425,22 +536,21 @@
 		;;
 	i370-ibm* | ibm*)
 		basic_machine=i370-ibm
-		os=-mvs
 		;;
 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
-	i[34567]86v32)
+	i*86v32)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv32
 		;;
-	i[34567]86v4*)
+	i*86v4*)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv4
 		;;
-	i[34567]86v)
+	i*86v)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv
 		;;
-	i[34567]86sol2)
+	i*86sol2)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-solaris2
 		;;
@@ -452,14 +562,6 @@
 		basic_machine=i386-unknown
 		os=-vsta
 		;;
-	i386-go32 | go32)
-		basic_machine=i386-unknown
-		os=-go32
-		;;
-	i386-mingw32 | mingw32)
-		basic_machine=i386-unknown
-		os=-mingw32
-		;;
 	iris | iris4d)
 		basic_machine=mips-sgi
 		case $os in
@@ -485,10 +587,14 @@
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
 	miniframe)
 		basic_machine=m68000-convergent
 		;;
-	*mint | *MiNT)
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
 		basic_machine=m68k-atari
 		os=-mint
 		;;
@@ -506,14 +612,22 @@
 	mips3*)
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
 		;;
+	mmix*)
+		basic_machine=mmix-knuth
+		os=-mmixware
+		;;
 	monitor)
 		basic_machine=m68k-rom68k
 		os=-coff
 		;;
 	msdos)
-		basic_machine=i386-unknown
+		basic_machine=i386-pc
 		os=-msdos
 		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
 	ncr3000)
 		basic_machine=i486-ncr
 		os=-sysv4
@@ -523,7 +637,7 @@
 		os=-netbsd
 		;;
 	netwinder)
-		basic_machine=armv4l-corel
+		basic_machine=armv4l-rebel
 		os=-linux
 		;;
 	news | news700 | news800 | news900)
@@ -571,9 +685,16 @@
 		basic_machine=i960-intel
 		os=-mon960
 		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
 	np1)
 		basic_machine=np1-gould
 		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
 	op50n-* | op60c-*)
 		basic_machine=hppa1.1-oki
 		os=-proelf
@@ -603,28 +724,28 @@
         pc532 | pc532-*)
 		basic_machine=ns32k-pc532
 		;;
-	pentium | p5 | k5 | k6 | nexen)
+	pentium | p5 | k5 | k6 | nexgen | viac3)
 		basic_machine=i586-pc
 		;;
-	pentiumpro | p6 | 6x86)
+	pentiumpro | p6 | 6x86 | athlon)
 		basic_machine=i686-pc
 		;;
 	pentiumii | pentium2)
-		basic_machine=i786-pc
+		basic_machine=i686-pc
 		;;
-	pentium-* | p5-* | k5-* | k6-* | nexen-*)
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
 		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
-	pentiumpro-* | p6-* | 6x86-*)
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
 		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	pentiumii-* | pentium2-*)
-		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	pn)
 		basic_machine=pn-gould
 		;;
-	power)	basic_machine=rs6000-ibm
+	power)	basic_machine=power-ibm
 		;;
 	ppc)	basic_machine=powerpc-unknown
 	        ;;
@@ -636,9 +757,23 @@
 	ppcle-* | powerpclittle-*)
 		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
+	ppc64)	basic_machine=powerpc64-unknown
+	        ;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+	        ;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	ps2)
 		basic_machine=i386-ibm
 		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
 	rom68k)
 		basic_machine=m68k-rom68k
 		os=-coff
@@ -649,6 +784,12 @@
 	rtpc | rtpc-*)
 		basic_machine=romp-ibm
 		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
 	sa29200)
 		basic_machine=a29k-amd
 		os=-udi
@@ -660,7 +801,7 @@
 		basic_machine=sh-hitachi
 		os=-hms
 		;;
-	sparclite-wrs)
+	sparclite-wrs | simso-wrs)
 		basic_machine=sparclite-wrs
 		os=-vxworks
 		;;
@@ -718,6 +859,10 @@
 	sun386 | sun386i | roadrunner)
 		basic_machine=i386-sun
 		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
 	symmetry)
 		basic_machine=i386-sequent
 		os=-dynix
@@ -726,6 +871,10 @@
 		basic_machine=t3e-cray
 		os=-unicos
 		;;
+	tic54x | c54x*)
+		basic_machine=tic54x-unknown
+		os=-coff
+		;;
 	tx39)
 		basic_machine=mipstx39-unknown
 		;;
@@ -778,6 +927,10 @@
 		basic_machine=hppa1.1-winbond
 		os=-proelf
 		;;
+	windows32)
+		basic_machine=i386-pc
+		os=-windows32-msvcrt
+		;;
 	xmp)
 		basic_machine=xmp-cray
 		os=-unicos
@@ -821,13 +974,20 @@
 	vax)
 		basic_machine=vax-dec
 		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
 	pdp11)
 		basic_machine=pdp11-dec
 		;;
 	we32k)
 		basic_machine=we32k-att
 		;;
-	sparc | sparcv9)
+	sh3 | sh4 | sh3eb | sh4eb)
+		basic_machine=sh-unknown
+		;;
+	sparc | sparcv9 | sparcv9b)
 		basic_machine=sparc-sun
 		;;
         cydra)
@@ -849,6 +1009,9 @@
 		basic_machine=c4x-none
 		os=-coff
 		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
 	*)
 		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
 		exit 1
@@ -905,14 +1068,30 @@
 	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* \
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-	      | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
+	      | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto*)
+		os=-nto-qnx
+		;;
 	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
 	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
-	      | -macos* | -mpw* | -magic* | -mon960* | -lnews*)
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
 		;;
 	-mac*)
 		os=`echo $os | sed -e 's|mac|macos|'`
@@ -926,6 +1105,12 @@
 	-sunos6*)
 		os=`echo $os | sed -e 's|sunos6|solaris3|'`
 		;;
+	-opened*)
+		os=-openedition
+		;;
+	-wince*)
+		os=-wince
+		;;
 	-osfrose*)
 		os=-osfrose
 		;;
@@ -950,6 +1135,9 @@
 	-ns2 )
 	        os=-nextstep2
 		;;
+	-nsk*)
+		os=-nsk
+		;;
 	# Preserve the version number of sinix5.
 	-sinix5.*)
 		os=`echo $os | sed -e 's|sinix|sysv|'`
@@ -984,7 +1172,7 @@
 	-xenix)
 		os=-xenix
 		;;
-        -*mint | -*MiNT)
+        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
 	        os=-mint
 		;;
 	-none)
@@ -1012,12 +1200,15 @@
 	*-acorn)
 		os=-riscix1.2
 		;;
-	arm*-corel)
+	arm*-rebel)
 		os=-linux
 		;;
 	arm*-semi)
 		os=-aout
 		;;
+	pdp10-*)
+		os=-tops20
+		;;
         pdp11-*)
 		os=-none
 		;;
@@ -1126,7 +1317,7 @@
 	*-masscomp)
 		os=-rtu
 		;;
-	f301-fujitsu)
+	f30[01]-fujitsu | f700-fujitsu)
 		os=-uxpv
 		;;
 	*-rom68k)
@@ -1186,7 +1377,7 @@
 			-genix*)
 				vendor=ns
 				;;
-			-mvs*)
+			-mvs* | -opened*)
 				vendor=ibm
 				;;
 			-ptx*)
@@ -1204,12 +1395,23 @@
 			-mpw* | -macos*)
 				vendor=apple
 				;;
-			-*mint | -*MiNT)
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
 				vendor=atari
 				;;
+			-vos*)
+				vendor=stratus
+				;;
 		esac
 		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
 		;;
 esac
 
 echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
--- emacs20-20.7.orig/debian/bin/gcc/gcc
+++ emacs20-20.7/debian/bin/gcc/gcc
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+echo Running gcc with ppc ld script.
+exec /usr/bin/gcc -Wl,-T,${DEBIAN_SRCDIR}/src/ppc.ldscript "$@"
--- emacs20-20.7.orig/debian/bin/info/install-info
+++ emacs20-20.7/debian/bin/info/install-info
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# Dummy script to fool emacs install into thinking it did something useful.
+
+exit 0
--- emacs20-20.7.orig/debian/TODO
+++ emacs20-20.7/debian/TODO
@@ -0,0 +1,2 @@
+Decide what to do with emacsclient-plus.
+See about breaking movemail out as a separate program.
--- emacs20-20.7.orig/debian/menu
+++ emacs20-20.7/debian/menu
@@ -0,0 +1,13 @@
+?package(emacs20):\
+  needs="x11"\
+  section="Apps/Editors"\
+  title="Emacs 20"\
+  command="/usr/bin/emacs20"\
+  icon=/usr/share/emacs/20.7/etc/gnu-32x32.xpm
+
+?package(emacs20):\
+  needs="text"\
+  section="Apps/Editors"\
+  title="Emacs 20"\
+  command="/usr/bin/emacs20"\
+  icon=/usr/share/emacs/20.7/etc/gnu-32x32.xpm
--- emacs20-20.7.orig/debian/emacs.preinst
+++ emacs20-20.7/debian/emacs.preinst
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+MAJOR=@MAJOR_VERSION@
+MINOR=@MINOR_VERSION@
+FULL=@FULL_VERSION@
+
+exit 0
--- emacs20-20.7.orig/debian/control
+++ emacs20-20.7/debian/control
@@ -0,0 +1,30 @@
+Source: emacs20
+Section: editors
+Priority: optional
+Maintainer: Rob Browning <rlb@defaultvalue.org>
+Build-Depends: mailx, libxaw-dev, libncurses5-dev, texinfo, liblockfile-dev
+Standards-Version: 2.1.2.2
+
+Package: emacs20
+Section: editors
+Priority: optional
+Architecture: any
+Depends: emacsen-common (>= 1.4.10), dpkg (>= 1.9.0), ${shlibs:Depends}
+Provides: emacsen, info-browser, mail-reader, news-reader, www-browser
+Suggests: emacs20-el
+Conflicts: emacs20-el (<< 20.7-13), w3-el
+Priority: standard
+Description: The GNU Emacs editor.
+ GNU Emacs is the extensible self-documenting text editor.
+
+Package: emacs20-el
+Section: editors
+Priority: optional
+Architecture: all
+Depends: emacs20 (= 20.7-13)
+Replaces: emacs20
+Priority: optional
+Description: GNU Emacs LISP (.el) files.
+ GNU Emacs is the extensible self-documenting text editor.
+ This package contains the elisp sources for the convenience of users,
+ saving space in the main package for small systems.
--- emacs20-20.7.orig/debian/emacs.prerm
+++ emacs20-20.7/debian/emacs.prerm
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+MAJOR=@MAJOR_VERSION@
+MINOR=@MINOR_VERSION@
+FULL=@FULL_VERSION@
+INFOFILES="@INFOFILES@"
+
+if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/emacs${MAJOR} ]
+then
+  rm -f /usr/doc/emacs${MAJOR}
+fi
+
+for file in ${INFOFILES}
+do
+  install-info --quiet --remove-exactly emacs-${MAJOR}/${file} || true
+done
+
+# update-alternatives on things that collide with xemacs, other editors
+if [ "$1" != "upgrade" ]
+then
+  for i in ctags etags b2m emacsclient rcs-checkin
+  do
+    update-alternatives --remove $i /usr/bin/$i.emacs${MAJOR}
+  done
+  update-alternatives --remove emacs /usr/bin/emacs${MAJOR}
+fi
+
+# emacsen-common registration.
+/usr/lib/emacsen-common/emacs-remove emacs${MAJOR}
+
+(rmdir /usr/local/share/emacs/${FULL}/site-lisp 2>/dev/null && \
+ rmdir /usr/local/share/emacs/${FULL}           2>/dev/null) || true
+
+exit 0
--- emacs20-20.7.orig/debian/README.add-on-package-maintainers
+++ emacs20-20.7/debian/README.add-on-package-maintainers
@@ -0,0 +1,2 @@
+Please see /usr/doc/emacsen-common/debian-emacs-policy.gz for information
+on how to properly structure your emacs add-on packages.
--- emacs20-20.7.orig/debian/copyright.in
+++ emacs20-20.7/debian/copyright.in
@@ -0,0 +1,38 @@
+-*-text-*-
+
+This package was debianized by Rob Browning <rlb@defaultvalue.org> on
+Tue, 16 Dec 1997 00:05:45 -0600.
+
+The source is a combination of the following files:
+
+  prep.ai.mit.edu:/pub/gnu/emacs-@NOMINAL_VERSION@.tar.gz
+  prep.ai.mit.edu:/pub/gnu/leim-@NOMINAL_VERSION@.tar.gz
+
+Copyright:
+
+  GNU Emacs is Copyright (C) Free Software Foundation, Inc. and is
+   covered under the terms of the GPL.  See the file
+  /usr/share/common-licenses/GPL for more information.
+
+Debian specific difference from the upstream version:
+
+  This is an unfinished list, but is in the process of being fleshed
+  out.  Please file bugs for things that aren't mentioned here, but
+  should be.  This list must eventually be as complete as possible,
+  and I plan to try and ensure that by a full evaluation of the
+  current Debian diff file, but I won't have time for that for a bit.
+  When I do get the chance to do that, I'll also work with the
+  upstream to get all of the relevant patches
+  contributed/assigned/etc.
+
+  * We have added CONF_MAIL_PROGRAM_NAME to configure.in and use it in
+    fakemail.c.  Either via this variable, or via a #define in an arch
+    specific file, we now insist that this var be defined, and abort
+    compilation otherwise.  We use #error, which is probably not
+    portable, so we need a better solution long term.  This fix
+    repairs a nasty bug where on sparc-debian-linux-gnu at least,
+    MAIL_PROGRAM_NAME pointed to /bin/mail, which didn't exist, and
+    fakemail failed silently, losing mail.
+
+  * We have added mail spool dir location detection to configure.in
+    and propagated it along with tests for liblockfile.
--- emacs20-20.7.orig/debian/emacsclient.1
+++ emacs20-20.7/debian/emacsclient.1
@@ -0,0 +1,64 @@
+.TH EMACSCLIENT 1
+.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
+.\" other parms are allowed: see man(7), man(1)
+.SH NAME
+emacsclient \- tells a running Emacs to visit a file
+.SH SYNOPSIS
+.B emacsclient
+.I "[options] files ..."
+.SH "DESCRIPTION"
+This manual page documents briefly the
+.BR emacsclient
+command.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+Instead, it has documentation in the GNU Info format; see below.
+.PP
+.B emacsclient 
+works in conjunction with the built-in server of Emacs.
+.PP
+You typically does not call 
+.B emacsclient
+directly. Instead, you set the environment variable EDITOR
+to 
+.B emacsclient
+and let programs like 'vipw' or 'bug' or anything run
+it for you, which will use an existing Emacs to visit the file.
+
+For
+.B emacsclient 
+to work, you need an already running Emacs with a server.  Within Emacs, call the function
+`server-start'.  (Your `.emacs' file can do this automatically if you
+add the expression `(server-start)' to it.)  
+
+When you've finished editing the buffer, type `C-x #'
+(`server-edit').  This saves the file and sends a message back to the
+`emacsclient' program telling it to exit.  The programs that use
+`EDITOR' wait for the "editor" (actually, `emacsclient') to exit.  `C-x
+#' also checks for other pending external requests to edit various
+files, and selects the next such file.
+
+If you set the variable `server-window' to a window or a frame, `C-x
+#' displays the server buffer in that window or in that frame.
+
+.SH OPTIONS
+The programs follow the usual GNU command line syntax, with long
+options starting with two dashes (`-').
+.TP
+.B \-n, \-\-no-wait
+returns
+immediately without waiting for you to "finish" the buffer in Emacs.
+.SH "SEE ALSO"
+The program is documented fully in
+.IR "Using Emacs as a Server"
+available via the Info system.
+.SH BUGS
+If there is no running Emacs server, 
+.B emacsclient 
+cannot launch one. I use a small Perl script instead of raw 
+.B emacsclient
+to do it (it works only with systems which have BSD sockets, which is fine
+for Debian GNU/Linux).
+.SH AUTHOR
+This manual page was written by Stephane Bortzmeyer <bortzmeyer@debian.org>,
+for the Debian GNU/Linux system (but may be used by others).
--- emacs20-20.7.orig/debian/menu.in
+++ emacs20-20.7/debian/menu.in
@@ -0,0 +1,13 @@
+?package(emacs@MAJOR_VERSION@):\
+  needs="x11"\
+  section="Apps/Editors"\
+  title="Emacs @MAJOR_VERSION@"\
+  command="/usr/bin/emacs@MAJOR_VERSION@"\
+  icon=/usr/share/emacs/@FULL_VERSION@/etc/gnu-32x32.xpm
+
+?package(emacs@MAJOR_VERSION@):\
+  needs="text"\
+  section="Apps/Editors"\
+  title="Emacs @MAJOR_VERSION@"\
+  command="/usr/bin/emacs@MAJOR_VERSION@"\
+  icon=/usr/share/emacs/@FULL_VERSION@/etc/gnu-32x32.xpm
--- emacs20-20.7.orig/debian/emacs-el.prerm
+++ emacs20-20.7/debian/emacs-el.prerm
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+MAJOR=@MAJOR_VERSION@
+MINOR=@MINOR_VERSION@
+FULL=@FULL_VERSION@
+
+if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/emacs${MAJOR}-el ]
+then
+  rm -f /usr/doc/emacs${MAJOR}-el
+fi
--- emacs20-20.7.orig/debian/emacs-el.postinst
+++ emacs20-20.7/debian/emacs-el.postinst
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+MAJOR=@MAJOR_VERSION@
+MINOR=@MINOR_VERSION@
+FULL=@FULL_VERSION@
+
+if [ "$1" = "configure" ]
+then
+  if [ -d /usr/doc \
+       -a ! -e /usr/doc/emacs${MAJOR}-el \
+       -a -d /usr/share/doc/emacs${MAJOR}-el ]
+  then
+    ln -sf ../share/doc/emacs${MAJOR}-el /usr/doc/emacs${MAJOR}-el
+  fi
+fi
--- emacs20-20.7.orig/debian/mangle-info
+++ emacs20-20.7/debian/mangle-info
@@ -0,0 +1,17 @@
+#!/usr/bin/perl -w -i
+
+use English;
+use strict;
+
+$RS = undef;
+
+my $prefix = $ENV{"DEBIAN_INFO_PREFIX"};
+
+my $x = <>;
+if(!($x =~ m/^(\s*START-INFO-DIR-ENTRY\s+\*\s*[^:]+:\s*)\(([^\)]+)\)/mo)) {
+  die "Couldn't find START-INFO-DIR-ENTRY.";
+}
+   
+print ${PREMATCH};
+print "$1($prefix/$2)";
+print ${POSTMATCH};
--- emacs20-20.7.orig/debian/gnu-32x32.xpm
+++ emacs20-20.7/debian/gnu-32x32.xpm
@@ -0,0 +1,384 @@
+/* XPM */
+static char * gnu_32x32_xpm[] = {
+"32 32 349 2",
+"  	c None",
+". 	c #D408F6",
+"+ 	c #7E098D",
+"@ 	c #CA0CE6",
+"# 	c #DE3AC6",
+"$ 	c #9C6641",
+"% 	c #B730A3",
+"& 	c #BE07DC",
+"* 	c #BE07DD",
+"= 	c #D612EC",
+"- 	c #DB2BD4",
+"; 	c #DB7E70",
+"> 	c #7C2F5C",
+", 	c #C614D7",
+"' 	c #CF08F0",
+") 	c #9206A9",
+"! 	c #993973",
+"~ 	c #CB08EC",
+"{ 	c #660476",
+"] 	c #77058B",
+"^ 	c #EC7F84",
+"/ 	c #BC7E4A",
+"( 	c #801285",
+"_ 	c #950FA2",
+": 	c #A26748",
+"< 	c #D719E4",
+"[ 	c #BC07DA",
+"} 	c #A106BB",
+"| 	c #5A263F",
+"1 	c #2F0F26",
+"2 	c #700482",
+"3 	c #421D2C",
+"4 	c #7F5632",
+"5 	c #5E3D28",
+"6 	c #361429",
+"7 	c #9D06B6",
+"8 	c #C115CE",
+"9 	c #845934",
+"0 	c #B6774B",
+"a 	c #820597",
+"b 	c #E86C96",
+"c 	c #D50AF4",
+"d 	c #C507E4",
+"e 	c #72314F",
+"f 	c #92623A",
+"g 	c #EC9F5D",
+"h 	c #B67A47",
+"i 	c #000000",
+"j 	c #B07645",
+"k 	c #F4A460",
+"l 	c #C1824C",
+"m 	c #260D1F",
+"n 	c #BB07D8",
+"o 	c #754F2E",
+"p 	c #C3834D",
+"q 	c #77048A",
+"r 	c #C908E9",
+"s 	c #6E1E60",
+"t 	c #DE8B64",
+"u 	c #DD32CD",
+"v 	c #B907D7",
+"w 	c #310832",
+"x 	c #9E6A3E",
+"y 	c #B27846",
+"z 	c #C6854E",
+"A 	c #241512",
+"B 	c #CC08ED",
+"C 	c #916239",
+"D 	c #D008F2",
+"E 	c #75196F",
+"F 	c #CF8B51",
+"G 	c #82375A",
+"H 	c #2D0431",
+"I 	c #8A5D36",
+"J 	c #F2A35F",
+"K 	c #93633A",
+"L 	c #573E28",
+"M 	c #BC8250",
+"N 	c #EA9D5C",
+"O 	c #D18D52",
+"P 	c #4E341F",
+"Q 	c #744E2D",
+"R 	c #5E3F25",
+"S 	c #41024C",
+"T 	c #9B06B3",
+"U 	c #EFA15E",
+"V 	c #271911",
+"W 	c #7A058E",
+"X 	c #501647",
+"Y 	c #9C693D",
+"Z 	c #EBEBEB",
+"` 	c #BEBEBE",
+" .	c #494949",
+"..	c #666666",
+"+.	c #141414",
+"@.	c #181818",
+"#.	c #454545",
+"$.	c #3B2717",
+"%.	c #4C331E",
+"&.	c #2A0231",
+"*.	c #4A153F",
+"=.	c #CA08EA",
+"-.	c #890B98",
+";.	c #E89C5B",
+">.	c #ED9F5D",
+",.	c #E69B5A",
+"'.	c #4E3622",
+").	c #696969",
+"!.	c #4E4E4E",
+"~.	c #353535",
+"{.	c #C2C2C2",
+"].	c #EEEEEE",
+"^.	c #FFFFFF",
+"/.	c #CECECE",
+"(.	c #6D6D6D",
+"_.	c #828282",
+":.	c #ABABAB",
+"<.	c #D7D7D7",
+"[.	c #AEAEAE",
+"}.	c #1F1F1F",
+"|.	c #291F2A",
+"1.	c #8C12A1",
+"2.	c #D208F4",
+"3.	c #684629",
+"4.	c #42024D",
+"5.	c #9D6741",
+"6.	c #A46E41",
+"7.	c #7B5330",
+"8.	c #D69054",
+"9.	c #7F5532",
+"0.	c #3A3A3A",
+"a.	c #969696",
+"b.	c #F4F4F4",
+"c.	c #E0E0E0",
+"d.	c #A5A5A5",
+"e.	c #B0B0B0",
+"f.	c #6A6A6A",
+"g.	c #6C6C6C",
+"h.	c #909090",
+"i.	c #ACACAC",
+"j.	c #858585",
+"k.	c #E2E2E2",
+"l.	c #707070",
+"m.	c #C307E2",
+"n.	c #89059F",
+"o.	c #412620",
+"p.	c #DD9457",
+"q.	c #EB9E5C",
+"r.	c #6F4B2C",
+"s.	c #563A22",
+"t.	c #442D1B",
+"u.	c #C9874F",
+"v.	c #533A24",
+"w.	c #968F89",
+"x.	c #474747",
+"y.	c #727272",
+"z.	c #333333",
+"A.	c #8E8E8E",
+"B.	c #CACACA",
+"C.	c #BDBDBD",
+"D.	c #818181",
+"E.	c #242424",
+"F.	c #86129A",
+"G.	c #B207CF",
+"H.	c #C125DB",
+"I.	c #532A5A",
+"J.	c #88169B",
+"K.	c #D108F3",
+"L.	c #382616",
+"M.	c #E4995A",
+"N.	c #97663B",
+"O.	c #402B19",
+"P.	c #7A7A7A",
+"Q.	c #BABABA",
+"R.	c #282828",
+"S.	c #7B7B7B",
+"T.	c #999999",
+"U.	c #7C7C7C",
+"V.	c #545454",
+"W.	c #C0C0C0",
+"X.	c #CFCFCF",
+"Y.	c #646464",
+"Z.	c #44034F",
+"`.	c #C607E6",
+" +	c #7C0590",
+".+	c #180C0F",
+"++	c #714C2D",
+"@+	c #956B48",
+"#+	c #545250",
+"$+	c #DEDEDE",
+"%+	c #0B0B0B",
+"&+	c #9A9A9A",
+"*+	c #090909",
+"=+	c #6E6EDE",
+"-+	c #3325D5",
+";+	c #0707F2",
+">+	c #A9A9EB",
+",+	c #5B5B5B",
+"'+	c #08000A",
+")+	c #787878",
+"!+	c #484848",
+"~+	c #6868EB",
+"{+	c #3826DA",
+"]+	c #0000C4",
+"^+	c #A3A3BD",
+"/+	c #4A4A4A",
+"(+	c #573E5B",
+"_+	c #A7A7A7",
+":+	c #343434",
+"<+	c #3B3B3B",
+"[+	c #B7B7B7",
+"}+	c #979797",
+"|+	c #5C5C5C",
+"1+	c #797979",
+"2+	c #D5D5D5",
+"3+	c #C3C3C3",
+"4+	c #1B161C",
+"5+	c #A606C1",
+"6+	c #5D3A62",
+"7+	c #938994",
+"8+	c #650775",
+"9+	c #4B4B4B",
+"0+	c #8F8F8F",
+"a+	c #A3A3A3",
+"b+	c #FDFDFD",
+"c+	c #EAEAEA",
+"d+	c #3D3D3D",
+"e+	c #550362",
+"f+	c #B807D5",
+"g+	c #A506BF",
+"h+	c #540362",
+"i+	c #808080",
+"j+	c #848484",
+"k+	c #313131",
+"l+	c #EFEFEF",
+"m+	c #D6D6D6",
+"n+	c #6E0480",
+"o+	c #323133",
+"p+	c #2D2D2D",
+"q+	c #959595",
+"r+	c #676767",
+"s+	c #6F6F6F",
+"t+	c #9C9C9C",
+"u+	c #C4C4C4",
+"v+	c #E5E5E5",
+"w+	c #F6F6F6",
+"x+	c #C8C8C8",
+"y+	c #BFBFBF",
+"z+	c #BCBCBC",
+"A+	c #6C5C6F",
+"B+	c #AB06C7",
+"C+	c #101010",
+"D+	c #DADADA",
+"E+	c #DBDBDB",
+"F+	c #C9C9C9",
+"G+	c #868686",
+"H+	c #373737",
+"I+	c #C1C1C1",
+"J+	c #F3F3F3",
+"K+	c #A6A6A6",
+"L+	c #929292",
+"M+	c #393939",
+"N+	c #392C22",
+"O+	c #402F23",
+"P+	c #484644",
+"Q+	c #A1A1A1",
+"R+	c #878787",
+"S+	c #24170D",
+"T+	c #572B0C",
+"U+	c #320632",
+"V+	c #E8E8E8",
+"W+	c #6F370F",
+"X+	c #8B4513",
+"Y+	c #5A2D0C",
+"Z+	c #211105",
+"`+	c #5B2D0C",
+" @	c #381C08",
+".@	c #27081F",
+"+@	c #0B030C",
+"@@	c #D8D8D8",
+"#@	c #737373",
+"$@	c #595959",
+"%@	c #B8B8B8",
+"&@	c #939393",
+"*@	c #383838",
+"=@	c #060606",
+"-@	c #53290B",
+";@	c #5D2E0D",
+">@	c #592C0C",
+",@	c #763B10",
+"'@	c #301807",
+")@	c #844112",
+"!@	c #450350",
+"~@	c #650475",
+"{@	c #2F2F2F",
+"]@	c #C6C6C6",
+"^@	c #5A5A5A",
+"/@	c #555555",
+"(@	c #C7C7C7",
+"_@	c #9D9D9D",
+":@	c #070401",
+"<@	c #4A250A",
+"[@	c #562B0C",
+"}@	c #49240A",
+"|@	c #200624",
+"1@	c #B6B6B6",
+"2@	c #525252",
+"3@	c #565656",
+"4@	c #626262",
+"5@	c #414141",
+"6@	c #1D0E04",
+"7@	c #3E1F09",
+"8@	c #1B0D04",
+"9@	c #434343",
+"0@	c #E6E6E6",
+"a@	c #272727",
+"b@	c #8C8C8C",
+"c@	c #110902",
+"d@	c #6A340E",
+"e@	c #64320E",
+"f@	c #1D0E05",
+"g@	c #50035C",
+"h@	c #C808E8",
+"i@	c #D008F1",
+"j@	c #3D0247",
+"k@	c #C5C5C5",
+"l@	c #717171",
+"m@	c #D3D3D3",
+"n@	c #402009",
+"o@	c #48240A",
+"p@	c #311807",
+"q@	c #460351",
+"r@	c #0F0F0F",
+"s@	c #ADADAD",
+"t@	c #B5B5B5",
+"u@	c #D4D4D4",
+"v@	c #686868",
+"w@	c #1A1A1A",
+"x@	c #4E035B",
+"y@	c #3B0244",
+"z@	c #88059E",
+"A@	c #130116",
+"B@	c #09000B",
+"C@	c #A006B9",
+"D@	c #C607E5",
+"E@	c #491053",
+"F@	c #4B1154",
+"G@	c #6C047E",
+"H@	c #C407E4",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . + @ . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . # $ % & . . . . . ",
+". . . . . . . * . . . . . . . . . . . . . . . = - ; > , ' . . . ",
+". . . . . . ) ! . . . . . . . . . ~ { ] . . . . . . ^ / ( . . . ",
+". . . . . _ : < . . . [ } } | 1 2 3 4 5 6 7 . . . . 8 9 0 a . . ",
+". . . . ) : b c . . d e f f g h i j k k l m } . . . n o p q . . ",
+". . . r s t u . . v w x k k k k y z k k k z A B . v w x C q . . ",
+". . D E F G . . r H I k J K L M N N N O P Q R S T H I U V W . . ",
+". . q p k X . v H Y k k p i Z ` i  ...+.i @...#.i $.f %.&.. . . ",
+". . q p k *.=.-.I ;.>.,.'.).!.~.{.].^./.(._.:.<.{.{.[.}.|.1.2.. ",
+". . q p k 3.4.5.6.7.8.9.).0.a.^.b.c.c.d.e.f.g.h.i.j.k.^.^.l.m.. ",
+". . n.o.p.q.r.s.t.u.v.w.x.y.z. .A.B.` :.[.C.D.E.F.G.H.I.I.J.K.. ",
+". . . &.L.M.k k N.O.P.Q.#.l.R.S.T.U.V.W.` ` X.Y.Z.. . . . . . . ",
+". . . `. +.+++@+#+Z $+%+&+*+=+-+;+>+,+!.` ` ` j.'+. . . . . . . ",
+". . . . . 2 i Q.^.^.)+!.$+!+~+{+]+^+i /+` ` ` D.'+. . . . . . . ",
+". . . . . (+^._+:+i }.^.<+[+^.}+|+1+2+3+` ` ` }+4+5+. . . . . . ",
+". . . . . 6+7+8+i  .9+_+0+a+b+}+x.~.c+{.` ` ` ` d+e+. . . . . . ",
+". . . . . f+g+h+!+..a.i+j+k+a+^.l.<.l+m+` ` ` ` y.e+. . . . . . ",
+". . . . . . n+o+2+p+q+r+s+l.t+u+v+^.^.w+x+y+` ` z+A+B+. . . . . ",
+". . . . . . e+d+2+T.C+#.m+l.a.^.D.D+^.^.^.E+` F+G+H+} . . . . . ",
+". . . . . . e+d+I+J+V.j.A.K+!+D.L+M+t+N+O+P+Q+R+S+T+U+. . . . . ",
+". . . . . . e+d+y+V+|+/.p+..f.a+|+|+0+W+X+Y+Z+i `+ @.@. . . . . ",
+". . . . . . ' +@j+@@#@$@%@,+&@E.g.*@=@-@;@>@,@'@)@i !@. . . . . ",
+". . . . . . . ~@{@]@/.^@/@!.#.(@i _@i :@`+<@[@W+}@i } . . . . . ",
+". . . . . . . B+|@h.]@1@2@3@!.4@5@i i i 6@7@-@-@8@i } . . . . . ",
+". . . . . . . . h+9@Q./.0@..x+$@a@b@(.i c@,@d@e@f@g@h@. . . . . ",
+". . . . . . . . i@j@9+0+k@c.l@m@i [./+i i n@o@p@'+. . . . . . . ",
+". . . . . . . . . `.q@r@j.s@t@u@v@w@x@G.G.y@&.&.z@. . . . . . . ",
+". . . . . . . . . . r q A@{@t@` i B@C@. . . . . . . . . . . . . ",
+". . . . . . . . . . . . D@q E@F@G@H@. . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "};
--- emacs20-20.7.orig/debian/fix-debian-scripts
+++ emacs20-20.7/debian/fix-debian-scripts
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+
+my $major_rev = $ARGV[0];
+my $minor_rev = $ARGV[1];
+my $upstream = $ARGV[2];
+my $target_sys = $ARGV[3];
+my @replacefiles = @ARGV[4 .. $#ARGV];
+
+my @info_files =
+    ("cl",
+     "dired-x",
+     "emacs",
+     "ediff",
+     "forms",
+     "gnus",
+     "info",
+     "message",
+     "mh-e",
+     "reftex",
+     "sc",
+     "vip",
+     "viper",
+     "widget");
+
+my $info_files_str = join(" ", @info_files);
+
+my $result = system("perl -pi" .
+                    " -e \"s/\\\@MAJOR_VERSION\\\@/${major_rev}/go;\"" .
+                    " -e \"s/\\\@MINOR_VERSION\\\@/${minor_rev}/go;\"" .
+                    " -e \"s/\\\@FULL_VERSION\\\@/${upstream}/go;\"" .
+                    " -e \"s/\\\@INFOFILES\\\@/${info_files_str}/go;\"" .
+                    " -e \"s/\\\@TARGET_SYS\\\@/${target_sys}/go;\"" .
+                    " " . join(' ', @replacefiles));
+
+exit ($result / 256);
--- emacs20-20.7.orig/debian/control.in
+++ emacs20-20.7/debian/control.in
@@ -0,0 +1,30 @@
+Source: emacs@MAJOR_VERSION@
+Section: editors
+Priority: optional
+Maintainer: Rob Browning <rlb@defaultvalue.org>
+Build-Depends: mailx, libxaw-dev, libncurses5-dev, texinfo, liblockfile-dev
+Standards-Version: 2.1.2.2
+
+Package: emacs@MAJOR_VERSION@
+Section: editors
+Priority: optional
+Architecture: any
+Depends: emacsen-common (>= 1.4.10), dpkg (>= 1.9.0), ${shlibs:Depends}
+Provides: emacsen, info-browser, mail-reader, news-reader, www-browser
+Suggests: emacs@MAJOR_VERSION@-el
+Conflicts: emacs@MAJOR_VERSION@-el (<< @PACKAGE_VERSION@), w3-el
+Priority: standard
+Description: The GNU Emacs editor.
+ GNU Emacs is the extensible self-documenting text editor.
+
+Package: emacs@MAJOR_VERSION@-el
+Section: editors
+Priority: optional
+Architecture: all
+Depends: emacs@MAJOR_VERSION@ (= @PACKAGE_VERSION@)
+Replaces: emacs@MAJOR_VERSION@
+Priority: optional
+Description: GNU Emacs LISP (.el) files.
+ GNU Emacs is the extensible self-documenting text editor.
+ This package contains the elisp sources for the convenience of users,
+ saving space in the main package for small systems.
--- emacs20-20.7.orig/debian/emacsclient-plus
+++ emacs20-20.7/debian/emacsclient-plus
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+
+# If there is an Emacs server, runs emacsclient.
+# Otherwise, launches Emacs.
+# Only for systems with Berkeley sockets (like Debian GNU/Linux).
+
+$real_emacsclient = "/usr/bin/emacsclient";
+$socket_prefix = "esrv";
+$id = `id --user`;
+chomp $id;
+$socket_dir = "/tmp/";
+$hostname = `hostname`;
+chomp $hostname;
+
+if (-S "$socket_dir$socket_prefix$id-$hostname") {
+    exec ("$real_emacsclient " . join (" ", @ARGV));            
+    die "Cannot run $real_emacsclient: $!";
+}
+else {
+    if ($ENV{'DISPLAY'}) {
+        system "emacs &";
+        # Wait the server (Emacs is slow)
+        sleep 2;
+        exec ("$real_emacsclient " . join (" ", @ARGV));                
+        die "Cannot run $real_emacsclient: $!";
+    }
+    else {
+        exec ("emacs " . join (" ", @ARGV));            
+        die "Cannot run emacs: $!";
+    }
+}
--- emacs20-20.7.orig/debian/copyright
+++ emacs20-20.7/debian/copyright
@@ -0,0 +1,38 @@
+-*-text-*-
+
+This package was debianized by Rob Browning <rlb@defaultvalue.org> on
+Tue, 16 Dec 1997 00:05:45 -0600.
+
+The source is a combination of the following files:
+
+  prep.ai.mit.edu:/pub/gnu/emacs-20.7.tar.gz
+  prep.ai.mit.edu:/pub/gnu/leim-20.7.tar.gz
+
+Copyright:
+
+  GNU Emacs is Copyright (C) Free Software Foundation, Inc. and is
+   covered under the terms of the GPL.  See the file
+  /usr/share/common-licenses/GPL for more information.
+
+Debian specific difference from the upstream version:
+
+  This is an unfinished list, but is in the process of being fleshed
+  out.  Please file bugs for things that aren't mentioned here, but
+  should be.  This list must eventually be as complete as possible,
+  and I plan to try and ensure that by a full evaluation of the
+  current Debian diff file, but I won't have time for that for a bit.
+  When I do get the chance to do that, I'll also work with the
+  upstream to get all of the relevant patches
+  contributed/assigned/etc.
+
+  * We have added CONF_MAIL_PROGRAM_NAME to configure.in and use it in
+    fakemail.c.  Either via this variable, or via a #define in an arch
+    specific file, we now insist that this var be defined, and abort
+    compilation otherwise.  We use #error, which is probably not
+    portable, so we need a better solution long term.  This fix
+    repairs a nasty bug where on sparc-debian-linux-gnu at least,
+    MAIL_PROGRAM_NAME pointed to /bin/mail, which didn't exist, and
+    fakemail failed silently, losing mail.
+
+  * We have added mail spool dir location detection to configure.in
+    and propagated it along with tests for liblockfile.
--- emacs20-20.7.orig/debian/emacs.postrm
+++ emacs20-20.7/debian/emacs.postrm
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+MAJOR=@MAJOR_VERSION@
+MINOR=@MINOR_VERSION@
+FULL=@FULL_VERSION@
+TARGET_SYS=@TARGET_SYS@
+
+if test -x /usr/bin/update-menus; then update-menus; fi
+
+# Legacy removal...
+if [ -e /etc/suid.conf -a -x /usr/sbin/suidunregister ]; then
+  suidunregister -s emacs${MAJOR} ${MOVEMAIL}
+fi
+
+exit 0
--- emacs20-20.7.orig/debian/emacs.postinst
+++ emacs20-20.7/debian/emacs.postinst
@@ -0,0 +1,141 @@
+#!/bin/sh -e
+
+MAJOR=@MAJOR_VERSION@
+MINOR=@MINOR_VERSION@
+FULL=@FULL_VERSION@
+INFOFILES="@INFOFILES@"
+TARGET_SYS=@TARGET_SYS@
+
+if [ -f /usr/share/info/gnus.gz ]; then
+    CRUFT_INFOFILES="ccmode cl dired-x ediff emacs forms info mh-e reftex sc \
+                     vip viper widget"
+else
+    CRUFT_INFOFILES="ccmode cl dired-x ediff emacs forms gnus info message \
+                     mh-e reftex sc vip viper widget"
+fi
+
+if [ "$1" = "configure" ]
+then
+  if [ -d /usr/doc \
+       -a ! -e /usr/doc/emacs${MAJOR} \
+       -a -d /usr/share/doc/emacs${MAJOR} ]
+  then
+    ln -sf ../share/doc/emacs${MAJOR} /usr/doc/emacs${MAJOR}
+  fi
+fi
+
+# We have to clean these up because the old package didn't.  The info
+# files were being removed in the postinst, not the prerm, and so
+# install-info wasn't doing anything because the files weren't there..
+for file in ${CRUFT_INFOFILES}
+do
+  install-info --quiet --remove-exactly ${file} || true
+done
+
+for file in ${INFOFILES}
+do
+  install-info --quiet --section Emacs Emacs \
+    /usr/share/info/emacs-${MAJOR}/${file}.gz || true
+done
+
+# update-alternatives on things that collide with xemacs, other editors
+
+for i in ctags etags
+do
+  update-alternatives --install /usr/bin/$i $i /usr/bin/$i.emacs${MAJOR} 23 \
+    --slave /usr/share/man/man1/$i.1.gz $i.1.gz \
+            /usr/share/man/man1/$i.1emacs${MAJOR}.gz 
+done
+
+for i in b2m emacsclient rcs-checkin
+do
+  update-alternatives --install /usr/bin/$i $i /usr/bin/$i.emacs${MAJOR} 23
+done
+
+# Fix for bug in previous emacs20 (<=20.2) packages.
+update-alternatives --remove emacs /usr/bin/emacs-20.1 || true
+update-alternatives --remove emacs /usr/bin/emacs-20.2 || true
+
+# Now install the right link.
+update-alternatives --install /usr/bin/emacs emacs /usr/bin/emacs${MAJOR} 23 \
+  --slave /usr/share/man/man1/emacs.1.gz emacs.1.gz \
+          /usr/share/man/man1/emacs.1emacs${MAJOR}.gz
+
+if test -x /usr/bin/update-menus; then update-menus; fi
+
+
+# Create the site-lisp dir for this flavor if we're allowed
+
+#### Begin Bug fix hack for old emacs20 package brain damage.
+#
+# We have to handle /usr/local/share and /usr/local/share/emacs here
+# because emacs20 used to contain /usr/local/share :< .  Normally
+# these dirs should have been handled exclusively by emacsen-common.
+
+parentdir=/usr/local
+newdir=share
+
+if [ -d ${parentdir} ]
+then
+  if mkdir ${parentdir}/${newdir} 2>/dev/null
+  then
+    chown root:staff ${parentdir}/${newdir}
+    chmod 2775 ${parentdir}/${newdir}
+  fi
+fi
+
+parentdir=/usr/local/share
+newdir=emacs
+
+if [ -d ${parentdir} ]
+then
+  if mkdir ${parentdir}/${newdir} 2>/dev/null
+  then
+    chown root:staff ${parentdir}/${newdir}
+    chmod 2775 ${parentdir}/${newdir}
+  fi
+fi
+
+parentdir=/usr/local/share/emacs
+newdir=site-lisp
+
+if [ -d ${parentdir} ]
+then
+  if mkdir ${parentdir}/${newdir} 2>/dev/null
+  then
+    chown root:staff ${parentdir}/${newdir}
+    chmod 2775 ${parentdir}/${newdir}
+  fi
+fi
+
+#### End Bug fix hack for old emacs20 package brain damage.
+
+
+parentdir=/usr/local/share/emacs
+newdir=${FULL}
+
+if [ -d ${parentdir} ]
+then
+  if mkdir ${parentdir}/${newdir} 2>/dev/null
+  then
+    chown root:staff ${parentdir}/${newdir}
+    chmod 2775 ${parentdir}/${newdir}
+  fi
+fi
+
+parentdir=/usr/local/share/emacs/${FULL}
+newdir=site-lisp
+
+if [ -d ${parentdir} ]
+then
+  if mkdir ${parentdir}/${newdir} 2>/dev/null
+  then
+    chown root:staff ${parentdir}/${newdir}
+    chmod 2775 ${parentdir}/${newdir}
+  fi
+fi
+
+# emacsen-common registration.
+/usr/lib/emacsen-common/emacs-install emacs${MAJOR}
+
+exit 0
--- emacs20-20.7.orig/debian/rules
+++ emacs20-20.7/debian/rules
@@ -0,0 +1,461 @@
+#!/usr/bin/make -f
+
+# This file is licensed under the terms of the Gnu Public License.
+# With the one additional provision that Ian Jackson's name may not be
+# removed from the file.
+
+# Copyright 1994,1995 by Ian Jackson.
+# Copyright 1998-2001 Rob Browning <rlb@defaultvalue.org>.
+
+# Originally copied from the GNU Hello Debian rules file (1.3).
+# modified for emacs by Mark Eichin <eichin@kitten.gen.ma.us>
+# modified for emacs20 by Rob Browning <rlb@defaultvalue.org>
+
+SHELL := /bin/bash
+pwd := $(shell pwd)
+
+# For now we assume that emacs' versioning scheme is always
+# MAJOR.MINORtinyrev where MAJOR and MINOR are integers and tinyrev is
+# an optional lowercase letter (or letters).  We also assume that
+# upstream uses a numbering scheme that sorts in a "Debian friendly"
+# way.  So far that's always been true.  If it becomes false, some of
+# the values below will have to be set manually.
+
+# At the moment, we try to make it so that a "debian/rules clean" will
+# get you back to the same state you were in before "debian/rules
+# build", but that's kinda tricky.  Right now, we try to avoid diff
+# bloat by keeping the original upstream .elc files in the source
+# package, and only re-byte-compiling files once they've been
+# transferred to debian/tmp-emacs.  This has associated dangers since if we
+# make any changes to the .el files that are needed during the build
+# process, they won't show up.  At some point we may need to revisit
+# the build process and consider shipping the debian source package
+# with matching .elc files, diff bloat or not.  I think perhaps I'll
+# ask Gerd what his opinion is...
+#
+# For now, be aware that the current approach means that we have to
+# have special handling for the info-files, the lisp_precious files,
+# and the leim files (leim doesn't have an accurate clean target,
+# if appropriate, I should create one and send it back upstream rather
+# than hacking it here).
+
+# The version from the changelog (i.e. 20.5-1)
+debian_ver := $(shell dpkg-parsechangelog | grep Version)
+debian_ver := $(shell echo ${debian_ver} | perl -pe 's/Version:\s+//o')
+# The Debian revision (i.e. the 1 from 20.5-1)
+# Always everything after the last '-'
+debian_rev := $(shell echo ${debian_ver} | perl -pe 's/.*-//o')
+
+# This is the official upstream version (the one in the tarfile names).
+nominal_ver := $(shell echo ${debian_ver} | perl -pe 's/-[^-]+$$//o')
+
+# This must be the version that's actually used at runtime for things
+# like load-path.  It may not be the same as the upstream version
+# (i.e. when you have upstream 20.5a, the functional version may still
+# be 20.5), so we do this by hand.
+runtime_ver := $(shell echo ${nominal_ver} | perl -pe 's/[a-z]+$$//o')
+
+major_ver := $(shell echo ${runtime_ver} | perl -pe 's/\.[^.]*$$//o')
+minor_ver := $(shell echo ${runtime_ver} | perl -pe 's/^[^.]*\.//o')
+
+DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_GNU_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
+DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
+
+ifeq ($(DEB_HOST_GNU_SYSTEM), linux)
+  target := $(DEB_HOST_GNU_CPU)-debian-linux-gnu
+else
+  target := $(DEB_HOST_GNU_TYPE)
+endif
+
+# Uncomment if strip is broken
+# CFLAGS    := -DDEBIAN -O2
+# LDFLAGS   :=
+
+# ifeq (${DEB_HOST_ARCH}, powerpc)
+#   # Junk for gcc problem...
+#   PATH:=${pwd}/debian/bin/gcc:${PATH}
+#   export PATH
+#   DEBIAN_SRCDIR=${pwd}
+#   export DEBIAN_SRCDIR
+# endif
+
+CFLAGS    := -DDEBIAN -O2 -g
+LDFLAGS   := -g
+
+local_lpath := /etc/emacs${major_ver}:/etc/emacs
+local_lpath := ${local_lpath}:/usr/local/share/emacs/${runtime_ver}/site-lisp
+local_lpath := ${local_lpath}:/usr/local/share/emacs/site-lisp
+local_lpath := ${local_lpath}:/usr/share/emacs/${runtime_ver}/site-lisp
+local_lpath := ${local_lpath}:/usr/share/emacs/site-lisp
+
+src_tree_lisp_path := \
+  $(shell find lisp leim -type d -printf "${pwd}/%p\n" | \
+       perl -e 'my @d = <>; chomp @d; print join(":", @d);')
+
+# This shouldn't be needed as of 20.3
+local_lpath := ${local_lpath}:/usr/share/emacs/${runtime_ver}/leim
+
+lisp_precious := startup.el
+
+# These files are created during the build and aren't handled in any
+# "make clean", so we have to handle them manually...
+leim_tits := $(shell find leim -name "*.tit" -printf "%f\n") 
+leim_trash := $(basename ${leim_tits})
+leim_trash := $(addsuffix .el,${leim_trash}) $(addsuffix .elc,${leim_trash})
+
+# Info files that are going to show up in the main dir.
+main_dir_info_files := \
+  cl \
+  dired-x \
+  ediff \
+  emacs \
+  forms \
+  gnus \
+  info \
+  message \
+  mh-e \
+  reftex \
+  sc \
+  vip \
+  viper \
+  widget
+
+check_vars:
+	@echo "pwd: ${pwd}"
+	@echo "debian_ver: ${debian_ver}"
+	@echo "debian_rev: ${debian_rev}"
+	@echo "nominal_ver: ${nominal_ver}"
+	@echo "runtime_ver: ${runtime_ver}"
+	@echo "major_ver: ${major_ver}"
+	@echo "minor_ver: ${minor_ver}"
+.PHONY: check_vars
+
+# Update the automatically generated files.
+# Useful before a CVS commit.
+debian-sync: $(patsubst %.in,%,$(wildcard debian/*.in))
+
+debian/% : debian/%.in debian/changelog
+	perl -p -e "s/\@MAJOR_VERSION\@/${major_ver}/go;" \
+          -e "s/\@MINOR_VERSION\@/${minor_ver}/go;" \
+          -e "s/\@FULL_VERSION\@/${runtime_ver}/go;" \
+          -e "s/\@PACKAGE_VERSION\@/${debian_ver}/go;" \
+          -e "s/\@DEBIAN_REV\@/${deb_rev}/go;" \
+          -e "s/\@NOMINAL_VERSION\@/${nominal_ver}/go;" \
+			> $@ < $<
+
+debian/stamp-setup: debian/control debian/copyright debian/menu
+	find debian/bin -type f | xargs chmod 775
+	touch debian/stamp-setup
+
+debian/stamp-configure: debian/stamp-setup
+	${checkdir}
+	CFLAGS="${CFLAGS}" ./configure ${target} \
+	  --prefix=/usr \
+	  --sharedstatedir=/var/lib \
+	  --libexecdir=/usr/lib \
+	  --localstatedir=/var/lib \
+	  --infodir=/usr/share/info \
+	  --mandir=/usr/share/man \
+	  --with-pop=yes \
+	  --with-x=yes --with-x-toolkit=yes
+
+        # Because paths-force is called in configure, but configure
+        # doesn't support --locallisppath
+	${MAKE} CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
+		prefix=/usr \
+          sharedstatedir=/var/lib \
+          libexecdir=/usr/lib \
+          infodir=/usr/share/info \
+          manext=.1emacs${major_ver} \
+	  locallisppath=${local_lpath} epaths-force
+
+	touch debian/stamp-configure
+
+define build_cmd
+	${MAKE} CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
+          prefix=/usr \
+          sharedstatedir=/var/lib \
+          libexecdir=/usr/lib \
+          infodir=/usr/share/info \
+          manext=.1emacs${major_ver} \
+	  locallisppath=${local_lpath}
+endef
+
+build: debian/stamp-configure
+	${checkdir}
+
+	${build_cmd}
+
+	test -d debian/lisp-precious || mkdir debian/lisp-precious
+
+	$(foreach file,${lisp_precious}, \
+          if [ ! -e debian/lisp-precious/${file}c ]; \
+            then mv lisp/${file}c debian/lisp-precious; \
+          fi)
+
+	EMACSLOADPATH=${src_tree_lisp_path} \
+          ${pwd}/src/emacs -q -no-site-file -batch -f batch-byte-compile \
+            $(addprefix lisp/,${lisp_precious})
+
+	rm src/emacs
+
+	$(build_cmd)
+
+	if [ ! -e debian/info-safe ]; \
+        then \
+          rm -rf debian/info.tmp; \
+	  cp -a info debian/info.tmp; \
+	  mv debian/info.tmp debian/info-safe; \
+        fi
+
+	(cd info && rm `find -type f -maxdepth 1 -not -name COPYING -not -name dir`)
+	(cd man && make)
+
+	touch build
+
+clean:
+	${checkdir}
+	-mv -f debian/lisp-precious/* lisp
+
+        # Restore the upstream info dir so we don't get unnecessary diff bloat.
+	if [ -d debian/info-safe ]; \
+        then \
+          rm -rf info; \
+          mv debian/info-safe info; \
+        fi
+	-rm -rf debian/info.tmp
+
+	rm -f build debian/stamp-* debian/substvars \
+          src/config.stamp src/stamp-oldxmenu
+
+        # not sure this is needed anymore...
+	rm -f leim/leim-list.el 
+	(cd leim/quail && rm -f ${leim_trash})
+
+	-make distclean
+	-rmdir cpp
+	find -name '*~' | xargs --no-run-if-empty rm -f
+	-rm -rf debian/lisp-precious debian/tmp-emacs debian/tmp-emacs-el \
+          debian/files* config.log core man/Makefile
+
+debian/stamp-install-tree:
+	rm -rf debian/tmp-emacs
+
+	install -d debian/tmp-emacs
+
+#    INSTALL_PROGRAM="install -s" \
+
+	PATH=${pwd}/debian/bin/info:${PATH}  ${MAKE} install \
+	  INSTALL_STRIP="-s" \
+	  prefix=${pwd}/debian/tmp-emacs/usr \
+	  sharedstatedir=${pwd}/debian/tmp-emacs/var/lib \
+	  libexecdir=${pwd}/debian/tmp-emacs/usr/lib \
+	  infodir=${pwd}/debian/tmp-emacs/usr/share/info/emacs-${major_ver} \
+	  mandir=${pwd}/debian/tmp-emacs/usr/share/man \
+	  manext=.1emacs${major_ver} \
+	  locallisppath=${local_lpath}
+
+        # Kill /usr/local dir
+	rm -r debian/tmp-emacs/usr/local
+
+        # /usr/bin files
+	rm debian/tmp-emacs/usr/bin/emacs
+	cd debian/tmp-emacs/usr/bin/ && ln -s emacs-${runtime_ver} emacs${major_ver}
+	for file in b2m ctags emacsclient etags rcs-checkin; do \
+	  mv debian/tmp-emacs/usr/bin/$$file \
+	     debian/tmp-emacs/usr/bin/$$file.emacs${major_ver}; \
+        done
+
+        # Can't strip emacs right now because strip is broken
+	(cd debian/tmp-emacs && find `ls | grep -v DEBIAN` -type f -perm +u=x \
+	  -not -name rcs-checkin.emacs${major_ver} \
+	  -not -name emacs-${runtime_ver} \
+	  -not -name vcdiff \
+	  -not -name rcs2log \
+	   | xargs strip)
+
+        # manpages
+	cp debian/emacsclient.1 debian/tmp-emacs/usr/share/man/man1
+	perl -pi -e "s|man1/etags\\.1|man1/etags\\.1emacs${major_ver}|" \
+          debian/tmp-emacs/usr/share/man/man1/ctags.1emacs20
+	find debian/tmp-emacs/usr/share/man -type f | xargs gzip -9v
+
+        # lisp path directories
+	install -d debian/tmp-emacs/etc/emacs${major_ver}/site-start.d
+	install -d debian/tmp-emacs/usr/share/emacs${major_ver}/
+	cd debian/tmp-emacs/usr/share/emacs${major_ver} && \
+	  ln -sf ../emacs/${runtime_ver}/site-lisp .
+
+        # Byte recompile *everything*, just to be sure.  This keeps us
+        # from having to worry about whether or not timestamps properly
+        # survive my CVS tree, the debian source packages, etc.  For now,
+        # I'd rather just waste CPU cycles to make sure everything's right.
+        # And a fresh set of .elc files should make everyone feel warm
+        # and fuzzy inside...
+        #
+        # Also, this means that the EL_MODIFIED_FOR_DEBIAN stuff is vestigal
+        # and should be removed later...
+
+	cd debian/tmp-emacs && \
+	  EMACSLOADPATH=`find usr/share -type d \
+	    -printf "${pwd}/debian/tmp-emacs/%p\n" | \
+	      perl -e 'my @d = <>; chomp @d; print join(":", @d);'` \
+	        ${pwd}/src/emacs -q --no-site-file -batch \
+	          --eval '(byte-recompile-directory "." nil t)'
+
+	touch debian/stamp-install-tree
+
+
+binary-indep:	checkroot build debian/stamp-install-tree
+	${checkdir}
+	rm -rf debian/tmp-emacs-el
+
+        # emacs${major_ver}-el files (move all the .el files that have 
+        # a corresponding .elc file to the emacs${major_ver}-el package)
+	install -d debian/tmp-emacs-el
+	(cd debian/tmp-emacs && \
+	  find -name "*.elc" | perl -pe 's/\.elc$$/\.el/o' | \
+	    tar cpf - --files-from -) | \
+	      (cd debian/tmp-emacs-el && tar xpf -)
+
+	install -d debian/tmp-emacs-el/usr/share/doc/emacs${major_ver}-el
+
+	cp debian/changelog \
+         debian/tmp-emacs-el/usr/share/doc/emacs${major_ver}-el/changelog.Debian
+
+        # Now compress before adding copyright.
+	find debian/tmp-emacs-el/usr/share/doc/emacs${major_ver}-el -type f | \
+	  xargs gzip -9v
+
+	cp debian/copyright \
+         debian/tmp-emacs-el/usr/share/doc/emacs${major_ver}-el
+
+        # Mangle permissions to conform.
+	chown -R root.root debian/tmp-emacs-el
+	find debian/tmp-emacs-el -type d | xargs chmod 755
+	find debian/tmp-emacs-el -not -type d -a -not -type l | \
+	  xargs chmod 644
+
+	install -d --mode 755 debian/tmp-emacs-el/DEBIAN
+        # control scripts	
+	install -m 755 debian/emacs-el.postinst \
+	               debian/tmp-emacs-el/DEBIAN/postinst
+	install -m 755 debian/emacs-el.prerm \
+	               debian/tmp-emacs-el/DEBIAN/prerm
+
+	chmod ug+x debian/fix-debian-scripts
+	debian/fix-debian-scripts \
+	  ${major_ver} ${minor_ver} ${runtime_ver} ${target} \
+	  debian/tmp-emacs-el/DEBIAN/postinst \
+	  debian/tmp-emacs-el/DEBIAN/prerm
+
+	dpkg-gencontrol -isp -pemacs${major_ver}-el -Pdebian/tmp-emacs-el
+	dpkg --build debian/tmp-emacs-el ..
+
+
+binary-arch: checkroot build debian/stamp-install-tree
+	${checkdir}
+
+        # Make sure you can't build a bad -el package
+	rm -f debian/stamp-install-tree
+
+	(cd debian/tmp-emacs && \
+	  find -name "*.elc" | perl -pe 's/\.elc$$/\.el/o' | xargs rm)
+
+        # Handle the duplicate file that got created because we built twice.
+	rm debian/tmp-emacs/usr/share/emacs/${runtime_ver}/etc/DOC-${runtime_ver}.1
+	rm debian/tmp-emacs/usr/lib/emacs/${runtime_ver}/${target}/fns-${runtime_ver}.1.el
+
+        # /usr/share/doc/emacs${major_ver} directory
+	install -d debian/tmp-emacs/usr/share/doc/emacs${major_ver}
+	cp README BUGS GETTING.GNU.SOFTWARE \
+	   debian/tmp-emacs/usr/share/doc/emacs${major_ver}
+	cp ChangeLog debian/tmp-emacs/usr/share/doc/emacs${major_ver}/changelog
+	cp debian/changelog \
+	   debian/tmp-emacs/usr/share/doc/emacs${major_ver}/changelog.Debian
+	cp debian/README.add-on-package-maintainers \
+	   debian/tmp-emacs/usr/share/doc/emacs${major_ver}
+	find debian/tmp-emacs/usr/share/doc/emacs${major_ver} -type f | xargs gzip -9v
+	cp debian/copyright debian/tmp-emacs/usr/share/doc/emacs${major_ver}
+	(cd debian/tmp-emacs/usr/share/doc/emacs${major_ver} && \
+         ln -s ../../../share/emacs/${runtime_ver}/etc .)
+
+        # info files
+        # Mangle menu entries for subdir.
+	chmod 755 debian/mangle-info
+	$(foreach f, ${main_dir_info_files}, \
+	  DEBIAN_INFO_PREFIX=emacs-${major_ver} \
+	    debian/mangle-info debian/tmp-emacs/usr/share/info/emacs-${major_ver}/$f;)
+
+        # Get rid of unwanted dir file.
+	rm debian/tmp-emacs/usr/share/info/emacs-${major_ver}/dir
+
+        # compress
+	find debian/tmp-emacs/usr/share/info -type f | xargs gzip -9v
+
+        # menu items
+	install -d debian/tmp-emacs/usr/lib/menu
+	cp debian/menu debian/tmp-emacs/usr/lib/menu/emacs${major_ver}
+	cp debian/gnu-32x32.xpm \
+	  debian/tmp-emacs/usr/share/emacs/${runtime_ver}/etc/gnu-32x32.xpm
+
+        # Mangle permissions to conform.
+	chown -R root.root debian/tmp-emacs
+	find debian/tmp-emacs -type d | xargs chmod 755
+	find debian/tmp-emacs -not -type d -a -not -type l | xargs chmod 644
+	find debian/tmp-emacs/usr/lib/emacs/${runtime_ver}/${target}/ \
+	  -type f -not -name "*.el" | xargs chmod 755
+	chmod 755 debian/tmp-emacs/usr/bin/*
+
+        # control scripts	
+	install -d debian/tmp-emacs/DEBIAN
+	install -m 755 debian/emacs.preinst debian/tmp-emacs/DEBIAN/preinst
+	install -m 755 debian/emacs.postinst debian/tmp-emacs/DEBIAN/postinst
+	install -m 755 debian/emacs.prerm debian/tmp-emacs/DEBIAN/prerm
+	install -m 755 debian/emacs.postrm debian/tmp-emacs/DEBIAN/postrm
+
+	chmod ug+x debian/fix-debian-scripts
+	debian/fix-debian-scripts \
+	  ${major_ver} ${minor_ver} ${runtime_ver} ${target} \
+	  debian/tmp-emacs/DEBIAN/preinst \
+	  debian/tmp-emacs/DEBIAN/postinst \
+	  debian/tmp-emacs/DEBIAN/prerm \
+	  debian/tmp-emacs/DEBIAN/postrm
+
+	dpkg-shlibdeps debian/tmp-emacs/usr/bin/* \
+	  `find debian/tmp-emacs/usr/lib/emacs/${runtime_ver}/${target}/ -type f -perm +u=x`
+
+        # Set up movemail (after dpkg-shlibdeps to avoid fakeroot sgid problem).
+	chown root \
+	  debian/tmp-emacs/usr/lib/emacs/${runtime_ver}/${target}/movemail
+	chgrp mail \
+	  debian/tmp-emacs/usr/lib/emacs/${runtime_ver}/${target}/movemail
+	chmod g+s \
+	  debian/tmp-emacs/usr/lib/emacs/${runtime_ver}/${target}/movemail
+
+	dpkg-gencontrol -isp -pemacs${major_ver} -Pdebian/tmp-emacs
+	dpkg --build debian/tmp-emacs ..
+
+define checkdir
+	test -f debian/rules
+endef
+
+# Below here is fairly generic really
+
+# For this package, order here may be important -- leave indep first.
+binary: binary-indep binary-arch
+
+source diff:
+	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+checkroot:
+	${checkdir}
+	test root = "`whoami`"
+
+.PHONY: binary binary-arch binary-indep clean checkroot
+
+# Local variables:
+# mode: makefile
+# End:
--- emacs20-20.7.orig/debian/changelog
+++ emacs20-20.7/debian/changelog
@@ -0,0 +1,445 @@
+emacs20 (20.7-13.1) unstable; urgency=high
+
+  * Backport stuff from emacs21 to fix nocombreloc problems
+    (Closes: #134106).
+
+ -- Colin Walters <walters@debian.org>  Tue,  2 Apr 2002 17:11:31 -0500
+
+emacs20 (20.7-13) unstable; urgency=high
+
+  * try again with nocombreloc - fix to hopefully work
+    everywhere. (closes: #123063)
+
+ -- Rob Browning <rlb@defaultvalue.org>  Mon, 10 Dec 2001 15:45:55 -0600
+
+emacs20 (20.7-12) unstable; urgency=high
+
+  * change to priority optional.
+  * fix vc-path to be correct for a Debian system.
+  * re-add lost hppa and s390 patches.
+  * add -z nocombreloc to LDFLAGS to fix binutils problem.
+
+ -- Rob Browning <rlb@defaultvalue.org>  Thu,  6 Dec 2001 16:02:30 -0600
+
+emacs20 (20.7-11) unstable; urgency=low
+
+  * Don't "clean up" the wrong info files. (closes: Bug#111691)
+
+ -- Rob Browning <rlb@defaultvalue.org>  Mon, 22 Oct 2001 08:43:41 -0500
+
+emacs20 (20.7-10) unstable; urgency=medium
+
+  * Add arch header for mipsel and fix configure.in and
+    configure. (closes: #103959)
+
+ -- Rob Browning <rlb@defaultvalue.org>  Mon, 23 Jul 2001 09:23:06 -0500
+
+emacs20 (20.7-9) unstable; urgency=low
+
+  * Added more Build-Depends. (closes: #101832)
+  * Disable ralloc on Hurd.  Thanks to Robert Bihlmeyer
+    <robbe@orcus.priv.at>. (closes: #101926)
+
+ -- Rob Browning <rlb@defaultvalue.org>  Tue, 10 Jul 2001 12:48:22 -0500
+
+emacs20 (20.7-8) unstable; urgency=low
+
+  * Added ia64 patches from Bdale Garbee <bdale@gag.com> for ia64.h.
+    (closes: #90518)
+  * Added Build-Depends on mailx for now (though this is *wrong* for the
+    long run -- I need to fix my fakemail handling).
+    (closes: #95903, #96761)
+  * Fix fakeroot sgid problem (move movemail chmod +s in debian/rules).
+  * Remove emacs' overzealous dir.gz file.
+  * Shrink gnu.xpm to 32x32 and make it the menu icon. (closes: #20253, #21310)
+  * Update manpage to not refer to kitchen sink anymore -- though with
+    emacs21, we're going to move back to using whatever they choose.
+    (closes: #81682)
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Wed, 13 Jun 2001 23:56:16 -0500
+
+emacs20 (20.7-7) unstable; urgency=low
+
+  * Fixed reftex-info problem. (closes: #44837).
+  * Fix install-strip target in Makefile.in.  Thanks to 
+    Kalle Olavi Niemitalo <tosi@ees2.oulu.fi>.  (closes: #51348)
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Sat,  5 May 2001 23:50:50 -0500
+
+emacs20 (20.7-6) unstable; urgency=low
+
+  * Fix improper usage of dpkg-statoverride and make sure movemail is set
+    up right. (closes: #95953)
+  * Fix bad manpage location in postinst update-alternatives call.
+  * Fix bad .so in ctags manpage (closes: #88231, #45317, #65017, #74570)
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Sat,  5 May 2001 09:47:40 -0500
+
+emacs20 (20.7-5) unstable; urgency=low
+
+  * configure.in: add detection of CONF_MAIL_PROGRAM_NAME.
+  * lib-src/fakemail.c: use CONF_MAIL_PROGRAM_NAME when appropriate
+    (closes: #72103) -- need to forward upstream.
+  * Add "modified by Debian" clause to (emacs-version) at RMS's request.
+  * Start Debian modifications section in copyright file as per policy.
+  * Add build fixes for hurd (closes: #78461).  Changes suggested by
+    Marcus.Brinkmann@ruhr-uni-bochum.de.  Thanks.
+  * Switch from Debian sendmail.el hack to Francesco's suggestion of
+    setting mail-from-style to 'system-default by default at startup
+    (closes: #35128).  This allows the user to override when desired in
+    the normal way.  This should be discussed with the upstream
+    maintainers.  They may be amenable to making this the default on
+    Debian systems.
+  * add dependency on dpkg (>= 1.9.0) for new install-info.
+  * info pages should finally work right (or at least closer to right).
+    They're now installed in /usr/share/info/emacs-20/ under their normal
+    names, and install-info can add the appropriate (emacs-20/emacs),
+    etc. entries to /usr/share/info/dir.  This hopefully closes a bunch of
+    old bugs.
+    (closes: #64994, #64512, #64025, #62155, #59332, #51163, #40443)
+  * No more files in /usr/doc. (closes: #91454, #63768)
+  * /usr/man moved to /usr/share/man. (closes: #91149)
+  * This should be fixed, in addition we've switched to dpkg-statoverride
+    (closes: #73007)
+  * /usr/share/info/dir.gz should be gone.
+    (closes: #75594, #68551, #65012)
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Sun, 29 Apr 2001 22:03:33 -0500
+
+emacs20 (20.7-4) unstable frozen; urgency=low
+
+  * Upload to unstable *and* frozen since this fixes outstanding grave
+    bugs.
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Thu, 27 Jul 2000 16:21:15 -0500
+
+emacs20 (20.7-3) unstable; urgency=low
+
+  * Change code to rebuild *all* the install tree .elc files at build
+    time.  This should fix the grave problems with gnus trashing mail at
+    the expense of more CPU at build time.
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Wed, 19 Jul 2000 20:27:27 -0500
+
+emacs20 (20.7-2) frozen unstable; urgency=low
+
+  * Revert to setting debian-emacs-flavor in startup.el as per recent
+    flip-flop in debian-emacs-policy :<  This was a *tiny* source change,
+    and definitely has to go into frozen - too much breaks otherwise.
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Tue, 20 Jun 2000 11:31:29 -0500
+
+emacs20 (20.7-1) frozen unstable; urgency=low
+
+  * New upstream bug-fix version.  Fixes security bugs, among others.
+  * Removed some now redundant Debian patches.
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Sat, 17 Jun 2000 12:59:48 -0500
+
+emacs20 (20.6-3) unstable frozen; urgency=medium
+
+  * Temp fix for alpha corruption problem in cm/src.h
+    src/termcap.c, src/terminfo.c, and src/sysdep.c (forwarded bug 63993).
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Mon, 12 Jun 2000 18:55:22 -0500
+
+emacs20 (20.6-2) frozen unstable; urgency=low
+
+  * Make sure info files get registered after /usr/share migration.
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Fri, 12 May 2000 15:30:02 -0500
+
+emacs20 (20.6-1) frozen unstable; urgency=low
+
+  * Let emacsen-common handle setting debian-emacs-flavor and modify
+    "Depends:" accordingly.
+  * Maintainer release of 20.6 - fixes same issues as 20.6-0.1, so it
+    should go into frozen.
+  * Move info files to /usr/share/info.
+  * Make sure .elc files for .el files we've modified are *always* rebuilt.
+  * Add new unexelf.c from Gerd Moellmann <gerd@gnu.org>.  Without this,
+    emacs20 will *not* build on either frozen or unstable x86 machines.
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Fri, 12 May 2000 11:00:33 -0500
+
+emacs20 (20.6-0.1) frozen unstable; urgency=low
+
+  * Non-maintainer release.
+  * New upstream bug fix release (closes:#60931).
+  * ARM support merged upstream.
+  * Add security patches from RUS-CERT posting on BugTraq.
+  * postinst: Use 2775 as directory permissions in /usr/local (closes:#59919)
+
+ -- Joel Klecker <espy@debian.org>  Wed, 26 Apr 2000 11:26:28 -0700
+
+emacs20 (20.5a-2) unstable; urgency=low
+
+  * Check in a bogus modification to all the .el files that we modified
+    before 20.5a so that new .elc files with our changes will be generated
+    when we build.  This must be done every time an upstream change is
+    merged in.
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Tue, 28 Dec 1999 19:51:14 -0600
+
+emacs20 (20.5a-1) unstable; urgency=high
+
+  * Upstream version number is just fine (20.5a *is* newer than 20.5).
+    Switch to use it.
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Wed, 22 Dec 1999 11:12:44 -0600
+
+emacs20 (20.4.pre20.5a-1) unstable; urgency=high
+
+  * New upstream version, including some Y2K fixes.
+  * Use weird version to avoid epochs.  This is upstream 20.5a.
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Wed, 22 Dec 1999 00:16:52 -0600
+
+emacs20 (20.4-3) unstable; urgency=low
+
+  * Fix mistake in this file.  Fix bug number in architecture
+    dependency "closes" in last revision.
+  * Powerpc configure.in patch from Susumu OSAWA <susumuo@debian.org>.
+    (Should close bug 48997, but marked forwarded instead until patch is
+    resolved upstream.)
+  * Jargon problems apparently fixed. (closes: #31103 #37030)
+  * Gnus printing problems apparently fixed (closes: #20760)
+  * Fix manpage to refer to more accurate Debian file locations.
+    (closes: #35267)
+  * cperl-mode problem apparently fixed. (closes: #46739)
+  * Fix build stripping problem (use INSTALL_STRIP=-s rather than
+    INSTALL_PROGRAM="install -s").
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Sat,  4 Dec 1999 19:24:07 -0600
+
+emacs20 (20.4-2) unstable; urgency=low
+
+  * Modify mail-spool-directory/movemail patch in preparation for upstream
+    inclusion.
+  * Fix architecture dependency. (closes: #48997)
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Fri, 12 Nov 1999 17:59:01 -0600
+
+emacs20 (20.4-1) unstable; urgency=low
+
+  * New upstream version.
+  * I decided to go ahead and get this out without the major overhaul
+    that's coming, but I'm going to be working more tightly the core
+    upstream developers from now on, so there will be some more
+    substantial changes soon, including getting rid of more Debianisms and
+    double checking all our current patches.
+  * Fix movemail liblockfile detection to be non-Debian specific
+    (currently working out the appropriate upstream patch (see etc/NEWS)).
+  * Fix emacs to support a --with-mail-spool-directory configure option and to
+    automagically detect the right answer most of the time without it
+    (currently working out the appropriate upstream patch (see etc/NEWS)).
+  * Add the lisp-level variable mail-spool-directory which always contains
+    the location of the mail spool, and hack movemail, nnmail, rmail, and
+    friends to use it (currently working out the appropriate upstream
+    patch (see etc/NEWS)) .
+  * hexl-mode bug fixed upstream. (closes: #21762)
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Sat, 30 Oct 1999 13:24:39 -0500
+
+emacs20 (20.3-11) unstable; urgency=low
+
+  * Fix liblockfile version skew. (closes: #43803 #45123)
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Thu, 23 Sep 1999 13:27:00 -0500
+
+emacs20 (20.3-10) unstable; urgency=low
+
+  * Restructure debian/rules to build -el in binary-indep
+    (closes: #26761)
+  * Add emacsclient.1 manpage submitted ages ago. (closes: #22463)
+  * Handle duplicate DOC files (closes: #27668)
+  * Switch to gnu icon from old B&W drippy sink (closes: #33260)
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Tue,  6 Jul 1999 23:21:44 -0500
+
+emacs20 (20.3-9) unstable; urgency=low
+
+  * Added HURD patch from Marcus Brinkmann <brinkmd@debian.org>.
+    (closes: #38571).
+  * Backed out (global-set-key [delete] 'delete-char) modification 
+    (Ref: #26366).  This is too controversial (think cross-platform)
+    and needs to be resolved by the Debian Keyboard Czar in concert with
+    others.  For now we revert to the upstream behavior...
+  * Add /usr/share/info to info search path (closes: #38285).
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Fri, 11 Jun 1999 00:43:51 -0500
+
+emacs20 (20.3-8) unstable; urgency=low
+
+  * Added patch to emacs.c from Wolfram Gloger
+    <wmglo@dent.med.uni-muenchen.de> to fix exit segfaults.
+    (closes: #37745)
+  * Fixed suidregister inconsistency between postinst and postrm
+    (closes #36845)
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Sun, 30 May 1999 14:38:51 -0500
+
+emacs20 (20.3-7) unstable frozen; urgency=low
+
+  * Needed to go to frozen too: --print-architecture was an important
+    bug.  Should be OK since other fixes since -5 are minor and
+    important.
+  * Add conflict with w3-el (as per Ben Pfaff's <pfaffben@pilot.msu.edu>
+    request). (closes: #30413).
+  * Undo broken (and unneeded) "fix" for suidregister call in postrm.
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Thu, 28 Jan 1999 14:49:27 -0600
+
+emacs20 (20.3-6) unstable; urgency=low
+
+  * Use --print-installation-architecture rather than --print-architecture
+    (closes: #28177).
+  * Remove "#undef SIGIO" from m/arm.h as indicated by David Welton
+    <davidw@debian.org> (closes: #31279).
+  * Fix call to suidunregister (I didn't realize that it can't take
+    multiple file arguments) (closes: #21243 #26886).
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Wed, 27 Jan 1999 11:50:14 -0600
+
+emacs20 (20.3-5) frozen unstable; urgency=low
+
+  * Added NetWinder patches (closes: #28277).  (Thanks to David Welton)
+  * Rebuilt emacs20-el so the versions coincide.  In the future, people
+    need to be sure to build *both* binary packages when doing a
+    non-maintainer binary release.  (This fix justifies inclusion into
+    frozen).
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Sun,  1 Nov 1998 20:14:36 -0600
+
+emacs20 (20.3-4) unstable; urgency=low
+
+  * Fix gnus to default to /var/spool/mail rather than /usr/spool/mail for
+    mailbox locations (closes: #21364).
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Sat, 17 Oct 1998 14:28:45 -0500
+
+emacs20 (20.3-3) unstable; urgency=low
+
+  * Fixed leim.  All the input methods should work now (closes: #27398).
+  * Made (global-set-key [delete] 'delete-char) the default (closes: #26366).
+  * Fix ownership on emacs20-el files (closes: #27398).
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Tue, 13 Oct 1998 16:57:51 -0500
+
+emacs20 (20.3-2) unstable; urgency=low
+
+  * Added 20.2 patches for powerpc.  I omitted the patches to the
+    following files because it looks like equivalent fixes have already
+    made it into 20.3.  If anyone who understands that code better knows
+    differently, please let me know.  The rest of the patches applied
+    cleanly.
+      src/callproc.c.rej
+      src/dired.c.rej
+      src/fileio.c.rej
+      src/process.c.rej
+      src/regex.c.rej
+    I also modified src/m/powerpc.h to fix problems calling the ldscript.
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Mon,  7 Sep 1998 18:20:41 -0500
+
+emacs20 (20.3-1) unstable; urgency=low
+
+  * New upstream version.
+  * Modify all the debian/* stuff to automatically track version changes.
+  * Major changes to info page handling.  Emacs20 info is now integrated into
+    the main info page.  This was the best way I could think of to handle
+    cross references, etc. without major source changes.
+  * Locked emacs20-el and emacs20 package versions together with dependencies.
+  * Add info direntries for widget, info, and customize.
+  * Fix handling of /usr/local/share (which was badly broken).
+  * Turn stripping back on.  It appears to work.
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Tue,  1 Sep 1998 11:44:04 -0500
+
+emacs20 (20.2-9) unstable; urgency=low
+
+  * Fixes for leim problems (closes: #25536).  Thanks to
+    Junio Hamano <junio@twinsun.com>
+  * update-elc now made executable (closes: #25899).  Thanks to
+    Junio Hamano <junio@twinsun.com>
+  * Fix problem with package including dirs in /usr/local/share
+    (closes: #23431).
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Sat, 22 Aug 1998 11:45:16 -0500
+
+emacs20 (20.2-8) unstable; urgency=low
+
+  * Regenerate .elc files for .el files we've modified.  I didn't realize
+    that some of the .elc files were in the upstream tar file.  Hope this
+    doesn't break anything.  We haven't been using our sendmail and
+    message modifications until now.  (closes: #21079).
+  * Fix i386ism in debian scripts use "dpkg --print-architecture"
+    instead. (closes: #20548).
+  * Fixed reference in README.add-on-package-maintainers
+    (closes: #23445)
+  * Fix some alpha problems (closes: #21834).
+  * Had to add Replaces: emacs20 to emacs20-el to fix problem with
+    copyright files being in the wrong package (closes: #21531).
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Fri,  7 Aug 1998 20:39:59 -0500
+
+emacs20 (20.2-7) frozen unstable; urgency=low
+
+  * Changed emacs20-el from standard to optional.
+  * Fixed broken postrm (release critical) (closes: #24236)
+  * Don't strip emacs binary (strip is broken see binutils #23153).
+  * Since we can't strip, don't compile or link with "-g".
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Thu, 16 Jul 1998 16:58:04 -0500
+
+emacs20 (20.2-6) frozen unstable; urgency=low
+
+  * Gack.  Fix reject due to changed .tar.gz file (./leim added to tar).
+	
+ -- Rob Browning <rlb@cs.utexas.edu>  Wed,  8 Apr 1998 14:04:54 -0500
+
+emacs20 (20.2-5) frozen unstable; urgency=low
+
+  * Make sure to preserve timestamps on .el files in emacs20-el
+    (closes: #20274)
+  * Add leim support for alternate input methods.  May close several
+    bugs.
+	
+ -- Rob Browning <rlb@cs.utexas.edu>  Sun,  5 Apr 1998 10:38:20 -0500
+
+emacs20 (20.2-4) frozen unstable; urgency=low
+
+  * Added copright file to emacs20-el package (closes: #19300)
+  * suidmanager doesn't understand symbolic perms
+    (closes: #18448, #19213)
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Fri, 13 Mar 1998 13:01:07 -0600
+
+emacs20 (20.2-3) unstable; urgency=low
+
+  * Fixed problem with permissions on /usr/share/emacs/20.2/site-lisp/
+    (closes: #18717)
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Mon,  2 Mar 1998 12:02:33 -0600
+
+emacs20 (20.2-2) unstable; urgency=low
+
+  * fixed bad menu line (closes: #18362).
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Thu, 19 Feb 1998 10:52:58 -0600
+
+emacs20 (20.2-2) unstable; urgency=low
+
+  * Explicit dependency on liblockfile0 until bug is fixed
+    (closes #18186)
+  * added lisp/site-lisp.el to fix info path problem (closes #18190)
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Sat, 14 Feb 1998 19:19:09 -0600
+
+emacs20 (20.2-1) unstable; urgency=low
+
+  * movemail no longer suid -- not needed.
+  * start from scratch with emacs-20.2 source and old emacs-19.34 and
+    xemacs patches.
+
+ -- Rob Browning <rlb@cs.utexas.edu>  Tue, 16 Dec 1997 01:20:27 -0600
--- emacs20-20.7.orig/Makefile.in
+++ emacs20-20.7/Makefile.in
@@ -418,7 +418,9 @@
 
 ### Build Emacs and install it, stripping binaries while installing them.
 install-strip:
-	$(MAKE) INSTALL_STRIP=-s
+# One line fix by Kalle Olavi Niemitalo <tosi@ees2.oulu.fi>
+#	$(MAKE) INSTALL_STRIP=-s
+	$(MAKE) INSTALL_STRIP=-s install
 
 ### Build all the directories we're going to install Emacs in.	Since
 ### we may be creating several layers of directories (for example,
@@ -433,7 +435,7 @@
 	  ${bindir} ${docdir} ${libexecdir} \
 	  ${datadir}/emacs/site-lisp \
 	  ${datadir}/emacs/${version}/site-lisp \
-	  `echo ${locallisppath} | sed 's/:/ /g'`
+	  `echo debian/tmp-emacs${locallisppath} | sed 's/:/ debian\/tmp-emacs/g'`
 
 ### Delete all the installed files that the `install' target would
 ### create (but not the noninstalled files such as `make all' would
