summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-12-04 00:28:14 -0500
committerMike Frysinger <vapier@gentoo.org>2022-01-01 12:49:07 -0500
commit1d5269c994bf4af088b1a9d0ed39825541623a99 (patch)
tree427712dedcd41fc7d1d0e8f837444ec8f6c6c762 /config
parent3cc8ed6aaee33355a5d911a7401db3f1b05a2714 (diff)
downloadbinutils-gdb-1d5269c994bf4af088b1a9d0ed39825541623a99.tar.gz
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 'config')
-rw-r--r--config/bfd64.m436
1 files changed, 36 insertions, 0 deletions
diff --git a/config/bfd64.m4 b/config/bfd64.m4
new file mode 100644
index 00000000000..d134f1a5765
--- /dev/null
+++ b/config/bfd64.m4
@@ -0,0 +1,36 @@
+dnl
+dnl Copyright (C) 2012-2022 Free Software Foundation, Inc.
+dnl
+dnl This file is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; see the file COPYING3. If not see
+dnl <http://www.gnu.org/licenses/>.
+dnl
+
+dnl See whether 64-bit bfd lib has been enabled.
+AC_DEFUN([BFD_64_BIT], [dnl
+AC_ARG_ENABLE(64-bit-bfd,
+ AS_HELP_STRING([--enable-64-bit-bfd],
+ [64-bit support (on hosts with narrower word sizes)]),
+ [AS_CASE([$enableval],
+ [yes|no], [],
+ [*], [AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option)])],
+ [enable_64_bit_bfd=no])
+
+dnl If the host is 64-bit, then 64-bit bfd is enabled automatically.
+AS_IF([test "x$enable_64_bit_bfd" = "xno"], [dnl
+ AC_CHECK_SIZEOF(void *)
+ AS_IF([test "x$ac_cv_sizeof_void_p" = "x8"], [enable_64_bit_bfd=yes])
+])
+
+AM_CONDITIONAL([ENABLE_BFD_64_BIT], [test "x$enable_64_bit_bfd" = "xyes"])
+])