diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-12-04 00:28:14 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2022-01-01 12:49:07 -0500 |
commit | 1d5269c994bf4af088b1a9d0ed39825541623a99 (patch) | |
tree | 427712dedcd41fc7d1d0e8f837444ec8f6c6c762 /bfd | |
parent | 3cc8ed6aaee33355a5d911a7401db3f1b05a2714 (diff) | |
download | binutils-1d5269c994bf4af088b1a9d0ed39825541623a99.zip binutils-1d5269c994bf4af088b1a9d0ed39825541623a99.tar.gz binutils-1d5269c994bf4af088b1a9d0ed39825541623a99.tar.bz2 |
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.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/Makefile.in | 1 | ||||
-rw-r--r-- | bfd/aclocal.m4 | 1 | ||||
-rwxr-xr-x | bfd/configure | 77 | ||||
-rw-r--r-- | bfd/configure.ac | 13 | ||||
-rw-r--r-- | bfd/doc/Makefile.in | 1 |
5 files changed, 80 insertions, 13 deletions
diff --git a/bfd/Makefile.in b/bfd/Makefile.in index a838262..69a8848 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -114,6 +114,7 @@ target_triplet = @target@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/bfd64.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/gettext-sister.m4 \ $(top_srcdir)/../config/jobserver.m4 \ diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4 index a62ee4d..0f8aa1d 100644 --- a/bfd/aclocal.m4 +++ b/bfd/aclocal.m4 @@ -1168,6 +1168,7 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([../config/acx.m4]) +m4_include([../config/bfd64.m4]) m4_include([../config/depstand.m4]) m4_include([../config/gettext-sister.m4]) m4_include([../config/jobserver.m4]) diff --git a/bfd/configure b/bfd/configure index d4aa217..b09702f 100755 --- a/bfd/configure +++ b/bfd/configure @@ -697,6 +697,8 @@ REPORT_BUGS_TEXI REPORT_BUGS_TO PKGVERSION DEBUGDIR +ENABLE_BFD_64_BIT_FALSE +ENABLE_BFD_64_BIT_TRUE PLUGINS_FALSE PLUGINS_TRUE LARGEFILE_CPPFLAGS @@ -11084,7 +11086,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11087 "configure" +#line 11089 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11190,7 +11192,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11193 "configure" +#line 11195 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11847,12 +11849,71 @@ fi # Check whether --enable-64-bit-bfd was given. if test "${enable_64_bit_bfd+set}" = set; then : - enableval=$enable_64_bit_bfd; case "${enableval}" in - yes) want64=true ;; - no) want64=false ;; - *) as_fn_error $? "bad value ${enableval} for 64-bit-bfd option" "$LINENO" 5 ;; + enableval=$enable_64_bit_bfd; case $enableval in #( + yes|no) : + ;; #( + *) : + as_fn_error $? "bad value ${enableval} for 64-bit-bfd option" "$LINENO" 5 ;; #( + *) : + ;; esac else + enable_64_bit_bfd=no +fi + + +if test "x$enable_64_bit_bfd" = "xno"; then : + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } +if ${ac_cv_sizeof_void_p+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_void_p" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (void *) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_void_p=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + + if test "x$ac_cv_sizeof_void_p" = "x8"; then : + enable_64_bit_bfd=yes +fi + +fi + + if test "x$enable_64_bit_bfd" = "xyes"; then + ENABLE_BFD_64_BIT_TRUE= + ENABLE_BFD_64_BIT_FALSE='#' +else + ENABLE_BFD_64_BIT_TRUE='#' + ENABLE_BFD_64_BIT_FALSE= +fi + + +if test $enable_64_bit_bfd = yes ; then + want64=true +else want64=false fi @@ -15182,6 +15243,10 @@ if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then as_fn_error $? "conditional \"PLUGINS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_BFD_64_BIT_TRUE}" && test -z "${ENABLE_BFD_64_BIT_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_BFD_64_BIT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/bfd/configure.ac b/bfd/configure.ac index a578c3a..bdc2fc4 100644 --- a/bfd/configure.ac +++ b/bfd/configure.ac @@ -82,13 +82,12 @@ if test x$ac_checking != x ; then AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want run-time sanity checks.]) fi -AC_ARG_ENABLE(64-bit-bfd, -[ --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 +if test $enable_64_bit_bfd = yes ; then + want64=true +else + want64=false +fi AC_ARG_ENABLE(targets, [ --enable-targets alternative target configurations], diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in index c070dd8..f4d1ba7 100644 --- a/bfd/doc/Makefile.in +++ b/bfd/doc/Makefile.in @@ -109,6 +109,7 @@ target_triplet = @target@ subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/bfd64.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/gettext-sister.m4 \ $(top_srcdir)/../config/jobserver.m4 \ |