changeset 108461:781e675fa6f4

Merge from mainline.
author Katsumi Yamaoka <katsumi@flagship2>
date Fri, 07 May 2010 12:19:28 +0000
parents 00dd71f829e6 (current diff) 47521399f06e (diff)
children 3f495b95cc84
files
diffstat 49 files changed, 529 insertions(+), 320 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu May 06 12:51:40 2010 +0000
+++ b/ChangeLog	Fri May 07 12:19:28 2010 +0000
@@ -1,3 +1,17 @@
+2010-05-07  Glenn Morris  <rgm@gnu.org>
+
+	* configure.in (LD_SWITCH_SYSTEM): Set with configure, not cpp.
+	Merges logic from src/s/* and src/Makefile.in.
+	(LD_SWITCH_SYSTEM_TEMACS): New output variable.
+
+2010-05-07  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Define START_FILES and LIB_STANDARD using autoconf.
+	* configure.in (START_FILES, LIB_STANDARD): New definitions, moved
+	here from src/s/*.h.
+	(HAVE_CRTIN): Remove, inline logic in the netbsd
+	START_FILES/LIB_STANDARD computation.
+
 2010-05-06  Glenn Morris  <rgm@gnu.org>
 
 	* configure.in (AC_PROG_LN_S): Remove test, nothing uses @LN_S@.
--- a/admin/CPP-DEFINES	Thu May 06 12:51:40 2010 +0000
+++ b/admin/CPP-DEFINES	Fri May 07 12:19:28 2010 +0000
@@ -99,7 +99,6 @@
 BSD4_3
 BSD_SYSTEM
 CLASH_DETECTION
-COFF_BSD_SYMBOLS
 C_SWITCH_X_SYSTEM
 DATA_SEG_BITS
 DATA_START
@@ -155,7 +154,6 @@
 HAVE_INDEX
 HAVE_INET_SOCKETS
 HAVE_INVERSE_HYPERBOLIC
-HAVE_LIB64_DIR
 HAVE_LIBKSTAT
 HAVE_LIBNCURSES
 HAVE_LIBPTHREADS
@@ -217,15 +215,9 @@
 IS_DIRECTORY_SEP
 KERNEL_FILE
 LDAV_SYMBOL
-LD_SWITCH_SYSTEM
-LD_SWITCH_SYSTEM_tmp
-LD_SWITCH_X_DEFAULT
 LIBS_SYSTEM
 LIBS_TERMCAP
 LIBXMU
-LIB_GCC
-LIB_MATH
-LIB_STANDARD
 LINKER
 LINUX_VERSION_CODE
 LISP_FLOAT_TYPE
@@ -238,32 +230,20 @@
 MIN_PTY_KERNEL_VERSION -- only used on Mac
 MODE_LINE_BINARY_TEXT
 MUST_UNDEF__STDC__
-NEED_BSDTTY
-NEED_ERRNO
-NEED_UNISTD_H
 NLIST_STRUCT
 NOT_C_CODE
 NO_ABORT
-NO_DIR_LIBRARY
 NO_EDITRES
 NO_MATHERR
-NO_SHARED_LIBS
 NO_TERMIO
 NSIG
 NSIG_MINIMUM
 NULL
 NULL_DEVICE
 ORDINARY_LINK
-OTHER_FILES
 O_APPEND
-O_BINARY
-O_CREAT
-O_EXCL
 O_RDONLY
 O_RDWR
-O_TEXT
-O_TRUNC
-O_WRONLY
 PAGESIZE
 PENDING_OUTPUT_COUNT
 POSIX
@@ -296,7 +276,6 @@
 SYSTEM_PURESIZE_EXTRA
 SYSTEM_MALLOC
 SYSV_SYSTEM_DIR
-Srandom
 TAB3
 TABDLY
 TERM
@@ -311,7 +290,6 @@
 UNEXEC
 UNIX98_PTYS
 USE_CRT_DLL
-USE_MAC_IMAGE_IO
 USE_TOOLKIT_SCROLL_BARS
 USG
 USG5
--- a/configure	Thu May 06 12:51:40 2010 +0000
+++ b/configure	Fri May 07 12:19:28 2010 +0000
@@ -701,10 +701,12 @@
 INSTALL_INFO
 GZIP_PROG
 MAKEINFO
-LIB_MATH
+LD_SWITCH_SYSTEM
 C_SWITCH_MACHINE
 C_SWITCH_SYSTEM
 CRT_DIR
+LIB_MATH
+START_FILES
 LIBSOUND
 PKG_CONFIG
 ALSA_CFLAGS
@@ -716,6 +718,7 @@
 LD_SWITCH_X_SITE_AUX_RPATH
 NS_OBJ
 NS_SUPPORT
+LIB_STANDARD
 HAVE_XSERVER
 RSVG_CFLAGS
 RSVG_LIBS
@@ -807,6 +810,7 @@
 PRE_ALLOC_OBJ
 POST_ALLOC_OBJ
 LD_SWITCH_SYSTEM_TEMACS
+LD_SWITCH_SYSTEM_EXTRA
 LTLIBOBJS'
 ac_subst_files=''
 ac_user_opts='
@@ -2782,14 +2786,6 @@
   ## NetBSD ports
   *-*-netbsd* )
     opsys=netbsd
-    if test -f /usr/lib/crti.o; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CRTIN /**/
-_ACEOF
-
-   fi
-
     case "${canonical}" in
       alpha*-*-netbsd*)	machine=alpha ;;
       i[3456]86-*-netbsd*) machine=intel386 ;;
@@ -5812,20 +5808,6 @@
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
-LIB_MATH=-lm
-
-case $opsys in
-  cygwin )
-    LIB_MATH=
-    ;;
-  darwin )
-    ## Adding -lm confuses the dynamic linker, so omit it.
-    LIB_MATH=
-    ;;
-esac
-
-
-
 #### Extract some information from the operating system and machine files.
 
 { $as_echo "$as_me:$LINENO: checking the machine- and system-dependent files to find out
@@ -5886,12 +5868,6 @@
 #define C_WARNINGS_SWITCH ${C_WARNINGS_SWITCH}
 #endif
 
-#ifndef LD_SWITCH_SYSTEM
-#define LD_SWITCH_SYSTEM
-#endif
-
-configure___ ld_switch_system=LD_SWITCH_SYSTEM
-
 #ifdef THIS_IS_CONFIGURE
 
 /* Get the CFLAGS for tests in configure.  */
@@ -5928,7 +5904,49 @@
 fi
 rm ${tempcname}
 
-ac_link="$ac_link $ld_switch_system"
+
+LD_SWITCH_SYSTEM=
+case "$opsys" in
+  freebsd)
+   ## Let `ld' find image libs and similar things in /usr/local/lib.
+   ## The system compiler, GCC, has apparently been modified to not
+   ## look there, contrary to what a stock GCC would do.
+   LD_SWITCH_SYSTEM=-L/usr/local/lib
+   ;;
+
+  gnu-linux)
+   ## cpp test was "ifdef __mips__", but presumably this is equivalent...
+   test "$machine" = "mips" && LD_SWITCH_SYSTEM="-G 0"
+   ;;
+
+  netbsd)
+   LD_SWITCH_SYSTEM="-Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib"
+   ;;
+
+  openbsd)
+   ## Han Boetes <han@mijncomputer.nl> says this is necessary,
+   ## otherwise Emacs dumps core on elf systems.
+   LD_SWITCH_SYSTEM="-Z"
+   ;;
+esac
+
+
+ac_link="$ac_link $LD_SWITCH_SYSTEM"
+
+## This is fun.  Some settings of LD_SWITCH_SYSTEM reference
+## LD_SWITCH_X_SITE_AUX, which has not been defined yet.  When using
+## cpp, it was expanded to null.  Thus LD_SWITCH_SYSTEM had different
+## values in configure and the Makefiles.  How helpful.
+## FIXME why not use LD_SWITCH_SYSTEM_TEMACS (or somesuch) instead?
+case "$opsys" in
+  gnu-linux)
+   ## LD_SWITCH_X_SITE_AUX is a -R option saying where to find X at run-time.
+   LD_SWITCH_SYSTEM="$LD_SWITCH_SYSTEM \$(LD_SWITCH_X_SITE_AUX)" ;;
+
+  netbsd|openbsd)
+   ## _AUX_RPATH is like _AUX, but uses -rpath instead of -R.
+   LD_SWITCH_SYSTEM="\$(LD_SWITCH_X_SITE_AUX_RPATH) $LD_SWITCH_SYSTEM" ;;
+esac
 
 
 C_SWITCH_MACHINE=
@@ -6422,6 +6440,45 @@
 
 
 
