OSDN Git Service

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