bfd/
[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)
8fb84ecc 6sinclude(../bfd/bfd.m4)
9e9b66a9 7sinclude(../bfd/warning.m4)
6726e1ea 8
252b5132 9dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
f8b73030 10AC_DEFUN([BFD_BINARY_FOPEN],
5464f5a1 11[AC_REQUIRE([AC_CANONICAL_TARGET])
252b5132
RH
12case "${host}" in
13changequote(,)dnl
855b0be7 14*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
252b5132
RH
15changequote([,])dnl
16 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
17esac])dnl
18
19dnl Get a default for CC_FOR_BUILD to put into Makefile.
f8b73030 20AC_DEFUN([BFD_CC_FOR_BUILD],
252b5132
RH
21[# Put a plausible default for CC_FOR_BUILD in Makefile.
22if test -z "$CC_FOR_BUILD"; then
23 if test "x$cross_compiling" = "xno"; then
24 CC_FOR_BUILD='$(CC)'
25 else
26 CC_FOR_BUILD=gcc
27 fi
28fi
29AC_SUBST(CC_FOR_BUILD)
30# Also set EXEEXT_FOR_BUILD.
31if test "x$cross_compiling" = "xno"; then
32 EXEEXT_FOR_BUILD='$(EXEEXT)'
33else
34 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
aab08431
ILT
35 [rm -f conftest*
36 echo 'int main () { return 0; }' > conftest.c
37 bfd_cv_build_exeext=
38 ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
39 for file in conftest.*; do
40 case $file in
41 *.c | *.o | *.obj | *.ilk | *.pdb) ;;
42 *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
43 esac
44 done
45 rm -f conftest*
46 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
252b5132
RH
47 EXEEXT_FOR_BUILD=""
48 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
49fi
50AC_SUBST(EXEEXT_FOR_BUILD)])dnl
51
ac48eca1
AO
52sinclude(../libtool.m4)
53dnl The lines below arrange for aclocal not to bring libtool.m4
54dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
55dnl to add a definition of LIBTOOL to Makefile.in.
56ifelse(yes,no,[
57AC_DEFUN([AM_PROG_LIBTOOL],)
58AC_DEFUN([AM_DISABLE_SHARED],)
59AC_SUBST(LIBTOOL)
60])
252b5132 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)
85 AC_SUBST(bfdincludedir)
86]
87)
This page took 0.320946 seconds and 4 git commands to generate.