gold:
authorNick Clifton <nickc@redhat.com>
Tue, 27 Apr 2010 14:12:32 +0000 (14:12 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 27 Apr 2010 14:12:32 +0000 (14:12 +0000)
        * 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.

gold/ChangeLog
gold/Makefile.am
gold/Makefile.in
gold/configure
gold/configure.ac
ld/ChangeLog
ld/Makefile.am
ld/Makefile.in
ld/configure
ld/configure.in

index 5b5026461690fffc3aa4171215f3c1332a211187..714998b76c6a1b9a134785b99c15ea2a8a0d175a 100644 (file)
@@ -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
index e0665e04f81d7bedb9be4f371fd55e2dd820068b..a24e185669ab4036e3d25c78435a25965e9cda28 100644 (file)
@@ -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
index 6e736f1121b02430898925e7eb884f4ebae01181..13c71cac96ddd5f76dd2dd87e5e8cdf4eddd1c0c 100644 (file)
@@ -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
index 20df0dfa599f707ea65c27c3c54f3e5f2630afa0..eb8f01ed7b9182b55eff912e234fca30652ae4ac 100755 (executable)
@@ -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
index 72db25db161ded722efa6856a9c0ef899821c050..67d179670a4ac4a319dc4f01582b32109e05f348 100644 (file)
@@ -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],
index 9ed4a2e6737cc6dbc57435d99791b62263135828..36559b2e51c9b893edcebf8592d53790c810e4e3 100644 (file)
@@ -1,3 +1,16 @@
+2010-04-27  H.J. Lu  <hongjiu.lu@intel.com>
+           Nick Clifton  <nickc@redhat.com>
+
+       * 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.
+
 2010-04-22  Nick Clifton  <nickc@redhat.com>
 
        * po/ld.pot: Updated by the Translation project.
index 54e930923a45d18c616a829f4270bd92f420fa1d..91349719a648d81cb47052bfbe44035f924c6bf9 100644 (file)
@@ -95,7 +95,7 @@ CXX_FOR_TARGET = ` \
     fi; \
   fi`
 
-transform = s/^ld-new$$/ld/;@program_transform_name@
+transform = s/^ld-new$$/$(installed_linker)/;@program_transform_name@
 bin_PROGRAMS = ld-new
 info_TEXINFOS = ld.texinfo
 ld_TEXINFOS = configdoc.texi
@@ -1995,13 +1995,23 @@ CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 spu_ovl.s spu_ovl.o spu_icache.s spu_ica
 
 .PHONY: install-exec-local install-data-local
 
-install-exec-local: ld-new$(EXEEXT)
+install-exec-local: ld-new$(EXEEXT) install-binPROGRAMS
        $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin
