OSDN Git Service

2004-06-25 Artem B. Bityuckiy <dedekind@oktetlabs.ru>
[pf3gnuchains/pf3gnuchains3x.git] / newlib / libc / machine / necv70 / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
2
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 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.
7
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.
12
13 dnl This provides configure definitions used by all the newlib
14 dnl configure.in files.
15
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
19 dnl newlib directory.
20
21 AC_DEFUN(NEWLIB_CONFIGURE,
22 [
23 dnl Default to --enable-multilib
24 AC_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
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
40
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
49
50 dnl Support --enable-newlib-multithread
51 AC_ARG_ENABLE(newlib-multithread,
52 [  --enable-newlib-multithread        enable support for multiple threads],
53 [case "${enableval}" in
54   yes) newlib_multithread=yes ;;
55   no)  newlib_multithread=no ;;
56   *)   AC_MSG_ERROR(bad value ${enableval} for newlib-multithread option) ;;
57  esac], [newlib_multithread=yes])dnl
58
59 dnl Support --enable-newlib-elix-level
60 AC_ARG_ENABLE(newlib-elix-level,
61 [  --enable-newlib-elix-level         supply desired elix library level (1-4)],
62 [case "${enableval}" in
63   0)   newlib_elix_level=0 ;;
64   1)   newlib_elix_level=1 ;;
65   2)   newlib_elix_level=2 ;;
66   3)   newlib_elix_level=3 ;;
67   4)   newlib_elix_level=4 ;;
68   *)   AC_MSG_ERROR(bad value ${enableval} for newlib-elix-level option) ;;
69  esac], [newlib_elix_level=0])dnl
70
71 dnl Support --disable-newlib-io-float
72 AC_ARG_ENABLE(newlib-io-float,
73 [  --disable-newlib-io-float disable printf/scanf family float support],
74 [case "${enableval}" in
75   yes) newlib_io_float=yes ;;
76   no)  newlib_io_float=no ;;
77   *)   AC_MSG_ERROR(bad value ${enableval} for newlib-io-float option) ;;
78  esac], [newlib_io_float=yes])dnl
79
80 dnl Support --disable-newlib-supplied-syscalls
81 AC_ARG_ENABLE(newlib-supplied-syscalls,
82 [  --disable-newlib-supplied-syscalls disable newlib from supplying syscalls],
83 [case "${enableval}" in
84   yes) newlib_may_supply_syscalls=yes ;;
85   no)  newlib_may_supply_syscalls=no ;;
86   *)   AC_MSG_ERROR(bad value ${enableval} for newlib-supplied-syscalls option) ;;
87  esac], [newlib_may_supply_syscalls=yes])dnl
88
89 AM_CONDITIONAL(MAY_SUPPLY_SYSCALLS, test x[$]{newlib_may_supply_syscalls} = xyes)
90
91 dnl We may get other options which we don't document:
92 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
93
94 test -z "[$]{with_target_subdir}" && with_target_subdir=.
95
96 if test "[$]{srcdir}" = "."; then
97   if test "[$]{with_target_subdir}" != "."; then
98     newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
99   else
100     newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
101   fi
102 else
103   newlib_basedir="[$]{srcdir}/$1"
104 fi
105 AC_SUBST(newlib_basedir)
106
107 AC_CANONICAL_SYSTEM
108
109 AM_INIT_AUTOMAKE(newlib, 1.12.0)
110
111 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
112 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
113 # are probably using a cross compiler, which will not be able to fully
114 # link an executable.  This should really be fixed in autoconf
115 # itself.
116
117 AC_DEFUN(LIB_AC_PROG_CC,
118 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
119 AC_CHECK_PROG(CC, gcc, gcc)
120 if test -z "$CC"; then
121   AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
122   test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
123 fi
124
125 AC_PROG_CC_GNU
126
127 if test $ac_cv_prog_gcc = yes; then
128   GCC=yes
129 dnl Check whether -g works, even if CFLAGS is set, in case the package
130 dnl plays around with CFLAGS (such as to build both debugging and
131 dnl normal versions of a library), tasteless as that idea is.
132   ac_test_CFLAGS="${CFLAGS+set}"
133   ac_save_CFLAGS="$CFLAGS"
134   CFLAGS=
135   AC_PROG_CC_G
136   if test "$ac_test_CFLAGS" = set; then
137     CFLAGS="$ac_save_CFLAGS"
138   elif test $ac_cv_prog_cc_g = yes; then
139     CFLAGS="-g -O2"
140   else
141     CFLAGS="-O2"
142   fi
143 else
144   GCC=
145   test "${CFLAGS+set}" = set || CFLAGS="-g"
146 fi
147 ])
148
149 LIB_AC_PROG_CC
150
151 AC_CHECK_TOOL(AS, as)
152 AC_CHECK_TOOL(AR, ar)
153 AC_CHECK_TOOL(RANLIB, ranlib, :)
154
155 AC_PROG_INSTALL
156
157 AM_MAINTAINER_MODE
158
159 # We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
160 # at least currently, we never actually build a program, so we never
161 # need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
162 # fails, because we are probably configuring with a cross compiler
163 # which can't create executables.  So we include AC_EXEEXT to keep
164 # automake happy, but we don't execute it, since we don't care about
165 # the result.
166 if false; then
167   AC_EXEEXT
168 fi
169
170 . [$]{newlib_basedir}/configure.host
171
172 newlib_cflags="[$]{newlib_cflags} -fno-builtin"
173
174 NEWLIB_CFLAGS=${newlib_cflags}
175 AC_SUBST(NEWLIB_CFLAGS)
176
177 LDFLAGS=${ldflags}
178 AC_SUBST(LDFLAGS)
179
180 AM_CONDITIONAL(ELIX_LEVEL_0, test x[$]{newlib_elix_level} = x0)
181 AM_CONDITIONAL(ELIX_LEVEL_1, test x[$]{newlib_elix_level} = x1)
182 AM_CONDITIONAL(ELIX_LEVEL_2, test x[$]{newlib_elix_level} = x2)
183 AM_CONDITIONAL(ELIX_LEVEL_3, test x[$]{newlib_elix_level} = x3)
184 AM_CONDITIONAL(ELIX_LEVEL_4, test x[$]{newlib_elix_level} = x4)
185
186 AM_CONDITIONAL(USE_LIBTOOL, test x[$]{use_libtool} = xyes)
187
188 # Hard-code OBJEXT.  Normally it is set by AC_OBJEXT, but we
189 # use oext, which is set in configure.host based on the target platform.
190 OBJEXT=${oext}
191
192 AC_SUBST(OBJEXT)
193 AC_SUBST(oext)
194 AC_SUBST(aext)
195
196 AC_SUBST(libm_machine_dir)
197 AC_SUBST(machine_dir)
198 AC_SUBST(sys_dir)
199 ])
200
201 # Do all the work for Automake.  This macro actually does too much --
202 # some checks are only needed if your package does certain things.
203 # But this isn't really a big deal.
204
205 # serial 1
206
207 dnl Usage:
208 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
209
210 AC_DEFUN([AM_INIT_AUTOMAKE],
211 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
212 AC_REQUIRE([AC_PROG_INSTALL])
213 PACKAGE=[$1]
214 AC_SUBST(PACKAGE)
215 VERSION=[$2]
216 AC_SUBST(VERSION)
217 dnl test to see if srcdir already configured
218 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
219   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
220 fi
221 ifelse([$3],,
222 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
223 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
224 AC_REQUIRE([AM_SANITY_CHECK])
225 AC_REQUIRE([AC_ARG_PROGRAM])
226 dnl FIXME This is truly gross.
227 missing_dir=`cd $ac_aux_dir && pwd`
228 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
229 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
230 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
231 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
232 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
233 AC_REQUIRE([AC_PROG_MAKE_SET])])
234
235 # Copyright 2002  Free Software Foundation, Inc.
236
237 # This program is free software; you can redistribute it and/or modify
238 # it under the terms of the GNU General Public License as published by
239 # the Free Software Foundation; either version 2, or (at your option)
240 # any later version.
241
242 # This program is distributed in the hope that it will be useful,
243 # but WITHOUT ANY WARRANTY; without even the implied warranty of
244 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
245 # GNU General Public License for more details.
246
247 # You should have received a copy of the GNU General Public License
248 # along with this program; if not, write to the Free Software
249 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
250
251 # AM_AUTOMAKE_VERSION(VERSION)
252 # ----------------------------
253 # Automake X.Y traces this macro to ensure aclocal.m4 has been
254 # generated from the m4 files accompanying Automake X.Y.
255 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
256
257 # AM_SET_CURRENT_AUTOMAKE_VERSION
258 # -------------------------------
259 # Call AM_AUTOMAKE_VERSION so it can be traced.
260 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
261 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
262          [AM_AUTOMAKE_VERSION([1.4-p6])])
263
264 #
265 # Check to make sure that the build environment is sane.
266 #
267
268 AC_DEFUN([AM_SANITY_CHECK],
269 [AC_MSG_CHECKING([whether build environment is sane])
270 # Just in case
271 sleep 1
272 echo timestamp > conftestfile
273 # Do `set' in a subshell so we don't clobber the current shell's
274 # arguments.  Must try -L first in case configure is actually a
275 # symlink; some systems play weird games with the mod time of symlinks
276 # (eg FreeBSD returns the mod time of the symlink's containing
277 # directory).
278 if (
279    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
280    if test "[$]*" = "X"; then
281       # -L didn't work.
282       set X `ls -t $srcdir/configure conftestfile`
283    fi
284    if test "[$]*" != "X $srcdir/configure conftestfile" \
285       && test "[$]*" != "X conftestfile $srcdir/configure"; then
286
287       # If neither matched, then we have a broken ls.  This can happen
288       # if, for instance, CONFIG_SHELL is bash and it inherits a
289       # broken ls alias from the environment.  This has actually
290       # happened.  Such a system could not be considered "sane".
291       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
292 alias in your environment])
293    fi
294
295    test "[$]2" = conftestfile
296    )
297 then
298    # Ok.
299    :
300 else
301    AC_MSG_ERROR([newly created file is older than distributed files!
302 Check your system clock])
303 fi
304 rm -f conftest*
305 AC_MSG_RESULT(yes)])
306
307 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
308 dnl The program must properly implement --version.
309 AC_DEFUN([AM_MISSING_PROG],
310 [AC_MSG_CHECKING(for working $2)
311 # Run test in a subshell; some versions of sh will print an error if
312 # an executable is not found, even if stderr is redirected.
313 # Redirect stdin to placate older versions of autoconf.  Sigh.
314 if ($2 --version) < /dev/null > /dev/null 2>&1; then
315    $1=$2
316    AC_MSG_RESULT(found)
317 else
318    $1="$3/missing $2"
319    AC_MSG_RESULT(missing)
320 fi
321 AC_SUBST($1)])
322
323 # Define a conditional.
324
325 AC_DEFUN([AM_CONDITIONAL],
326 [AC_SUBST($1_TRUE)
327 AC_SUBST($1_FALSE)
328 if $2; then
329   $1_TRUE=
330   $1_FALSE='#'
331 else
332   $1_TRUE='#'
333   $1_FALSE=
334 fi])
335
336 # Add --enable-maintainer-mode option to configure.
337 # From Jim Meyering
338
339 # serial 1
340
341 AC_DEFUN([AM_MAINTAINER_MODE],
342 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
343   dnl maintainer-mode is disabled by default
344   AC_ARG_ENABLE(maintainer-mode,
345 [  --enable-maintainer-mode enable make rules and dependencies not useful
346                           (and sometimes confusing) to the casual installer],
347       USE_MAINTAINER_MODE=$enableval,
348       USE_MAINTAINER_MODE=no)
349   AC_MSG_RESULT($USE_MAINTAINER_MODE)
350   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
351   MAINT=$MAINTAINER_MODE_TRUE
352   AC_SUBST(MAINT)dnl
353 ]
354 )
355