aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2010-05-11 20:44:36 -0700
committerGlenn Morris2010-05-11 20:44:36 -0700
commitb5457f146f83943eef8f5662f89e10bd52eec9bd (patch)
treefcd0329be8b619052edc50b3dc4b5d66de7ce27d
parent057886a3ac4704f1ca5456c1d69c151c54263d09 (diff)
downloademacs-b5457f146f83943eef8f5662f89e10bd52eec9bd.tar.gz
emacs-b5457f146f83943eef8f5662f89e10bd52eec9bd.zip
Simplify linker-related logic in src/Makefile.in.
* src/Makefile.in (YMF_PASS_LDFLAGS, LD, LINKER): Simplify the logic. (LINKER_WAS_SPECIFIED): Remove.
-rw-r--r--src/ChangeLog3
-rw-r--r--src/Makefile.in57
2 files changed, 25 insertions, 35 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7bf067e2427..16c20e188b4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12010-05-12 Glenn Morris <rgm@gnu.org> 12010-05-12 Glenn Morris <rgm@gnu.org>
2 2
3 * Makefile.in (YMF_PASS_LDFLAGS, LD, LINKER): Simplify the logic.
4 (LINKER_WAS_SPECIFIED): Remove.
5
3 * Makefile.in (LIB_GCC): Set using configure, not cpp. 6 * Makefile.in (LIB_GCC): Set using configure, not cpp.
4 (GNULIB_VAR) [!ORDINARY_LINK]: Always set to $LIB_GCC. 7 (GNULIB_VAR) [!ORDINARY_LINK]: Always set to $LIB_GCC.
5 * m/arm.h (LIB_GCC) [GNU_LINUX]: 8 * m/arm.h (LIB_GCC) [GNU_LINUX]:
diff --git a/src/Makefile.in b/src/Makefile.in
index 9476254e48d..46d4e0c2878 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,7 +1,7 @@
1# Makefile for GNU Emacs. 1# Makefile for GNU Emacs.
2# Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002, 2# Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
3# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 3# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
4# Free Software Foundation, Inc. 4# Free Software Foundation, Inc.
5 5
6# This file is part of GNU Emacs. 6# This file is part of GNU Emacs.
7 7
@@ -260,16 +260,22 @@ LIBX_BASE=$(LIBXMENU) LD_SWITCH_X_SITE
260LIBX_OTHER=@LIBX_OTHER@ 260LIBX_OTHER=@LIBX_OTHER@
261#endif /* not HAVE_X_WINDOWS */ 261#endif /* not HAVE_X_WINDOWS */
262 262
263#ifndef ORDINARY_LINK
264GNULIB_VAR = $(LIB_GCC)
265 263
266/* Fix linking if compiled with GCC. */ 264/* A macro which other sections of Makefile can redefine to munge the
267#ifdef __GNUC__ 265 flags before they are passed to LD. This is helpful if you have
266 redefined LD to something odd, like "gcc".
267 (The YMF prefix is a holdover from the old name "ymakefile".) */
268#define YMF_PASS_LDFLAGS(flags) flags
268 269
269#ifdef LINKER
270#define LINKER_WAS_SPECIFIED
271#endif
272 270
271#ifdef ORDINARY_LINK
272LD = $(CC)
273
274#else /* not ORDINARY_LINK */
275GNULIB_VAR = $(LIB_GCC)
276
277/* Fix linking if compiled with GCC. */
278#if defined (__GNUC__) && ! defined (LINKER)
273/* Versions of GCC >= 2.0 put their library, libgcc.a, in obscure 279/* Versions of GCC >= 2.0 put their library, libgcc.a, in obscure
274 places that are difficult to figure out at make time. Fortunately, 280 places that are difficult to figure out at make time. Fortunately,
275 these same versions allow you to pass arbitrary flags on to the 281 these same versions allow you to pass arbitrary flags on to the
@@ -278,42 +284,23 @@ GNULIB_VAR = $(LIB_GCC)
278 Well, it is not quite perfect. The "-nostdlib" keeps GCC from 284 Well, it is not quite perfect. The "-nostdlib" keeps GCC from
279 searching for libraries in its internal directories, so we have to 285 searching for libraries in its internal directories, so we have to
280 ask GCC explicitly where to find libgcc.a. */ 286 ask GCC explicitly where to find libgcc.a. */
281
282#ifndef LINKER
283#define LINKER $(CC) -nostdlib 287#define LINKER $(CC) -nostdlib
284#endif 288/* GCC passes any argument prefixed with -Xlinker directly to the linker.
285 289 See prefix-args.c for an explanation of why we do not do this with the
286#ifndef LINKER_WAS_SPECIFIED 290 shell''s ``for'' construct. Note that sane people do not have '.' in
287/* GCC passes any argument prefixed with -Xlinker directly to the 291 their paths, so we must use ./prefix-args. */
288 linker. See prefix-args.c for an explanation of why we do not do 292#undef YMF_PASS_LDFLAGS
289 this with the shell''s ``for'' construct.
290 Note that some people do not have '.' in their paths, so we must
291 use ./prefix-args. */
292#define YMF_PASS_LDFLAGS(flags) `./prefix-args -Xlinker flags` 293#define YMF_PASS_LDFLAGS(flags) `./prefix-args -Xlinker flags`
293#else 294#endif /* defined (__GNUC__) && ! defined (LINKER) */
294#define YMF_PASS_LDFLAGS(flags) flags
295#endif
296 295
297#endif /* not ORDINARY_LINK */
298
299#ifdef ORDINARY_LINK
300LD = $(CC)
301#else
302#ifdef LINKER 296#ifdef LINKER
303LD=LINKER 297LD=LINKER
304#else /* not LINKER */ 298#else /* not LINKER */
305LD=ld 299LD=ld
306#endif /* not LINKER */ 300#endif /* not LINKER */
301
307#endif /* not ORDINARY_LINK */ 302#endif /* not ORDINARY_LINK */
308 303
309/* A macro which other sections of Makefile can redefine to munge the
310 flags before they are passed to LD. This is helpful if you have
311 redefined LD to something odd, like "gcc".
312 (The YMF prefix is a holdover from the old name "ymakefile".)
313 */
314#ifndef YMF_PASS_LDFLAGS
315#define YMF_PASS_LDFLAGS(flags) flags
316#endif
317 304
318#ifdef MSDOS 305#ifdef MSDOS
319#ifdef HAVE_X_WINDOWS 306#ifdef HAVE_X_WINDOWS