changeset 108286:e7bdc5ae2810

Merge from mainline.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Fri, 07 May 2010 06:32:10 +0000
parents e14a0bf9fbd0 (current diff) d951d5810160 (diff)
children c0d13767677a
files
diffstat 22 files changed, 337 insertions(+), 229 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu May 06 22:42:55 2010 +0000
+++ b/ChangeLog	Fri May 07 06:32:10 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 22:42:55 2010 +0000
+++ b/admin/CPP-DEFINES	Fri May 07 06:32:10 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 22:42:55 2010 +0000
+++ b/configure	Fri May 07 06:32:10 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 22:42:55 2010 +0000
+++ b/configure.in	Fri May 07 06:32:10 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/lisp/ChangeLog	Thu May 06 22:42:55 2010 +0000
+++ b/lisp/ChangeLog	Fri May 07 06:32:10 2010 +0000
@@ -1,3 +1,13 @@
+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 22:42:55 2010 +0000
+++ b/lisp/emulation/cua-base.el	Fri May 07 06:32:10 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 22:42:55 2010 +0000
+++ b/lisp/emulation/cua-gmrk.el	Fri May 07 06:32:10 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/progmodes/cperl-mode.el	Thu May 06 22:42:55 2010 +0000
+++ b/lisp/progmodes/cperl-mode.el	Fri May 07 06:32:10 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/src/ChangeLog	Thu May 06 22:42:55 2010 +0000
+++ b/src/ChangeLog	Fri May 07 06:32:10 2010 +0000
@@ -1,3 +1,30 @@
+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.
--- a/src/Makefile.in	Thu May 06 22:42:55 2010 +0000
+++ b/src/Makefile.in	Fri May 07 06:32:10 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,42 +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
 
-#ifdef START_FILES
-STARTFILES = START_FILES
-#else
-STARTFILES =
-#endif
-
 #ifdef NS_IMPL_GNUSTEP
 /* Pull in stuff from GNUstep-make. */
 FOUNDATION_LIB=gnu
@@ -327,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".
@@ -691,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)
 
@@ -733,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 \
@@ -741,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
 
@@ -1181,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 22:42:55 2010 +0000
+++ b/src/config.in	Fri May 07 06:32:10 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/m/ibmrs6000.h	Thu May 06 22:42:55 2010 +0000
+++ b/src/m/ibmrs6000.h	Fri May 07 06:32:10 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 22:42:55 2010 +0000
+++ b/src/s/aix4-2.h	Fri May 07 06:32:10 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
--- a/src/s/cygwin.h	Thu May 06 22:42:55 2010 +0000
+++ b/src/s/cygwin.h	Fri May 07 06:32:10 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 22:42:55 2010 +0000
+++ b/src/s/darwin.h	Fri May 07 06:32:10 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 22:42:55 2010 +0000
+++ b/src/s/freebsd.h	Fri May 07 06:32:10 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 22:42:55 2010 +0000
+++ b/src/s/gnu-linux.h	Fri May 07 06:32:10 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/hpux10-20.h	Thu May 06 22:42:55 2010 +0000
+++ b/src/s/hpux10-20.h	Fri May 07 06:32:10 2010 +0000
@@ -131,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
@@ -160,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 22:42:55 2010 +0000
+++ b/src/s/irix6-5.h	Fri May 07 06:32:10 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 22:42:55 2010 +0000
+++ b/src/s/netbsd.h	Fri May 07 06:32:10 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 22:42:55 2010 +0000
+++ b/src/s/openbsd.h	Fri May 07 06:32:10 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 22:42:55 2010 +0000
+++ b/src/s/usg5-4.h	Fri May 07 06:32:10 2010 +0000
@@ -97,8 +97,6 @@
 
 #define ORDINARY_LINK
 
-#define LIB_STANDARD
-
 /* Undump with ELF */
 
 #undef COFF