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