1 dnl aclocal.m4 generated automatically by aclocal 1.4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 # Copyright (c) 1999-2001, 2002 by Red Hat, Inc. All rights reserved.
15 # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
16 # OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
18 # Permission is hereby granted to use or copy this program
19 # for any purpose, provided the above notices are retained on all copies.
20 # Permission to modify the code and to distribute modified code is granted,
21 # provided the above notices are retained, and a notice that the code was
22 # modified is included with the above copyright notice.
24 # Original author: Tom Tromey
26 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
27 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
28 # are probably using a cross compiler, which will not be able to fully
29 # link an executable. This should really be fixed in autoconf
32 AC_DEFUN(GC_CONFIGURE,
34 dnl Default to --enable-multilib
35 AC_ARG_ENABLE(multilib,
36 [ --enable-multilib build many library versions (default)],
37 [case "${enableval}" in
40 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
41 esac], [multilib=yes])dnl
43 dnl We may get other options which we don't document:
44 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
46 dnl I needed to add the -n test to allow configuration in src directory - HB
47 if test "[$]{srcdir}" = "."; then
48 if test "[$]{with_target_subdir}" != "." -a -n "[$]{with_target_subdir}"; then
49 gc_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
51 gc_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
54 gc_basedir="[$]{srcdir}/$1"
57 AC_CONFIG_AUX_DIR($gc_basedir/..)
59 # This overrides the previous occurrence for automake, but not for
60 # autoconf, which is exactly what we want.
66 # This works around an automake problem.
67 mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
68 AC_SUBST(mkinstalldirs)
70 AM_INIT_AUTOMAKE(gc, 6.0, no-define)
72 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
73 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
74 # are probably using a cross compiler, which will not be able to fully
75 # link an executable. This should really be fixed in autoconf
78 AC_DEFUN(LIB_AC_PROG_CC,
79 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
80 dnl Fool anybody using AC_PROG_CC.
81 AC_PROVIDE([AC_PROG_CC])
82 AC_CHECK_PROG(CC, gcc, gcc)
83 if test -z "$CC"; then
84 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
85 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
90 if test $ac_cv_prog_gcc = yes; then
92 dnl Check whether -g works, even if CFLAGS is set, in case the package
93 dnl plays around with CFLAGS (such as to build both debugging and
94 dnl normal versions of a library), tasteless as that idea is.
95 ac_test_CFLAGS="${CFLAGS+set}"
96 ac_save_CFLAGS="$CFLAGS"
99 if test "$ac_test_CFLAGS" = set; then
100 CFLAGS="$ac_save_CFLAGS"
101 elif test $ac_cv_prog_cc_g = yes; then
108 test "${CFLAGS+set}" = set || CFLAGS="-g"
114 # Likewise for AC_PROG_CXX.
115 AC_DEFUN(LIB_AC_PROG_CXX,
116 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
117 dnl Fool anybody using AC_PROG_CXX.
118 AC_PROVIDE([AC_PROG_CXX])
119 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
120 test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
124 if test $ac_cv_prog_gxx = yes; then
126 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
127 dnl plays around with CXXFLAGS (such as to build both debugging and
128 dnl normal versions of a library), tasteless as that idea is.
129 ac_test_CXXFLAGS="${CXXFLAGS+set}"
130 ac_save_CXXFLAGS="$CXXFLAGS"
133 if test "$ac_test_CXXFLAGS" = set; then
134 CXXFLAGS="$ac_save_CXXFLAGS"
135 elif test $ac_cv_prog_cxx_g = yes; then
142 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
148 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
149 # run it explicitly here, it will be run implicitly before
150 # NEWLIB_CONFIGURE, which doesn't work because that means that it will
151 # be run before AC_CANONICAL_HOST.
154 AC_CHECK_TOOL(AS, as)
155 AC_CHECK_TOOL(AR, ar)
156 AC_CHECK_TOOL(RANLIB, ranlib, :)
162 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
163 # at least currently, we never actually build a program, so we never
164 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
165 # fails, because we are probably configuring with a cross compiler
166 # which can't create executables. So we include AC_EXEEXT to keep
167 # automake happy, but we don't execute it, since we don't care about
170 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
171 # to nothing, so nothing would remain between `then' and `fi' if it
172 # were not for the `:' below.
177 . [$]{srcdir}/configure.host
179 case [$]{gc_basedir} in
180 /* | [A-Za-z]:[/\\]*) gc_flagbasedir=[$]{gc_basedir} ;;
181 *) gc_flagbasedir='[$](top_builddir)/'[$]{gc_basedir} ;;
184 gc_cflags="[$]{gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{gc_flagbasedir}/libc/include"
187 gc_cflags="[$]{gc_cflags} -I[$]{gc_flagbasedir}/../winsup/include"
191 dnl gc_cflags="[$]{gc_cflags} -fno-builtin"
193 GC_CFLAGS=${gc_cflags}
199 sinclude(../libtool.m4)
200 dnl The line below arranges for aclocal not to bring a definition of
201 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
202 dnl to add a definition of LIBTOOL to Makefile.in.
203 ifelse(yes,no,[AC_DEFUN([AM_PROG_LIBTOOL],[AC_SUBST(LIBTOOL)])])
205 # Do all the work for Automake. This macro actually does too much --
206 # some checks are only needed if your package does certain things.
207 # But this isn't really a big deal.
212 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
214 AC_DEFUN(AM_INIT_AUTOMAKE,
215 [AC_REQUIRE([AC_PROG_INSTALL])
220 dnl test to see if srcdir already configured
221 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
222 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
225 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
226 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
227 AC_REQUIRE([AM_SANITY_CHECK])
228 AC_REQUIRE([AC_ARG_PROGRAM])
229 dnl FIXME This is truly gross.
230 missing_dir=`cd $ac_aux_dir && pwd`
231 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
232 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
233 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
234 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
235 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
236 AC_REQUIRE([AC_PROG_MAKE_SET])])
239 # Check to make sure that the build environment is sane.
242 AC_DEFUN(AM_SANITY_CHECK,
243 [AC_MSG_CHECKING([whether build environment is sane])
246 echo timestamp > conftestfile
247 # Do `set' in a subshell so we don't clobber the current shell's
248 # arguments. Must try -L first in case configure is actually a
249 # symlink; some systems play weird games with the mod time of symlinks
250 # (eg FreeBSD returns the mod time of the symlink's containing
253 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
254 if test "[$]*" = "X"; then
256 set X `ls -t $srcdir/configure conftestfile`
258 if test "[$]*" != "X $srcdir/configure conftestfile" \
259 && test "[$]*" != "X conftestfile $srcdir/configure"; then
261 # If neither matched, then we have a broken ls. This can happen
262 # if, for instance, CONFIG_SHELL is bash and it inherits a
263 # broken ls alias from the environment. This has actually
264 # happened. Such a system could not be considered "sane".
265 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
266 alias in your environment])
269 test "[$]2" = conftestfile
275 AC_MSG_ERROR([newly created file is older than distributed files!
276 Check your system clock])
281 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
282 dnl The program must properly implement --version.
283 AC_DEFUN(AM_MISSING_PROG,
284 [AC_MSG_CHECKING(for working $2)
285 # Run test in a subshell; some versions of sh will print an error if
286 # an executable is not found, even if stderr is redirected.
287 # Redirect stdin to placate older versions of autoconf. Sigh.
288 if ($2 --version) < /dev/null > /dev/null 2>&1; then
293 AC_MSG_RESULT(missing)
297 # Add --enable-maintainer-mode option to configure.
302 AC_DEFUN(AM_MAINTAINER_MODE,
303 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
304 dnl maintainer-mode is disabled by default
305 AC_ARG_ENABLE(maintainer-mode,
306 [ --enable-maintainer-mode enable make rules and dependencies not useful
307 (and sometimes confusing) to the casual installer],
308 USE_MAINTAINER_MODE=$enableval,
309 USE_MAINTAINER_MODE=no)
310 AC_MSG_RESULT($USE_MAINTAINER_MODE)
311 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
312 MAINT=$MAINTAINER_MODE_TRUE
317 # Define a conditional.
319 AC_DEFUN(AM_CONDITIONAL,