1 dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
2 AC_DEFUN([BFD_BINARY_FOPEN],
3 [AC_REQUIRE([AC_CANONICAL_TARGET])
6 *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
8 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
11 dnl Get a default for CC_FOR_BUILD to put into Makefile.
12 AC_DEFUN([BFD_CC_FOR_BUILD],
13 [# Put a plausible default for CC_FOR_BUILD in Makefile.
14 if test -z "$CC_FOR_BUILD"; then
15 if test "x$cross_compiling" = "xno"; then
21 AC_SUBST(CC_FOR_BUILD)
22 # Also set EXEEXT_FOR_BUILD.
23 if test "x$cross_compiling" = "xno"; then
24 EXEEXT_FOR_BUILD='$(EXEEXT)'
26 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
28 echo 'int main () { return 0; }' > conftest.c
30 ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
31 for file in conftest.*; do
33 *.c | *.o | *.obj | *.ilk | *.pdb) ;;
34 *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
38 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
40 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
42 AC_SUBST(EXEEXT_FOR_BUILD)])dnl
44 AC_DEFUN([AM_INSTALL_LIBBFD],
45 [AC_MSG_CHECKING([whether to install libbfd])
46 AC_ARG_ENABLE(install-libbfd,
47 [ --enable-install-libbfd controls installation of libbfd and related headers],
48 install_libbfd_p=$enableval,
49 if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then
54 AC_MSG_RESULT($install_libbfd_p)
55 AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes)
56 # Need _noncanonical variables for this.
58 ACX_NONCANONICAL_TARGET
59 # libbfd.a is a host library containing target dependent code
61 bfdincludedir='$(includedir)'
62 if test "${host}" != "${target}"; then
63 bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib'
64 bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include'
67 AC_SUBST(bfdincludedir)