emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r100359: Set linker-related things wi


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100359: Set linker-related things with configure.
Date: Tue, 18 May 2010 19:42:04 -0700
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100359
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Tue 2010-05-18 19:42:04 -0700
message:
  Set linker-related things with configure.
  
  * configure.in (LINKER, YMF_PASS_LDFLAGS): New output variables.
  (ORDINARY_LINK): New AC_DEFINE.
  (LIB_GCC): No need to set if ORDINARY_LINK.
  
  * src/Makefile.in (LD, YMF_PASS_LDFLAGS): Set with configure, not cpp.
  (GNULIB_VAR): Remove.
  (LIBES): Use LIB_GCC instead of GNULIB_VAR.
  
  * src/m/ibms390x.h (LINKER):
  * src/m/macppc.h (LINKER) [GNU_LINUX]:
  * src/s/aix4-2.h (ORDINARY_LINK):
  * src/s/cygwin.h (LINKER):
  * src/s/darwin.h (ORDINARY_LINK):
  * src/s/gnu.h (ORDINARY_LINK):
  * src/s/netbsd.h (LINKER):
  * src/s/usg5-4.h (ORDINARY_LINK):
  Move to configure.
  
  * msdos/sed1v2.inp (LD): Edit to $(CC).
  (YMF_PASS_LDFLAGS): Edit to `flags'.
modified:
  ChangeLog
  configure.in
  msdos/ChangeLog
  msdos/sed1v2.inp
  src/ChangeLog
  src/Makefile.in
  src/m/ibms390x.h
  src/m/macppc.h
  src/s/aix4-2.h
  src/s/cygwin.h
  src/s/darwin.h
  src/s/gnu.h
  src/s/netbsd.h
  src/s/usg5-4.h
=== modified file 'ChangeLog'
--- a/ChangeLog 2010-05-18 02:49:28 +0000
+++ b/ChangeLog 2010-05-19 02:42:04 +0000
@@ -1,3 +1,9 @@
+2010-05-19  Glenn Morris  <address@hidden>
+
+       * configure.in (LINKER, YMF_PASS_LDFLAGS): New output variables.
+       (ORDINARY_LINK): New AC_DEFINE.
+       (LIB_GCC): No need to set if ORDINARY_LINK.
+
 2010-05-18  Glenn Morris  <address@hidden>
 
        * configure.in (POST_ALLOC_OBJ) [cygwin]: Omit vm-limit.o.

=== modified file 'configure.in'
--- a/configure.in      2010-05-18 02:49:28 +0000
+++ b/configure.in      2010-05-19 02:42:04 +0000
@@ -3277,8 +3277,75 @@
 AC_SUBST(LD_SWITCH_SYSTEM_EXTRA)
 
 
+LINKER=
+ORDINARY_LINK=
+case "$opsys" in
+  ## gnu: GNU needs its own crt0.
+  aix4-2|darwin|gnu|usg5-4|irix6-5|sol2*|unixware) ORDINARY_LINK=yes ;;
+
+  cygwin) LINKER="\$(CC)" ;;
+
+  ## 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 this problem, and
+  ## will also work on earlier NetBSD releases.
+  netbsd|openbsd) LINKER="\$(CC) -nostartfiles" ;;
+
+  ## macpcc: NAKAJI Hiroyuki <address@hidden> says
+  ##   MkLinux/LinuxPPC needs this.
+  ## ibms390x only supports opsys = gnu-linux so it can be added here.
+  gnu-*)
+    case "$machine" in
+      macppc|ibms390x) LINKER="\$(CC) -nostdlib" ;;
+    esac
+    ;;
+esac
+
+## 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".
+## (The YMF prefix is a holdover from the old name "ymakefile".) 
+YMF_PASS_LDFLAGS=flags
+if test "x$ORDINARY_LINK" = "xyes"; then
+
+  LINKER="\$(CC)"
+  AC_DEFINE(ORDINARY_LINK, 1, [Define if the C compiler is the linker.])
+
+## The system files defining neither ORDINARY_LINK nor LINKER are:
+## (bsd-common), freebsd, gnu-* not on macppc|ibms390x, hpux*.
+elif test "x$GCC" = "xyes" && test "x$LINKER" = "x"; then
+
+  ## Versions of GCC >= 2.0 put their library, libgcc.a, in obscure
+  ## places that are difficult to figure out at make time.  Fortunately,
+  ## these same versions allow you to pass arbitrary flags on to the
+  ## linker, so there is no reason not to use it as a linker.
+  ##
+  ## Well, it is not quite perfect.  The "-nostdlib" keeps GCC from
+  ## searching for libraries in its internal directories, so we have to
+  ## ask GCC explicitly where to find libgcc.a (LIB_GCC below).
+  LINKER="\$(CC) -nostdlib"
+  ## GCC passes any argument prefixed with -Xlinker directly to the linker.
+  ## See prefix-args.c for an explanation of why we do not do this with the
+  ## shell''s ``for'' construct.  Note that sane people do not have '.' in
+  ## their paths, so we must use ./prefix-args.
+  ## TODO either make prefix-args check ORDINARY_LINK internally,
+  ## or remove it altogether (bug#6184), removing the need for this macro.
+  YMF_PASS_LDFLAGS='`./prefix-args -Xlinker flags`'
+fi
+AC_SUBST(YMF_PASS_LDFLAGS)
+
+test "x$LINKER" = "x" && LINKER=ld
+## FIXME? What setting of YMF_PASS_LDFLAGS should this have?
+test "$NS_IMPL_GNUSTEP" = "yes" && LINKER="\$(CC) -rdynamic"
+
+AC_SUBST(LINKER)
+
+
+## FIXME? The logic here is not precisely the same as that above
+## setting YMF_PASS_LDFLAGS.  There is no check here for a pre-defined
+## LINKER.  Should we only be setting LIB_GCC if LD ~ -nostdlib?
 LIB_GCC=
-if test "x$GCC" = "xyes"; then
+if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then
 
   case "$opsys" in
     ## cygwin: don't link against static libgcc.

=== modified file 'msdos/ChangeLog'
--- a/msdos/ChangeLog   2010-05-18 07:57:27 +0000
+++ b/msdos/ChangeLog   2010-05-19 02:42:04 +0000
@@ -1,3 +1,8 @@
+2010-05-19  Glenn Morris  <address@hidden>
+
+       * sed1v2.inp (LD): Edit to $(CC).
+       (YMF_PASS_LDFLAGS): Edit to `flags'.
+
 2010-05-18  Eli Zaretskii  <address@hidden>
 
        * sed1x.inp: Add copyright notice.

