source: branches/BINUTILS_2-11-2_BRANCH/src/binutils/bfd/acinclude.m4@ 450

Last change on this file since 450 was 450, checked in by (none), 22 years ago

This commit was manufactured by cvs2svn to create branch
'BINUTILS_2-11-2_BRANCH'.

  • Property cvs2svn:cvs-rev set to 1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 3.7 KB
Line 
1dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
2AC_DEFUN(BFD_BINARY_FOPEN,
3[AC_REQUIRE([AC_CANONICAL_SYSTEM])
4case "${host}" in
5changequote(,)dnl
6*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows* | *-*-os2*)
7changequote([,])dnl
8 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
9esac])dnl
10
11dnl Get a default for CC_FOR_BUILD to put into Makefile.
12AC_DEFUN(BFD_CC_FOR_BUILD,
13[# Put a plausible default for CC_FOR_BUILD in Makefile.
14if test -z "$CC_FOR_BUILD"; then
15 if test "x$cross_compiling" = "xno"; then
16 CC_FOR_BUILD='$(CC)'
17 else
18 CC_FOR_BUILD=gcc
19 fi
20fi
21AC_SUBST(CC_FOR_BUILD)
22# Also set EXEEXT_FOR_BUILD.
23if test "x$cross_compiling" = "xno"; then
24 EXEEXT_FOR_BUILD='$(EXEEXT)'
25else
26 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
27 [rm -f conftest*
28 echo 'int main () { return 0; }' > conftest.c
29 bfd_cv_build_exeext=
30 ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
31 for file in conftest.*; do
32 case $file in
33 *.c | *.o | *.obj | *.ilk | *.pdb) ;;
34 *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
35 esac
36 done
37 rm -f conftest*
38 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
39 EXEEXT_FOR_BUILD=""
40 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
41fi
42AC_SUBST(EXEEXT_FOR_BUILD)])dnl
43
44dnl See whether we need a declaration for a function.
45AC_DEFUN(BFD_NEED_DECLARATION,
46[AC_MSG_CHECKING([whether $1 must be declared])
47AC_CACHE_VAL(bfd_cv_decl_needed_$1,
48[AC_TRY_COMPILE([
49#include <stdio.h>
50#ifdef HAVE_STRING_H
51#include <string.h>
52#else
53#ifdef HAVE_STRINGS_H
54#include <strings.h>
55#endif
56#endif
57#ifdef HAVE_STDLIB_H
58#include <stdlib.h>
59#endif
60#ifdef HAVE_UNISTD_H
61#include <unistd.h>