Allow --enable-gold co-exists with --enable-ld=default
Andrew Hsieh [Thu, 24 May 2012 13:15:00 +0000 (21:15 +0800)]
Previously --enable-gold meant "enable gold" and "gold is default".
This CL allows ld remains default when gold is enabled.

Change-Id: I6313ca8b410d9937ddfbd4da05fafbfc0e7b7f06

Makefile.in
configure
configure.ac

index 2bb1803..eb78661 100644 (file)
@@ -87,6 +87,7 @@ HAVE_PPL=@have_ppl@
 HAVE_CLOOG=@have_cloog@
 HAVE_EXPAT=@have_expat@
 ENABLE_GOLD=@enable_gold@
+ENABLE_LD_DEFAULT=@enable_ld_default@
 STAMP=touch
 
 TARGET_BINUTILS_BUILDDIR=$(abs_builddir)/$(BINUTILS_VERSION)
@@ -294,9 +295,15 @@ endif
 # enabled. Notice that our binutils take different --enable-gold=xxx options.
 ifneq ($(ENABLE_GOLD),)
 ifeq ($(BINUTILS_MIN_VERSION_2_21),yes)
+ifeq ($(ENABLE_LD_DEFAULT),)
 BINUTILS_CONFIG_ARGS += --enable-gold=default
+endif
 else
+ifeq ($(ENABLE_LD_DEFAULT),)
 BINUTILS_CONFIG_ARGS += --enable-gold=both/gold
+else
+BINUTILS_CONFIG_ARGS += --enable-gold=both/ld
+endif
 endif
 endif
 stmp-config-target-binutils: config.status $(canadian_stmp)
index 98dc7b1..deeb302 100755 (executable)
--- a/configure
+++ b/configure
@@ -579,6 +579,7 @@ package_to_srcdir
 ENABLE_GRAPHITE
 gold_baseargs
 enable_gold
+enable_ld_default
 baseargs
 TOPLEVEL_CONFIGURE_ARGUMENTS
 GDB_TARGET
@@ -2061,6 +2062,7 @@ baseargs=
 keep_next=no
 skip_next=no
 enable_gold=
+enable_ld_default=
 eval "set -- $ac_configure_args"
 for ac_arg
 do
@@ -2129,6 +2131,12 @@ do
         --disable-gold )
           enable_gold=
           ;;
+        --enable-ld=default )
+          enable_ld_default=yes
+          ;;
+        --disable-ld )
+          enable_ld_default=
+          ;;
       esac
 
       # An option.  Add it.
index ad947c7..ab42f71 100644 (file)
@@ -87,6 +87,7 @@ baseargs=
 keep_next=no
 skip_next=no
 enable_gold=
+enable_ld_default=
 eval "set -- $ac_configure_args"
 for ac_arg
 do
@@ -155,6 +156,12 @@ do
         --disable-gold )
           enable_gold=
           ;;
+        --enable-ld=default )
+          enable_ld_default=yes
+          ;;
+        --disable-ld )
+          enable_ld_default=
+          ;;
       esac
 
       # An option.  Add it.
@@ -195,6 +202,7 @@ fi
 
 AC_SUBST(baseargs)
 AC_SUBST(enable_gold)
+AC_SUBST(enable_ld_default)
 
 # Strip --{enable|disable}-{gold|ld}* from baseargs.  These are used for the
 # gold binutils.  Note that baseargs are quoted.