Commit b5457f14 authored by Glenn Morris's avatar Glenn Morris
Browse files

Simplify linker-related logic in src/Makefile.in.

* src/Makefile.in (YMF_PASS_LDFLAGS, LD, LINKER): Simplify the logic.
(LINKER_WAS_SPECIFIED): Remove.
parent 057886a3
2010-05-12 Glenn Morris <rgm@gnu.org> 2010-05-12 Glenn Morris <rgm@gnu.org>
* Makefile.in (YMF_PASS_LDFLAGS, LD, LINKER): Simplify the logic.
(LINKER_WAS_SPECIFIED): Remove.
* Makefile.in (LIB_GCC): Set using configure, not cpp. * Makefile.in (LIB_GCC): Set using configure, not cpp.
(GNULIB_VAR) [!ORDINARY_LINK]: Always set to $LIB_GCC. (GNULIB_VAR) [!ORDINARY_LINK]: Always set to $LIB_GCC.
* m/arm.h (LIB_GCC) [GNU_LINUX]: * m/arm.h (LIB_GCC) [GNU_LINUX]:
......
# Makefile for GNU Emacs. # Makefile for GNU Emacs.
# Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002, # Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This file is part of GNU Emacs. # This file is part of GNU Emacs.
...@@ -260,16 +260,22 @@ LIBX_BASE=$(LIBXMENU) LD_SWITCH_X_SITE ...@@ -260,16 +260,22 @@ LIBX_BASE=$(LIBXMENU) LD_SWITCH_X_SITE
LIBX_OTHER=@LIBX_OTHER@ LIBX_OTHER=@LIBX_OTHER@
#endif /* not HAVE_X_WINDOWS */ #endif /* not HAVE_X_WINDOWS */
#ifndef ORDINARY_LINK
GNULIB_VAR = $(LIB_GCC)
/* Fix linking if compiled with GCC. */ /* A macro which other sections of Makefile can redefine to munge the
#ifdef __GNUC__ 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 LINKER
#define LINKER_WAS_SPECIFIED
#endif
#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 /* Versions of GCC >= 2.0 put their library, libgcc.a, in obscure
places that are difficult to figure out at make time. Fortunately, places that are difficult to figure out at make time. Fortunately,
these same versions allow you to pass arbitrary flags on to the these same versions allow you to pass arbitrary flags on to the
...@@ -278,42 +284,23 @@ GNULIB_VAR = $(LIB_GCC) ...@@ -278,42 +284,23 @@ GNULIB_VAR = $(LIB_GCC)
Well, it is not quite perfect. The "-nostdlib" keeps GCC from Well, it is not quite perfect. The "-nostdlib" keeps GCC from
searching for libraries in its internal directories, so we have to searching for libraries in its internal directories, so we have to
ask GCC explicitly where to find libgcc.a. */ ask GCC explicitly where to find libgcc.a. */
#ifndef LINKER
#define LINKER $(CC) -nostdlib #define LINKER $(CC) -nostdlib
#endif /* 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
#ifndef LINKER_WAS_SPECIFIED shell''s ``for'' construct. Note that sane people do not have '.' in
/* GCC passes any argument prefixed with -Xlinker directly to the their paths, so we must use ./prefix-args. */
linker. See prefix-args.c for an explanation of why we do not do #undef YMF_PASS_LDFLAGS
this with the shell''s ``for'' construct.
Note that some people do not have '.' in their paths, so we must
use ./prefix-args. */
#define YMF_PASS_LDFLAGS(flags) `./prefix-args -Xlinker flags` #define YMF_PASS_LDFLAGS(flags) `./prefix-args -Xlinker flags`
#else #endif /* defined (__GNUC__) && ! defined (LINKER) */
#define YMF_PASS_LDFLAGS(flags) flags
#endif
#endif /* not ORDINARY_LINK */
#ifdef ORDINARY_LINK
LD = $(CC)
#else
#ifdef LINKER #ifdef LINKER
LD=LINKER LD=LINKER
#else /* not LINKER */ #else /* not LINKER */
LD=ld LD=ld
#endif /* not LINKER */ #endif /* not LINKER */
#endif /* not ORDINARY_LINK */ #endif /* not ORDINARY_LINK */
/* 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".)
*/
#ifndef YMF_PASS_LDFLAGS
#define YMF_PASS_LDFLAGS(flags) flags
#endif
#ifdef MSDOS #ifdef MSDOS
#ifdef HAVE_X_WINDOWS #ifdef HAVE_X_WINDOWS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment