OSDN Git Service

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