summaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-04-27 14:12:32 +0000
committerNick Clifton <nickc@redhat.com>2010-04-27 14:12:32 +0000
commit4fda8867e90e3f6a43fcbd9a6f25280315648f46 (patch)
tree2b4c1d9dde7b2f720b6dad53c1b90fabd13ffd27 /gold
parent7ce0d9b1ffa9c8ca1c4da112afad5017a0b5f553 (diff)
downloadbinutils-gdb-4fda8867e90e3f6a43fcbd9a6f25280315648f46.tar.gz
gold:
* configure.ac (install_as_default): Define and set to false unless --enable-gold or --enable-gold=both/gold has been specified. * configure: Regenerate. * Makefile.am (install-exec-local): Install the executable as 'ld.gold'. If install_as_default is true then also install it as 'ld'. * Makefile.in: Regenerated. ld: * configure.in (install_as_default): Define and set to true unless --enable-gold=both/gold has been specified. * configure: Regenerate. * Makefile.am (transform): Use ld.bfd as the default name of the linker. (install-exec-local): Also install the executable as a binary named 'ld' if install_as_default is true. * Makefile.in: Regenerate.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog13
-rw-r--r--gold/Makefile.am16
-rw-r--r--gold/Makefile.in18
-rwxr-xr-xgold/configure31
-rw-r--r--gold/configure.ac27
5 files changed, 99 insertions, 6 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 5b502646169..714998b76c6 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,16 @@
+2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
+ Nick Clifton <nickc@redhat.com>
+
+ * configure.ac (install_as_default): Define and set to false
+ unless --enable-gold or --enable-gold=both/gold has been
+ specified.
+ * configure: Regenerate.
+
+ * Makefile.am (install-exec-local): Install the executable as
+ 'ld.gold'. If install_as_default is true then also install it as
+ 'ld'.
+ * Makefile.in: Regenerated.
+
2010-04-24 Ian Lance Taylor <iant@google.com>
* layout.cc (Layout::layout_reloc): In relocatable link don't
diff --git a/gold/Makefile.am b/gold/Makefile.am
index e0665e04f81..a24e185669a 100644
--- a/gold/Makefile.am
+++ b/gold/Makefile.am
@@ -178,12 +178,22 @@ check: libgold.a
install-exec-local: ld-new$(EXEEXT)
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
- n=`echo ld | sed '$(transform)'`; \
+ n=`echo $(installed_linker) | sed '$(transform)'`; \
$(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \
if test "$(bindir)" != "$(tooldir)/bin"; then \
- rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
- ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
+ rm -f $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
+ ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT) >/dev/null 2>/dev/null \
+ || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
+ fi; \
+ if test "x$(install_as_default)" = "xyes"; then \
+ rm -f $(DESTDIR)$(bindir)/ld$(EXEEXT); \
+ ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(bindir)/ld$(EXEEXT) >/dev/null 2>/dev/null \
+ || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/ld$(EXEEXT); \
+ if test "$(bindir)" != "$(tooldir)/bin"; then \
+ rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
+ ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
|| $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
+ fi; \
fi
# We want install to imply install-info as per GNU standards, despite
diff --git a/gold/Makefile.in b/gold/Makefile.in
index 6e736f1121b..13c71cac96d 100644
--- a/gold/Makefile.in
+++ b/gold/Makefile.in
@@ -258,7 +258,9 @@ host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
+install_as_default = @install_as_default@
install_sh = @install_sh@
+installed_linker = @installed_linker@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
@@ -1002,12 +1004,22 @@ check: libgold.a
install-exec-local: ld-new$(EXEEXT)
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
- n=`echo ld | sed '$(transform)'`; \
+ n=`echo $(installed_linker) | sed '$(transform)'`; \
$(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \
if test "$(bindir)" != "$(tooldir)/bin"; then \
- rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
- ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
+ rm -f $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
+ ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT) >/dev/null 2>/dev/null \
+ || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
+ fi; \
+ if test "x$(install_as_default)" = "xyes"; then \
+ rm -f $(DESTDIR)$(bindir)/ld$(EXEEXT); \
+ ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(bindir)/ld$(EXEEXT) >/dev/null 2>/dev/null \
+ || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/ld$(EXEEXT); \
+ if test "$(bindir)" != "$(tooldir)/bin"; then \
+ rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
+ ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
|| $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
+ fi; \
fi
# We want install to imply install-info as per GNU standards, despite
diff --git a/gold/configure b/gold/configure
index 20df0dfa599..eb8f01ed7b9 100755
--- a/gold/configure
+++ b/gold/configure
@@ -682,6 +682,8 @@ PLUGINS_FALSE
PLUGINS_TRUE
THREADS_FALSE
THREADS_TRUE
+installed_linker
+install_as_default
am__untar
am__tar
AMTAR
@@ -759,6 +761,7 @@ ac_subst_files=''
ac_user_opts='
enable_option_checking
with_sysroot
+enable_gold
enable_threads
enable_plugins
enable_targets
@@ -1403,6 +1406,7 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-gold[=ARG] build gold [ARG={both}[/{gold,ld}]]
--enable-threads multi-threaded linking
--enable-plugins linker plugins
--enable-targets alternative target configurations
@@ -3227,6 +3231,33 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+# Check whether --enable-gold was given.
+if test "${enable_gold+set}" = set; then :
+ enableval=$enable_gold; case "${enableval}" in
+ yes)
+ install_as_default=gold
+ installed_linker=ld
+ ;;
+ both/gold)
+ install_as_default=yes
+ installed_linker=ld.gold
+ ;;
+ both|both/ld)
+ install_as_default=no
+ installed_linker=ld.gold
+ ;;
+ *)
+ as_fn_error "invalid --enable-gold argument" "$LINENO" 5
+ ;;
+ esac
+else
+ install_as_default=gold
+ installed_linker=ld
+fi
+
+
+
+
# Check whether --enable-threads was given.
if test "${enable_threads+set}" = set; then :
enableval=$enable_threads; case "${enableval}" in
diff --git a/gold/configure.ac b/gold/configure.ac
index 72db25db161..67d179670a4 100644
--- a/gold/configure.ac
+++ b/gold/configure.ac
@@ -38,6 +38,33 @@ AC_DEFINE_UNQUOTED(TARGET_SYSTEM_ROOT, "$sysroot",
AC_DEFINE_UNQUOTED(TARGET_SYSTEM_ROOT_RELOCATABLE, $sysroot_relocatable,
[Whether the system root can be relocated])
+dnl "install_as_default" is true if the linker to be installed as the
+dnl default linker, ld.
+dnl "installed_linker" is the installed gold linker name.
+AC_ARG_ENABLE(gold,
+[[ --enable-gold[=ARG] build gold [ARG={both}[/{gold,ld}]]]],
+[case "${enableval}" in
+ yes)
+ install_as_default=gold
+ installed_linker=ld
+ ;;
+ both/gold)
+ install_as_default=yes
+ installed_linker=ld.gold
+ ;;
+ both|both/ld)
+ install_as_default=no
+ installed_linker=ld.gold
+ ;;
+ *)
+ AC_MSG_ERROR([invalid --enable-gold argument])
+ ;;
+ esac],
+[install_as_default=gold
+ installed_linker=ld])
+AC_SUBST(install_as_default)
+AC_SUBST(installed_linker)
+
dnl For now threads are a configure time option.
AC_ARG_ENABLE([threads],
[ --enable-threads multi-threaded linking],