1dnl
2dnl   Copyright (C) 2012-2022 Free Software Foundation, Inc.
3dnl
4dnl This file is free software; you can redistribute it and/or modify
5dnl it under the terms of the GNU General Public License as published by
6dnl the Free Software Foundation; either version 3 of the License, or
7dnl (at your option) any later version.
8dnl
9dnl This program is distributed in the hope that it will be useful,
10dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12dnl GNU General Public License for more details.
13dnl
14dnl You should have received a copy of the GNU General Public License
15dnl along with this program; see the file COPYING3.  If not see
16dnl <http://www.gnu.org/licenses/>.
17dnl
18
19dnl See whether 64-bit bfd lib has been enabled.
20AC_DEFUN([BFD_64_BIT], [dnl
21AC_ARG_ENABLE(64-bit-bfd,
22  AS_HELP_STRING([--enable-64-bit-bfd],
23		 [64-bit support (on hosts with narrower word sizes)]),
24  [AS_CASE([$enableval],
25	   [yes|no], [],
26	   [*], [AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option)])],
27  [enable_64_bit_bfd=no])
28
29dnl If the host is 64-bit, then 64-bit bfd is enabled automatically.
30AS_IF([test "x$enable_64_bit_bfd" = "xno"], [dnl
31  AC_CHECK_SIZEOF(void *)
32  AS_IF([test "x$ac_cv_sizeof_void_p" = "x8"], [enable_64_bit_bfd=yes])
33])
34
35AM_CONDITIONAL([ENABLE_BFD_64_BIT], [test "x$enable_64_bit_bfd" = "xyes"])
36])
37