unify 64-bit bfd checks

Move the 64-bit bfd logic out of bfd/configure.ac and into bfd64.m4
under config so it can be shared between all the other subdirs.

This replaces want64 with enable_64_bit_bfd which was already being
declared, but not used directly.
This commit is contained in:
Mike Frysinger
2021-12-04 00:28:14 -05:00
parent 3cc8ed6aae
commit 1d5269c994
19 changed files with 579 additions and 218 deletions

View File

@ -165,14 +165,7 @@ AS_HELP_STRING([--enable-targets=TARGETS], [alternative target configurations]),
*) enable_targets=$enableval ;;
esac])
# Check whether to enable 64-bit support on 32-bit hosts
AC_ARG_ENABLE(64-bit-bfd,
AS_HELP_STRING([--enable-64-bit-bfd], [64-bit support (on hosts with narrower word sizes)]),
[case "${enableval}" in
yes) want64=true ;;
no) want64=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
esac],[want64=false])dnl
BFD_64_BIT
# Provide defaults for some variables set by the per-host and per-target
# configuration.
@ -221,7 +214,7 @@ do
done
# Check whether this target needs 64-bit CORE_ADDR
if test x${want64} = xfalse; then
if test x${enable_64_bit_bfd} = xno; then
. ${srcdir}/../bfd/config.bfd
fi
@ -234,23 +227,7 @@ do
done
if test x${all_targets} = xtrue; then
# We want all 64-bit targets if we either:
# - run on a 64-bit host or
# - already require 64-bit support for some other target or
# - the --enable-64-bit-bfd option was supplied
# Otherwise we only support all 32-bit targets.
#
# NOTE: This test must be in sync with the corresponding
# tests in BFD!
if test x${want64} = xfalse; then
AC_CHECK_SIZEOF(long)
if test "x${ac_cv_sizeof_long}" = "x8"; then
want64=true
fi
fi
if test x${want64} = xtrue; then
if test x${enable_64_bit_bfd} = xyes; then
TARGET_OBS='$(ALL_TARGET_OBS) $(ALL_64_TARGET_OBS)'
else
TARGET_OBS='$(ALL_TARGET_OBS)'