1 dnl aclocal.m4 generated automatically by aclocal 1.2
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 i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32 | *-*-windows)
10 AC_DEFINE(USE_BINARY_FOPEN) ;;
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)])dnl
25 dnl See whether we need a declaration for a function.
26 AC_DEFUN(BFD_NEED_DECLARATION,
27 [AC_MSG_CHECKING([whether $1 must be declared])
28 AC_CACHE_VAL(bfd_cv_decl_needed_$1,
44 [char *(*pfn) = (char *(*)) $1],
45 bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
46 AC_MSG_RESULT($bfd_cv_decl_needed_$1)
47 if 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)
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.
60 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
62 AC_DEFUN(AM_INIT_AUTOMAKE,
63 [AC_REQUIRE([AM_PROG_INSTALL])
68 dnl test to see if srcdir already configured
69 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
70 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
73 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
74 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
77 dnl FIXME This is truly gross.
78 missing_dir=`cd $ac_aux_dir && pwd`
79 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
80 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
81 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
82 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
83 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
89 AC_DEFUN(AM_PROG_INSTALL,
90 [AC_REQUIRE([AC_PROG_INSTALL])
91 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
92 AC_SUBST(INSTALL_SCRIPT)dnl
96 # Check to make sure that the build environment is sane.
99 AC_DEFUN(AM_SANITY_CHECK,
100 [AC_MSG_CHECKING([whether build environment is sane])
103 echo 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
110 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
111 if test "$@" = "X"; then
113 set X `ls -t $srcdir/configure conftestfile`
115 test "[$]2" = conftestfile
121 AC_MSG_ERROR([newly created file is older than distributed files!
122 Check your system clock])
127 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
128 dnl The program must properly implement --version.
129 AC_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.
134 if ($2 --version) < /dev/null > /dev/null 2>&1; then
139 AC_MSG_RESULT(missing)
143 # Like AC_CONFIG_HEADER, but automatically create stamp file.
145 AC_DEFUN(AM_CONFIG_HEADER,
147 AC_CONFIG_HEADER([$1])
148 dnl When config.status generates a header, we must update the stamp-h file.
149 dnl This file resides in the same directory as the config header
150 dnl that is generated. We must strip everything past the first ":",
151 dnl and everything past the last "/".
152 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
153 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
154 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
156 for 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
162 am_indx=`expr "<<$>>am_indx" + 1`
166 # Add --enable-maintainer-mode option to configure.
171 AC_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
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".
194 dnl You might think we can do this by checking for a cygwin32-specific
196 AC_DEFUN(AM_CYGWIN32,
197 [AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
198 [AC_TRY_COMPILE(,[int main () { return __CYGWIN32__; }],
199 am_cv_cygwin32=yes, am_cv_cygwin32=no)
202 test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
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 "".
209 dnl This knows we add .exe if we're building in the Cygwin32
210 dnl environment. But if we're not, then it compiles a test program
211 dnl to see if there is a suffix for executables.
213 dnl AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AM_CYGWIN32])
214 AC_MSG_CHECKING([for executable suffix])
215 [AC_CACHE_VAL(am_cv_exeext,
216 [if test "$CYGWIN32" = yes; then
219 cat > am_c_test.c << 'EOF'
221 /* Nothing needed here */
224 ${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
225 am_cv_exeext=`ls am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
227 test x"${am_cv_exeext}" = x && am_cv_exeext=no
230 test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
231 AC_MSG_RESULT(${am_cv_exeext})