+LIB_MATH=-lm
+LIB_STANDARD=
+START_FILES=
+
+case $opsys in
+  cygwin )
+    LIB_MATH=
+    START_FILES='ecrt0.o'
+    ;;
+  darwin )
+    ## Adding -lm confuses the dynamic linker, so omit it.
+    LIB_MATH=
+    START_FILES='pre-crt0.o'
+    ;;
+  freebsd )
+    LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
+    START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
+    ;;
+  gnu-linux | gnu-kfreebsd )
+    LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o'
+    START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
+    ;;
+  hpux10-20 | hpux11 )
+    LIB_STANDARD=-lc
+    START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o'
+    ;;
+  netbsd | openbsd )
+    if test -f $(CRT_DIR)/crti.o; then
+	LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
+        START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
+    else
+	LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o'
+	START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o'
+    fi
+    ;;
+esac
+
+
+
 
 
 
@@ -9879,6 +9936,7 @@
      CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
      REAL_CFLAGS="$REAL_CFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
      LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES}"
+     LIB_STANDARD=
   fi
   if test "${ac_cv_header_AppKit_AppKit_h+set}" = set; then
   { $as_echo "$as_me:$LINENO: checking for AppKit/AppKit.h" >&5
@@ -10085,6 +10143,7 @@
 
 
 
+
 case "${window_system}" in
   x11 )
     HAVE_X_WINDOWS=yes
@@ -26273,6 +26332,23 @@
 
 
 
+## This exists because src/Makefile.in did some extra fiddling around
+## with LD_SWITCH_SYSTEM.  The cpp logic was:
+##   #ifndef LD_SWITCH_SYSTEM
+##   #if !defined (__GNUC__) && ((defined (BSD_SYSTEM) && !defined (COFF)))
+## Since all the *bsds define LD_SWITCH_SYSTEM, this simplifies to:
+## not using gcc, darwin system not on an alpha (ie darwin, since
+## darwin + alpha does not occur).
+## Note that unlike L_S_S, this is not used in ac_link.
+if test "x$LD_SWITCH_SYSTEM" = "x" && test "x$GCC" != "xyes" && \
+   test "$opsys" = "darwin"; then
+  LD_SWITCH_SYSTEM_EXTRA="-X"
+else
+  LD_SWITCH_SYSTEM_EXTRA=
+fi
+
+
+
 
 
 
--- a/configure.in	Thu May 06 12:51:40 2010 +0000
+++ b/configure.in	Fri May 07 12:19:28 2010 +0000
@@ -428,12 +428,6 @@
   ## NetBSD ports
   *-*-netbsd* )
     opsys=netbsd
-    if test -f /usr/lib/crti.o; then]
-dnl The close and open brackets here are because this section is quoted --
-dnl see the `changequote' comment above.
-      AC_DEFINE(HAVE_CRTIN, [], [Define to 1 if you have /usr/lib/crti.o.])
-[   fi
-
     case "${canonical}" in
       alpha*-*-netbsd*)	machine=alpha ;;
       i[3456]86-*-netbsd*) machine=intel386 ;;
@@ -841,20 +835,6 @@
   LDFLAGS=$late_LDFLAGS
   [AC_MSG_RESULT(no)])
 
-LIB_MATH=-lm
-
-case $opsys in
-  cygwin )
-    LIB_MATH=
-    ;;
-  darwin )
-    ## Adding -lm confuses the dynamic linker, so omit it.
-    LIB_MATH=
-    ;;
-esac
-
-AC_SUBST(LIB_MATH)
-
 #### Extract some information from the operating system and machine files.
 
 AC_CHECKING([the machine- and system-dependent files to find out
@@ -912,12 +892,6 @@
 #define C_WARNINGS_SWITCH ${C_WARNINGS_SWITCH}
 #endif
 
-#ifndef LD_SWITCH_SYSTEM
-#define LD_SWITCH_SYSTEM
-#endif
-
-configure___ ld_switch_system=LD_SWITCH_SYSTEM
-
 #ifdef THIS_IS_CONFIGURE
 
 /* Get the CFLAGS for tests in configure.  */
@@ -954,7 +928,49 @@
 fi]
 rm ${tempcname}
 
-ac_link="$ac_link $ld_switch_system"
+
+LD_SWITCH_SYSTEM=
+case "$opsys" in
+  freebsd)
+   ## Let `ld' find image libs and similar things in /usr/local/lib.
+   ## The system compiler, GCC, has apparently been modified to not
+   ## look there, contrary to what a stock GCC would do.
+   LD_SWITCH_SYSTEM=-L/usr/local/lib
+   ;;
+
+  gnu-linux)
+   ## cpp test was "ifdef __mips__", but presumably this is equivalent...
+   test "$machine" = "mips" && LD_SWITCH_SYSTEM="-G 0"
+   ;;
+
+  netbsd)
+   LD_SWITCH_SYSTEM="-Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib"
+   ;;
+
+  openbsd)
+   ## Han Boetes <han@mijncomputer.nl> says this is necessary,
+   ## otherwise Emacs dumps core on elf systems.
+   LD_SWITCH_SYSTEM="-Z"
+   ;;
+esac
+AC_SUBST(LD_SWITCH_SYSTEM)
+
+ac_link="$ac_link $LD_SWITCH_SYSTEM"
+
+## This is fun.  Some settings of LD_SWITCH_SYSTEM reference
+## LD_SWITCH_X_SITE_AUX, which has not been defined yet.  When using
+## cpp, it was expanded to null.  Thus LD_SWITCH_SYSTEM had different
+## values in configure and the Makefiles.  How helpful.
+## FIXME why not use LD_SWITCH_SYSTEM_TEMACS (or somesuch) instead?
+case "$opsys" in
+  gnu-linux)
+   ## LD_SWITCH_X_SITE_AUX is a -R option saying where to find X at run-time.
+   LD_SWITCH_SYSTEM="$LD_SWITCH_SYSTEM \$(LD_SWITCH_X_SITE_AUX)" ;;
+
+  netbsd|openbsd)
+   ## _AUX_RPATH is like _AUX, but uses -rpath instead of -R.
+   LD_SWITCH_SYSTEM="\$(LD_SWITCH_X_SITE_AUX_RPATH) $LD_SWITCH_SYSTEM" ;;
+esac
 
 
 C_SWITCH_MACHINE=
@@ -1038,6 +1054,45 @@
 
 AC_SUBST(CRT_DIR)
 
+LIB_MATH=-lm
+LIB_STANDARD=
+START_FILES=
+
+case $opsys in
+  cygwin )
+    LIB_MATH=
+    START_FILES='ecrt0.o'
+    ;;
+  darwin )
+    ## Adding -lm confuses the dynamic linker, so omit it.
+    LIB_MATH=
+    START_FILES='pre-crt0.o'
+    ;;
+  freebsd )
+    LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
+    START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
+    ;;
+  gnu-linux | gnu-kfreebsd )
+    LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o'
+    START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
+    ;;
+  hpux10-20 | hpux11 )
+    LIB_STANDARD=-lc
+    START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o'
+    ;;
+  netbsd | openbsd )
+    if test -f $(CRT_DIR)/crti.o; then
+	LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
+        START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
+    else
+	LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o'
+	START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o'
+    fi
+    ;;
+esac
+
+AC_SUBST(LIB_MATH)
+AC_SUBST(START_FILES)
 
 dnl This function defintion taken from Gnome 2.0
 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
@@ -1409,6 +1464,7 @@
      CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
      REAL_CFLAGS="$REAL_CFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
      LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES}"
