Commit | Line | Data |
---|---|---|
bf993e3c JB |
1 | sinclude([../config/zlib.m4]) |
2 | ||
252b5132 | 3 | dnl See whether we need to use fopen-bin.h rather than fopen-same.h. |
f8b73030 | 4 | AC_DEFUN([BFD_BINARY_FOPEN], |
5464f5a1 | 5 | [AC_REQUIRE([AC_CANONICAL_TARGET]) |
252b5132 RH |
6 | case "${host}" in |
7 | changequote(,)dnl | |
855b0be7 | 8 | *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) |
252b5132 RH |
9 | changequote([,])dnl |
10 | AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;; | |
11 | esac])dnl | |
12 | ||
13 | dnl Get a default for CC_FOR_BUILD to put into Makefile. | |
f8b73030 | 14 | AC_DEFUN([BFD_CC_FOR_BUILD], |
252b5132 RH |
15 | [# Put a plausible default for CC_FOR_BUILD in Makefile. |
16 | if test -z "$CC_FOR_BUILD"; then | |
17 | if test "x$cross_compiling" = "xno"; then | |
18 | CC_FOR_BUILD='$(CC)' | |
19 | else | |
20 | CC_FOR_BUILD=gcc | |
21 | fi | |
22 | fi | |
23 | AC_SUBST(CC_FOR_BUILD) | |
24 | # Also set EXEEXT_FOR_BUILD. | |
25 | if test "x$cross_compiling" = "xno"; then | |
26 | EXEEXT_FOR_BUILD='$(EXEEXT)' | |
27 | else | |
28 | AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext, | |
aab08431 ILT |
29 | [rm -f conftest* |
30 | echo 'int main () { return 0; }' > conftest.c | |
31 | bfd_cv_build_exeext= | |
32 | ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5 | |
33 | for file in conftest.*; do | |
34 | case $file in | |
35 | *.c | *.o | *.obj | *.ilk | *.pdb) ;; | |
36 | *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;; | |
37 | esac | |
38 | done | |
39 | rm -f conftest* | |
40 | test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no]) | |
252b5132 RH |
41 | EXEEXT_FOR_BUILD="" |
42 | test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} | |
43 | fi | |
44 | AC_SUBST(EXEEXT_FOR_BUILD)])dnl | |
45 | ||
a703a6ea AM |
46 | AC_DEFUN([AM_INSTALL_LIBBFD], |
47 | [AC_MSG_CHECKING([whether to install libbfd]) | |
48 | AC_ARG_ENABLE(install-libbfd, | |
c5d1701e | 49 | [ --enable-install-libbfd controls installation of libbfd and related headers], |
a703a6ea | 50 | install_libbfd_p=$enableval, |
66e25bab | 51 | if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then |
a703a6ea AM |
52 | install_libbfd_p=yes |
53 | else | |
54 | install_libbfd_p=no | |
55 | fi) | |
56 | AC_MSG_RESULT($install_libbfd_p) | |
57 | AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes) | |
5464f5a1 | 58 | # Need _noncanonical variables for this. |
24443139 AS |
59 | ACX_NONCANONICAL_HOST |
60 | ACX_NONCANONICAL_TARGET | |
a703a6ea AM |
61 | # libbfd.a is a host library containing target dependent code |
62 | bfdlibdir='$(libdir)' | |
63 | bfdincludedir='$(includedir)' | |
64 | if test "${host}" != "${target}"; then | |
5464f5a1 NN |
65 | bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib' |
66 | bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include' | |
a703a6ea AM |
67 | fi |
68 | AC_SUBST(bfdlibdir) | |
573e8a1c | 69 | AM_SUBST_NOTMAKE(bfdlibdir) |
a703a6ea | 70 | AC_SUBST(bfdincludedir) |
573e8a1c | 71 | AM_SUBST_NOTMAKE(bfdincludedir) |
a703a6ea AM |
72 | ] |
73 | ) |