=== modified file 'msdos/sed1v2.inp'
--- a/msdos/sed1v2.inp  2010-05-18 02:44:07 +0000
+++ b/msdos/sed1v2.inp  2010-05-19 02:42:04 +0000
@@ -55,6 +55,7 @@
 /^TEMACS_LDFLAGS2 *=/s/@TEMACS_LDFLAGS2@/$(LDFLAGS)/
 /^LIBS_SYSTEM *=/s/@LIBS_SYSTEM@//
 /^LIB_GCC *=/s/@LIB_GCC@/-Lgcc/
+/^LD *=/s/@LINKER@/$(CC)/
 /^LIB_STANDARD *=/s/@LIB_STANDARD@//
 /^LIB_MATH *=/s/@LIB_MATH@/-lm/
 /^LIBTIFF *=/s/@LIBTIFF@//
@@ -143,6 +144,7 @@
 /^     @: /d
 /^     -\{0,1\}ln -/s/ln -f/cp -pf/
 /^[    ]touch /s/touch/djecho $@ >/
+s/@YMF_PASS_LDFLAGS@/flags/
 s/bootstrap-emacs/b-emacs/
 s/bootstrap-temacs/b-temacs/
 s/bootstrap-doc/b-doc/

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-05-19 02:27:01 +0000
+++ b/src/ChangeLog     2010-05-19 02:42:04 +0000
@@ -1,5 +1,19 @@
 2010-05-19  Glenn Morris  <address@hidden>
 
+       * Makefile.in (LD, YMF_PASS_LDFLAGS): Set with configure, not cpp.
+       (GNULIB_VAR): Remove.
+       (LIBES): Use LIB_GCC instead of GNULIB_VAR.
+
+       * m/ibms390x.h (LINKER):
+       * m/macppc.h (LINKER) [GNU_LINUX]:
+       * s/aix4-2.h (ORDINARY_LINK):
+       * s/cygwin.h (LINKER):
+       * s/darwin.h (ORDINARY_LINK):
+       * s/gnu.h (ORDINARY_LINK):
+       * s/netbsd.h (LINKER):
+       * s/usg5-4.h (ORDINARY_LINK):
+       Move to configure.
+
        * s/aix4-2.h (LINKER): Remove; this file sets ORDINARY_LINK.
 
 2010-05-18  Chong Yidong  <address@hidden>

=== modified file 'src/Makefile.in'
--- a/src/Makefile.in   2010-05-18 02:49:28 +0000
+++ b/src/Makefile.in   2010-05-19 02:42:04 +0000
@@ -124,6 +124,8 @@
 ## Where to find libgcc.a, if using gcc and necessary.
 address@hidden@
 
address@hidden@
+
 ## May use $CRT_DIR.
 address@hidden@
 
@@ -329,52 +331,6 @@
        $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
 
 
-/* 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".
-   (The YMF prefix is a holdover from the old name "ymakefile".)  */
-#define YMF_PASS_LDFLAGS(flags) flags
-
-
-#ifdef ORDINARY_LINK
-LD = $(CC)
-
-#else /* not ORDINARY_LINK */
-GNULIB_VAR = $(LIB_GCC)
-
-/* Fix linking if compiled with GCC.  */
-#if defined (__GNUC__) && ! defined (LINKER)
-/* Versions of GCC >= 2.0 put their library, libgcc.a, in obscure
-   places that are difficult to figure out at make time.  Fortunately,
-   these same versions allow you to pass arbitrary flags on to the
-   linker, so there is no reason not to use it as a linker.
-
-   Well, it is not quite perfect.  The "-nostdlib" keeps GCC from
-   searching for libraries in its internal directories, so we have to
-   ask GCC explicitly where to find libgcc.a.  */
-#define LINKER $(CC) -nostdlib
-/* GCC passes any argument prefixed with -Xlinker directly to the linker.
-   See prefix-args.c for an explanation of why we do not do this with the
-   shell''s ``for'' construct.  Note that sane people do not have '.' in
-   their paths, so we must use ./prefix-args.  */
-#undef YMF_PASS_LDFLAGS
-#define YMF_PASS_LDFLAGS(flags) `./prefix-args -Xlinker flags`
-#endif /* defined (__GNUC__) && ! defined (LINKER) */
-
-#ifdef LINKER
-LD=LINKER
-#else /* not LINKER */
-LD=ld
-#endif /* not LINKER */
-
-#endif /* not ORDINARY_LINK */
-
-
-#ifdef NS_IMPL_GNUSTEP
-LD=$(CC) -rdynamic
-#endif
-
-
 /* lastfile must follow all files whose initialized data areas should
    be dumped as pure by dump-emacs.  */
 obj=    dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
@@ -634,13 +590,13 @@
 /* Construct full set of libraries to be linked.
    Note that SunOS needs -lm to come before -lc; otherwise, you get
    duplicated symbols.  If the standard libraries were compiled
-   with GCC, we might need gnulib again after them.  */
+   with GCC, we might need LIB_GCC again after them.  */
 
 LIBES = $(LOADLIBES) $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \
    $(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)
+   $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC)
 
 all: emacs${EXEEXT} $(OTHER_FILES)
 
@@ -682,6 +638,8 @@
 buildobj.h: Makefile
        echo "#define BUILDOBJ \"${obj} ${otherobj} " "\"" > buildobj.h
 
+#define YMF_PASS_LDFLAGS(flags) @YMF_PASS_LDFLAGS@
+
 temacs${EXEEXT}: $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} 
prefix-args${EXEEXT}
        $(LD) YMF_PASS_LDFLAGS ( ${TEMACS_LDFLAGS} \
          ${NS_IMPL_GNUSTEP_TEMACS_LDFLAGS} ) \

=== modified file 'src/m/ibms390x.h'
--- a/src/m/ibms390x.h  2010-05-12 02:37:59 +0000
+++ b/src/m/ibms390x.h  2010-05-19 02:42:04 +0000
@@ -62,8 +62,6 @@
 /* On the 64 bit architecture, we can use 60 bits for addresses */
 #define VALBITS         60
 