+     LIB_STANDARD=
   fi
   AC_CHECK_HEADER([AppKit/AppKit.h], [HAVE_NS=yes],
   		  [AC_MSG_ERROR([`--with-ns' was specified, but the include
@@ -1441,6 +1497,7 @@
 CPPFLAGS="$tmp_CPPFLAGS"
 AC_SUBST(NS_OBJ)
 AC_SUBST(NS_SUPPORT)
+AC_SUBST(LIB_STANDARD)
 
 case "${window_system}" in
   x11 )
@@ -3012,6 +3069,23 @@
 AC_SUBST(LD_SWITCH_SYSTEM_TEMACS)
 
 
+## This exists because src/Makefile.in did some extra fiddling around
+## with LD_SWITCH_SYSTEM.  The cpp logic was:
+##   #ifndef LD_SWITCH_SYSTEM
+##   #if !defined (__GNUC__) && ((defined (BSD_SYSTEM) && !defined (COFF)))
+## Since all the *bsds define LD_SWITCH_SYSTEM, this simplifies to:
+## not using gcc, darwin system not on an alpha (ie darwin, since
+## darwin + alpha does not occur).
+## Note that unlike L_S_S, this is not used in ac_link.
+if test "x$LD_SWITCH_SYSTEM" = "x" && test "x$GCC" != "xyes" && \
+   test "$opsys" = "darwin"; then
+  LD_SWITCH_SYSTEM_EXTRA="-X"
+else
+  LD_SWITCH_SYSTEM_EXTRA=
+fi
+AC_SUBST(LD_SWITCH_SYSTEM_EXTRA)
+
+
 AH_TOP([/* GNU Emacs site configuration template file.
    Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005,
      2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
--- a/etc/ChangeLog	Thu May 06 12:51:40 2010 +0000
+++ b/etc/ChangeLog	Fri May 07 12:19:28 2010 +0000
@@ -1,3 +1,8 @@
+2010-05-07  Eli Zaretskii  <eliz@gnu.org>
+
+	* HELLO: Reorder Arabic greetings into logical order (they were
+	mistakenly changed to visual order by the 2010-03-28 change).
+
 2010-04-18  Francesc Rocher  <rocher@member.fsf.org>
 
 	* MORE.STUFF: Add a new entry for QWE.
--- a/etc/HELLO	Thu May 06 12:51:40 2010 +0000
+++ b/etc/HELLO	Fri May 07 12:19:28 2010 +0000
@@ -4,7 +4,7 @@
   Europe: ,A!(BHola!, Gr,A|_(B Gott, Hyv,Add(B p,Ad(Biv,Add(B, Tere ,Au(Bhtust, Bon,Cu(Bu
           Cze,B6f(B!, Dobr,B}(B den, ,L7T`PRabRcYbU(B!, ,FCei\(B ,Fsar(B, $,1J2J0J;J0J@JOJ=J1J0(B
   Africa: $(3!A!,!>(B
-  Middle/Near East: ,Hylem(B, ,GecjdY(B ,GeGdqSdG(B
+  Middle/Near East: ,Hylem(B, ,GGdSqdGe(B ,GYdjce(B
   South Asia: $,19h9n9x:-9d:'(B, $,15h5n5x6-5d6'(B, $,1?(?.?8?M>u?>?0(B, $,1@H@N@X@m@5@^@P@"(B, $,1;6;A;#;?;,;G(B,
               $,1AFAzB4AvB=B AqB*(B, $,1<U<C<5<m<5<N<m(B, $,1=h=n=x>-=U=~=p=B(B, $(7"7"!#C!;"E"S"G!;"7"2"[!;"D"["#"G!>(B
   South East Asia: $,1\'\f\:\V\4\?\]\:(B, (1JP:R-4U(B, $,1H9H$HYrmH"H<HLH5HL(B, ,TJGQJ4U$CQ:(B, Ch,1`(Bo b,1U(Bn
@@ -16,7 +16,7 @@
 LANGUAGE (NATIVE NAME)	HELLO
 ----------------------	-----
 Amharic ($,1O M[MmN{(B)	$,1M`MKM](B
-Arabic $,1ro(B(,GGdYQHjqI(B)	,GecjdY(B ,GeGdqSdG(B
+Arabic $,1ro(B(,GGdYQHjqI(B)	,GGdSqdGe(B ,GYdjce(B
 Bengali ($,17,7>6b727>(B)	$,17(7.787M6u7>70(B
 Braille	$,2(3(1('('(5(B
 Burmese ($,1H9HYH;H4HYrlH9HL(B)	$,1H9H$HYrmH"H<HLH5HL(B
--- a/lisp/ChangeLog	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/ChangeLog	Fri May 07 12:19:28 2010 +0000
@@ -1,3 +1,30 @@
+2010-05-07  Christian von Roques <roques@mti.ag> (tiny change)
+
+	* lisp/epg.el (epg-key-capablity-alist): Add "D" flag (Bug#5592).
+
+2010-05-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* mail/binhex.el (binhex-decode-region-internal)
+	* mail/uudecode.el (uudecode-decode-region-internal)
+	* net/dns.el (dns-read-string-name, dns-write, dns-read)
+	(dns-read-type, dns-query)
+	* pgg-parse.el (pgg-parse-armor)
+	* pgg.el (pgg-verify-region)
+	* sha1.el (sha1-string-external): Don't run set-buffer-multibyte for
+	XEmacs.
+
+	* net/imap.el (imap-disable-multibyte): Redefine it as a macro.
+
+2010-05-07  Juanma Barranquero  <lekktu@gmail.com>
+
+	* progmodes/cperl-mode.el (cperl-mode-unload-function): New function.
+
+	Fix use of `filter-buffer-substring' (4th arg NOPROPS removed).
+	* emulation/cua-base.el (cua-repeat-replace-region):
+	* emulation/cua-gmrk.el (cua-copy-region-to-global-mark)
+	(cua-cut-region-to-global-mark):
+	Remove text properties with `set-text-properties'.
+
 2010-05-06  Michael Albinus  <michael.albinus@gmx.de>
 
 	* net/tramp.el (top, with-progress-reporter): Use
--- a/lisp/emulation/cua-base.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/emulation/cua-base.el	Fri May 07 12:19:28 2010 +0000
@@ -1040,7 +1040,9 @@
 		  (setq s (car u) e (cdr u)))))))
 	  (cond ((and s e (<= s e) (= s (mark t)))
 		 (setq cua--repeat-replace-text
-		       (filter-buffer-substring s e nil t)))
+		       (filter-buffer-substring s e))
+		 (set-text-properties 0 (length cua--repeat-replace-text)
+				      nil cua--repeat-replace-text))
 		((and (null s) (eq u elt)) ;; nothing inserted
 		 (setq cua--repeat-replace-text
 		       ""))
--- a/lisp/emulation/cua-gmrk.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/emulation/cua-gmrk.el	Fri May 07 12:19:28 2010 +0000
@@ -137,8 +137,9 @@
       (let ((src-buf (current-buffer)))
 	(save-excursion
 	  (if (equal (marker-buffer cua--global-mark-marker) src-buf)
-	      (let ((text (filter-buffer-substring start end nil t)))
+	      (let ((text (filter-buffer-substring start end)))
 		(goto-char (marker-position cua--global-mark-marker))
+		(set-text-properties 0 (length text) text)
 		(insert text))
 	    (set-buffer (marker-buffer cua--global-mark-marker))
 	    (goto-char (marker-position cua--global-mark-marker))
@@ -161,10 +162,11 @@
 	      (if (and (< start (marker-position cua--global-mark-marker))
 		       (< (marker-position cua--global-mark-marker) end))
 		  (message "Can't move region into itself")
-		(let ((text (filter-buffer-substring start end nil t))
+		(let ((text (filter-buffer-substring start end))
 		      (p1 (copy-marker start))
 		      (p2 (copy-marker end)))
 		  (goto-char (marker-position cua--global-mark-marker))
+		  (set-text-properties 0 (length text) text)
 		  (insert text)
 		  (cua--activate-global-mark)
 		  (delete-region (marker-position p1) (marker-position p2))
--- a/lisp/epg.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/epg.el	Fri May 07 12:19:28 2010 +0000
@@ -137,7 +137,8 @@
   '((?e . encrypt)
     (?s . sign)
     (?c . certify)
-    (?a . authentication)))
+    (?a . authentication)
+    (?D . disabled)))
 
 (defvar epg-new-signature-type-alist
   '((?D . detached)
--- a/lisp/gnus/ChangeLog	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/gnus/ChangeLog	Fri May 07 12:19:28 2010 +0000
@@ -1,3 +1,53 @@
+2010-05-07  Christian von Roques <roques@mti.ag> (tiny change)
+
+	* mml2015.el (mml2015-epg-find-usable-key): Skip disabled key
+	(Bug#5592).
+
+2010-05-07  Julien Danjou  <julien@danjou.info>
+
+	* gnus-art.el (gnus-mime-pipe-part): Add optional argument `cmd'; pass
+	it to mm-pipe-part.
+
+	* mm-decode.el (mm-pipe-part): Add optional argument `cmd'; use it if
+	it is given.
+
+2010-05-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* nnweb.el (nnweb-gmane-search)
+	* yenc.el (yenc-decode-region): Don't run set-buffer-multibyte for
+	XEmacs.
+
+	* gnus-art.el (gnus-article-browse-html-parts)
+	* gnus-group.el (gnus-read-ephemeral-gmane-group)
+	(gnus-read-ephemeral-bug-grou): Use mm-make-temp-file instead of
+	make-temp-file.
+
+	* gnus-dired.el (gnus-dired-mode): Bind gnus-dired-mode-hook,
+	gnus-dired-mode-on-hook and gnus-dired-mode-off-hook for XEmacs when
+	compiling.
+
+	* gnus-ml.el (gnus-mailing-list-mode): Bind gnus-mailing-list-mode-hook,
+	gnus-mailing-list-mode-on-hook and gnus-mailing-list-mode-off-hook for
+	XEmacs when compiling.
+
+	* gnus-salt.el (gnus-pick-mode): Bind gnus-pick-mode-on-hook and
+	gnus-pick-mode-off-hook for XEmacs when compiling.
+	(gnus-binary-mode): Bind gnus-binary-mode-on-hook and
+	gnus-binary-mode-off-hook for XEmacs when compiling.
+
+	* gnus-sum.el (gnus-summary-limit-strange-charsets-predicate): Return
+	nil if char-charset is not available.
+
+	* sieve-manage.el (sieve-manage-disable-multibyte): Redefine it as a
+	macro.
+
+	* mm-url.el (mm-url-form-encode-xwfu): Use mm-encode-coding-string
+	instead of encode-coding-string.
+
+	* mm-util.el (mm-enable-multibyte, mm-disable-multibyte): Use (featurep
+	'xemacs) instead of mm-emacs-mule to switch function definitions.
+	(mm-with-unibyte-current-buffer): Make it a progn macro for XEmacs.
+
 2010-05-06  Tommi Vainikainen  <thv@iki.fi>  (tiny change)
 
 	* mml-sec.el (mml-secure-message-sign): Fix cut and paste error.
--- a/lisp/gnus/gnus-art.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/gnus/gnus-art.el	Fri May 07 12:19:28 2010 +0000
@@ -2897,7 +2897,7 @@
 <img[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*src=\"\\(cid:\\([^\"]+\\)\\)\""
 					   nil t)
 		   (unless cid-dir
-		     (setq cid-dir (make-temp-file "cid" t))
+		     (setq cid-dir (mm-make-temp-file "cid" t))
 		     (add-to-list 'gnus-article-browse-html-temp-list cid-dir))
 		   (setq file nil
 			 content nil)
@@ -5041,13 +5041,14 @@
     (when data
       (mm-save-part data))))
 
-(defun gnus-mime-pipe-part ()
-  "Pipe the MIME part under point to a process."
+(defun gnus-mime-pipe-part (&optional cmd)
+  "Pipe the MIME part under point to a process.
+Use CMD as the process."
   (interactive)
   (gnus-article-check-buffer)
   (let ((data (get-text-property (point) 'gnus-data)))
     (when data
-      (mm-pipe-part data))))
+      (mm-pipe-part data cmd))))
 
 (defun gnus-mime-view-part ()
   "Interactively choose a viewing method for the MIME part under point."
--- a/lisp/gnus/gnus-dired.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/gnus/gnus-dired.el	Fri May 07 12:19:28 2010 +0000
@@ -87,6 +87,12 @@
 			       gnus-user-agent)
 		(function :tag "Other")))
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (defvar gnus-dired-mode-hook)
+    (defvar gnus-dired-mode-on-hook)
+    (defvar gnus-dired-mode-off-hook)))
+
 (define-minor-mode gnus-dired-mode
   "Minor mode for intersections of gnus and dired.
 
--- a/lisp/gnus/gnus-group.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/gnus/gnus-group.el	Fri May 07 12:19:28 2010 +0000
@@ -2364,7 +2364,7 @@
   (unless range (setq range 500))
   (when (< range 1)
     (error "Invalid range: %s" range))
-  (let ((tmpfile (make-temp-file
+  (let ((tmpfile (mm-make-temp-file
 		  (format "%s.start-%s.range-%s." group start range)))
 	(gnus-thread-sort-functions '(gnus-thread-sort-by-number)))
     (with-temp-file tmpfile
@@ -2445,7 +2445,7 @@
 		     (cdr (assoc 'emacs gnus-bug-group-download-format-alist))))
   (when (stringp number)
     (setq number (string-to-number number)))
-  (let ((tmpfile (make-temp-file "gnus-temp-group-")))
+  (let ((tmpfile (mm-make-temp-file "gnus-temp-group-")))
     (with-temp-file tmpfile
       (url-insert-file-contents (format mbox-url number))
       (write-region (point-min) (point-max) tmpfile)
--- a/lisp/gnus/gnus-ml.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/gnus/gnus-ml.el	Fri May 07 12:19:28 2010 +0000
@@ -85,6 +85,12 @@
 	  (gnus-mailing-list-mode 1))
       (gnus-message 1 "no list-post in this message."))))
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (defvar gnus-mailing-list-mode-hook)
+    (defvar gnus-mailing-list-mode-on-hook)
+    (defvar gnus-mailing-list-mode-off-hook)))
+
 ;;;###autoload
 (define-minor-mode gnus-mailing-list-mode
   "Minor mode for providing mailing-list commands.
--- a/lisp/gnus/gnus-salt.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/gnus/gnus-salt.el	Fri May 07 12:19:28 2010 +0000
@@ -101,6 +101,11 @@
 	["Start reading" gnus-pick-start-reading t]
 	["Switch pick mode off" gnus-pick-mode gnus-pick-mode]))))
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (defvar gnus-pick-mode-on-hook)
+    (defvar gnus-pick-mode-off-hook)))
+
 (define-minor-mode gnus-pick-mode
   "Minor mode for providing a pick-and-read interface in Gnus summary buffers.
 
@@ -332,6 +337,11 @@
       '("Pick"
 	["Switch binary mode off" gnus-binary-mode t]))))
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (defvar gnus-binary-mode-on-hook)
+    (defvar gnus-binary-mode-off-hook)))
+
 (define-minor-mode gnus-binary-mode
   "Minor mode for providing a binary group interface in Gnus summary buffers."
   :lighter " Binary" :keymap gnus-binary-mode-map
--- a/lisp/gnus/gnus-sum.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/gnus/gnus-sum.el	Fri May 07 12:19:28 2010 +0000
@@ -8185,14 +8185,15 @@
       (gnus-summary-position-point))))
 
 (defun gnus-summary-limit-strange-charsets-predicate (header)
-  (let ((string (concat (mail-header-subject header)
-			(mail-header-from header)))
-	charset found)
-    (dotimes (i (1- (length string)))
-      (setq charset (format "%s" (char-charset (aref string (1+ i)))))
-      (when (string-match "unicode\\|big\\|japanese" charset)
-	(setq found t)))
-    found))
+  (when (fboundp 'char-charset)
+    (let ((string (concat (mail-header-subject header)
+			  (mail-header-from header)))
+	  charset found)
+      (dotimes (i (1- (length string)))
+	(setq charset (format "%s" (char-charset (aref string (1+ i)))))
+	(when (string-match "unicode\\|big\\|japanese" charset)
+	  (setq found t)))
+      found)))
 
 (defun gnus-summary-limit-to-predicate (predicate)
   "Limit to articles where PREDICATE returns non-nil.
--- a/lisp/gnus/mm-decode.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/gnus/mm-decode.el	Fri May 07 12:19:28 2010 +0000
@@ -1301,12 +1301,13 @@
 	  (mm-write-region (point-min) (point-max) file nil nil nil 'binary t)
 	(set-default-file-modes current-file-modes)))))
 
-(defun mm-pipe-part (handle)
-  "Pipe HANDLE to a process."
-  (let* ((name (mail-content-type-get (mm-handle-type handle) 'name))
-	 (command
-	  (gnus-read-shell-command
-           "Shell command on MIME part: " mm-last-shell-command)))
+(defun mm-pipe-part (handle &optional cmd)
+  "Pipe HANDLE to a process.
+Use CMD as the process."
+  (let ((name (mail-content-type-get (mm-handle-type handle) 'name))
+	(command (or cmd
+		     (gnus-read-shell-command
+		      "Shell command on MIME part: " mm-last-shell-command))))
     (mm-with-unibyte-buffer
       (mm-insert-part handle)
       (mm-add-meta-html-tag handle)
--- a/lisp/gnus/mm-url.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/gnus/mm-url.el	Fri May 07 12:19:28 2010 +0000
@@ -404,14 +404,10 @@
       ((= char ?  ) "+")
       ((memq char mm-url-unreserved-chars) (char-to-string char))
       (t (upcase (format "%%%02x" char)))))
-   ;; Fixme: Should this actually be accepting multibyte?  Is there a
-   ;; better way in XEmacs?
-   (if (featurep 'mule)
-       (encode-coding-string chunk
-			     (if (fboundp 'find-coding-systems-string)
-				 (car (find-coding-systems-string chunk))
-				 buffer-file-coding-system))
-     chunk)
+   (mm-encode-coding-string chunk
+			    (if (fboundp 'find-coding-systems-string)
+				(car (find-coding-systems-string chunk))
+			      buffer-file-coding-system))
    ""))
 
 (defun mm-url-encode-www-form-urlencoded (pairs)
--- a/lisp/gnus/mm-util.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/gnus/mm-util.el	Fri May 07 12:19:28 2010 +0000
@@ -908,20 +908,20 @@
 			     (fboundp 'set-buffer-multibyte))
     "True in Emacs with Mule.")
 
-  (if mm-emacs-mule
-      (defun mm-enable-multibyte ()
-	"Set the multibyte flag of the current buffer.
+  (if (featurep 'xemacs)
+      (defalias 'mm-enable-multibyte 'ignore)
+    (defun mm-enable-multibyte ()
+      "Set the multibyte flag of the current buffer.
 Only do this if the default value of `enable-multibyte-characters' is
 non-nil.  This is a no-op in XEmacs."
-	(set-buffer-multibyte 'to))
-    (defalias 'mm-enable-multibyte 'ignore))
+      (set-buffer-multibyte t)))
 
-  (if mm-emacs-mule
-      (defun mm-disable-multibyte ()
-	"Unset the multibyte flag of in the current buffer.
+  (if (featurep 'xemacs)
+      (defalias 'mm-disable-multibyte 'ignore)
+    (defun mm-disable-multibyte ()
+      "Unset the multibyte flag of in the current buffer.
 This is a no-op in XEmacs."
-	(set-buffer-multibyte nil))
-    (defalias 'mm-disable-multibyte 'ignore)))
+      (set-buffer-multibyte nil))))
 
 (defun mm-preferred-coding-system (charset)
   ;; A typo in some Emacs versions.
@@ -1239,22 +1239,24 @@
 harmful since it is likely to modify existing data in the buffer.
 For instance, it converts \"\\300\\255\" into \"\\255\" in
 Emacs 23 (unicode)."
-  ;; FIXME: (default-value 'enable-multibyte-characters) is read-only
-  ;; so let-binding it is wrong.  The right fix is to not use this
-  ;; macro at all any more, since it's been ill-defined from the start.
-  (let ((multibyte (make-symbol "multibyte"))
-	(buffer (make-symbol "buffer")))
-    `(if mm-emacs-mule
-	 (let ((,multibyte enable-multibyte-characters)
-	       (,buffer (current-buffer)))
-	   (unwind-protect
-	       (letf (((default-value 'enable-multibyte-characters) nil))
-		 (set-buffer-multibyte nil)
-		 ,@forms)
-	     (set-buffer ,buffer)
-	     (set-buffer-multibyte ,multibyte)))
-       (letf (((default-value 'enable-multibyte-characters) nil))
-	 ,@forms))))
+  (if (featurep 'xemacs)
+      `(progn ,@forms)
+    ;; FIXME: (default-value 'enable-multibyte-characters) is read-only
+    ;; so let-binding it is wrong.  The right fix is to not use this
+    ;; macro at all any more, since it's been ill-defined from the start.
+    (let ((multibyte (make-symbol "multibyte"))
+	  (buffer (make-symbol "buffer")))
+      `(if mm-emacs-mule
+	   (let ((,multibyte enable-multibyte-characters)
+		 (,buffer (current-buffer)))
+	     (unwind-protect
+		 (letf (((default-value 'enable-multibyte-characters) nil))
+		       (set-buffer-multibyte nil)
+		       ,@forms)
+	       (set-buffer ,buffer)
+	       (set-buffer-multibyte ,multibyte)))
+	 (letf (((default-value 'enable-multibyte-characters) nil))
+	       ,@forms)))))
 (put 'mm-with-unibyte-current-buffer 'lisp-indent-function 0)
 (put 'mm-with-unibyte-current-buffer 'edebug-form-spec '(body))
 
--- a/lisp/gnus/mml2015.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/gnus/mml2015.el	Fri May 07 12:19:28 2010 +0000
@@ -1021,6 +1021,7 @@
       (let ((pointer (epg-key-sub-key-list (car keys))))
 	(while pointer
 	  (if (and (memq usage (epg-sub-key-capability (car pointer)))
+		   (not (memq 'disabled (epg-sub-key-capability (car pointer))))
 		   (not (memq (epg-sub-key-validity (car pointer))
 			      '(revoked expired))))
 	      (throw 'found (car keys)))
--- a/lisp/gnus/nnweb.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/gnus/nnweb.el	Fri May 07 12:19:28 2010 +0000
@@ -525,7 +525,7 @@
        ;;("TOPDOC" . "1000")
        ))))
   (setq buffer-file-name nil)
-  (set-buffer-multibyte t)
+  (unless (featurep 'xemacs) (set-buffer-multibyte t))
   (mm-decode-coding-region (point-min) (point-max) 'utf-8)
   t)
 
--- a/lisp/gnus/sieve-manage.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/gnus/sieve-manage.el	Fri May 07 12:19:28 2010 +0000
@@ -191,10 +191,10 @@
 
 ;; Internal utility functions
 
-(defsubst sieve-manage-disable-multibyte ()
+(defmacro sieve-manage-disable-multibyte ()
   "Enable multibyte in the current buffer."
-  (when (fboundp 'set-buffer-multibyte)
-    (set-buffer-multibyte nil)))
+  (unless (featurep 'xemacs)
+    '(set-buffer-multibyte nil)))
 
 (declare-function password-read         "password-cache" (prompt &optional key))
 (declare-function password-cache-add    "password-cache" (key password))
--- a/lisp/gnus/yenc.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/gnus/yenc.el	Fri May 07 12:19:28 2010 +0000
@@ -89,9 +89,9 @@
 	      (when (re-search-forward "^=yend.*$" end t)
 		(setq last (match-beginning 0))
 		(setq footer-alist (yenc-parse-line (match-string 0)))
-                (with-current-buffer
-                    (setq work-buffer (generate-new-buffer " *yenc-work*"))
-                  (set-buffer-multibyte nil))
+		(setq work-buffer (generate-new-buffer " *yenc-work*"))
+		(unless (featurep 'xemacs)
+		  (with-current-buffer work-buffer (set-buffer-multibyte nil)))
 		(while (< first last)
 		  (setq char (char-after first))
 		  (cond ((or (eq char ?\r)
--- a/lisp/mail/binhex.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/mail/binhex.el	Fri May 07 12:19:28 2010 +0000
@@ -221,7 +221,8 @@
 	  (goto-char start)
 	  (when (re-search-forward binhex-begin-line end t)
             (setq work-buffer (generate-new-buffer " *binhex-work*"))
-            (with-current-buffer work-buffer (set-buffer-multibyte nil))
+	    (unless (featurep 'xemacs)
+	      (with-current-buffer work-buffer (set-buffer-multibyte nil)))
 	    (beginning-of-line)
 	    (setq bits 0 counter 0)
 	    (while tmp
--- a/lisp/mail/uudecode.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/mail/uudecode.el	Fri May 07 12:19:28 2010 +0000
@@ -216,7 +216,7 @@
 	  (skip-chars-forward non-data-chars end))
 	(if file-name
             (with-temp-file file-name
-              (set-buffer-multibyte nil)
+              (unless (featurep 'xemacs) (set-buffer-multibyte nil))
               (insert (apply 'concat (nreverse result))))
 	  (or (markerp end) (setq end (set-marker (make-marker) end)))
 	  (goto-char start)
--- a/lisp/net/dns.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/net/dns.el	Fri May 07 12:19:28 2010 +0000
@@ -101,7 +101,7 @@
 
 (defun dns-read-string-name (string buffer)
   (with-temp-buffer
-    (set-buffer-multibyte nil)
+    (unless (featurep 'xemacs) (set-buffer-multibyte nil))
     (insert string)
     (goto-char (point-min))
     (dns-read-name buffer)))
@@ -135,7 +135,7 @@
   "Write a DNS packet according to SPEC.
 If TCP-P, the first two bytes of the package with be the length field."
   (with-temp-buffer
-    (set-buffer-multibyte nil)
+    (unless (featurep 'xemacs) (set-buffer-multibyte nil))
     (dns-write-bytes (dns-get 'id spec) 2)
     (dns-write-bytes
      (logior
@@ -186,7 +186,7 @@
 
 (defun dns-read (packet)
   (with-temp-buffer
-    (set-buffer-multibyte nil)
+    (unless (featurep 'xemacs) (set-buffer-multibyte nil))
     (let ((spec nil)
           queries answers authorities additionals)
       (insert packet)
@@ -263,7 +263,7 @@
 	(point (point)))
     (prog1
         (with-temp-buffer
-          (set-buffer-multibyte nil)
+	  (unless (featurep 'xemacs) (set-buffer-multibyte nil))
           (insert string)
           (goto-char (point-min))
           (cond
@@ -391,7 +391,7 @@
   (if (not dns-servers)
       (message "No DNS server configuration found")
     (with-temp-buffer
-      (set-buffer-multibyte nil)
+      (unless (featurep 'xemacs) (set-buffer-multibyte nil))
       (let ((process (condition-case ()
                          (dns-make-network-process (car dns-servers))
                        (error
--- a/lisp/net/imap.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/net/imap.el	Fri May 07 12:19:28 2010 +0000
@@ -475,10 +475,10 @@
       (setcdr alist (imap-remassoc key (cdr alist)))
       alist)))
 
-(defsubst imap-disable-multibyte ()
+(defmacro imap-disable-multibyte ()
   "Enable multibyte in the current buffer."
-  (when (fboundp 'set-buffer-multibyte)
-    (set-buffer-multibyte nil)))
+  (unless (featurep 'xemacs)
+    '(set-buffer-multibyte nil)))
 
 (defsubst imap-utf7-encode (string)
   (if imap-use-utf7
--- a/lisp/pgg-parse.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/pgg-parse.el	Fri May 07 12:19:28 2010 +0000
@@ -503,8 +503,8 @@
 (defun pgg-parse-armor (string)
   (with-temp-buffer
     (buffer-disable-undo)
-    (if (fboundp 'set-buffer-multibyte)
-	(set-buffer-multibyte nil))
+    (unless (featurep 'xemacs)
+      (set-buffer-multibyte nil))
     (insert string)
     (pgg-decode-armor-region (point-min)(point))))
 
--- a/lisp/pgg.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/pgg.el	Fri May 07 12:19:28 2010 +0000
@@ -475,8 +475,8 @@
 	  (if (null signature) nil
 	    (with-temp-buffer
 	      (buffer-disable-undo)
-	      (if (fboundp 'set-buffer-multibyte)
-		  (set-buffer-multibyte nil))
+	      (unless (featurep 'xemacs)
+		(set-buffer-multibyte nil))
 	      (insert-file-contents signature)
 	      (cdr (assq 2 (pgg-decode-armor-region
 			    (point-min)(point-max)))))))
--- a/lisp/progmodes/cperl-mode.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/progmodes/cperl-mode.el	Fri May 07 12:19:28 2010 +0000
@@ -8980,6 +8980,18 @@
     (substring v (match-beginning 1) (match-end 1)))
   "Version of IZ-supported CPerl package this file is based on.")
 
+(defun cperl-mode-unload-function ()
+  "Unload the Cperl mode library."
+  (let ((new-mode (if (eq (symbol-function 'perl-mode) 'cperl-mode)
+		      'fundamental-mode
+		    'perl-mode)))
+    (dolist (buf (buffer-list))
+      (with-current-buffer buf
+	(when (eq major-mode 'cperl-mode)
+	  (funcall new-mode)))))
+  ;; continue standard unloading
+  nil)
+
 (provide 'cperl-mode)
 
 ;; arch-tag: 42e5b19b-e187-4537-929f-1a7408980ce6
--- a/lisp/sha1.el	Thu May 06 12:51:40 2010 +0000
+++ b/lisp/sha1.el	Fri May 07 12:19:28 2010 +0000
@@ -95,7 +95,7 @@
       (setq prog sha1-program
 	    args nil))
     (with-temp-buffer
-      (set-buffer-multibyte nil)
+      (unless (featurep 'xemacs) (set-buffer-multibyte nil))
       (insert string)
       (apply (function call-process-region)
 	     (point-min) (point-max)
--- a/src/ChangeLog	Thu May 06 12:51:40 2010 +0000
+++ b/src/ChangeLog	Fri May 07 12:19:28 2010 +0000
@@ -1,3 +1,43 @@
+2010-05-07  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (LD_SWITCH_SYSTEM): Set with configure, not cpp.
+	(LD_SWITCH_SYSTEM_EXTRA): New variable, set by configure.
+	(TEMACS_LDFLAGS): Use $LD_SWITCH_SYSTEM and $LD_SWITCH_SYSTEM_EXTRA,
+	move out of cpp section.
+	* s/freebsd.h (LD_SWITCH_SYSTEM):
+	* s/gnu-linux.h (LD_SWITCH_SYSTEM):
+	* s/netbsd.h (LD_SWITCH_SYSTEM):
+	* s/openbsd.h (LD_SWITCH_SYSTEM): Move to configure.in.
+
+2010-05-07  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Define LIB_STANDARD and START_FILES using autoconf.
+	* s/usg5-4.h (LIB_STANDARD):
+	* s/netbsd.h (START_FILES):
+	* s/irix6-5.h (LIB_STANDARD):
+	* s/hpux10-20.h (LIB_STANDARD, START_FILES):
+	* s/gnu-linux.h (START_FILES, LIB_STANDARD):
+	* s/freebsd.h (START_FILES):
+	* s/darwin.h (START_FILES):
+	* s/cygwin.h (START_FILES):
+	* s/aix4-2.h (LIB_STANDARD):
+	* m/ibmrs6000.h (START_FILES): Remove, move logic to configure.in.
+	* Makefile.in (STARTFILES): Rename to START_FILES, define using
+	autoconf, not cpp.
+
+2010-05-06  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Remove NEED_BSDTTY and NEED_UNISTD_H.
+	* s/hpux10-20.h (NEED_BSDTTY): Remove.
+	* s/aix4-2.h (NEED_UNISTD_H): Remove.
+	* systty.h: Simplify conditionals for including <sys/bsdtty.h>,
+	<sys/ptyio.h> and <unistd.h>.
+
+	* emacs.c (main): Remove NO_DIR_LIBRARY conditional, unused.
+
+	* Makefile.in (STARTFILES): Conditionally define to make the usage clear.
+	* s/gnu.h (START_FILES): Remove empty definition.
+
 2010-05-06  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* xterm.c (x_draw_image_relief): Move declaration of extra to beginning.
--- a/src/Makefile.in	Thu May 06 12:51:40 2010 +0000
+++ b/src/Makefile.in	Fri May 07 12:19:28 2010 +0000
@@ -73,13 +73,20 @@
 ## System-specific CFLAGS.
 C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
 ## This holds any special options for linking temacs only (ie, not
-## used by configure).
+## used by configure).  Not used elsewhere because it sometimes
+## contains options that have to do with using Emacs's crt0, 
+## which are only good with temacs.
 LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
 ## Next two must come before LD_SWITCH_SYSTEM.
 ## If needed, a -R option that says where to find X windows at run time.
 LD_SWITCH_X_SITE_AUX=@LD_SWITCH_X_SITE_AUX@
 ## As above, but using -rpath instead.
 LD_SWITCH_X_SITE_AUX_RPATH=@LD_SWITCH_X_SITE_AUX_RPATH@
+## System-specific LDFLAGS.
+LD_SWITCH_SYSTEM=@LD_SWITCH_SYSTEM@
+LD_SWITCH_SYSTEM_EXTRA=@LD_SWITCH_SYSTEM_EXTRA@
+## Flags to pass to ld only for temacs.
+TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_EXTRA) $(LD_SWITCH_SYSTEM_TEMACS)
 
 LIBTIFF=@LIBTIFF@
 LIBJPEG=@LIBJPEG@
@@ -150,6 +157,8 @@
 
 RUN_TEMACS = `/bin/pwd`/temacs
 
+START_FILES = @START_FILES@
+
 # ========================== start of cpp stuff =======================
 /* From here on, comments must be done in C syntax.  */
 
@@ -182,39 +191,16 @@
    do not let it interfere with this file.  */
 #undef register
 
-/* Some machines do not find the standard C libraries in the usual place.  */
-#ifndef LIB_STANDARD
-#define LIB_STANDARD
-#endif
-
-/* Under GNUstep, putting libc on the link line causes problems. */
-#ifdef NS_IMPL_GNUSTEP
-#undef LIB_STANDARD
-#define LIB_STANDARD
-#endif
-
 /* Some s/SYSTEM.h files define this to request special libraries.  */
 #ifndef LIBS_SYSTEM
 #define LIBS_SYSTEM
 #endif
 
-/* Some s/SYSTEM.h files define this to request special switches in ld.  */
-#ifndef LD_SWITCH_SYSTEM
-#if !defined (__GNUC__) && ((defined (BSD_SYSTEM) && !defined (COFF)))
-#define LD_SWITCH_SYSTEM -X
-#else /* (defined (BSD_SYSTEM) && !defined (COFF)) */
-#define LD_SWITCH_SYSTEM
-#endif /* (defined (BSD_SYSTEM) && !defined (COFF)) */
-#endif /* LD_SWITCH_SYSTEM */
-
-/* These macros are for switches specifically related to X Windows.  */
+/* This macro is for switches specifically related to X Windows.  */
 #ifndef LD_SWITCH_X_SITE
 #define LD_SWITCH_X_SITE
 #endif
 
-STARTFILES = START_FILES
-
-
 #ifdef NS_IMPL_GNUSTEP
 /* Pull in stuff from GNUstep-make. */
 FOUNDATION_LIB=gnu
@@ -324,11 +310,6 @@
 #endif /* not LINKER */
 #endif /* not ORDINARY_LINK */
 
-/* Flags to pass to LD only for temacs.  */
-/* Do not split this line with a backslash.  That can cause trouble with
-   some cpps.  */
-TEMACS_LDFLAGS = LD_SWITCH_SYSTEM $(LD_SWITCH_SYSTEM_TEMACS)
-
 /* A macro which other sections of Makefile can redefine to munge the
    flags before they are passed to LD.  This is helpful if you have
    redefined LD to something odd, like "gcc".
@@ -688,7 +669,7 @@
    $(RSVG_LIBS) $(DBUS_LIBS) @LIBGPM@ @LIBRESOLV@ LIBS_SYSTEM LIBS_TERMCAP \
    $(GETLOADAVG_LIBS) ${GCONF_LIBS} ${LIBSELINUX_LIBS} \
    @FREETYPE_LIBS@ @FONTCONFIG_LIBS@ @LIBOTF_LIBS@ @M17N_FLT_LIBS@ \
-   $(GNULIB_VAR) @LIB_MATH@ LIB_STANDARD $(GNULIB_VAR)
+   $(GNULIB_VAR) @LIB_MATH@ @LIB_STANDARD@ $(GNULIB_VAR)
 
 all: emacs${EXEEXT} $(OTHER_FILES)
 
@@ -730,7 +711,7 @@
 	echo "#define BUILDOBJ \"${obj} ${otherobj} " "\"" > buildobj.h
 
 /* FIXME LOCALCPP not defined or mentioned anywhere.  */
-temacs${EXEEXT}: $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj} prefix-args${EXEEXT}
+temacs${EXEEXT}: $(LOCALCPP) $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} prefix-args${EXEEXT}
 #ifdef NS_IMPL_GNUSTEP
 	$(CC) -rdynamic YMF_PASS_LDFLAGS ( ${TEMACS_LDFLAGS} \
 	-L@GNUSTEP_SYSTEM_LIBRARIES@ -lgnustep-gui -lgnustep-base \
@@ -738,13 +719,10 @@
 	${obj} ${otherobj} ${LIBES}
 #else
 	$(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${TEMACS_LDFLAGS}) $(LDFLAGS) \
-    -o temacs ${STARTFILES} ${obj} ${otherobj}  \
+    -o temacs ${START_FILES} ${obj} ${otherobj}  \
     ${LIBES}
 #endif
 
-/* We do not use ALL_LDFLAGS because LD_SWITCH_SYSTEM
-   often contains options that have to do with using Emacs''s crt0,
-   which are only good with temacs.  */
 prefix-args${EXEEXT}: prefix-args.o $(config_h)
 	$(CC) $(LDFLAGS) prefix-args.o -o prefix-args
 
@@ -1178,6 +1156,6 @@
 	cd ../lisp; $(MAKE) $(MFLAGS) compile-first EMACS=${bootstrap_exe}
 
 #ifdef AUTO_DEPEND
-ALLOBJS=$(STARTFILES) ${obj} ${otherobj} prefix-args.o
+ALLOBJS=$(START_FILES) ${obj} ${otherobj} prefix-args.o
 -include $(ALLOBJS:%.o=deps/%.d)
 #endif
--- a/src/config.in	Thu May 06 12:51:40 2010 +0000
+++ b/src/config.in	Fri May 07 12:19:28 2010 +0000
@@ -135,9 +135,6 @@
 /* Define to 1 if you have the <com_err.h> header file. */
 #undef HAVE_COM_ERR_H
 
-/* Define to 1 if you have /usr/lib/crti.o. */
-#undef HAVE_CRTIN
-
 /* Define to 1 if using D-Bus. */
 #undef HAVE_DBUS
 
@@ -318,10 +315,10 @@
 /* Define to 1 if you have the <kerberos/krb.h> header file. */
 #undef HAVE_KERBEROS_KRB_H
 
-/* Define to 1 if `e_text' is member of `krb5_error'. */
+/* Define to 1 if `e_text' is a member of `krb5_error'. */
 #undef HAVE_KRB5_ERROR_E_TEXT
 
-/* Define to 1 if `text' is member of `krb5_error'. */
+/* Define to 1 if `text' is a member of `krb5_error'. */
 #undef HAVE_KRB5_ERROR_TEXT
 
 /* Define to 1 if you have the <krb5.h> header file. */
@@ -609,25 +606,25 @@
 /* Define to 1 if you have the `strsignal' function. */
 #undef HAVE_STRSIGNAL
 
-/* Define to 1 if `ifr_addr' is member of `struct ifreq'. */
+/* Define to 1 if `ifr_addr' is a member of `struct ifreq'. */
 #undef HAVE_STRUCT_IFREQ_IFR_ADDR
 
-/* Define to 1 if `ifr_broadaddr' is member of `struct ifreq'. */
+/* Define to 1 if `ifr_broadaddr' is a member of `struct ifreq'. */
 #undef HAVE_STRUCT_IFREQ_IFR_BROADADDR
 
-/* Define to 1 if `ifr_flags' is member of `struct ifreq'. */
+/* Define to 1 if `ifr_flags' is a member of `struct ifreq'. */
 #undef HAVE_STRUCT_IFREQ_IFR_FLAGS
 
-/* Define to 1 if `ifr_hwaddr' is member of `struct ifreq'. */
+/* Define to 1 if `ifr_hwaddr' is a member of `struct ifreq'. */
 #undef HAVE_STRUCT_IFREQ_IFR_HWADDR
 
-/* Define to 1 if `ifr_netmask' is member of `struct ifreq'. */
+/* Define to 1 if `ifr_netmask' is a member of `struct ifreq'. */
 #undef HAVE_STRUCT_IFREQ_IFR_NETMASK
 
-/* Define to 1 if `n_un.n_name' is member of `struct nlist'. */
+/* Define to 1 if `n_un.n_name' is a member of `struct nlist'. */
 #undef HAVE_STRUCT_NLIST_N_UN_N_NAME
 
-/* Define to 1 if `tm_zone' is member of `struct tm'. */
+/* Define to 1 if `tm_zone' is a member of `struct tm'. */
 #undef HAVE_STRUCT_TM_TM_ZONE
 
 /* Define to 1 if `struct utimbuf' is declared by <utime.h>. */
@@ -850,6 +847,9 @@
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
@@ -906,6 +906,28 @@
 /* Define to 1 if using the Motif X toolkit. */
 #undef USE_MOTIF
 
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
 /* Define to 1 if we should use toolkit scroll bars. */
 #undef USE_TOOLKIT_SCROLL_BARS
 
@@ -941,28 +963,6 @@
 /* Define to 1 if you need to in order for `stat' and other things to work. */
 #undef _POSIX_SOURCE
 
-/* Enable extensions on AIX 3, Interix.  */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them.  */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris.  */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop.  */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
 /* Define to rpl_ if the getopt replacement functions and variables should be
    used. */
 #undef __GETOPT_PREFIX
--- a/src/emacs.c	Thu May 06 12:51:40 2010 +0000
+++ b/src/emacs.c	Fri May 07 12:19:28 2010 +0000
@@ -1582,9 +1582,7 @@
       syms_of_ccl ();
       syms_of_character ();
       syms_of_cmds ();
-#ifndef NO_DIR_LIBRARY
       syms_of_dired ();
-#endif /* not NO_DIR_LIBRARY */
       syms_of_display ();
       syms_of_doc ();
       syms_of_editfns ();
--- a/src/m/ibmrs6000.h	Thu May 06 12:51:40 2010 +0000
+++ b/src/m/ibmrs6000.h	Fri May 07 12:19:28 2010 +0000
@@ -36,7 +36,6 @@
 #undef ADDR_CORRECT
 #define ADDR_CORRECT(x) ((int)(x))
 
-#define START_FILES
 /*** BUILD 9008 - FIONREAD problem still exists in X-Windows. ***/
 #define BROKEN_FIONREAD
 /* As we define BROKEN_FIONREAD, SIGIO will be undefined in systty.h.
--- a/src/s/aix4-2.h	Thu May 06 12:51:40 2010 +0000
+++ b/src/s/aix4-2.h	Fri May 07 12:19:28 2010 +0000
@@ -87,10 +87,6 @@
 #define LINKER cc
 #endif
 
-/* No need to specify -lc when linking.  */
-
-#define LIB_STANDARD
-
 /* -lpthreads seems to be necessary for Xlib in X11R6, and should be harmless
    on older versions of X where it happens to exist.  */
 #ifdef HAVE_LIBPTHREADS
@@ -109,9 +105,6 @@
    It may not have been needed in certain earlier versions.  */
 #define HAVE_TCATTR
 
-/* Include unistd.h, even though we don't define POSIX.  */
-#define NEED_UNISTD_H
-
 /* AIX doesn't define this.  */
 #define unix 1
 
--- a/src/s/cygwin.h	Thu May 06 12:51:40 2010 +0000
+++ b/src/s/cygwin.h	Fri May 07 12:19:28 2010 +0000
@@ -134,11 +134,6 @@
 /* Don't link against static libgcc */
 #define LIB_GCC
 
-/* Don't list system libs on link command line */
-#define LIB_STANDARD
-
-#define START_FILES ecrt0.o
-
 /* the end */
 
 /* arch-tag: 5ae7ba00-83b0-4ab3-806a-3e845779191b
--- a/src/s/darwin.h	Thu May 06 12:51:40 2010 +0000
+++ b/src/s/darwin.h	Fri May 07 12:19:28 2010 +0000
@@ -155,8 +155,6 @@
 
 #define UNEXEC unexmacosx.o
 
-#define START_FILES pre-crt0.o
-
 /* start_of_text isn't actually used, so make it compile without error.  */
 #define TEXT_START (0)
 
--- a/src/s/freebsd.h	Thu May 06 12:51:40 2010 +0000
+++ b/src/s/freebsd.h	Fri May 07 12:19:28 2010 +0000
@@ -1,9 +1,8 @@
 /* System description header for FreeBSD systems.
-   This file describes the parameters that system description files
-   should define or not.
-   Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-                 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-                 Free Software Foundation, Inc.
+
+Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+  2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+  Free Software Foundation, Inc.
 
 Author: Shawn M. Carey
 (according to authors.el)
@@ -41,13 +40,6 @@
 #define LIBS_TERMCAP -lncurses
 #endif
 
-/* Let `ld' find image libs and similar things in /usr/local/lib.  The
-   system compiler, GCC, has apparently been modified to not look
-   there, contrary to what a stock GCC would do.  */
-
-#define LD_SWITCH_SYSTEM  -L/usr/local/lib
-#define START_FILES pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o
-#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o
 #undef LIB_GCC
 #define LIB_GCC
 
--- a/src/s/gnu-linux.h	Thu May 06 12:51:40 2010 +0000
+++ b/src/s/gnu-linux.h	Fri May 07 12:19:28 2010 +0000
@@ -1,7 +1,7 @@
 /* This file is the configuration file for Linux-based GNU systems
-   Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007, 2008, 2009, 2010
-                 Free Software Foundation, Inc.
+
+Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004,
+  2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -169,17 +169,6 @@
 /* Ask GCC where to find libgcc.a.  */
 #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
 
-#define START_FILES pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o
-
-/* Here is how to find X Windows.  LD_SWITCH_X_SITE_AUX gives an -R option
-   that says where to find X windows at run time.  */
-
-#ifdef __mips__
-#define LD_SWITCH_SYSTEM -G 0 $(LD_SWITCH_X_SITE_AUX)
-#else
-#define LD_SWITCH_SYSTEM $(LD_SWITCH_X_SITE_AUX)
-#endif /* __mips__ */
-
 #ifdef emacs
 #define INTERRUPT_INPUT
 #endif
@@ -190,7 +179,6 @@
 
 #undef LIB_GCC
 #define LIB_GCC
-#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtn.o
 
 #ifdef HAVE_LIBNCURSES
 #define TERMINFO
--- a/src/s/gnu.h	Thu May 06 12:51:40 2010 +0000
+++ b/src/s/gnu.h	Fri May 07 12:19:28 2010 +0000
@@ -44,8 +44,6 @@
 #define ORDINARY_LINK
 #define DATA_START ({ extern int data_start; (char *) &data_start; })
 
-#define START_FILES
-
 /* Some losing code fails to include this and then assumes
    that because it is braindead that O_RDONLY==0.  */
 #ifndef NOT_C_CODE
--- a/src/s/hpux10-20.h	Thu May 06 12:51:40 2010 +0000
+++ b/src/s/hpux10-20.h	Fri May 07 12:19:28 2010 +0000
@@ -91,9 +91,6 @@
 
 #define UNEXEC unexhp9k800.o
 
-/* Include the file bsdtty.h, since this machine has job control.  */
-#define NEED_BSDTTY
-
 /* This is how to get the device name of the tty end of a pty.  */
 #define PTY_TTY_NAME_SPRINTF \
             sprintf (pty_name, "/dev/pty/tty%c%x", c, i);
@@ -134,7 +131,6 @@
 
 #define LIBS_SYSTEM -l:libdld.sl
 
-#define LIB_STANDARD -lc
 
 /* Rainer Malzbender <rainer@displaytech.com> says definining
    HAVE_XRMSETDATABASE allows Emacs to compile on HP-UX 10.20
@@ -163,8 +159,6 @@
 
 #define NO_REMAP
 
-#define START_FILES pre-crt0.o $(CRT_DIR)/crt0.o
-
 /* 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.
--- a/src/s/irix6-5.h	Thu May 06 12:51:40 2010 +0000
+++ b/src/s/irix6-5.h	Fri May 07 12:19:28 2010 +0000
@@ -27,10 +27,6 @@
 
 #define SETPGRP_RELEASES_CTTY
 
-#ifdef LIB_STANDARD
-#undef LIB_STANDARD
-#endif
-
 #ifdef SYSTEM_TYPE
 #undef SYSTEM_TYPE
 #endif
--- a/src/s/netbsd.h	Thu May 06 12:51:40 2010 +0000
+++ b/src/s/netbsd.h	Fri May 07 12:19:28 2010 +0000
@@ -1,7 +1,7 @@
 /* s/ file for netbsd system.
 
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-                 2008, 2009, 2010  Free Software Foundation, Inc.
+Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+  2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -28,25 +28,11 @@
 
 #define LIBS_TERMCAP -ltermcap
 
-#define START_FILES pre-crt0.o $(CRT_DIR)/crt0.o START_FILES_1 $(CRT_DIR)/crtbegin.o
-#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtend.o END_FILES_1
 #undef LIB_GCC
 #define LIB_GCC
 
-#ifdef HAVE_CRTIN
-#define START_FILES_1 $(CRT_DIR)/crti.o 
-#define END_FILES_1 $(CRT_DIR)/crtn.o
-#else
-#define START_FILES_1
-#define END_FILES_1
-#endif
-
 #define AMPERSAND_FULL_NAME
 
-/* LD_SWITCH_X_SITE_AUX_RPATH gives a -rpath option (which is what
-   OSF1 uses) that says where to find X windows at run time.  */
-#define LD_SWITCH_SYSTEM $(LD_SWITCH_X_SITE_AUX_RPATH) -Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib
-
 /* On post 1.3 releases of NetBSD, gcc -nostdlib also clears
    the library search parth, i.e. it won't search /usr/lib
    for libc and friends. Using -nostartfiles instead avoids
--- a/src/s/openbsd.h	Thu May 06 12:51:40 2010 +0000
+++ b/src/s/openbsd.h	Fri May 07 12:19:28 2010 +0000
@@ -1,20 +1,13 @@
-/* s/ file for openbsd systems.  */
+/* System file for openbsd.  */
 
 /* Mostly the same as NetBSD.  */
 #include "netbsd.h"
 
 /*  David Mazieres <dm@reeducation-labor.lcs.mit.edu> says this
     is necessary.  Otherwise Emacs dumps core when run -nw.  */
+#define TERMINFO
 #undef LIBS_TERMCAP
-
-#define TERMINFO
 #define LIBS_TERMCAP -lncurses
 
-#undef LD_SWITCH_SYSTEM
-
-  /*  Han Boetes <han@mijncomputer.nl> says this
-      is necessary,  otherwise Emacs dumps core on elf systems.  */
-#define LD_SWITCH_SYSTEM $(LD_SWITCH_X_SITE_AUX_RPATH) -Z
-
 /* arch-tag: 7e3f65ca-3f48-4237-933f-2b208b21e8e2
    (do not change this comment) */
--- a/src/s/usg5-4.h	Thu May 06 12:51:40 2010 +0000
+++ b/src/s/usg5-4.h	Fri May 07 12:19:28 2010 +0000
@@ -97,8 +97,6 @@
 
 #define ORDINARY_LINK
 
-#define LIB_STANDARD
-
 /* Undump with ELF */
 
 #undef COFF
--- a/src/systty.h	Thu May 06 12:51:40 2010 +0000
+++ b/src/systty.h	Fri May 07 12:19:28 2010 +0000
@@ -51,11 +51,8 @@
 #include <termios.h>
 #endif
 
-#ifdef NEED_BSDTTY
+#ifdef HPUX
 #include <sys/bsdtty.h>
-#endif
-
-#if defined (HPUX) && defined (HAVE_PTYS)
 #include <sys/ptyio.h>
 #endif
 
@@ -63,7 +60,7 @@
 #include <sys/pty.h>
 #endif /* AIX */
 
-#if (defined (POSIX) || defined (NEED_UNISTD_H)) && defined (HAVE_UNISTD_H)
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif