* Makefile.am: New file, based on old Makefile.in.
[deliverable/binutils-gdb.git] / bfd / aclocal.m4
CommitLineData
c0734708
ILT
1dnl aclocal.m4 generated automatically by aclocal 1.2
2
b1ee3d6a
RS
3dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
4AC_DEFUN(BFD_BINARY_FOPEN,
5[AC_REQUIRE([AC_CANONICAL_SYSTEM])
6case "${host}" in
7changequote(,)dnl
8i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32 | *-*-windows)
9changequote([,])dnl
10 AC_DEFINE(USE_BINARY_FOPEN) ;;
11esac])dnl
12
13dnl Get a default for CC_FOR_BUILD to put into Makefile.
14AC_DEFUN(BFD_CC_FOR_BUILD,
15[# Put a plausible default for CC_FOR_BUILD in Makefile.
16if test -z "$CC_FOR_BUILD"; then
17 if test "x$cross_compiling" = "xno"; then
18 CC_FOR_BUILD='$(CC)'
19 else
20 CC_FOR_BUILD=gcc
f515fb2f 21 fi
f515fb2f 22fi
b1ee3d6a
RS
23AC_SUBST(CC_FOR_BUILD)])dnl
24
25dnl See whether we need a declaration for a function.
26AC_DEFUN(BFD_NEED_DECLARATION,
27[AC_MSG_CHECKING([whether $1 must be declared])
28AC_CACHE_VAL(bfd_cv_decl_needed_$1,
29[AC_TRY_COMPILE([
30#include <stdio.h>
31#ifdef HAVE_STRING_H
32#include <string.h>
33#else
34#ifdef HAVE_STRINGS_H
35#include <strings.h>
36#endif
37#endif
38#ifdef HAVE_STDLIB_H
39#include <stdlib.h>
40#endif
41#ifdef HAVE_UNISTD_H
42#include <unistd.h>
43#endif],
44[char *(*pfn) = (char *(*)) $1],
45bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
46AC_MSG_RESULT($bfd_cv_decl_needed_$1)
47if test $bfd_cv_decl_needed_$1 = yes; then
48 bfd_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
49 AC_DEFINE_UNQUOTED($bfd_tr_decl)
50fi
f515fb2f 51])dnl
b1ee3d6a 52
c0734708
ILT
53# Do all the work for Automake. This macro actually does too much --
54# some checks are only needed if your package does certain things.
55# But this isn't really a big deal.
56
57# serial 1
58
59dnl Usage:
60dnl AM_INIT_AUTOMAKE(package,version, [no-define])
61
62AC_DEFUN(AM_INIT_AUTOMAKE,
63[AC_REQUIRE([AM_PROG_INSTALL])
64PACKAGE=[$1]
65AC_SUBST(PACKAGE)
66VERSION=[$2]
67AC_SUBST(VERSION)
68dnl test to see if srcdir already configured
69if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
70 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
71fi
72ifelse([$3],,
73AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
74AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
75AM_SANITY_CHECK
76AC_ARG_PROGRAM
77dnl FIXME This is truly gross.
78missing_dir=`cd $ac_aux_dir && pwd`
79AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
80AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
81AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
82AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
83AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
84AC_PROG_MAKE_SET])
85
86
87# serial 1
88
89AC_DEFUN(AM_PROG_INSTALL,
90[AC_REQUIRE([AC_PROG_INSTALL])
91test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
92AC_SUBST(INSTALL_SCRIPT)dnl
93])
94
95#
96# Check to make sure that the build environment is sane.
97#
98
99AC_DEFUN(AM_SANITY_CHECK,
100[AC_MSG_CHECKING([whether build environment is sane])
101# Just in case
102sleep 1
103echo timestamp > conftestfile
104# Do `set' in a subshell so we don't clobber the current shell's
105# arguments. Must try -L first in case configure is actually a
106# symlink; some systems play weird games with the mod time of symlinks
107# (eg FreeBSD returns the mod time of the symlink's containing
108# directory).
109if (
110 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
111 if test "$@" = "X"; then
112 # -L didn't work.
113 set X `ls -t $srcdir/configure conftestfile`
114 fi
115 test "[$]2" = conftestfile
116 )
117then
118 # Ok.
119 :
120else
121 AC_MSG_ERROR([newly created file is older than distributed files!
122Check your system clock])
123fi
124rm -f conftest*
125AC_MSG_RESULT(yes)])
126
127dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
128dnl The program must properly implement --version.
129AC_DEFUN(AM_MISSING_PROG,
130[AC_MSG_CHECKING(for working $2)
131# Run test in a subshell; some versions of sh will print an error if
132# an executable is not found, even if stderr is redirected.
133# Redirect stdin to placate older versions of autoconf. Sigh.
134if ($2 --version) < /dev/null > /dev/null 2>&1; then
135 $1=$2
136 AC_MSG_RESULT(found)
137else
138 $1="$3/missing $2"
139 AC_MSG_RESULT(missing)
140fi
141AC_SUBST($1)])
142
143# Like AC_CONFIG_HEADER, but automatically create stamp file.
144
145AC_DEFUN(AM_CONFIG_HEADER,
146[AC_PREREQ([2.12])
147AC_CONFIG_HEADER([$1])
148dnl When config.status generates a header, we must update the stamp-h file.
149dnl This file resides in the same directory as the config header
150dnl that is generated. We must strip everything past the first ":",
151dnl and everything past the last "/".
152AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
153ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
154<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
155<<am_indx=1
156for am_file in <<$1>>; do
157 case " <<$>>CONFIG_HEADERS " in
158 *" <<$>>am_file "*<<)>>
159 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
160 ;;
161 esac
162 am_indx=`expr "<<$>>am_indx" + 1`
163done<<>>dnl>>)
164changequote([,]))])
165
166# Add --enable-maintainer-mode option to configure.
167# From Jim Meyering
168
169# serial 1
170
171AC_DEFUN(AM_MAINTAINER_MODE,
172[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
173 dnl maintainer-mode is disabled by default
174 AC_ARG_ENABLE(maintainer-mode,
175[ --enable-maintainer-mode enable make rules and dependencies not useful
176 (and sometimes confusing) to the casual installer],
177 USE_MAINTAINER_MODE=$enableval,
178 USE_MAINTAINER_MODE=no)
179 AC_MSG_RESULT($USE_MAINTAINER_MODE)
180 if test $USE_MAINTAINER_MODE = yes; then
181 MAINT=
182 else
183 MAINT='#M#'
184 fi
185 AC_SUBST(MAINT)dnl
186]
187)
b1ee3d6a
RS
188
189# Check to see if we're running under Cygwin32, without using
190# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
191# Otherwise set it to "no".
192
c0734708
ILT
193dnl AM_CYGWIN32()
194dnl You might think we can do this by checking for a cygwin32-specific
195dnl cpp define.
196AC_DEFUN(AM_CYGWIN32,
b1ee3d6a
RS
197[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
198[AC_TRY_COMPILE(,[int main () { return __CYGWIN32__; }],
199am_cv_cygwin32=yes, am_cv_cygwin32=no)
200rm -f conftest*])
201CYGWIN32=
202test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
c0734708 203
b1ee3d6a
RS
204# Check to see if we're running under Win32, without using
205# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
206# Otherwise set it to "".
207
c0734708 208dnl AM_EXEEXT()
b1ee3d6a
RS
209dnl This knows we add .exe if we're building in the Cygwin32
210dnl environment. But if we're not, then it compiles a test program
211dnl to see if there is a suffix for executables.
c0734708
ILT
212AC_DEFUN(AM_EXEEXT,
213dnl AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AM_CYGWIN32])
b1ee3d6a
RS
214AC_MSG_CHECKING([for executable suffix])
215[AC_CACHE_VAL(am_cv_exeext,
216[if test "$CYGWIN32" = yes; then
217am_cv_exeext=.exe
218else
219cat > am_c_test.c << 'EOF'
220int main() {
221/* Nothing needed here */
222}
223EOF
224${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
225am_cv_exeext=`ls am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
226rm -f am_c_test*])
227test x"${am_cv_exeext}" = x && am_cv_exeext=no
228fi
229EXEEXT=""
230test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
231AC_MSG_RESULT(${am_cv_exeext})
232AC_SUBST(EXEEXT)])
c0734708 233
This page took 0.084392 seconds and 4 git commands to generate.