summaryrefslogtreecommitdiff
path: root/gold/configure.ac
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-02-06 20:32:10 +0000
committerIan Lance Taylor <iant@google.com>2008-02-06 20:32:10 +0000
commit848a9929d12b55c177f97373e5c574aebea1859d (patch)
treed508aaef33d770ddfe1b1acb4f8e90a638ee04d8 /gold/configure.ac
parent5f7fd240bea3a0332fffe25bcddf311a6c44204d (diff)
downloadbinutils-redhat-848a9929d12b55c177f97373e5c574aebea1859d.tar.gz
Support creating empty output when there are no input objects.
Diffstat (limited to 'gold/configure.ac')
-rw-r--r--gold/configure.ac61
1 files changed, 45 insertions, 16 deletions
diff --git a/gold/configure.ac b/gold/configure.ac
index 62fdaab4de..c719e78534 100644
--- a/gold/configure.ac
+++ b/gold/configure.ac
@@ -86,11 +86,14 @@ fi
# See which specific instantiations we need.
targetobjs=
all_targets=
+default_machine=
+default_size=
+default_big_endian=
+targ_32_little=
+targ_32_big=
+targ_64_little=
+targ_64_big=
for targ in $target $canon_targets; do
- targ_32_little=
- targ_32_big=
- targ_64_little=
- targ_64_big=
if test "$targ" = "all"; then
targ_32_little=yes
targ_32_big=yes
@@ -98,19 +101,38 @@ for targ in $target $canon_targets; do
targ_64_big=yes
all_targets=yes
else
- case "$targ" in
- i?86-*)
- targ_32_little=yes
- targetobjs="$targetobjs i386.\$(OBJEXT)"
- ;;
- x86_64-*)
- targ_64_little=yes
- targetobjs="$targetobjs x86_64.\$(OBJEXT)"
- ;;
- *)
+ . ${srcdir}/configure.tgt
+
+ if test "$targ_obj" = "UNKNOWN"; then
AC_MSG_ERROR("unsupported target $targ")
- ;;
- esac
+ else
+ targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
+ if test "$targ_size" = "32"; then
+ if test "$targ_big_endian" = "false"; then
+ targ_32_little=yes
+ elif test "$targ_big_endian" = "true"; then
+ targ_32_big=yes
+ else
+ AC_MSG_ERROR("bad configure.tgt endian $targ_big_endian")
+ fi
+ elif test "$targ_size" = "64"; then
+ if test "$targ_big_endian" = "false"; then
+ targ_64_little=yes
+ elif test "$targ_big_endian" = "true"; then
+ targ_64_big=yes
+ else
+ AC_MSG_ERROR("bad configure.tgt endian $targ_big_endian")
+ fi
+ else
+ AC_MSG_ERROR("bad configure.tgt size $targ_size")
+ fi
+
+ if test "$target" = "$targ"; then
+ default_machine=$targ_machine
+ default_size=$targ_size
+ default_big_endian=$targ_big_endian
+ fi
+ fi
fi
done
@@ -138,6 +160,13 @@ else
fi
AC_SUBST(TARGETOBJS)
+AC_DEFINE_UNQUOTED(GOLD_DEFAULT_MACHINE, $default_machine,
+ [Default machine code])
+AC_DEFINE_UNQUOTED(GOLD_DEFAULT_SIZE, $default_size,
+ [Default size (32 or 64)])
+AC_DEFINE_UNQUOTED(GOLD_DEFAULT_BIG_ENDIAN, $default_big_endian,
+ [Default big endian (true or false)])
+
AC_PROG_CC
AC_PROG_CXX
AC_PROG_YACC