diff options
| author | Dan Nicolaescu | 2010-09-21 01:35:37 +0300 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-09-21 01:35:37 +0300 |
| commit | f5ea3ba7ccf9174cbb1c115cf185632cfe44f655 (patch) | |
| tree | 8f1268550b6d437a785f7aea69ae0317a3bc0178 | |
| parent | 984edd2215e74d54d387c7e8fa2fd14ee43ff5f0 (diff) | |
| download | emacs-f5ea3ba7ccf9174cbb1c115cf185632cfe44f655.tar.gz emacs-f5ea3ba7ccf9174cbb1c115cf185632cfe44f655.zip | |
Link temacs using $(CC) not $(LD).
* configure.in (LINKER): Rename to LD_FIRSTFLAG, do not include $(CC).
* src/Makefile.in (temacs): Link using $(CC) not $(LD).
(LD_FIRSTFLAG): Define using autoconf.
(LD): Remove.
| -rwxr-xr-x | configure | 21 | ||||
| -rw-r--r-- | configure.in | 21 | ||||
| -rw-r--r-- | src/Makefile.in | 5 |
3 files changed, 22 insertions, 25 deletions
| @@ -599,7 +599,7 @@ WINDOW_SUPPORT | |||
| 599 | TOOLTIP_SUPPORT | 599 | TOOLTIP_SUPPORT |
| 600 | MOUSE_SUPPORT | 600 | MOUSE_SUPPORT |
| 601 | LIB_GCC | 601 | LIB_GCC |
| 602 | LINKER | 602 | LD_FIRSTFLAG |
| 603 | LD_SWITCH_SYSTEM_TEMACS | 603 | LD_SWITCH_SYSTEM_TEMACS |
| 604 | POST_ALLOC_OBJ | 604 | POST_ALLOC_OBJ |
| 605 | PRE_ALLOC_OBJ | 605 | PRE_ALLOC_OBJ |
| @@ -14703,7 +14703,7 @@ fi | |||
| 14703 | 14703 | ||
| 14704 | 14704 | ||
| 14705 | 14705 | ||
| 14706 | LINKER= | 14706 | LD_FIRSTFLAG= |
| 14707 | ORDINARY_LINK= | 14707 | ORDINARY_LINK= |
| 14708 | case "$opsys" in | 14708 | case "$opsys" in |
| 14709 | ## gnu: GNU needs its own crt0. | 14709 | ## gnu: GNU needs its own crt0. |
| @@ -14713,14 +14713,14 @@ case "$opsys" in | |||
| 14713 | ## library search parth, i.e. it won't search /usr/lib for libc and | 14713 | ## library search parth, i.e. it won't search /usr/lib for libc and |
| 14714 | ## friends. Using -nostartfiles instead avoids this problem, and | 14714 | ## friends. Using -nostartfiles instead avoids this problem, and |
| 14715 | ## will also work on earlier NetBSD releases. | 14715 | ## will also work on earlier NetBSD releases. |
| 14716 | netbsd|openbsd) LINKER="\$(CC) -nostartfiles" ;; | 14716 | netbsd|openbsd) LD_FIRSTFLAG="-nostartfiles" ;; |
| 14717 | 14717 | ||
| 14718 | ## macpcc: NAKAJI Hiroyuki <nakaji@tutrp.tut.ac.jp> says | 14718 | ## macpcc: NAKAJI Hiroyuki <nakaji@tutrp.tut.ac.jp> says |
| 14719 | ## MkLinux/LinuxPPC needs this. | 14719 | ## MkLinux/LinuxPPC needs this. |
| 14720 | ## ibms390x only supports opsys = gnu-linux so it can be added here. | 14720 | ## ibms390x only supports opsys = gnu-linux so it can be added here. |
| 14721 | gnu-*) | 14721 | gnu-*) |
| 14722 | case "$machine" in | 14722 | case "$machine" in |
| 14723 | macppc|ibms390x) LINKER="\$(CC) -nostdlib" ;; | 14723 | macppc|ibms390x) LD_FIRSTFLAG="-nostdlib" ;; |
| 14724 | esac | 14724 | esac |
| 14725 | ;; | 14725 | ;; |
| 14726 | esac | 14726 | esac |
| @@ -14728,14 +14728,14 @@ esac | |||
| 14728 | 14728 | ||
| 14729 | if test "x$ORDINARY_LINK" = "xyes"; then | 14729 | if test "x$ORDINARY_LINK" = "xyes"; then |
| 14730 | 14730 | ||
| 14731 | LINKER="\$(CC)" | 14731 | LD_FIRSTFLAG="" |
| 14732 | 14732 | ||
| 14733 | $as_echo "#define ORDINARY_LINK 1" >>confdefs.h | 14733 | $as_echo "#define ORDINARY_LINK 1" >>confdefs.h |
| 14734 | 14734 | ||
| 14735 | 14735 | ||
| 14736 | ## The system files defining neither ORDINARY_LINK nor LINKER are: | 14736 | ## The system files defining neither ORDINARY_LINK nor LD_FIRSTFLAG are: |
| 14737 | ## freebsd, gnu-* not on macppc|ibms390x. | 14737 | ## freebsd, gnu-* not on macppc|ibms390x. |
| 14738 | elif test "x$GCC" = "xyes" && test "x$LINKER" = "x"; then | 14738 | elif test "x$GCC" = "xyes" && test "x$LD_FIRSTFLAG" = "x"; then |
| 14739 | 14739 | ||
| 14740 | ## Versions of GCC >= 2.0 put their library, libgcc.a, in obscure | 14740 | ## Versions of GCC >= 2.0 put their library, libgcc.a, in obscure |
| 14741 | ## places that are difficult to figure out at make time. Fortunately, | 14741 | ## places that are difficult to figure out at make time. Fortunately, |
| @@ -14745,18 +14745,17 @@ elif test "x$GCC" = "xyes" && test "x$LINKER" = "x"; then | |||
| 14745 | ## Well, it is not quite perfect. The "-nostdlib" keeps GCC from | 14745 | ## Well, it is not quite perfect. The "-nostdlib" keeps GCC from |
| 14746 | ## searching for libraries in its internal directories, so we have to | 14746 | ## searching for libraries in its internal directories, so we have to |
| 14747 | ## ask GCC explicitly where to find libgcc.a (LIB_GCC below). | 14747 | ## ask GCC explicitly where to find libgcc.a (LIB_GCC below). |
| 14748 | LINKER="\$(CC) -nostdlib" | 14748 | LD_FIRSTFLAG="-nostdlib" |
| 14749 | fi | 14749 | fi |
| 14750 | 14750 | ||
| 14751 | test "x$LINKER" = "x" && LINKER=ld | ||
| 14752 | ## FIXME? What setting of EDIT_LDFLAGS should this have? | 14751 | ## FIXME? What setting of EDIT_LDFLAGS should this have? |
| 14753 | test "$NS_IMPL_GNUSTEP" = "yes" && LINKER="\$(CC) -rdynamic" | 14752 | test "$NS_IMPL_GNUSTEP" = "yes" && LD_FIRSTFLAG="-rdynamic" |
| 14754 | 14753 | ||
| 14755 | 14754 | ||
| 14756 | 14755 | ||
| 14757 | 14756 | ||
| 14758 | ## FIXME? The logic here is not precisely the same as that above. | 14757 | ## FIXME? The logic here is not precisely the same as that above. |
| 14759 | ## There is no check here for a pre-defined LINKER. | 14758 | ## There is no check here for a pre-defined LD_FIRSTFLAG. |
| 14760 | ## Should we only be setting LIB_GCC if LD ~ -nostdlib? | 14759 | ## Should we only be setting LIB_GCC if LD ~ -nostdlib? |
| 14761 | LIB_GCC= | 14760 | LIB_GCC= |
| 14762 | if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then | 14761 | if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then |
diff --git a/configure.in b/configure.in index b814b1a0236..47f3e0d7538 100644 --- a/configure.in +++ b/configure.in | |||
| @@ -3373,7 +3373,7 @@ fi | |||
| 3373 | AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) | 3373 | AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) |
| 3374 | 3374 | ||
| 3375 | 3375 | ||
| 3376 | LINKER= | 3376 | LD_FIRSTFLAG= |
| 3377 | ORDINARY_LINK= | 3377 | ORDINARY_LINK= |
| 3378 | case "$opsys" in | 3378 | case "$opsys" in |
| 3379 | ## gnu: GNU needs its own crt0. | 3379 | ## gnu: GNU needs its own crt0. |
| @@ -3383,14 +3383,14 @@ case "$opsys" in | |||
| 3383 | ## library search parth, i.e. it won't search /usr/lib for libc and | 3383 | ## library search parth, i.e. it won't search /usr/lib for libc and |
| 3384 | ## friends. Using -nostartfiles instead avoids this problem, and | 3384 | ## friends. Using -nostartfiles instead avoids this problem, and |
| 3385 | ## will also work on earlier NetBSD releases. | 3385 | ## will also work on earlier NetBSD releases. |
| 3386 | netbsd|openbsd) LINKER="\$(CC) -nostartfiles" ;; | 3386 | netbsd|openbsd) LD_FIRSTFLAG="-nostartfiles" ;; |
| 3387 | 3387 | ||
| 3388 | ## macpcc: NAKAJI Hiroyuki <nakaji@tutrp.tut.ac.jp> says | 3388 | ## macpcc: NAKAJI Hiroyuki <nakaji@tutrp.tut.ac.jp> says |
| 3389 | ## MkLinux/LinuxPPC needs this. | 3389 | ## MkLinux/LinuxPPC needs this. |
| 3390 | ## ibms390x only supports opsys = gnu-linux so it can be added here. | 3390 | ## ibms390x only supports opsys = gnu-linux so it can be added here. |
| 3391 | gnu-*) | 3391 | gnu-*) |
| 3392 | case "$machine" in | 3392 | case "$machine" in |
| 3393 | macppc|ibms390x) LINKER="\$(CC) -nostdlib" ;; | 3393 | macppc|ibms390x) LD_FIRSTFLAG="-nostdlib" ;; |
| 3394 | esac | 3394 | esac |
| 3395 | ;; | 3395 | ;; |
| 3396 | esac | 3396 | esac |
| @@ -3398,12 +3398,12 @@ esac | |||
| 3398 | 3398 | ||
| 3399 | if test "x$ORDINARY_LINK" = "xyes"; then | 3399 | if test "x$ORDINARY_LINK" = "xyes"; then |
| 3400 | 3400 | ||
| 3401 | LINKER="\$(CC)" | 3401 | LD_FIRSTFLAG="" |
| 3402 | AC_DEFINE(ORDINARY_LINK, 1, [Define if the C compiler is the linker.]) | 3402 | AC_DEFINE(ORDINARY_LINK, 1, [Define if the C compiler is the linker.]) |
| 3403 | 3403 | ||
| 3404 | ## The system files defining neither ORDINARY_LINK nor LINKER are: | 3404 | ## The system files defining neither ORDINARY_LINK nor LD_FIRSTFLAG are: |
| 3405 | ## freebsd, gnu-* not on macppc|ibms390x. | 3405 | ## freebsd, gnu-* not on macppc|ibms390x. |
| 3406 | elif test "x$GCC" = "xyes" && test "x$LINKER" = "x"; then | 3406 | elif test "x$GCC" = "xyes" && test "x$LD_FIRSTFLAG" = "x"; then |
| 3407 | 3407 | ||
| 3408 | ## Versions of GCC >= 2.0 put their library, libgcc.a, in obscure | 3408 | ## Versions of GCC >= 2.0 put their library, libgcc.a, in obscure |
| 3409 | ## places that are difficult to figure out at make time. Fortunately, | 3409 | ## places that are difficult to figure out at make time. Fortunately, |
| @@ -3413,18 +3413,17 @@ elif test "x$GCC" = "xyes" && test "x$LINKER" = "x"; then | |||
| 3413 | ## Well, it is not quite perfect. The "-nostdlib" keeps GCC from | 3413 | ## Well, it is not quite perfect. The "-nostdlib" keeps GCC from |
| 3414 | ## searching for libraries in its internal directories, so we have to | 3414 | ## searching for libraries in its internal directories, so we have to |
| 3415 | ## ask GCC explicitly where to find libgcc.a (LIB_GCC below). | 3415 | ## ask GCC explicitly where to find libgcc.a (LIB_GCC below). |
| 3416 | LINKER="\$(CC) -nostdlib" | 3416 | LD_FIRSTFLAG="-nostdlib" |
| 3417 | fi | 3417 | fi |
| 3418 | 3418 | ||
| 3419 | test "x$LINKER" = "x" && LINKER=ld | ||
| 3420 | ## FIXME? What setting of EDIT_LDFLAGS should this have? | 3419 | ## FIXME? What setting of EDIT_LDFLAGS should this have? |
| 3421 | test "$NS_IMPL_GNUSTEP" = "yes" && LINKER="\$(CC) -rdynamic" | 3420 | test "$NS_IMPL_GNUSTEP" = "yes" && LD_FIRSTFLAG="-rdynamic" |
| 3422 | 3421 | ||
| 3423 | AC_SUBST(LINKER) | 3422 | AC_SUBST(LD_FIRSTFLAG) |
| 3424 | 3423 | ||
| 3425 | 3424 | ||
| 3426 | ## FIXME? The logic here is not precisely the same as that above. | 3425 | ## FIXME? The logic here is not precisely the same as that above. |
| 3427 | ## There is no check here for a pre-defined LINKER. | 3426 | ## There is no check here for a pre-defined LD_FIRSTFLAG. |
| 3428 | ## Should we only be setting LIB_GCC if LD ~ -nostdlib? | 3427 | ## Should we only be setting LIB_GCC if LD ~ -nostdlib? |
| 3429 | LIB_GCC= | 3428 | LIB_GCC= |
| 3430 | if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then | 3429 | if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then |
diff --git a/src/Makefile.in b/src/Makefile.in index d91b95d86e3..7fe3fe0ae81 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -35,6 +35,7 @@ CC = @CC@ | |||
| 35 | CFLAGS = @CFLAGS@ | 35 | CFLAGS = @CFLAGS@ |
| 36 | CPPFLAGS = @CPPFLAGS@ | 36 | CPPFLAGS = @CPPFLAGS@ |
| 37 | LDFLAGS = @LDFLAGS@ | 37 | LDFLAGS = @LDFLAGS@ |
| 38 | LD_FIRSTFLAG=@LD_FIRSTFLAG@ | ||
| 38 | EXEEXT = @EXEEXT@ | 39 | EXEEXT = @EXEEXT@ |
| 39 | version = @version@ | 40 | version = @version@ |
| 40 | # Substitute an assignment for the MAKE variable, because | 41 | # Substitute an assignment for the MAKE variable, because |
| @@ -124,8 +125,6 @@ LIBS_SYSTEM=@LIBS_SYSTEM@ | |||
| 124 | ## Where to find libgcc.a, if using gcc and necessary. | 125 | ## Where to find libgcc.a, if using gcc and necessary. |
| 125 | LIB_GCC=@LIB_GCC@ | 126 | LIB_GCC=@LIB_GCC@ |
| 126 | 127 | ||
| 127 | LD=@LINKER@ | ||
| 128 | |||
| 129 | ## May use $CRT_DIR. | 128 | ## May use $CRT_DIR. |
| 130 | LIB_STANDARD=@LIB_STANDARD@ | 129 | LIB_STANDARD=@LIB_STANDARD@ |
| 131 | 130 | ||
| @@ -646,7 +645,7 @@ buildobj.h: Makefile | |||
| 646 | 645 | ||
| 647 | 646 | ||
| 648 | temacs${EXEEXT}: $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} | 647 | temacs${EXEEXT}: $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} |
| 649 | $(LD) ${TEMACS_LDFLAGS} ${TEMACS_LDFLAGS2} \ | 648 | $(CC) $(LD_FIRSTFLAG) ${TEMACS_LDFLAGS} ${TEMACS_LDFLAGS2} \ |
| 650 | -o temacs ${START_FILES} ${obj} ${otherobj} ${LIBES} | 649 | -o temacs ${START_FILES} ${obj} ${otherobj} ${LIBES} |
| 651 | 650 | ||
| 652 | ## The following oldxmenu-related rules are only (possibly) used if | 651 | ## The following oldxmenu-related rules are only (possibly) used if |