-       n=`echo ld | sed '$(transform)'`; \
-       if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/ld$(EXEEXT)" ]; then \
-         rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
-         ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
-         || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
+       n=`echo $(installed_linker) | sed '$(transform)'`; \
+       if test "$(bindir)" != "$(tooldir)/bin"; then \
+         rm -f $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
+         ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT) >/dev/null 2>/dev/null \
+         || $(LIBTOOL) --mode=install $(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 \
+         || $(LIBTOOL) --mode=install $(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 \
+           || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
+         fi; \
        fi
 
 install-data-local:
index 12c465a409dc618f81ca6160e53fa61ec171f43f..3b53c905bdfd01163cc4a2699111c672122fd798 100644 (file)
@@ -155,7 +155,7 @@ CTAGS = ctags
 DEJATOOL = $(PACKAGE)
 RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
 DIST_SUBDIRS = $(SUBDIRS)
-transform = s/^ld-new$$/ld/;@program_transform_name@
+transform = s/^ld-new$$/$(installed_linker)/;@program_transform_name@
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AR = @AR@
@@ -295,7 +295,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@
@@ -3320,13 +3322,23 @@ mostlyclean-local:
 
 .PHONY: install-exec-local install-data-local
 
-install-exec-local: ld-new$(EXEEXT)
+install-exec-local: ld-new$(EXEEXT) install-binPROGRAMS
        $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin
-       n=`echo ld | sed '$(transform)'`; \
-       if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/ld$(EXEEXT)" ]; then \
-         rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
-         ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
-         || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
+       n=`echo $(installed_linker) | sed '$(transform)'`; \
+       if test "$(bindir)" != "$(tooldir)/bin"; then \
+         rm -f $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
+         ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT) >/dev/null 2>/dev/null \
+         || $(LIBTOOL) --mode=install $(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 \
+         || $(LIBTOOL) --mode=install $(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 \
+           || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
+         fi; \
        fi
 
 install-data-local:
index 1fa03956d0d6323dc3c4fa75312fe108febe8f11..ed3da982c2177eeb3c21c8c2716a8ada834c157a 100755 (executable)
@@ -657,6 +657,8 @@ WARN_CFLAGS
 EGREP
 GREP
 CPP
+installed_linker
+install_as_default
 TARGET_SYSTEM_ROOT_DEFINE
 TARGET_SYSTEM_ROOT
 use_sysroot
@@ -761,6 +763,7 @@ with_lib_path
 enable_targets
 enable_64_bit_bfd
 with_sysroot
+enable_gold
 enable_got
 enable_werror
 enable_build_warnings
@@ -1409,6 +1412,7 @@ Optional Features:
                          (and sometimes confusing) to the casual installer
   --enable-targets        alternative target configurations
   --enable-64-bit-bfd     64-bit support (on hosts with narrower word sizes)
+  --enable-gold[=ARG]     build gold [ARG={both}[/{gold,ld}]]
   --enable-got=<type>     GOT handling scheme (target, single, negative,
                           multigot)
   --enable-werror         treat compile warnings as errors
@@ -4164,6 +4168,29 @@ fi
 
 
 
+# Check whether --enable-gold was given.
+if test "${enable_gold+set}" = set; then :
+  enableval=$enable_gold; case "${enableval}" in
+ yes|both/gold)
+   install_as_default=no
+   installed_linker=ld.bfd
+   ;;
+ both|both/ld)
+   install_as_default=yes
+   installed_linker=ld.bfd
+   ;;
+ *)
+   as_fn_error "invalid --enable-gold argument" "$LINENO" 5
+   ;;
+ esac
+else
+  install_as_default=ld
+ installed_linker=ld
+fi
+
+
+
+
 # Check whether --enable-got was given.
 if test "${enable_got+set}" = set; then :
   enableval=$enable_got; case "${enableval}" in
@@ -11587,7 +11614,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11590 "configure"
+#line 11617 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11693,7 +11720,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11696 "configure"
+#line 11723 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index 2abfba4388f3367d44f6f56786a6b810cfda6e79..90baeca3bacf7e06c8abadc1ae19f613c426fd50 100644 (file)
@@ -69,6 +69,29 @@ AC_SUBST(use_sysroot)
 AC_SUBST(TARGET_SYSTEM_ROOT)
 AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
 
+dnl Use --enable-gold to decide if this linker should be the default.
+dnl "install_as_default" is set to false if gold is the default linker.
+dnl "installed_linker" is the installed BFD linker name.
+AC_ARG_ENABLE(gold,
+[[  --enable-gold[=ARG]     build gold [ARG={both}[/{gold,ld}]]]],
+[case "${enableval}" in 
+ yes|both/gold)
+   install_as_default=no
+   installed_linker=ld.bfd
+   ;;
+ both|both/ld)
+   install_as_default=yes
+   installed_linker=ld.bfd
+   ;;
+ *)
+   AC_MSG_ERROR([invalid --enable-gold argument])
+   ;;
+ esac],
+[install_as_default=ld
+ installed_linker=ld])
+AC_SUBST(install_as_default)
+AC_SUBST(installed_linker)
+
 AC_ARG_ENABLE([got],
 AS_HELP_STRING([--enable-got=<type>],
                [GOT handling scheme (target, single, negative, multigot)]),