PR 4497
[deliverable/binutils-gdb.git] / bfd / acinclude.m4
CommitLineData
5464f5a1 1sinclude(../config/acx.m4)
20e95c23
DJ
2sinclude(../config/gettext-sister.m4)
3sinclude(../config/nls.m4)
4sinclude(../config/po.m4)
5sinclude(../config/progtest.m4)
d5efd9fc 6sinclude(../config/stdint.m4)
8fb84ecc 7sinclude(../bfd/bfd.m4)
9e9b66a9 8sinclude(../bfd/warning.m4)
6726e1ea 9
252b5132 10dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
f8b73030 11AC_DEFUN([BFD_BINARY_FOPEN],
5464f5a1 12[AC_REQUIRE([AC_CANONICAL_TARGET])
252b5132
RH
13case "${host}" in
14changequote(,)dnl
855b0be7 15*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
252b5132
RH
16changequote([,])dnl
17 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
18esac])dnl
19
20dnl Get a default for CC_FOR_BUILD to put into Makefile.
f8b73030 21AC_DEFUN([BFD_CC_FOR_BUILD],
252b5132
RH
22[# Put a plausible default for CC_FOR_BUILD in Makefile.
23if test -z "$CC_FOR_BUILD"; then
24 if test "x$cross_compiling" = "xno"; then
25 CC_FOR_BUILD='$(CC)'
26 else
27 CC_FOR_BUILD=gcc
28 fi
29fi
30AC_SUBST(CC_FOR_BUILD)
31# Also set EXEEXT_FOR_BUILD.
32if test "x$cross_compiling" = "xno"; then
33 EXEEXT_FOR_BUILD='$(EXEEXT)'
34else
35 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
aab08431
ILT
36 [rm -f conftest*
37 echo 'int main () { return 0; }' > conftest.c
38 bfd_cv_build_exeext=
39 ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
40 for file in conftest.*; do
41 case $file in
42 *.c | *.o | *.obj | *.ilk | *.pdb) ;;
43 *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
44 esac
45 done
46 rm -f conftest*
47 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
252b5132
RH
48 EXEEXT_FOR_BUILD=""
49 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
50fi
51AC_SUBST(EXEEXT_FOR_BUILD)])dnl
52
ac48eca1
AO
53sinclude(../libtool.m4)
54dnl The lines below arrange for aclocal not to bring libtool.m4
55dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
56dnl to add a definition of LIBTOOL to Makefile.in.
57ifelse(yes,no,[
58AC_DEFUN([AM_PROG_LIBTOOL],)
59AC_DEFUN([AM_DISABLE_SHARED],)
60AC_SUBST(LIBTOOL)
61])
252b5132 62
a703a6ea
AM
63AC_DEFUN([AM_INSTALL_LIBBFD],
64[AC_MSG_CHECKING([whether to install libbfd])
65 AC_ARG_ENABLE(install-libbfd,
c5d1701e 66[ --enable-install-libbfd controls installation of libbfd and related headers],
a703a6ea 67 install_libbfd_p=$enableval,
66e25bab 68 if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then
a703a6ea
AM
69 install_libbfd_p=yes
70 else
71 install_libbfd_p=no
72 fi)
73 AC_MSG_RESULT($install_libbfd_p)
74 AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes)
5464f5a1 75 # Need _noncanonical variables for this.
24443139
AS
76 ACX_NONCANONICAL_HOST
77 ACX_NONCANONICAL_TARGET
a703a6ea
AM
78 # libbfd.a is a host library containing target dependent code
79 bfdlibdir='$(libdir)'
80 bfdincludedir='$(includedir)'
81 if test "${host}" != "${target}"; then
5464f5a1
NN
82 bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib'
83 bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include'
a703a6ea
AM
84 fi
85 AC_SUBST(bfdlibdir)
86 AC_SUBST(bfdincludedir)
87]
88)
This page took 0.311355 seconds and 4 git commands to generate.