]> sourceware.org Git - newlib-cygwin.git/blame - newlib/libc/sys/d10v/aclocal.m4
* cygwin.din: Add *scanf and *scan_r functions.
[newlib-cygwin.git] / newlib / libc / sys / d10v / aclocal.m4
CommitLineData
8a0efa53
CF
1dnl aclocal.m4 generated automatically by aclocal 1.4
2
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13dnl This provides configure definitions used by all the newlib
14dnl configure.in files.
15
16dnl Basic newlib configury. This calls basic introductory stuff,
17dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs
18dnl configure.host. The only argument is the relative path to the top
19dnl newlib directory.
20
21AC_DEFUN(NEWLIB_CONFIGURE,
22[
23dnl Default to --enable-multilib
24AC_ARG_ENABLE(multilib,
25[ --enable-multilib build many library versions (default)],
26[case "${enableval}" in
27 yes) multilib=yes ;;
28 no) multilib=no ;;
29 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
30 esac], [multilib=yes])dnl
31
32dnl Support --enable-target-optspace
33AC_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
40
41dnl Support --enable-newlib-mb
42AC_ARG_ENABLE(newlib-mb,
43[ --enable-newlib-mb enable multibyte support],
44[case "${enableval}" in
45 yes) newlib_mb=yes ;;
46 no) newlib_mb=no ;;
47 *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;;
48 esac], [newlib_mb=no])dnl
49
50dnl We may get other options which we don't document:
51dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
52
53test -z "[$]{with_target_subdir}" && with_target_subdir=.
54
55if test "[$]{srcdir}" = "."; then
56 if test "[$]{with_target_subdir}" != "."; then
57 newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
58 else
59 newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
60 fi
61else
62 newlib_basedir="[$]{srcdir}/$1"
63fi
64AC_SUBST(newlib_basedir)
65
66AC_CANONICAL_HOST
67
804368d3 68AM_INIT_AUTOMAKE(newlib, 1.9.0)
8a0efa53
CF
69
70# FIXME: We temporarily define our own version of AC_PROG_CC. This is
71# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
72# are probably using a cross compiler, which will not be able to fully
73# link an executable. This should really be fixed in autoconf
74# itself.
75
76AC_DEFUN(LIB_AC_PROG_CC,
77[AC_BEFORE([$0], [AC_PROG_CPP])dnl
78AC_CHECK_PROG(CC, gcc, gcc)
79if test -z "$CC"; then
80 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
81 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
82fi
83
84AC_PROG_CC_GNU
85
86if test $ac_cv_prog_gcc = yes; then
87 GCC=yes
88dnl Check whether -g works, even if CFLAGS is set, in case the package
89dnl plays around with CFLAGS (such as to build both debugging and
90dnl normal versions of a library), tasteless as that idea is.
91 ac_test_CFLAGS="${CFLAGS+set}"
92 ac_save_CFLAGS="$CFLAGS"
93 CFLAGS=
94 AC_PROG_CC_G
95 if test "$ac_test_CFLAGS" = set; then
96 CFLAGS="$ac_save_CFLAGS"
97 elif test $ac_cv_prog_cc_g = yes; then
98 CFLAGS="-g -O2"
99 else
100 CFLAGS="-O2"
101 fi
102else
103 GCC=
104 test "${CFLAGS+set}" = set || CFLAGS="-g"
105fi
106])
107
108LIB_AC_PROG_CC
109
110# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
111# run it explicitly here, it will be run implicitly before
112# NEWLIB_CONFIGURE, which doesn't work because that means that it will
113# be run before AC_CANONICAL_HOST.
114AC_CANONICAL_BUILD
115
116AC_CHECK_TOOL(AS, as)
117AC_CHECK_TOOL(AR, ar)
118AC_CHECK_TOOL(RANLIB, ranlib, :)
119
120AC_PROG_INSTALL
121
122AM_MAINTAINER_MODE
123
124# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
125# at least currently, we never actually build a program, so we never
126# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
127# fails, because we are probably configuring with a cross compiler
128# which can't create executables. So we include AC_EXEEXT to keep
129# automake happy, but we don't execute it, since we don't care about
130# the result.
131if false; then
132 AC_EXEEXT
133fi
134
135. [$]{newlib_basedir}/configure.host
136
137case [$]{newlib_basedir} in
138/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;;
139*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;;
140esac
141
142newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include"
143case "${host}" in
144 *-*-cygwin*)
145 newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include"
146 ;;
147esac
148
149newlib_cflags="[$]{newlib_cflags} -fno-builtin"
150
151NEWLIB_CFLAGS=${newlib_cflags}
152AC_SUBST(NEWLIB_CFLAGS)
153
154AC_SUBST(machine_dir)
155AC_SUBST(sys_dir)
156])
157
158# Do all the work for Automake. This macro actually does too much --
159# some checks are only needed if your package does certain things.
160# But this isn't really a big deal.
161
162# serial 1
163
164dnl Usage:
165dnl AM_INIT_AUTOMAKE(package,version, [no-define])
166
167AC_DEFUN(AM_INIT_AUTOMAKE,
168[AC_REQUIRE([AC_PROG_INSTALL])
169PACKAGE=[$1]
170AC_SUBST(PACKAGE)
171VERSION=[$2]
172AC_SUBST(VERSION)
173dnl test to see if srcdir already configured
174if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
175 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
176fi
177ifelse([$3],,
178AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
179AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
180AC_REQUIRE([AM_SANITY_CHECK])
181AC_REQUIRE([AC_ARG_PROGRAM])
182dnl FIXME This is truly gross.
183missing_dir=`cd $ac_aux_dir && pwd`
184AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
185AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
186AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
187AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
188AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
189AC_REQUIRE([AC_PROG_MAKE_SET])])
190
191#
192# Check to make sure that the build environment is sane.
193#
194
195AC_DEFUN(AM_SANITY_CHECK,
196[AC_MSG_CHECKING([whether build environment is sane])
197# Just in case
198sleep 1
199echo timestamp > conftestfile
200# Do `set' in a subshell so we don't clobber the current shell's
201# arguments. Must try -L first in case configure is actually a
202# symlink; some systems play weird games with the mod time of symlinks
203# (eg FreeBSD returns the mod time of the symlink's containing
204# directory).
205if (
206 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
207 if test "[$]*" = "X"; then
208 # -L didn't work.
209 set X `ls -t $srcdir/configure conftestfile`
210 fi
211 if test "[$]*" != "X $srcdir/configure conftestfile" \
212 && test "[$]*" != "X conftestfile $srcdir/configure"; then
213
214 # If neither matched, then we have a broken ls. This can happen
215 # if, for instance, CONFIG_SHELL is bash and it inherits a
216 # broken ls alias from the environment. This has actually
217 # happened. Such a system could not be considered "sane".
218 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
219alias in your environment])
220 fi
221
222 test "[$]2" = conftestfile
223 )
224then
225 # Ok.
226 :
227else
228 AC_MSG_ERROR([newly created file is older than distributed files!
229Check your system clock])
230fi
231rm -f conftest*
232AC_MSG_RESULT(yes)])
233
234dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
235dnl The program must properly implement --version.
236AC_DEFUN(AM_MISSING_PROG,
237[AC_MSG_CHECKING(for working $2)
238# Run test in a subshell; some versions of sh will print an error if
239# an executable is not found, even if stderr is redirected.
240# Redirect stdin to placate older versions of autoconf. Sigh.
241if ($2 --version) < /dev/null > /dev/null 2>&1; then
242 $1=$2
243 AC_MSG_RESULT(found)
244else
245 $1="$3/missing $2"
246 AC_MSG_RESULT(missing)
247fi
248AC_SUBST($1)])
249
250# Add --enable-maintainer-mode option to configure.
251# From Jim Meyering
252
253# serial 1
254
255AC_DEFUN(AM_MAINTAINER_MODE,
256[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
257 dnl maintainer-mode is disabled by default
258 AC_ARG_ENABLE(maintainer-mode,
259[ --enable-maintainer-mode enable make rules and dependencies not useful
260 (and sometimes confusing) to the casual installer],
261 USE_MAINTAINER_MODE=$enableval,
262 USE_MAINTAINER_MODE=no)
263 AC_MSG_RESULT($USE_MAINTAINER_MODE)
264 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
265 MAINT=$MAINTAINER_MODE_TRUE
266 AC_SUBST(MAINT)dnl
267]
268)
269
270# Define a conditional.
271
272AC_DEFUN(AM_CONDITIONAL,
273[AC_SUBST($1_TRUE)
274AC_SUBST($1_FALSE)
275if $2; then
276 $1_TRUE=
277 $1_FALSE='#'
278else
279 $1_TRUE='#'
280 $1_FALSE=
281fi])
282
This page took 0.07126 seconds and 5 git commands to generate.