1 dnl Autoconf sets the quotes to [ and ], which hoses shell commands.
2 dnl We get rid of the quotes altogether, and turn them on for AC_*.
6 # Configuration script for the GNU C Library.
7 dnl You can ignore the following line if you are reading this sentence.
8 # DO NOT EDIT! This script is generated from configure.in; edit that instead.
10 # Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
11 # This file is part of the GNU C Library.
13 # The GNU C Library is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU Library General Public License as
15 # published by the Free Software Foundation; either version 2 of the
16 # License, or (at your option) any later version.
18 # The GNU C Library is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 # Library General Public License for more details.
23 # You should have received a copy of the GNU Library General Public
24 # License along with the GNU C Library; see the file COPYING.LIB. If
25 # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
26 # Cambridge, MA 02139, USA.
29 # Configure the GNU C Library.
34 # All the standard GNU configure options are accepted but only
35 # --nfp, --with-gnu-ld, and --with-gnu-as are meaningful.
46 if [ x$next != x ]; then
51 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
52 srcdir=`echo $arg | sed 's/-*s[a-z]*=//'`
54 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
57 -target | --target | --targe | --targ | --tar | --ta | --t)
60 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
61 target=`echo $arg | sed 's/-*t[a-z]*=//'`
64 -with-gnu-ld | --with-gnu-ld | --with-gnu-l)
68 -gas | --gas | --ga | --g | -with-gnu-as | --with-gnu-as | -with-gnu-a)
72 -nfp | --nfp | --nf | --n)
77 # For `--with-foo=bar', do "with_foo='bar'".
78 # For `--with-fnord', do "with_fnord=yes".
79 # These variables may be examined by sysdep configure fragments.
80 eval `echo "$arg" | sed '{s/^-*//;s/-/_/g
81 s/^\([^=]*\)=\(.*\)$/\1='\''\2'\''/;s/^\([^=]*\)$/\1=yes/;}'`
87 # For backward compatibility, also recognize exact --exec_prefix.
88 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
89 exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'`
91 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
95 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
96 prefix=`echo $arg | sed 's/[-a-z_]*=//'`
98 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
102 -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
103 # Autoconf-generated code below will test this.
108 echo "Invalid option \`$arg'" 1>&2
112 if [ ! "$target" ]; then
122 # NEXT will be set iff we have seen an option that wants an arg, but no arg.
124 echo "$0: the \`--${next}' option requires an argument" >&2
128 dnl This deals with setting srcdir if it needs to be set.
130 AC_PREPARE(features.h)
134 # Decanonicalize srcdir so we can tell when we are configuring in srcdir.
135 if [ "`(cd ${srcdir}; pwd)`" = "`pwd`" ]; then
139 if [ ! "$target" ]; then
140 target=`$srcdir/config.guess`
141 test -n "$target" && echo "No target given; guessing target is ${target}."
144 if [ "$lose" = yes -o ! "$target" ]; then
146 Usage: $prog [--srcdir=DIR] [--prefix=DIR] [--exec-prefix=DIR]
147 [--nfp] [--with-gnu-ld] [--with-gnu-as] TARGET" >&2
148 if [ -r config.status ]; then
149 cat config.status >&2
154 # Done parsing the arguments.
156 # This will get text that should go into config.make.
159 # Check for a --with-gmp argument and set gmp-srcdir in config.make.
161 yes) echo "$prog: --with-gmp requires an argument; use --with-gmp=DIRECTORY"
164 *) config_vars="$config_vars
165 gmp-srcdir = $with_gmp" ;;
168 # Canonicalize the configuration name.
169 config=`$srcdir/config.sub $target`
170 if [ ! "$config" ]; then
171 # config.sub has written an error message.
175 sysdep_dir=$srcdir/sysdeps
178 eval "`echo $config | \
179 sed 's/^\(.*\)-\(.*\)-\(.*\)$/\
180 config_machine=\1 config_vendor=\2 config_os=\3/'`"
182 # We keep the original values in `$config_*' and never modify them, so we
183 # can write them unchanged into config.make. Everything else uses
184 # $machine, $vendor, and $os, and changes them whenever convenient.
185 machine=$config_machine
186 vendor=$config_vendor
189 # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
190 os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
192 # Expand the configuration machine name into a subdirectory by architecture
193 # type and particular chip.
196 machine=i386/$machine ;;
198 machine=sparc/$machine ;;
200 machine=m68k/m68020 ;;
202 machine=m68k/$machine ;;
204 machine=m88k/m88100 ;;
206 machine=m88k/$machine ;;
208 machine=mips/r3000 ;;
210 machine=mips/$machine ;;
217 base_os=unix/bsd/bsd4.4 ;;
218 osf1* | sunos* | ultrix* | newsos* | dynix* | *bsd*)
220 linux* | sysv* | isc* | esix* | sco* | minix* | irix4*)
223 base_os=unix/sysv/sysv4 ;;
226 case "$os:$base_os" in
227 gnu* | linux* | bsd4.4* | *:bsd4.4)
232 # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
235 while o=`echo $tail | sed 's/\.[^.]*$//'`; [ $o != $tail ]; do
239 o=`echo $tail | sed 's/[0-9]*$//'`
240 if [ $o != $tail ]; then
244 # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
247 while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; [ "$b" ]; do
253 # For sparc/sparc9, try sparc/sparc9 and then sparc.
256 while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; [ "$m" ]; do
262 # Find what sysdep directories exist.
264 for b in $base ''; do
265 for v in /$vendor ''; do
266 for o in /$ostry ''; do
267 for m in $mach ''; do
268 if [ -d $sysdep_dir$b$v$o$m ]; then
269 sysnames="$sysnames $b$v$o$m"
270 [ "$o" -o "$b" ] && os_used=t
271 [ "$m" ] && machine_used=t
278 if [ ! "$os_used" -a "$os" != none ]; then
279 echo Operating system $os is not supported. >&2
282 if [ ! "$machine_used" -a "$machine" != none ]; then
283 echo The $machine is not supported. >&2
287 # We have now validated the configuration.
290 echo Configuring the GNU C library in $PWD
291 echo on `(hostname || uname -n) 2>/dev/null | sed 1q` for ${config}.
293 # Remove the leading slashes.
294 sysnames="`echo $sysnames | sed -e 's@^/@@' -e 's@ /@ @g'`"
296 # Prepend the machine's FPU directory unless --nfp.
297 if [ ! "$nfp" ]; then
300 if [ -d $sysdep_dir$mach/fpu ]; then
301 fpu_dirs="$fpu_dirs $mach/fpu"
304 sysnames="`echo $fpu_dirs | sed -e 's,^/,,' -e 's, /,,g'` $sysnames"
307 # Expand the list of system names into a full list of directories
308 # from each element's parent name and Implies file (if present).
310 while [ $# -gt 0 ]; do
314 if [ -f $sysdep_dir/$name/Implies ]; then
315 # Collect more names from the `Implies' file (removing comments).
316 implied="`sed 's/#.*$//' < $sysdep_dir/$name/Implies`"
317 for x in $implied; do
318 test -d $sysdep_dir/$x || echo "Warning: $name implies nonexistent $x">&2
324 # Add NAME to the list of names.
327 # Find the parent of NAME, using the empty string if it has none.
328 parent="`echo $name | sed -n -e '/\//!q' -e 's=/[^/]*$==p'`"
330 # Add the names implied by NAME, and NAME's parent (if it has one), to
331 # the list of names to be processed (the argument list). We prepend the
332 # implied names to the list and append the parent. We want implied
333 # directories to come before further directories inferred from the
334 # configuration components; this ensures that for sysv4, unix/common
335 # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
337 sysnames="`echo $implied $* $parent`"
338 if [ "$sysnames" != "" ]; then
343 # Add the default directories.
344 names="$names generic stub"
346 # Now uniquize the list.
349 for name in $names; do
350 if echo "$seen" | fgrep -x $name >/dev/null; then
351 # Already in the list.
355 if [ "$seen" = "" ]; then
356 seen="$name" sysnames="$name"
360 sysnames="$sysnames $name"
365 echo Using system-dependent files from directories:
366 for dir in $sysnames; do echo " $dir"; done
368 changequote([,])dnl The world is now safe for m4, and unsafe for shell.
369 dnl Be sure to add each macro used here to aclocal.m4 (which see).
372 if [ "$INSTALL" = "${srcdir}/install.sh" ]; then
373 # The makefiles need to use a different form to find it in $srcdir.
374 INSTALL='$(..)./install.sh'
381 echo checking for signed size_t type
382 echo '#include <stddef.h>
383 FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
384 eval "$CPP conftest.c 2>/dev/null" \
385 | grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null \
387 dnl Do this by hand instead of AC_DEFINE so we can use -U to avoid warnings.
388 DEFS="$DEFS -U__SIZE_TYPE__ -D__SIZE_TYPE__=unsigned"
389 (echo '#undef __SIZE_TYPE__';
390 echo '#define __SIZE_TYPE__ unsigned') >> confdefs.h
391 test -n "$verbose" && echo ' using unsigned int for size_t'
395 AC_COMPILE_CHECK([libc-friendly stddef.h],
396 [#define __need_size_t
397 #define __need_wchar_t
400 #include <stddef.h>], [size_t size; wchar_t wchar;
402 #error stddef.h ignored __need_*
404 if (&size == NULL || &wchar == NULL) abort ();],
405 [config_vars="$config_vars
406 stddef.h = # The installed <stddef.h> seems to be libc-friendly."
407 test -n "$verbose" && echo ' installed stddef.h looks friendly'])
409 changequote(,)dnl The world is again safe for shell scripts.
411 echo 'checking for need to use -P to assemble .S files'
412 cat > conftest.S <<EOF
413 #include "confdefs.h"
414 /* Nothing whatsoever. */
416 ${CC-cc} $CFLAGS -c conftest.S 2>/dev/null || {
417 config_vars="$config_vars
418 asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
419 test -n "$verbose" && echo ' using -P flag'
423 # Iterate over all the sysdep directories we will use, running their
424 # configure fragments, and looking for a uname implementation.
426 for dir in $sysnames; do
427 if test -r $sysdep_dir/$dir/configure; then
428 echo running configure fragment for $dir
429 . $sysdep_dir/$dir/configure
432 test -r $sysdep_dir/$dir/uname.c -o -r $sysdep_dir/$dir/uname.S && uname=$dir
435 # If we will use the generic uname implementation, we must figure out what
436 # it will say by examining the system, and write the results in config-name.h.
437 if [ "$uname" = generic ]; then
439 echo trying to guess OS release and version for uname
444 if [ ! "$release" -o ! "$version" ]; then
445 if [ -r /vmunix ]; then
446 kernel_id=`strings /vmunix | grep UNIX`
447 elif [ -r /dynix ]; then
448 kernel_id=`strings /dynix | grep DYNIX`
452 if [ "$kernel_id" ]; then
453 kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'`
454 kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'`
458 sysname=`echo $os | sed 's/[0-9.]*$//'`
459 if [ $sysname != $os ]; then
460 config_release=`echo $os | sed s/$sysname//`
463 if [ "$release" ]; then
466 elif [ x`echo "$config_release" | sed "s/^$kernel_release//"` \
467 != x$config_release ]; then
468 # The configuration release is a substring of the kernel release.
469 release=$kernel_release
470 elif [ x$config_release != x ]; then
471 release=$config_release
472 elif [ x$kernel_release != x ]; then
473 release=$kernel_release
476 I don't know what release of $sysname you are using. Please enter the
477 release number now. This information is used only for the \`uname' function,
478 so it is not critical.
481 if [ ! "$release" ]; then
486 if [ "$version" ]; then
489 elif [ ! "$kernel_version" ]; then
491 I don't know what version of $sysname $release you are using. Please enter
492 the version number now. This information is used only for the uname
493 function, so it is not critical.
496 if [ ! "$version" ]; then
500 version=$kernel_version
503 cat > config-name.h <<END
504 /* This file was generated automatically by configure. Do not edit.
505 This is used by the generic uname function. */
506 #define UNAME_SYSNAME "${sysname}"
507 #define UNAME_RELEASE "${release}"
508 #define UNAME_VERSION "${version}"
509 #define UNAME_MACHINE "${config_machine}-${config_vendor}"
512 system_name="$sysname $release version $version on $vendor $machine"
514 # Not generic uname. We don't need config-name.h at all.
518 if [ "$gnu_ld" ]; then
519 DEFS="$DEFS -DHAVE_GNU_LD"
521 if [ "$gnu_as" ]; then
522 DEFS="$DEFS -DHAVE_GNU_AS"
526 echo '# This file was generated automatically by configure. Do not edit.'
527 echo '# Put configuration parameters in configparms instead.'
528 echo "config-machine = ${config_machine}"
529 echo "config-vendor = ${config_vendor}"
530 echo "config-os = ${config_os}"
531 echo "config-sysdirs = ${sysnames}"
532 if [ "$prefix" ]; then
533 echo "prefix = ${prefix}"
535 if [ "$exec_prefix" ]; then
536 echo "exec_prefix = ${exec_prefix}"
538 echo "config-defines = ${DEFS}"
539 for var in INSTALL INSTALL_PROGRAM INSTALL_DATA RANLIB; do
540 eval "echo \"${var} = \${$var}\""
544 echo "Wrote config.make in $PWD."
546 if [ $srcdir != . ]; then
547 if [ $srcdir = .. ]; then
549 objdir=`basename $cwd`
554 # This file was generated automatically by configure. Do not edit.
558 \$(MAKE) -C \$(srcdir) objdir=\`pwd\` \$@
561 echo "Wrote Makefile in $PWD."
564 cat > config.status <<END
566 # This file was generated automatically by configure. Do not edit.
567 # The GNU C library was configured in $PWD for
568 # $system_name as follows:
569 release=$release version=$version $0 $configure_args \$*
571 chmod a+x config.status
572 echo "Wrote config.status in $PWD."
575 dnl This gets rid of the random stuff autoconf has stuffed in weird places.
576 divert(-1)dnl AC_This is here so I can search for `AC_' to find the frobs.
578 dnl compile-command: "autoconf"