-#define LINKER $(CC) -nostdlib
-
 /* Define XPNTR to avoid or'ing with DATA_SEG_BITS */
 #define XPNTR(a) XUINT (a)
 

=== modified file 'src/m/macppc.h'
--- a/src/m/macppc.h    2010-05-12 02:37:59 +0000
+++ b/src/m/macppc.h    2010-05-19 02:42:04 +0000
@@ -32,12 +32,6 @@
 #define HAVE_TEXT_START
 #endif
 
-/* NAKAJI Hiroyuki <address@hidden> says this is needed
-   For MkLinux/LinuxPPC.  */
-#ifdef GNU_LINUX
-#define LINKER $(CC) -nostdlib
-#endif
-
 #ifdef _ARCH_PPC64
 #ifndef _LP64
 #define _LP64

=== modified file 'src/s/aix4-2.h'
--- a/src/s/aix4-2.h    2010-05-19 02:27:01 +0000
+++ b/src/s/aix4-2.h    2010-05-19 02:42:04 +0000
@@ -106,7 +106,5 @@
 
 #define UNEXEC unexaix.o
 
-#define ORDINARY_LINK
-
 /* arch-tag: 38fe75ea-6aef-42bd-8449-bc34d921a562
    (do not change this comment) */

=== modified file 'src/s/cygwin.h'
--- a/src/s/cygwin.h    2010-05-12 06:53:03 +0000
+++ b/src/s/cygwin.h    2010-05-19 02:42:04 +0000
@@ -1,7 +1,7 @@
 /* System description header file for Cygwin.
 
 Copyright (C) 1985, 1986, 1992, 1999, 2002, 2003, 2004, 2005, 2006,
-  2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+  2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -19,7 +19,7 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* SYSTEM_TYPE should indicate the kind of system you are using.
- It sets the Lisp variable system-type.  */
+   It sets the Lisp variable system-type.  */
 #define SYSTEM_TYPE "cygwin"
 
 /* Emacs can read input using SIGIO and buffering characters itself,
@@ -94,7 +94,6 @@
 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
 #define SYSV_SYSTEM_DIR 1
 #define UNEXEC unexcw.o
-#define LINKER $(CC)
 
 #define HAVE_SOCKETS
 

=== modified file 'src/s/darwin.h'
--- a/src/s/darwin.h    2010-05-12 06:53:03 +0000
+++ b/src/s/darwin.h    2010-05-19 02:42:04 +0000
@@ -147,9 +147,6 @@
 #undef HAVE_POSIX_MEMALIGN
 #endif
 
-/* Link this program just by running cc.  */
-#define ORDINARY_LINK
-
 /* Define the following so emacs symbols will not conflict with those
    in the System framework.  Otherwise -prebind will not work.  */
 

=== modified file 'src/s/gnu.h'
--- a/src/s/gnu.h       2010-05-18 02:44:07 +0000
+++ b/src/s/gnu.h       2010-05-19 02:42:04 +0000
@@ -29,8 +29,7 @@
 
 #define SIGNALS_VIA_CHARACTERS
 
-/* GNU needs its own crt0, and libc defines data_start.  */
-#define ORDINARY_LINK
+/* libc defines data_start.  */
 #define DATA_START ({ extern int data_start; (char *) &data_start; })
 
 /* Some losing code fails to include this and then assumes

=== modified file 'src/s/netbsd.h'
--- a/src/s/netbsd.h    2010-05-14 02:28:28 +0000
+++ b/src/s/netbsd.h    2010-05-19 02:42:04 +0000
@@ -26,12 +26,6 @@
 
 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
 
-/* 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
-   this problem, and will also work on earlier NetBSD releases.  */
-#define LINKER $(CC) -nostartfiles
-
 #define DEFAULT_SOUND_DEVICE "/dev/audio"
 
 /* Greg A. Woods <address@hidden> says we must include signal.h

=== modified file 'src/s/usg5-4.h'
--- a/src/s/usg5-4.h    2010-05-12 06:53:03 +0000
+++ b/src/s/usg5-4.h    2010-05-19 02:42:04 +0000
@@ -69,8 +69,6 @@
 /* On USG systems signal handlers return void.  */
 #define SIGTYPE void
 
-#define ORDINARY_LINK
-
 /* Undump with ELF.  */
 #undef COFF
 


reply via email to

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