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 dnl This provides configure definitions used by all the newlib
14 dnl configure.in files.
16 dnl Basic newlib configury. This calls basic introductory stuff,
17 dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs
18 dnl configure.host. The only argument is the relative path to the top
21 AC_DEFUN(NEWLIB_CONFIGURE,
23 dnl Default to --enable-multilib
24 AC_ARG_ENABLE(multilib,
25 [ --enable-multilib build many library versions (default)],
26 [case "${enableval}" in
29 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
30 esac], [multilib=yes])dnl
32 dnl Support --enable-target-optspace
33 AC_ARG_ENABLE(target-optspace,
34 [ --enable-target-optspace optimize for space],
35 [case "${enableval}" in
36 yes) target_optspace=yes ;;
37 no) target_optspace=no ;;
38 *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;;
39 esac], [target_optspace=])dnl
41 dnl Support --enable-malloc-debugging - currently only supported for Cygwin
42 AC_ARG_ENABLE(malloc-debugging,
43 [ --enable-malloc-debugging indicate malloc debugging requested],
44 [case "${enableval}" in
45 yes) malloc_debugging=yes ;;
46 no) malloc_debugging=no ;;
47 *) AC_MSG_ERROR(bad value ${enableval} for malloc-debugging option) ;;
48 esac], [malloc_debugging=])dnl
50 dnl Support --enable-newlib-mb
51 AC_ARG_ENABLE(newlib-mb,
52 [ --enable-newlib-mb enable multibyte support],
53 [case "${enableval}" in
56 *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;;
57 esac], [newlib_mb=no])dnl
59 dnl Support --enable-newlib-multithread
60 AC_ARG_ENABLE(newlib-multithread,
61 [ --enable-newlib-multithread enable support for multiple threads],
62 [case "${enableval}" in
63 yes) newlib_multithread=yes ;;
64 no) newlib_multithread=no ;;
65 *) AC_MSG_ERROR(bad value ${enableval} for newlib-multithread option) ;;
66 esac], [newlib_multithread=yes])dnl
68 dnl Support --disable-newlib-io-float
69 AC_ARG_ENABLE(newlib-io-float,
70 [ --disable-newlib-io-float disable printf/scanf family float support],
71 [case "${enableval}" in
72 yes) newlib_io_float=yes ;;
73 no) newlib_io_float=no ;;
74 *) AC_MSG_ERROR(bad value ${enableval} for newlib-io-float option) ;;
75 esac], [newlib_io_float=yes])dnl
78 dnl We may get other options which we don't document:
79 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
81 test -z "[$]{with_target_subdir}" && with_target_subdir=.
83 if test "[$]{srcdir}" = "."; then
84 if test "[$]{with_target_subdir}" != "."; then
85 newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
87 newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
90 newlib_basedir="[$]{srcdir}/$1"
92 AC_SUBST(newlib_basedir)
96 AM_INIT_AUTOMAKE(newlib, 1.10.0)
98 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
99 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
100 # are probably using a cross compiler, which will not be able to fully
101 # link an executable. This should really be fixed in autoconf
104 AC_DEFUN(LIB_AC_PROG_CC,
105 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
106 AC_CHECK_PROG(CC, gcc, gcc)
107 if test -z "$CC"; then
108 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
109 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
114 if test $ac_cv_prog_gcc = yes; then
116 dnl Check whether -g works, even if CFLAGS is set, in case the package
117 dnl plays around with CFLAGS (such as to build both debugging and
118 dnl normal versions of a library), tasteless as that idea is.
119 ac_test_CFLAGS="${CFLAGS+set}"
120 ac_save_CFLAGS="$CFLAGS"
123 if test "$ac_test_CFLAGS" = set; then
124 CFLAGS="$ac_save_CFLAGS"
125 elif test $ac_cv_prog_cc_g = yes; then
132 test "${CFLAGS+set}" = set || CFLAGS="-g"
138 AC_CHECK_TOOL(AS, as)
139 AC_CHECK_TOOL(AR, ar)
140 AC_CHECK_TOOL(RANLIB, ranlib, :)
146 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
147 # at least currently, we never actually build a program, so we never
148 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
149 # fails, because we are probably configuring with a cross compiler
150 # which can't create executables. So we include AC_EXEEXT to keep
151 # automake happy, but we don't execute it, since we don't care about
157 . [$]{newlib_basedir}/configure.host
159 newlib_cflags="[$]{newlib_cflags} -fno-builtin"
161 NEWLIB_CFLAGS=${newlib_cflags}
162 AC_SUBST(NEWLIB_CFLAGS)
167 AM_CONDITIONAL(USE_LIBTOOL, test x[$]{use_libtool} = xyes)
171 AC_SUBST(libm_machine_dir)
172 AC_SUBST(machine_dir)
176 # Do all the work for Automake. This macro actually does too much --
177 # some checks are only needed if your package does certain things.
178 # But this isn't really a big deal.
183 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
185 AC_DEFUN(AM_INIT_AUTOMAKE,
186 [AC_REQUIRE([AC_PROG_INSTALL])
191 dnl test to see if srcdir already configured
192 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
193 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
196 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
197 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
198 AC_REQUIRE([AM_SANITY_CHECK])
199 AC_REQUIRE([AC_ARG_PROGRAM])
200 dnl FIXME This is truly gross.
201 missing_dir=`cd $ac_aux_dir && pwd`
202 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
203 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
204 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
205 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
206 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
207 AC_REQUIRE([AC_PROG_MAKE_SET])])
210 # Check to make sure that the build environment is sane.
213 AC_DEFUN(AM_SANITY_CHECK,
214 [AC_MSG_CHECKING([whether build environment is sane])
217 echo timestamp > conftestfile
218 # Do `set' in a subshell so we don't clobber the current shell's
219 # arguments. Must try -L first in case configure is actually a
220 # symlink; some systems play weird games with the mod time of symlinks
221 # (eg FreeBSD returns the mod time of the symlink's containing
224 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
225 if test "[$]*" = "X"; then
227 set X `ls -t $srcdir/configure conftestfile`
229 if test "[$]*" != "X $srcdir/configure conftestfile" \
230 && test "[$]*" != "X conftestfile $srcdir/configure"; then
232 # If neither matched, then we have a broken ls. This can happen
233 # if, for instance, CONFIG_SHELL is bash and it inherits a
234 # broken ls alias from the environment. This has actually
235 # happened. Such a system could not be considered "sane".
236 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
237 alias in your environment])
240 test "[$]2" = conftestfile
246 AC_MSG_ERROR([newly created file is older than distributed files!
247 Check your system clock])
252 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
253 dnl The program must properly implement --version.
254 AC_DEFUN(AM_MISSING_PROG,
255 [AC_MSG_CHECKING(for working $2)
256 # Run test in a subshell; some versions of sh will print an error if
257 # an executable is not found, even if stderr is redirected.
258 # Redirect stdin to placate older versions of autoconf. Sigh.
259 if ($2 --version) < /dev/null > /dev/null 2>&1; then
264 AC_MSG_RESULT(missing)
268 # Add --enable-maintainer-mode option to configure.
273 AC_DEFUN(AM_MAINTAINER_MODE,
274 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
275 dnl maintainer-mode is disabled by default
276 AC_ARG_ENABLE(maintainer-mode,
277 [ --enable-maintainer-mode enable make rules and dependencies not useful
278 (and sometimes confusing) to the casual installer],
279 USE_MAINTAINER_MODE=$enableval,
280 USE_MAINTAINER_MODE=no)
281 AC_MSG_RESULT($USE_MAINTAINER_MODE)
282 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
283 MAINT=$MAINTAINER_MODE_TRUE
288 # Define a conditional.
290 AC_DEFUN(AM_CONDITIONAL,