]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - bfd/acinclude.m4
[gdb/symtab] Work around PR gas/29517, dwarf2 case
[thirdparty/binutils-gdb.git] / bfd / acinclude.m4
CommitLineData
5bf135a7 1dnl
fd67aa11 2dnl Copyright (C) 2012-2024 Free Software Foundation, Inc.
5bf135a7
NC
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.
1b786873 8dnl
5bf135a7
NC
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.
1b786873 13dnl
5bf135a7
NC
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
252b5132 19dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
f8b73030 20AC_DEFUN([BFD_BINARY_FOPEN],
5464f5a1 21[AC_REQUIRE([AC_CANONICAL_TARGET])
252b5132
RH
22case "${host}" in
23changequote(,)dnl
855b0be7 24*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
252b5132
RH
25changequote([,])dnl
26 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
27esac])dnl
28
29dnl Get a default for CC_FOR_BUILD to put into Makefile.
f8b73030 30AC_DEFUN([BFD_CC_FOR_BUILD],
252b5132
RH
31[# Put a plausible default for CC_FOR_BUILD in Makefile.
32if test -z "$CC_FOR_BUILD"; then
33 if test "x$cross_compiling" = "xno"; then
34 CC_FOR_BUILD='$(CC)'
35 else
36 CC_FOR_BUILD=gcc
37 fi
38fi
39AC_SUBST(CC_FOR_BUILD)
40# Also set EXEEXT_FOR_BUILD.
41if test "x$cross_compiling" = "xno"; then
42 EXEEXT_FOR_BUILD='$(EXEEXT)'
43else
44 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
aab08431
ILT
45 [rm -f conftest*
46 echo 'int main () { return 0; }' > conftest.c
47 bfd_cv_build_exeext=
48 ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
49 for file in conftest.*; do
50 case $file in
51 *.c | *.o | *.obj | *.ilk | *.pdb) ;;
52 *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
53 esac
54 done
55 rm -f conftest*
56 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
252b5132
RH
57 EXEEXT_FOR_BUILD=""
58 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
59fi
60AC_SUBST(EXEEXT_FOR_BUILD)])dnl
61
a703a6ea
AM
62AC_DEFUN([AM_INSTALL_LIBBFD],
63[AC_MSG_CHECKING([whether to install libbfd])
64 AC_ARG_ENABLE(install-libbfd,
c5d1701e 65[ --enable-install-libbfd controls installation of libbfd and related headers],
a703a6ea 66 install_libbfd_p=$enableval,
66e25bab 67 if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then
a703a6ea
AM
68 install_libbfd_p=yes
69 else
70 install_libbfd_p=no
71 fi)
72 AC_MSG_RESULT($install_libbfd_p)
73 AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes)
5464f5a1 74 # Need _noncanonical variables for this.
24443139
AS
75 ACX_NONCANONICAL_HOST
76 ACX_NONCANONICAL_TARGET
a703a6ea
AM
77 # libbfd.a is a host library containing target dependent code
78 bfdlibdir='$(libdir)'
79 bfdincludedir='$(includedir)'
80 if test "${host}" != "${target}"; then
5464f5a1
NN
81 bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib'
82 bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include'
a703a6ea
AM
83 fi
84 AC_SUBST(bfdlibdir)
573e8a1c 85 AM_SUBST_NOTMAKE(bfdlibdir)
a703a6ea 86 AC_SUBST(bfdincludedir)
573e8a1c 87 AM_SUBST_NOTMAKE(bfdincludedir)
a703a6ea
AM
88]
89)