diff options
| author | Glenn Morris | 2010-05-06 19:55:47 -0700 |
|---|---|---|
| committer | Glenn Morris | 2010-05-06 19:55:47 -0700 |
| commit | 2f86b22b05324b3687dd470bbd85e65d4d8db1d7 (patch) | |
| tree | 46379234ee8f4d02c818b9b93685552b0a09c346 | |
| parent | cae7fcf92d01240eb8dd6de99ba8add4d85b397e (diff) | |
| download | emacs-2f86b22b05324b3687dd470bbd85e65d4d8db1d7.tar.gz emacs-2f86b22b05324b3687dd470bbd85e65d4d8db1d7.zip | |
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.
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | admin/CPP-DEFINES | 1 | ||||
| -rw-r--r-- | configure.in | 67 | ||||
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/Makefile.in | 28 | ||||
| -rw-r--r-- | src/s/freebsd.h | 14 | ||||
| -rw-r--r-- | src/s/gnu-linux.h | 15 | ||||
| -rw-r--r-- | src/s/netbsd.h | 8 |
8 files changed, 95 insertions, 55 deletions
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-05-07 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * configure.in (LD_SWITCH_SYSTEM): Set with configure, not cpp. | ||
| 4 | Merges logic from src/s/* and src/Makefile.in. | ||
| 5 | (LD_SWITCH_SYSTEM_TEMACS): New output variable. | ||
| 6 | |||
| 1 | 2010-05-07 Dan Nicolaescu <dann@ics.uci.edu> | 7 | 2010-05-07 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 8 | ||
| 3 | Define START_FILES and LIB_STANDARD using autoconf. | 9 | Define START_FILES and LIB_STANDARD using autoconf. |
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index eee7a99d1a1..ab78d1b8c5f 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES | |||
| @@ -215,7 +215,6 @@ IS_ANY_SEP | |||
| 215 | IS_DIRECTORY_SEP | 215 | IS_DIRECTORY_SEP |
| 216 | KERNEL_FILE | 216 | KERNEL_FILE |
| 217 | LDAV_SYMBOL | 217 | LDAV_SYMBOL |
| 218 | LD_SWITCH_SYSTEM | ||
| 219 | LIBS_SYSTEM | 218 | LIBS_SYSTEM |
| 220 | LIBS_TERMCAP | 219 | LIBS_TERMCAP |
| 221 | LIBXMU | 220 | LIBXMU |
diff --git a/configure.in b/configure.in index d670342723f..8b1bc60cc5f 100644 --- a/configure.in +++ b/configure.in | |||
| @@ -892,12 +892,6 @@ configure___ use_mmap_for_buffers=no | |||
| 892 | #define C_WARNINGS_SWITCH ${C_WARNINGS_SWITCH} | 892 | #define C_WARNINGS_SWITCH ${C_WARNINGS_SWITCH} |
| 893 | #endif | 893 | #endif |
| 894 | 894 | ||
| 895 | #ifndef LD_SWITCH_SYSTEM | ||
| 896 | #define LD_SWITCH_SYSTEM | ||
| 897 | #endif | ||
| 898 | |||
| 899 | configure___ ld_switch_system=LD_SWITCH_SYSTEM | ||
| 900 | |||
| 901 | #ifdef THIS_IS_CONFIGURE | 895 | #ifdef THIS_IS_CONFIGURE |
| 902 | 896 | ||
| 903 | /* Get the CFLAGS for tests in configure. */ | 897 | /* Get the CFLAGS for tests in configure. */ |
| @@ -934,7 +928,49 @@ else | |||
| 934 | fi] | 928 | fi] |
| 935 | rm ${tempcname} | 929 | rm ${tempcname} |
| 936 | 930 | ||
| 937 | ac_link="$ac_link $ld_switch_system" | 931 | |
| 932 | LD_SWITCH_SYSTEM= | ||
| 933 | case "$opsys" in | ||
| 934 | freebsd) | ||
| 935 | ## Let `ld' find image libs and similar things in /usr/local/lib. | ||
| 936 | ## The system compiler, GCC, has apparently been modified to not | ||
| 937 | ## look there, contrary to what a stock GCC would do. | ||
| 938 | LD_SWITCH_SYSTEM=-L/usr/local/lib | ||
| 939 | ;; | ||
| 940 | |||
| 941 | gnu-linux) | ||
| 942 | ## cpp test was "ifdef __mips__", but presumably this is equivalent... | ||
| 943 | test "$machine" = "mips" && LD_SWITCH_SYSTEM="-G 0" | ||
| 944 | ;; | ||
| 945 | |||
| 946 | netbsd) | ||
| 947 | LD_SWITCH_SYSTEM="-Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib" | ||
| 948 | ;; | ||
| 949 | |||
| 950 | openbsd) | ||
| 951 | ## Han Boetes <han@mijncomputer.nl> says this is necessary, | ||
| 952 | ## otherwise Emacs dumps core on elf systems. | ||
| 953 | LD_SWITCH_SYSTEM="-Z" | ||
| 954 | ;; | ||
| 955 | esac | ||
| 956 | AC_SUBST(LD_SWITCH_SYSTEM) | ||
| 957 | |||
| 958 | ac_link="$ac_link $LD_SWITCH_SYSTEM" | ||
| 959 | |||
| 960 | ## This is fun. Some settings of LD_SWITCH_SYSTEM reference | ||
| 961 | ## LD_SWITCH_X_SITE_AUX, which has not been defined yet. When using | ||
| 962 | ## cpp, it was expanded to null. Thus LD_SWITCH_SYSTEM had different | ||
| 963 | ## values in configure and the Makefiles. How helpful. | ||
| 964 | ## FIXME why not use LD_SWITCH_SYSTEM_TEMACS (or somesuch) instead? | ||
| 965 | case "$opsys" in | ||
| 966 | gnu-linux) | ||
| 967 | ## LD_SWITCH_X_SITE_AUX is a -R option saying where to find X at run-time. | ||
| 968 | LD_SWITCH_SYSTEM="$LD_SWITCH_SYSTEM \$(LD_SWITCH_X_SITE_AUX)" ;; | ||
| 969 | |||
| 970 | netbsd|openbsd) | ||
| 971 | ## _AUX_RPATH is like _AUX, but uses -rpath instead of -R. | ||
| 972 | LD_SWITCH_SYSTEM="\$(LD_SWITCH_X_SITE_AUX_RPATH) $LD_SWITCH_SYSTEM" ;; | ||
| 973 | esac | ||
| 938 | 974 | ||
| 939 | 975 | ||
| 940 | C_SWITCH_MACHINE= | 976 | C_SWITCH_MACHINE= |
| @@ -3033,6 +3069,23 @@ esac | |||
| 3033 | AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) | 3069 | AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) |
| 3034 | 3070 | ||
| 3035 | 3071 | ||
| 3072 | ## This exists because src/Makefile.in did some extra fiddling around | ||
| 3073 | ## with LD_SWITCH_SYSTEM. The cpp logic was: | ||
| 3074 | ## #ifndef LD_SWITCH_SYSTEM | ||
| 3075 | ## #if !defined (__GNUC__) && ((defined (BSD_SYSTEM) && !defined (COFF))) | ||
| 3076 | ## Since all the *bsds define LD_SWITCH_SYSTEM, this simplifies to: | ||
| 3077 | ## not using gcc, darwin system not on an alpha (ie darwin, since | ||
| 3078 | ## darwin + alpha does not occur). | ||
| 3079 | ## Note that unlike L_S_S, this is not used in ac_link. | ||
| 3080 | if test "x$LD_SWITCH_SYSTEM" = "x" && test "x$GCC" != "xyes" && \ | ||
| 3081 | test "$opsys" = "darwin"; then | ||
| 3082 | LD_SWITCH_SYSTEM_EXTRA="-X" | ||
| 3083 | else | ||
| 3084 | LD_SWITCH_SYSTEM_EXTRA= | ||
| 3085 | fi | ||
| 3086 | AC_SUBST(LD_SWITCH_SYSTEM_EXTRA) | ||
| 3087 | |||
| 3088 | |||
| 3036 | AH_TOP([/* GNU Emacs site configuration template file. | 3089 | AH_TOP([/* GNU Emacs site configuration template file. |
| 3037 | Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005, | 3090 | Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005, |
| 3038 | 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | 3091 | 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
diff --git a/src/ChangeLog b/src/ChangeLog index 81fe7c07571..04d9d6b8266 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2010-05-07 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * Makefile.in (LD_SWITCH_SYSTEM): Set with configure, not cpp. | ||
| 4 | (LD_SWITCH_SYSTEM_EXTRA): New variable, set by configure. | ||
| 5 | (TEMACS_LDFLAGS): Use $LD_SWITCH_SYSTEM and $LD_SWITCH_SYSTEM_EXTRA, | ||
| 6 | move out of cpp section. | ||
| 7 | * s/freebsd.h (LD_SWITCH_SYSTEM): | ||
| 8 | * s/gnu-linux.h (LD_SWITCH_SYSTEM): | ||
| 9 | * s/netbsd.h (LD_SWITCH_SYSTEM): | ||
| 10 | * s/openbsd.h (LD_SWITCH_SYSTEM): Move to configure.in. | ||
| 11 | |||
| 1 | 2010-05-07 Dan Nicolaescu <dann@ics.uci.edu> | 12 | 2010-05-07 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 13 | ||
| 3 | Define LIB_STANDARD and START_FILES using autoconf. | 14 | Define LIB_STANDARD and START_FILES using autoconf. |
diff --git a/src/Makefile.in b/src/Makefile.in index 70ec71f3fb6..5ea321df78c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -73,13 +73,20 @@ C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ | |||
| 73 | ## System-specific CFLAGS. | 73 | ## System-specific CFLAGS. |
| 74 | C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ | 74 | C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ |
| 75 | ## This holds any special options for linking temacs only (ie, not | 75 | ## This holds any special options for linking temacs only (ie, not |
| 76 | ## used by configure). | 76 | ## used by configure). Not used elsewhere because it sometimes |
| 77 | ## contains options that have to do with using Emacs's crt0, | ||
| 78 | ## which are only good with temacs. | ||
| 77 | LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@ | 79 | LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@ |
| 78 | ## Next two must come before LD_SWITCH_SYSTEM. | 80 | ## Next two must come before LD_SWITCH_SYSTEM. |
| 79 | ## If needed, a -R option that says where to find X windows at run time. | 81 | ## If needed, a -R option that says where to find X windows at run time. |
| 80 | LD_SWITCH_X_SITE_AUX=@LD_SWITCH_X_SITE_AUX@ | 82 | LD_SWITCH_X_SITE_AUX=@LD_SWITCH_X_SITE_AUX@ |
| 81 | ## As above, but using -rpath instead. | 83 | ## As above, but using -rpath instead. |
| 82 | LD_SWITCH_X_SITE_AUX_RPATH=@LD_SWITCH_X_SITE_AUX_RPATH@ | 84 | LD_SWITCH_X_SITE_AUX_RPATH=@LD_SWITCH_X_SITE_AUX_RPATH@ |
| 85 | ## System-specific LDFLAGS. | ||
| 86 | LD_SWITCH_SYSTEM=@LD_SWITCH_SYSTEM@ | ||
| 87 | LD_SWITCH_SYSTEM_EXTRA=@LD_SWITCH_SYSTEM_EXTRA@ | ||
| 88 | ## Flags to pass to ld only for temacs. | ||
| 89 | TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_EXTRA) $(LD_SWITCH_SYSTEM_TEMACS) | ||
| 83 | 90 | ||
| 84 | LIBTIFF=@LIBTIFF@ | 91 | LIBTIFF=@LIBTIFF@ |
| 85 | LIBJPEG=@LIBJPEG@ | 92 | LIBJPEG=@LIBJPEG@ |
| @@ -189,16 +196,7 @@ DEPFLAGS = -MMD -MF deps/$*.d | |||
| 189 | #define LIBS_SYSTEM | 196 | #define LIBS_SYSTEM |
| 190 | #endif | 197 | #endif |
| 191 | 198 | ||
| 192 | /* Some s/SYSTEM.h files define this to request special switches in ld. */ | 199 | /* This macro is for switches specifically related to X Windows. */ |
| 193 | #ifndef LD_SWITCH_SYSTEM | ||
| 194 | #if !defined (__GNUC__) && ((defined (BSD_SYSTEM) && !defined (COFF))) | ||
| 195 | #define LD_SWITCH_SYSTEM -X | ||
| 196 | #else /* (defined (BSD_SYSTEM) && !defined (COFF)) */ | ||
| 197 | #define LD_SWITCH_SYSTEM | ||
| 198 | #endif /* (defined (BSD_SYSTEM) && !defined (COFF)) */ | ||
| 199 | #endif /* LD_SWITCH_SYSTEM */ | ||
| 200 | |||
| 201 | /* These macros are for switches specifically related to X Windows. */ | ||
| 202 | #ifndef LD_SWITCH_X_SITE | 200 | #ifndef LD_SWITCH_X_SITE |
| 203 | #define LD_SWITCH_X_SITE | 201 | #define LD_SWITCH_X_SITE |
| 204 | #endif | 202 | #endif |
| @@ -312,11 +310,6 @@ LD=ld | |||
| 312 | #endif /* not LINKER */ | 310 | #endif /* not LINKER */ |
| 313 | #endif /* not ORDINARY_LINK */ | 311 | #endif /* not ORDINARY_LINK */ |
| 314 | 312 | ||
| 315 | /* Flags to pass to LD only for temacs. */ | ||
| 316 | /* Do not split this line with a backslash. That can cause trouble with | ||
| 317 | some cpps. */ | ||
| 318 | TEMACS_LDFLAGS = LD_SWITCH_SYSTEM $(LD_SWITCH_SYSTEM_TEMACS) | ||
| 319 | |||
| 320 | /* A macro which other sections of Makefile can redefine to munge the | 313 | /* A macro which other sections of Makefile can redefine to munge the |
| 321 | flags before they are passed to LD. This is helpful if you have | 314 | flags before they are passed to LD. This is helpful if you have |
| 322 | redefined LD to something odd, like "gcc". | 315 | redefined LD to something odd, like "gcc". |
| @@ -730,9 +723,6 @@ temacs${EXEEXT}: $(LOCALCPP) $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} pr | |||
| 730 | ${LIBES} | 723 | ${LIBES} |
| 731 | #endif | 724 | #endif |
| 732 | 725 | ||
| 733 | /* We do not use ALL_LDFLAGS because LD_SWITCH_SYSTEM | ||
| 734 | often contains options that have to do with using Emacs''s crt0, | ||
| 735 | which are only good with temacs. */ | ||
| 736 | prefix-args${EXEEXT}: prefix-args.o $(config_h) | 726 | prefix-args${EXEEXT}: prefix-args.o $(config_h) |
| 737 | $(CC) $(LDFLAGS) prefix-args.o -o prefix-args | 727 | $(CC) $(LDFLAGS) prefix-args.o -o prefix-args |
| 738 | 728 | ||
diff --git a/src/s/freebsd.h b/src/s/freebsd.h index 0b56f6b3c81..1e79e1d3581 100644 --- a/src/s/freebsd.h +++ b/src/s/freebsd.h | |||
| @@ -1,9 +1,8 @@ | |||
| 1 | /* System description header for FreeBSD systems. | 1 | /* System description header for FreeBSD systems. |
| 2 | This file describes the parameters that system description files | 2 | |
| 3 | should define or not. | 3 | Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
| 4 | Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | 4 | 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
| 5 | 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 | 5 | Free Software Foundation, Inc. |
| 6 | Free Software Foundation, Inc. | ||
| 7 | 6 | ||
| 8 | Author: Shawn M. Carey | 7 | Author: Shawn M. Carey |
| 9 | (according to authors.el) | 8 | (according to authors.el) |
| @@ -41,11 +40,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 41 | #define LIBS_TERMCAP -lncurses | 40 | #define LIBS_TERMCAP -lncurses |
| 42 | #endif | 41 | #endif |
| 43 | 42 | ||
| 44 | /* Let `ld' find image libs and similar things in /usr/local/lib. The | ||
| 45 | system compiler, GCC, has apparently been modified to not look | ||
| 46 | there, contrary to what a stock GCC would do. */ | ||
| 47 | |||
| 48 | #define LD_SWITCH_SYSTEM -L/usr/local/lib | ||
| 49 | #undef LIB_GCC | 43 | #undef LIB_GCC |
| 50 | #define LIB_GCC | 44 | #define LIB_GCC |
| 51 | 45 | ||
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index e5ac75ff0d4..f3a06990ed3 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* This file is the configuration file for Linux-based GNU systems | 1 | /* This file is the configuration file for Linux-based GNU systems |
| 2 | Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004, | 2 | |
| 3 | 2005, 2006, 2007, 2008, 2009, 2010 | 3 | Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004, |
| 4 | Free Software Foundation, Inc. | 4 | 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | This file is part of GNU Emacs. | 6 | This file is part of GNU Emacs. |
| 7 | 7 | ||
| @@ -169,15 +169,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 169 | /* Ask GCC where to find libgcc.a. */ | 169 | /* Ask GCC where to find libgcc.a. */ |
| 170 | #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name` | 170 | #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name` |
| 171 | 171 | ||
| 172 | /* Here is how to find X Windows. LD_SWITCH_X_SITE_AUX gives an -R option | ||
| 173 | that says where to find X windows at run time. */ | ||
| 174 | |||
| 175 | #ifdef __mips__ | ||
| 176 | #define LD_SWITCH_SYSTEM -G 0 $(LD_SWITCH_X_SITE_AUX) | ||
| 177 | #else | ||
| 178 | #define LD_SWITCH_SYSTEM $(LD_SWITCH_X_SITE_AUX) | ||
| 179 | #endif /* __mips__ */ | ||
| 180 | |||
| 181 | #ifdef emacs | 172 | #ifdef emacs |
| 182 | #define INTERRUPT_INPUT | 173 | #define INTERRUPT_INPUT |
| 183 | #endif | 174 | #endif |
diff --git a/src/s/netbsd.h b/src/s/netbsd.h index 987f5e68907..a92e8ce56ee 100644 --- a/src/s/netbsd.h +++ b/src/s/netbsd.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* s/ file for netbsd system. | 1 | /* s/ file for netbsd system. |
| 2 | 2 | ||
| 3 | Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, | 3 | Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, |
| 4 | 2008, 2009, 2010 Free Software Foundation, Inc. | 4 | 2010 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | This file is part of GNU Emacs. | 6 | This file is part of GNU Emacs. |
| 7 | 7 | ||
| @@ -33,10 +33,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 33 | 33 | ||
| 34 | #define AMPERSAND_FULL_NAME | 34 | #define AMPERSAND_FULL_NAME |
| 35 | 35 | ||
| 36 | /* LD_SWITCH_X_SITE_AUX_RPATH gives a -rpath option (which is what | ||
| 37 | OSF1 uses) that says where to find X windows at run time. */ | ||
| 38 | #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 | ||
| 39 | |||
| 40 | /* On post 1.3 releases of NetBSD, gcc -nostdlib also clears | 36 | /* On post 1.3 releases of NetBSD, gcc -nostdlib also clears |
| 41 | the library search parth, i.e. it won't search /usr/lib | 37 | the library search parth, i.e. it won't search /usr/lib |
| 42 | for libc and friends. Using -nostartfiles instead avoids | 38 | for libc and friends. Using -nostartfiles instead avoids |