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