1 sinclude(../config/accross.m4)
3 dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
4 AC_DEFUN([BFD_BINARY_FOPEN],
5 [AC_REQUIRE([AC_CANONICAL_SYSTEM])
8 *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
10 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
13 dnl Get a default for CC_FOR_BUILD to put into Makefile.
14 AC_DEFUN([BFD_CC_FOR_BUILD],
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
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)'
28 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
30 echo 'int main () { return 0; }' > conftest.c
32 ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
33 for file in conftest.*; do
35 *.c | *.o | *.obj | *.ilk | *.pdb) ;;
36 *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
40 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
42 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
44 AC_SUBST(EXEEXT_FOR_BUILD)])dnl
46 dnl See whether we need a declaration for a function.
47 AC_DEFUN([BFD_NEED_DECLARATION],
48 [AC_MSG_CHECKING([whether $1 must be declared])
49 AC_CACHE_VAL(bfd_cv_decl_needed_$1,
65 [char *(*pfn) = (char *(*)) $1],
66 bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
67 AC_MSG_RESULT($bfd_cv_decl_needed_$1)
68 if test $bfd_cv_decl_needed_$1 = yes; then
69 AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
70 [Define if $1 is not declared in system header files.])
74 dnl Check for existence of a type $1 in sys/procfs.h
76 AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE],
77 [AC_MSG_CHECKING([for $1 in sys/procfs.h])
78 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
81 #include <sys/procfs.h>],
83 bfd_cv_have_sys_procfs_type_$1=yes,
84 bfd_cv_have_sys_procfs_type_$1=no
86 if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
87 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
88 [Define if <sys/procfs.h> has $1.])
90 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
94 dnl Check for existence of member $2 in type $1 in sys/procfs.h
96 AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER],
97 [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
98 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
101 #include <sys/procfs.h>],
102 [$1 avar; void* aref = (void*) &avar.$2],
103 bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
104 bfd_cv_have_sys_procfs_type_member_$1_$2=no
106 if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
107 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
108 [Define if <sys/procfs.h> has $1.$2.])
110 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
113 sinclude(../libtool.m4)
114 dnl The lines below arrange for aclocal not to bring libtool.m4
115 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
116 dnl to add a definition of LIBTOOL to Makefile.in.
118 AC_DEFUN([AM_PROG_LIBTOOL],)
119 AC_DEFUN([AM_DISABLE_SHARED],)
123 sinclude(../gettext.m4)
125 AC_DEFUN([CY_WITH_NLS],)
129 AC_DEFUN([AM_INSTALL_LIBBFD],
130 [AC_MSG_CHECKING([whether to install libbfd])
131 AC_ARG_ENABLE(install-libbfd,
132 [ --enable-install-libbfd controls installation of libbfd and related headers],
133 install_libbfd_p=$enableval,
134 if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then
139 AC_MSG_RESULT($install_libbfd_p)
140 AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes)
141 # libbfd.a is a host library containing target dependent code
142 bfdlibdir='$(libdir)'
143 bfdincludedir='$(includedir)'
144 if test "${host}" != "${target}"; then
145 bfdlibdir='$(exec_prefix)/$(host_alias)/$(target_alias)/lib'
146 bfdincludedir='$(exec_prefix)/$(host_alias)/$(target_alias)/include'
149 AC_SUBST(bfdincludedir)