1 sinclude(../config/accross.m4)
2 sinclude(../config/acx.m4)
4 dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
5 AC_DEFUN([BFD_BINARY_FOPEN],
6 [AC_REQUIRE([AC_CANONICAL_TARGET])
9 *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
11 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
14 dnl Get a default for CC_FOR_BUILD to put into Makefile.
15 AC_DEFUN([BFD_CC_FOR_BUILD],
16 [# Put a plausible default for CC_FOR_BUILD in Makefile.
17 if test -z "$CC_FOR_BUILD"; then
18 if test "x$cross_compiling" = "xno"; then
24 AC_SUBST(CC_FOR_BUILD)
25 # Also set EXEEXT_FOR_BUILD.
26 if test "x$cross_compiling" = "xno"; then
27 EXEEXT_FOR_BUILD='$(EXEEXT)'
29 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
31 echo 'int main () { return 0; }' > conftest.c
33 ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
34 for file in conftest.*; do
36 *.c | *.o | *.obj | *.ilk | *.pdb) ;;
37 *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
41 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
43 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
45 AC_SUBST(EXEEXT_FOR_BUILD)])dnl
47 dnl See whether we need a declaration for a function.
48 AC_DEFUN([BFD_NEED_DECLARATION],
49 [AC_MSG_CHECKING([whether $1 must be declared])
50 AC_CACHE_VAL(bfd_cv_decl_needed_$1,
66 [char *(*pfn) = (char *(*)) $1],
67 bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
68 AC_MSG_RESULT($bfd_cv_decl_needed_$1)
69 if test $bfd_cv_decl_needed_$1 = yes; then
70 AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
71 [Define if $1 is not declared in system header files.])
75 dnl Check for existence of a type $1 in sys/procfs.h
77 AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE],
78 [AC_MSG_CHECKING([for $1 in sys/procfs.h])
79 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
82 #include <sys/procfs.h>],
84 bfd_cv_have_sys_procfs_type_$1=yes,
85 bfd_cv_have_sys_procfs_type_$1=no
87 if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
88 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
89 [Define if <sys/procfs.h> has $1.])
91 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
95 dnl Check for existence of member $2 in type $1 in sys/procfs.h
97 AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER],
98 [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
99 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
102 #include <sys/procfs.h>],
103 [$1 avar; void* aref = (void*) &avar.$2],
104 bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
105 bfd_cv_have_sys_procfs_type_member_$1_$2=no
107 if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
108 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
109 [Define if <sys/procfs.h> has $1.$2.])
111 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
114 sinclude(../libtool.m4)
115 dnl The lines below arrange for aclocal not to bring libtool.m4
116 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
117 dnl to add a definition of LIBTOOL to Makefile.in.
119 AC_DEFUN([AM_PROG_LIBTOOL],)
120 AC_DEFUN([AM_DISABLE_SHARED],)
124 sinclude(../gettext.m4)
126 AC_DEFUN([CY_WITH_NLS],)
130 AC_DEFUN([AM_INSTALL_LIBBFD],
131 [AC_MSG_CHECKING([whether to install libbfd])
132 AC_ARG_ENABLE(install-libbfd,
133 [ --enable-install-libbfd controls installation of libbfd and related headers],
134 install_libbfd_p=$enableval,
135 if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then
140 AC_MSG_RESULT($install_libbfd_p)
141 AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes)
142 # Need _noncanonical variables for this.
143 ACX_NONCANONICAL_HOST
144 ACX_NONCANONICAL_TARGET
145 # libbfd.a is a host library containing target dependent code
146 bfdlibdir='$(libdir)'
147 bfdincludedir='$(includedir)'
148 if test "${host}" != "${target}"; then
149 bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib'
150 bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include'
153 AC_SUBST(bfdincludedir)