emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r100174: Move LD_SWITCH_SYSTEM from c


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100174: Move LD_SWITCH_SYSTEM from cpp to configure.
Date: Thu, 06 May 2010 19:55:47 -0700
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100174
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Thu 2010-05-06 19:55:47 -0700
message:
  Move LD_SWITCH_SYSTEM from cpp to configure.
  
  * 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.
  
  * src/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.
  * src/s/freebsd.h (LD_SWITCH_SYSTEM):
  * src/s/gnu-linux.h (LD_SWITCH_SYSTEM):
  * src/s/netbsd.h (LD_SWITCH_SYSTEM):
  
  * admin/CPP-DEFINES: Remove LD_SWITCH_SYSTEM.
modified:
  ChangeLog
  admin/CPP-DEFINES
  configure.in
  src/ChangeLog
  src/Makefile.in
  src/s/freebsd.h
  src/s/gnu-linux.h
  src/s/netbsd.h
=== modified file 'ChangeLog'
--- a/ChangeLog 2010-05-07 00:30:56 +0000
+++ b/ChangeLog 2010-05-07 02:55:47 +0000
@@ -1,3 +1,9 @@
+2010-05-07  Glenn Morris  <address@hidden>
+
+       * 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  <address@hidden>
 
        Define START_FILES and LIB_STANDARD using autoconf.

=== modified file 'admin/CPP-DEFINES'
--- a/admin/CPP-DEFINES 2010-05-07 00:35:44 +0000
+++ b/admin/CPP-DEFINES 2010-05-07 02:55:47 +0000
@@ -215,7 +215,6 @@
 IS_DIRECTORY_SEP
 KERNEL_FILE
 LDAV_SYMBOL
-LD_SWITCH_SYSTEM
 LIBS_SYSTEM
 LIBS_TERMCAP
 LIBXMU

=== modified file 'configure.in'
--- a/configure.in      2010-05-07 00:30:56 +0000
+++ b/configure.in      2010-05-07 02:55:47 +0000
@@ -892,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.  */
@@ -934,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 <address@hidden> 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=
@@ -3033,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.

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-05-07 00:30:56 +0000
+++ b/src/ChangeLog     2010-05-07 02:55:47 +0000
@@ -1,3 +1,14 @@
+2010-05-07  Glenn Morris  <address@hidden>
+
+       * 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  <address@hidden>
 
        Define LIB_STANDARD and START_FILES using autoconf.

=== modified file 'src/Makefile.in'
--- a/src/Makefile.in   2010-05-07 00:30:56 +0000
+++ b/src/Makefile.in   2010-05-07 02:55:47 +0000
@@ -73,13 +73,20 @@
 ## System-specific CFLAGS.
 address@hidden@
 ## 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.
 address@hidden@
 ## Next two must come before LD_SWITCH_SYSTEM.
 ## If needed, a -R option that says where to find X windows at run time.
 address@hidden@
 ## As above, but using -rpath instead.
 address@hidden@
+## System-specific LDFLAGS.
address@hidden@
address@hidden@
+## Flags to pass to ld only for temacs.
+TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_EXTRA) 
$(LD_SWITCH_SYSTEM_TEMACS)
 
 address@hidden@
 address@hidden@
@@ -189,16 +196,7 @@
 #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
@@ -312,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".
@@ -730,9 +723,6 @@
     ${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
 

=== modified file 'src/s/freebsd.h'
--- a/src/s/freebsd.h   2010-05-07 00:30:56 +0000
+++ b/src/s/freebsd.h   2010-05-07 02:55:47 +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,11 +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
 #undef LIB_GCC
 #define LIB_GCC
 

=== modified file 'src/s/gnu-linux.h'
--- a/src/s/gnu-linux.h 2010-05-07 00:30:56 +0000
+++ b/src/s/gnu-linux.h 2010-05-07 02:55:47 +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,15 +169,6 @@
 /* Ask GCC where to find libgcc.a.  */
 #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
 
-/* 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

=== modified file 'src/s/netbsd.h'
--- a/src/s/netbsd.h    2010-05-07 00:30:56 +0000
+++ b/src/s/netbsd.h    2010-05-07 02:55:47 +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.
 
@@ -33,10 +33,6 @@
 
 #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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]