* Makefile.am: New file, based on old Makefile.in.
[deliverable/binutils-gdb.git] / bfd / aclocal.m4
CommitLineData
b1ee3d6a
RS
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
6i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32 | *-*-windows)
7changequote([,])dnl
8 AC_DEFINE(USE_BINARY_FOPEN) ;;
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
f515fb2f 19 fi
f515fb2f 20fi
b1ee3d6a
RS
21AC_SUBST(CC_FOR_BUILD)])dnl
22
23dnl See whether we need a declaration for a function.
24AC_DEFUN(BFD_NEED_DECLARATION,
25[AC_MSG_CHECKING([whether $1 must be declared])
26AC_CACHE_VAL(bfd_cv_decl_needed_$1,
27[AC_TRY_COMPILE([
28#include <stdio.h>
29#ifdef HAVE_STRING_H
30#include <string.h>
31#else
32#ifdef HAVE_STRINGS_H
33#include <strings.h>
34#endif
35#endif
36#ifdef HAVE_STDLIB_H
37#include <stdlib.h>
38#endif
39#ifdef HAVE_UNISTD_H
40#include <unistd.h>
41#endif],
42[char *(*pfn) = (char *(*)) $1],
43bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
44AC_MSG_RESULT($bfd_cv_decl_needed_$1)
45if test $bfd_cv_decl_needed_$1 = yes; then
46 bfd_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
47 AC_DEFINE_UNQUOTED($bfd_tr_decl)
48fi
f515fb2f 49])dnl
b1ee3d6a
RS
50
51
52# Check to see if we're running under Cygwin32, without using
53# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
54# Otherwise set it to "no".
55
56AC_DEFUN(CY_CYGWIN32,
57[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
58[AC_TRY_COMPILE(,[int main () { return __CYGWIN32__; }],
59am_cv_cygwin32=yes, am_cv_cygwin32=no)
60rm -f conftest*])
61CYGWIN32=
62test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
63# Check to see if we're running under Win32, without using
64# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
65# Otherwise set it to "".
66
67dnl This knows we add .exe if we're building in the Cygwin32
68dnl environment. But if we're not, then it compiles a test program
69dnl to see if there is a suffix for executables.
70AC_DEFUN(CY_EXEEXT,
71dnl AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([CY_CYGWIN32])
72AC_MSG_CHECKING([for executable suffix])
73[AC_CACHE_VAL(am_cv_exeext,
74[if test "$CYGWIN32" = yes; then
75am_cv_exeext=.exe
76else
77cat > am_c_test.c << 'EOF'
78int main() {
79/* Nothing needed here */
80}
81EOF
82${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
83am_cv_exeext=`ls am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
84rm -f am_c_test*])
85test x"${am_cv_exeext}" = x && am_cv_exeext=no
86fi
87EXEEXT=""
88test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
89AC_MSG_RESULT(${am_cv_exeext})
90AC_SUBST(EXEEXT)])
This page took 0.077476 seconds and 4 git commands to generate.