From eb21eab59bbe301074cf478f43743d335254d97e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 3 May 2010 20:06:27 -0700 Subject: [PATCH] Move LD_SWITCH_SYSTEM_TEMACS from cpp to autoconf. * configure.in (LD_SWITCH_SYSTEM_TEMACS): New output variable. * src/s/aix4-2.h (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in. * src/s/darwin.h (HEADERPAD_EXTRA, LIBS_NSGUI): Remove. (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in. * src/Makefile.in (LD_SWITCH_SYSTEM_TEMACS): New variable, set by configure. (TEMACS_LDFLAGS): Use $LD_SWITCH_SYSTEM_TEMACS. --- ChangeLog | 2 ++ configure.in | 24 ++++++++++++++++++++++++ src/ChangeLog | 6 ++++++ src/Makefile.in | 11 ++++------- src/s/aix4-2.h | 3 --- src/s/darwin.h | 13 +------------ 6 files changed, 37 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index efcc5991fb7..c9b61269fe0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2010-05-04 Glenn Morris + * configure.in (LD_SWITCH_SYSTEM_TEMACS): New output variable. + * configure.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM): New output variables, replacing c_switch_machine, c_switch_system. diff --git a/configure.in b/configure.in index 184dbef6ff1..48dbff5254f 100644 --- a/configure.in +++ b/configure.in @@ -2992,6 +2992,30 @@ AC_SUBST(CYGWIN_OBJ) AC_SUBST(PRE_ALLOC_OBJ) AC_SUBST(POST_ALLOC_OBJ) + +case "$opsys" in + aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;; + + darwin) + ## The -headerpad option tells ld (see man page) to leave room at the + ## end of the header for adding load commands. Needed for dumping. + ## 0x690 is the total size of 30 segment load commands (at 56 + ## each); under Cocoa 31 commands are required. + if test "$HAVE_NS" = "yes"; then + libs_nsgui="-framework AppKit" + headerpad_extra=6C8 + else + libs_nsgui= + headerpad_extra=690 + fi + LD_SWITCH_SYSTEM_TEMACS="-prebind $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra" + ;; + + *) LD_SWITCH_SYSTEM_TEMACS= ;; +esac +AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) + + 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. diff --git a/src/ChangeLog b/src/ChangeLog index 33d550e7824..cbd5088e173 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2010-05-04 Glenn Morris + * s/aix4-2.h (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in. + * s/darwin.h (HEADERPAD_EXTRA, LIBS_NSGUI): Remove. + (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in. + * Makefile.in (LD_SWITCH_SYSTEM_TEMACS): New variable, set by configure. + (TEMACS_LDFLAGS): Use $LD_SWITCH_SYSTEM_TEMACS. + * s/aix4-2.h (C_SWITCH_SYSTEM): * m/alpha.h (C_SWITCH_MACHINE): Move to configure.in. diff --git a/src/Makefile.in b/src/Makefile.in index 220eac61c1f..fd6493aee29 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -74,6 +74,9 @@ CRT_DIR=@CRT_DIR@ C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ ## System-specific CFLAGS. C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ +## This holds any special options for linking temacs only (ie, not +## used by configure). +LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@ LIBTIFF=@LIBTIFF@ LIBJPEG=@LIBJPEG@ @@ -201,12 +204,6 @@ DEPFLAGS = -MMD -MF deps/$*.d #endif /* (defined (BSD_SYSTEM) && !defined (COFF)) */ #endif /* LD_SWITCH_SYSTEM */ -/* This holds special options for linking temacs - that should be used for linking anything else. */ -#ifndef LD_SWITCH_SYSTEM_TEMACS -#define LD_SWITCH_SYSTEM_TEMACS -#endif - /* These macros are for switches specifically related to X Windows. */ #ifndef LD_SWITCH_X_SITE #define LD_SWITCH_X_SITE @@ -326,7 +323,7 @@ LD=ld /* 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 +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 diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h index f6ed94828d4..b7de0312f7b 100644 --- a/src/s/aix4-2.h +++ b/src/s/aix4-2.h @@ -100,9 +100,6 @@ along with GNU Emacs. If not, see . */ #define LIBS_SYSTEM -lrts -lIM -liconv #endif -#define LD_SWITCH_SYSTEM_TEMACS -Wl,-bnodelcsect - - /* Use terminfo instead of termcap. */ diff --git a/src/s/darwin.h b/src/s/darwin.h index 060e354dca7..de8369ddae2 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h @@ -163,13 +163,8 @@ along with GNU Emacs. If not, see . */ /* Definitions for how to compile & link. */ #ifdef HAVE_NS -#define LIBS_NSGUI -framework AppKit #define SYSTEM_PURESIZE_EXTRA 200000 -#define HEADERPAD_EXTRA 6C8 -#else /* !HAVE_NS */ -#define LIBS_NSGUI -#define HEADERPAD_EXTRA 690 -#endif /* !HAVE_NS */ +#endif /* On Darwin, res_init appears not to be useful: see bug#562 and http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01467.html */ @@ -177,12 +172,6 @@ along with GNU Emacs. If not, see . */ #undef HAVE_RES_INIT #undef HAVE_LIBRESOLV -/* The -headerpad option tells ld (see man page) to leave room at the - end of the header for adding load commands. Needed for dumping. - 0x690 is the total size of 30 segment load commands (at 56 - each); under Cocoa 31 commands are required. */ -#define LD_SWITCH_SYSTEM_TEMACS -prebind LIBS_NSGUI -Xlinker -headerpad -Xlinker HEADERPAD_EXTRA - #ifdef emacs #define malloc unexec_malloc #define realloc unexec_realloc -- 2.39.2