summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-11-23 13:39:57 +0000
committerNick Clifton <nickc@redhat.com>2010-11-23 13:39:57 +0000
commitc77912127fd71c822df5b03a3190cddd19b1dd4f (patch)
tree41bb4118ae77e8f2b79d8b2870ecf911014a4a2a
parentea976c60e229b7d4ccfbf4a735a09c407f104a20 (diff)
* configure.ac: For --enable-gold, handle value `default' instead of
`both*'. New configure option --{en,dis}able-ld. ld, gold/ * configure.ac: For --enable-gold, handle value `default' instead of `both*'. Always install ld as ld.gold, install as ld if gold is the default.
-rw-r--r--ChangeLog6
-rwxr-xr-xconfigure72
-rw-r--r--configure.ac66
-rw-r--r--gold/ChangeLog7
-rwxr-xr-xgold/configure36
-rw-r--r--gold/configure.ac32
-rw-r--r--ld/ChangeLog7
-rwxr-xr-xld/configure10
-rw-r--r--ld/configure.in10
9 files changed, 172 insertions, 74 deletions
diff --git a/ChangeLog b/ChangeLog
index 3a20025437..d1356a6e7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-23 Matthias Klose <doko@ubuntu.com>
+
+ * configure.ac: For --enable-gold, handle value `default' instead of
+ `both*'. New configure option --{en,dis}able-ld.
+ * configure: Regenerate.
+
2010-11-20 Ian Lance Taylor <iant@google.com>
* configure.ac: Only disable a language library if no language needs
diff --git a/configure b/configure
index a44f4184e6..2758ab0ea2 100755
--- a/configure
+++ b/configure
@@ -741,6 +741,7 @@ ac_user_opts='
enable_option_checking
with_build_libsubdir
enable_gold
+enable_ld
enable_libada
enable_libssp
enable_build_with_cxx
@@ -1450,7 +1451,8 @@ 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-gold[=ARG] build gold [ARG={default,yes,no}]
+ --enable-ld[=ARG] build ld [ARG={default,yes,no}]
--enable-libada build libada directory
--enable-libssp build libssp directory
--enable-build-with-cxx build with C++ compiler instead of C compiler
@@ -2849,13 +2851,21 @@ case ${with_newlib} in
yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
esac
-# Handle --enable-gold.
-# --enable-gold Build only gold
-# --disable-gold [default] Build only ld
-# --enable-gold=both Build both gold and ld, ld is default
-# --enable-gold=both/ld Same
-# --enable-gold=both/gold Build both gold and ld, gold is default, ld is renamed ld.bfd
-
+# Handle --enable-gold, --enable-ld.
+# --disable-gold [--enable-ld]
+# Build only ld. Default option.
+# --enable-gold[=default] [--enable-ld]
+# Build both gold and ld. Install gold as "ld.gold" and "ld",
+# install ld as "ld.bfd".
+# --enable-gold[=default] --disable-ld
+# Build only gold, which is then installed as both "ld.gold" and "ld".
+# --enable-gold --enable-ld=default
+# Build both gold (installed as "gold") and ld (installed as "ld").
+# In other words, ld is default
+# --enable-gold=default --enable-ld=default
+# Error.
+
+default_ld=
# Check whether --enable-gold was given.
if test "${enable_gold+set}" = set; then :
enableval=$enable_gold; ENABLE_GOLD=$enableval
@@ -2863,8 +2873,8 @@ else
ENABLE_GOLD=no
fi
- case "${ENABLE_GOLD}" in
- yes|both|both/gold|both/ld)
+case "${ENABLE_GOLD}" in
+ yes|default)
# Check for ELF target.
is_elf=no
case "${target}" in
@@ -2884,14 +2894,10 @@ fi
# Check for target supported by gold.
case "${target}" in
i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-*)
- case "${ENABLE_GOLD}" in
- both*)
- configdirs="$configdirs gold"
- ;;
- *)
- configdirs=`echo " ${configdirs} " | sed -e 's/ ld / gold /'`
- ;;
- esac
+ configdirs="$configdirs gold"
+ if test x${ENABLE_GOLD} = xdefault; then
+ default_ld=gold
+ fi
ENABLE_GOLD=yes
;;
esac
@@ -2902,7 +2908,35 @@ fi
*)
as_fn_error "invalid --enable-gold argument" "$LINENO" 5
;;
- esac
+esac
+
+# Check whether --enable-ld was given.
+if test "${enable_ld+set}" = set; then :
+ enableval=$enable_ld; ENABLE_LD=$enableval
+else
+ ENABLE_LD=yes
+fi
+
+
+case "${ENABLE_LD}" in
+ default)
+ if test x${default_ld} != xgold; then
+ as_fn_error "either gold or ld can be the default ld" "$LINENO" 5
+ fi
+ ;;
+ yes)
+ ;;
+ no)
+ if test x${ENABLE_GOLD} != xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: neither ld nor gold are enabled" >&5
+$as_echo "$as_me: WARNING: neither ld nor gold are enabled" >&2;}
+ fi
+ configdirs=`echo " ${configdirs} " | sed -e 's/ ld / /'`
+ ;;
+ *)
+ as_fn_error "invalid --enable-ld argument" "$LINENO" 5
+ ;;
+esac
# Configure extra directories which are host specific
diff --git a/configure.ac b/configure.ac
index 0a5c276a03..626bb4e10f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -324,19 +324,27 @@ case ${with_newlib} in
yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
esac
-# Handle --enable-gold.
-# --enable-gold Build only gold
-# --disable-gold [default] Build only ld
-# --enable-gold=both Build both gold and ld, ld is default
-# --enable-gold=both/ld Same
-# --enable-gold=both/gold Build both gold and ld, gold is default, ld is renamed ld.bfd
-
+# Handle --enable-gold, --enable-ld.
+# --disable-gold [--enable-ld]
+# Build only ld. Default option.
+# --enable-gold[=default] [--enable-ld]
+# Build both gold and ld. Install gold as "ld.gold" and "ld",
+# install ld as "ld.bfd".
+# --enable-gold[=default] --disable-ld
+# Build only gold, which is then installed as both "ld.gold" and "ld".
+# --enable-gold --enable-ld=default
+# Build both gold (installed as "gold") and ld (installed as "ld").
+# In other words, ld is default
+# --enable-gold=default --enable-ld=default
+# Error.
+
+default_ld=
AC_ARG_ENABLE(gold,
-[[ --enable-gold[=ARG] build gold [ARG={both}[/{gold,ld}]]]],
+[[ --enable-gold[=ARG] build gold [ARG={default,yes,no}]]],
ENABLE_GOLD=$enableval,
ENABLE_GOLD=no)
- case "${ENABLE_GOLD}" in
- yes|both|both/gold|both/ld)
+case "${ENABLE_GOLD}" in
+ yes|default)
# Check for ELF target.
is_elf=no
case "${target}" in
@@ -356,14 +364,10 @@ ENABLE_GOLD=no)
# Check for target supported by gold.
case "${target}" in
i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-*)
- case "${ENABLE_GOLD}" in
- both*)
- configdirs="$configdirs gold"
- ;;
- *)
- configdirs=`echo " ${configdirs} " | sed -e 's/ ld / gold /'`
- ;;
- esac
+ configdirs="$configdirs gold"
+ if test x${ENABLE_GOLD} = xdefault; then
+ default_ld=gold
+ fi
ENABLE_GOLD=yes
;;
esac
@@ -374,7 +378,31 @@ ENABLE_GOLD=no)
*)
AC_MSG_ERROR([invalid --enable-gold argument])
;;
- esac
+esac
+
+AC_ARG_ENABLE(ld,
+[[ --enable-ld[=ARG] build ld [ARG={default,yes,no}]]],
+ENABLE_LD=$enableval,
+ENABLE_LD=yes)
+
+case "${ENABLE_LD}" in
+ default)
+ if test x${default_ld} != xgold; then
+ AC_MSG_ERROR([either gold or ld can be the default ld])
+ fi
+ ;;
+ yes)
+ ;;
+ no)
+ if test x${ENABLE_GOLD} != xyes; then
+ AC_MSG_WARN([neither ld nor gold are enabled])
+ fi
+ configdirs=`echo " ${configdirs} " | sed -e 's/ ld / /'`
+ ;;
+ *)
+ AC_MSG_ERROR([invalid --enable-ld argument])
+ ;;
+esac
# Configure extra directories which are host specific
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 29a3438edf..ab9ed3c75a 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,10 @@
+2010-11-23 Matthias Klose <doko@ubuntu.com>
+
+ * configure.in: For --enable-gold, handle value `default' instead of
+ `both*'. Always install ld as ld.bfd, install as ld if gold is
+ not the default.
+ * configure: Regenerate.
+
2010-11-18 Doug Kwan <dougkwan@google.com>
* expression.cc (BINARY_EXPRESSION): Initialize left_alignment
diff --git a/gold/configure b/gold/configure
index ce08d65910..c759b77575 100755
--- a/gold/configure
+++ b/gold/configure
@@ -765,6 +765,7 @@ ac_subst_files=''
ac_user_opts='
enable_option_checking
with_sysroot
+enable_ld
enable_gold
enable_threads
enable_plugins
@@ -1410,7 +1411,8 @@ 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-ld[=ARG] build ld [ARG={default,yes,no}]
+ --enable-gold[=ARG] build gold [ARG={default,yes,no}]
--enable-threads multi-threaded linking
--enable-plugins linker plugins
--enable-targets alternative target configurations
@@ -3247,28 +3249,36 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+
+default_ld=
+# Check whether --enable-ld was given.
+if test "${enable_ld+set}" = set; then :
+ enableval=$enable_ld; case "${enableval}" in
+ default)
+ default_ld=ld.bfd
+ ;;
+esac
+fi
+
+
# 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
+ yes|default)
+ if test x${default_ld} = x; then
+ install_as_default=yes
+ fi
installed_linker=ld.gold
;;
- both|both/ld)
- install_as_default=no
- installed_linker=ld.gold
+ no)
;;
*)
as_fn_error "invalid --enable-gold argument" "$LINENO" 5
;;
esac
else
- install_as_default=gold
- installed_linker=ld
+ install_as_default=no
+ installed_linker=ld.gold
fi
@@ -8577,7 +8587,7 @@ $as_echo X"$file" |
case "$ac_file" in */Makefile.in)
# Adjust a relative srcdir.
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
- ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
# In autoconf-2.13 it is called $ac_given_srcdir.
# In autoconf-2.50 it is called $srcdir.
diff --git a/gold/configure.ac b/gold/configure.ac
index 8bd80faf2d..2c50d9741c 100644
--- a/gold/configure.ac
+++ b/gold/configure.ac
@@ -41,27 +41,33 @@ AC_DEFINE_UNQUOTED(TARGET_SYSTEM_ROOT_RELOCATABLE, $sysroot_relocatable,
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}]]]],
+
+default_ld=
+AC_ARG_ENABLE(ld,
+[[ --enable-ld[=ARG] build ld [ARG={default,yes,no}]]],
[case "${enableval}" in
- yes)
- install_as_default=gold
- installed_linker=ld
- ;;
- both/gold)
- install_as_default=yes
+ default)
+ default_ld=ld.bfd
+ ;;
+esac])
+
+AC_ARG_ENABLE(gold,
+[[ --enable-gold[=ARG] build gold [ARG={default,yes,no}]]],
+[case "${enableval}" in
+ yes|default)
+ if test x${default_ld} = x; then
+ install_as_default=yes
+ fi
installed_linker=ld.gold
;;
- both|both/ld)
- install_as_default=no
- installed_linker=ld.gold
+ no)
;;
*)
AC_MSG_ERROR([invalid --enable-gold argument])
;;
esac],
-[install_as_default=gold
- installed_linker=ld])
+[install_as_default=no
+ installed_linker=ld.gold])
AC_SUBST(install_as_default)
AC_SUBST(installed_linker)
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 562ba578fb..fc6a6d07e1 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2010-11-23 Matthias Klose <doko@ubuntu.com>
+
+ * configure.ac: For --enable-gold, handle value `default' instead of
+ `both*'. Always install ld as ld.gold, install as ld if gold is
+ the default.
+ * configure: Regenerate.
+
2010-11-21 H.J. Lu <hongjiu.lu@intel.com>
* ldfile.c: Re-indent plugin code.
diff --git a/ld/configure b/ld/configure
index 3367a88a32..088c721de7 100755
--- a/ld/configure
+++ b/ld/configure
@@ -1414,7 +1414,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-gold[=ARG] build gold [ARG={default,yes,no}]
--enable-got=<type> GOT handling scheme (target, single, negative,
multigot)
--enable-werror treat compile warnings as errors
@@ -4179,11 +4179,11 @@ fi
# Check whether --enable-gold was given.
if test "${enable_gold+set}" = set; then :
enableval=$enable_gold; case "${enableval}" in
- yes|both/gold)
+ default)
install_as_default=no
installed_linker=ld.bfd
;;
- both|both/ld)
+ yes|no)
install_as_default=yes
installed_linker=ld.bfd
;;
@@ -4192,8 +4192,8 @@ if test "${enable_gold+set}" = set; then :
;;
esac
else
- install_as_default=ld
- installed_linker=ld
+ install_as_default=yes
+ installed_linker=ld.bfd
fi
diff --git a/ld/configure.in b/ld/configure.in
index 122f65e13b..85fe903d3b 100644
--- a/ld/configure.in
+++ b/ld/configure.in
@@ -73,13 +73,13 @@ 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}]]]],
+[[ --enable-gold[=ARG] build gold [ARG={default,yes,no}]]],
[case "${enableval}" in
- yes|both/gold)
+ default)
install_as_default=no
installed_linker=ld.bfd
;;
- both|both/ld)
+ yes|no)
install_as_default=yes
installed_linker=ld.bfd
;;
@@ -87,8 +87,8 @@ AC_ARG_ENABLE(gold,
AC_MSG_ERROR([invalid --enable-gold argument])
;;
esac],
-[install_as_default=ld
- installed_linker=ld])
+[install_as_default=yes
+ installed_linker=ld.bfd])
AC_SUBST(install_as_default)
AC_SUBST(installed_linker)