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.
48 if [ x$next != x ]; then
53 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
54 srcdir=`echo $arg | sed 's/-*s[a-z]*=//'`
56 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
59 -target | --target | --targe | --targ | --tar | --ta | --t)
62 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
63 target=`echo $arg | sed 's/-*t[a-z]*=//'`
66 -with-gnu-ld | --with-gnu-ld | --with-gnu-l)
70 -gas | --gas | --ga | --g | -with-gnu-as | --with-gnu-as | -with-gnu-a)
74 -nfp | --nfp | --nf | --n)
79 # For `--with-foo=bar', do "with_foo='bar'".
80 # For `--with-fnord', do "with_fnord=yes".
81 # These variables may be examined by sysdep configure fragments.
82 eval `echo "$arg" | sed '{s/^-*//;s/-/_/g
83 s/^\([^=]*\)=\(.*\)$/\1='\''\2'\''/;s/^\([^=]*\)$/\1=yes/;}'`
89 -os-release=* | -os-releas=* | -os-relea=* | -os-rele=* | -os-rel=* \
90 | -os-re=* | -os-r=* | --os-release=* | --os-releas=* | --os-relea=* \
91 | --os-rele=* | --os-rel=* | --os-re=* | --os-r=*)
92 release=`echo $arg | sed 's/-*os-r[a-z]*=//'`
94 -os-release | -os-releas | -os-relea | -os-rele | -os-rel \
95 | -os-re | -os-r | --os-release | --os-releas | --os-relea \
96 | --os-rele | --os-rel | --os-re | --os-r)
100 -os-version=* | -os-versio=* | -os-versi=* | -os-vers=* | -os-ver=* \
101 | -os-ver=* | -os-ve=* | -os-v=* | --os-version=* | --os-versio=* \
102 | --os-versi=* | --os-vers=* | --os-ver=* | --os-ver=* | --os-ve=* \
104 version=`echo $arg | sed 's/-*os-v[a-z]*=//'`
106 -os-version | -os-versio | -os-versi | -os-vers | -os-ver \
107 | -os-ver | -os-ve | -os-v |--os-version | --os-versio \
108 | --os-versi | --os-vers | --os-ver | --os-ver | --os-ve | --os-v)
112 # For backward compatibility, also recognize exact --exec_prefix.
113 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
114 exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'`
116 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
120 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
121 prefix=`echo $arg | sed 's/[-a-z_]*=//'`
123 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
127 -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
128 # Autoconf-generated code below will test this.
133 echo "Invalid option \`$arg'" 1>&2
137 if [ ! "$target" ]; then
147 # NEXT will be set iff we have seen an option that wants an arg, but no arg.
149 echo "$0: the \`--${next}' option requires an argument" >&2
153 dnl This deals with setting srcdir if it needs to be set.
155 AC_PREPARE(features.h)
158 # Decanonicalize srcdir so we can tell when we are configuring in srcdir.
159 if [ "`(cd ${srcdir}; pwd)`" = "`pwd`" ]; then
163 if [ ! "$target" ]; then
164 target=`$srcdir/config.guess`
165 test -n "$target" && echo "No target given; guessing target is ${target}."
168 if [ "$lose" = yes -o ! "$target" ]; then
170 Usage: $prog [--srcdir=DIR] [--prefix=DIR] [--exec-prefix=DIR]
171 [--nfp] [--with-gnu-ld] [--with-gnu-as] TARGET" >&2
172 if [ -r config.status ]; then
173 cat config.status >&2
178 # Done parsing the arguments.
180 # This will get text that should go into config.make.
183 # Check for a --with-gmp argument and set gmp-srcdir in config.make.
185 yes) echo "$prog: --with-gmp requires an argument; use --with-gmp=DIRECTORY"
188 *) config_vars="$config_vars
189 gmp-srcdir = $with_gmp" ;;
192 # Canonicalize the configuration name.
193 config=`$srcdir/config.sub $target`
194 if [ ! "$config" ]; then
195 # config.sub has written an error message.
199 sysdep_dir=$srcdir/sysdeps
202 eval "`echo $config | \
203 sed 's/^\(.*\)-\(.*\)-\(.*\)$/\
204 config_machine=\1 config_vendor=\2 config_os=\3/'`"
206 # We keep the original values in `$config_*' and never modify them, so we
207 # can write them unchanged into config.make. Everything else uses
208 # $machine, $vendor, and $os, and changes them whenever convenient.
209 machine=$config_machine
210 vendor=$config_vendor
213 # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
214 os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
218 machine=i386/$machine ;;
220 machine=sparc/$machine ;;
222 machine=m68k/m68020 ;;
224 machine=m68k/$machine ;;
226 machine=m88k/m88100 ;;
228 machine=m88k/$machine ;;
230 machine=mips/r3000 ;;
232 machine=mips/$machine ;;
239 base_os=unix/bsd/bsd4.4 ;;
240 osf1* | sunos* | ultrix* | newsos* | dynix* | *bsd*)
242 linux* | sysv* | isc* | esix* | sco* | minix* | irix4*)
245 base_os=unix/sysv/sysv4 ;;
248 case "$os:$base_os" in
249 gnu* | linux* | bsd4.4* | *:bsd4.4)
254 # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
257 while o=`echo $tail | sed 's/\.[^.]*$//'`; [ $o != $tail ]; do
261 o=`echo $tail | sed 's/[0-9]*$//'`
262 if [ $o != $tail ]; then
266 # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
269 while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; [ "$b" ]; do
275 # For sparc/sparc9, try sparc/sparc9 and then sparc.
278 while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; [ "$m" ]; do
284 # Find what sysdep directories exist.
286 for b in $base ''; do
287 for v in /$vendor ''; do
288 for o in /$ostry ''; do
289 for m in $mach ''; do
290 if [ -d $sysdep_dir$b$v$o$m ]; then
291 sysnames="$sysnames $b$v$o$m"
292 [ "$o" -o "$b" ] && os_used=t
293 [ "$m" ] && machine_used=t
300 if [ ! "$os_used" -a "$os" != none ]; then
301 echo Operating system $os is not supported. >&2
304 if [ ! "$machine_used" -a "$machine" != none ]; then
305 echo The $machine is not supported. >&2
309 # We have now validated the configuration.
312 echo Configuring the GNU C library in $PWD
313 echo on `(hostname || uname -n) 2>/dev/null | sed 1q` for ${config}.
315 # Remove the leading slashes.
316 sysnames="`echo $sysnames | sed -e 's@^/@@' -e 's@ /@ @g'`"
318 # Prepend the machine's FPU directory unless --nfp.
319 if [ ! "$nfp" -a -d $sysdep_dir/$machine/fpu ]; then
320 sysnames="${machine}/fpu $sysnames"
323 # Expand the list of system names into a full list of directories
324 # from each element's parent name and Implies file (if present).
326 while [ $# -gt 0 ]; do
330 if [ -f $sysdep_dir/$name/Implies ]; then
331 # Collect more names from the `Implies' file (removing comments).
332 implied="`sed 's/#.*$//' < $sysdep_dir/$name/Implies`"
333 for x in $implied; do
334 test -d $sysdep_dir/$x || echo "Warning: $name implies nonexistent $x">&2
340 # Add NAME to the list of names.
343 # Find the parent of NAME, using the empty string if it has none.
344 parent="`echo $name | sed -n -e '/\//!q' -e 's=/[^/]*$==p'`"
346 # Append the names implied by NAME, and NAME's parent (if it has one),
347 # to the list of names to be processed (the argument list).
348 sysnames="`echo $* $implied $parent`"
349 if [ "$sysnames" != "" ]; then
354 # Add the default directories.
355 names="$names generic stub"
357 # Now uniquize the list.
360 for name in $names; do
361 if echo "$seen" | fgrep -x $name >/dev/null; then
362 # Already in the list.
366 if [ "$seen" = "" ]; then
367 seen="$name" sysnames="$name"
371 sysnames="$sysnames $name"
376 echo Using system-dependent files from directories:
377 for dir in $sysnames; do echo " $dir"; done
379 changequote([,])dnl The world is now safe for m4, and unsafe for shell.
380 dnl Be sure to add each macro used here to aclocal.m4 (which see).
382 dnl Without this hack, AC_PROG_INSTALL will expand ${srcdir} in the name.
383 define([AC_PROG_INSTALL_INSTALL_SH], ['$(..)install.sh -c'])
390 echo checking for signed size_t type
391 echo '#include <stddef.h>
392 FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
393 eval "$CPP conftest.c 2>/dev/null" \
394 | grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null \
396 dnl Do this by hand instead of AC_DEFINE so we can use -U to avoid warnings.
397 DEFS="$DEFS -U__SIZE_TYPE__ -D__SIZE_TYPE__=unsigned"
398 (echo '#undef __SIZE_TYPE__';
399 echo '#define __SIZE_TYPE__ unsigned') >> confdefs.h
400 test -n "$verbose" && echo ' using unsigned int for size_t'
404 AC_HEADER_EGREP(__gnuc_va_list, stdarg.h, [config_vars="$config_vars
405 stdarg.h = # The installed <stdarg.h> defines __gnuc_va_list."])
407 AC_COMPILE_CHECK([libc-friendly stddef.h],
408 [#define __need_size_t
409 #define __need_wchar_t
412 #include <stddef.h>], [size_t size; wchar_t wchar;
414 #error stddef.h ignored __need_*
416 if (&size == NULL || &wchar == NULL) abort ();],
417 [config_vars="$config_vars
418 stddef.h = # The installed <stddef.h> seems to be libc-friendly."
419 test -n "$verbose" && echo ' installed stddef.h looks friendly'])
421 changequote(,)dnl The world is again safe for shell scripts.
423 echo 'checking for need to use -P to assemble .S files'
424 cat > conftest.S <<EOF
425 #include "confdefs.h"
426 /* Nothing whatsoever. */
428 ${CC-cc} $CFLAGS -c conftest.S 2>/dev/null || {
429 config_vars="$config_vars
430 asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
431 test -n "$verbose" && echo ' using -P flag'
435 # Iterate over all the sysdep directories we will use, running their
436 # configure fragments, and looking for a uname implementation.
438 for dir in $sysnames; do
439 if test -r $sysdep_dir/$dir/configure; then
440 echo running configure fragment for $dir
441 . $sysdep_dir/$dir/configure
444 test -r $sysdep_dir/$dir/uname.c -o -r $sysdep_dir/$dir/uname.S && uname=$dir
447 # If we will use the generic uname implementation, we must figure out what
448 # it will say by examining the system, and write the results in config-name.h.
449 if [ "$uname" = generic ]; then
451 echo trying to guess OS release and version for uname
456 if [ ! "$release" -o ! "$version" ]; then
457 if [ -r /vmunix ]; then
458 kernel_id=`strings /vmunix | grep UNIX`
459 elif [ -r /dynix ]; then
460 kernel_id=`strings /dynix | grep DYNIX`
464 if [ "$kernel_id" ]; then
465 kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'`
466 kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'`
470 sysname=`echo $os | sed 's/[0-9.]*$//'`
471 if [ $sysname != $os ]; then
472 config_release=`echo $os | sed s/$sysname//`
475 if [ "$release" ]; then
478 elif [ x`echo "$config_release" | sed "s/^$kernel_release//"` \
479 != x$config_release ]; then
480 # The configuration release is a substring of the kernel release.
481 release=$kernel_release
482 elif [ x$config_release != x ]; then
483 release=$config_release
484 elif [ x$kernel_release != x ]; then
485 release=$kernel_release
488 I don't know what release of $sysname you are using. Please enter the
489 release number now. This information is used only for the \`uname' function,
490 so it is not critical.
493 if [ ! "$release" ]; then
498 if [ "$version" ]; then
501 elif [ ! "$kernel_version" ]; then
503 I don't know what version of $sysname $release you are using. Please enter
504 the version number now. This information is used only for the uname
505 function, so it is not critical.
508 if [ ! "$version" ]; then
512 version=$kernel_version
515 cat > config-name.h <<END
516 /* This file was generated automatically by configure. Do not edit.
517 This is used by the generic uname function. */
518 #define UNAME_SYSNAME "${sysname}"
519 #define UNAME_RELEASE "${release}"
520 #define UNAME_VERSION "${version}"
521 #define UNAME_MACHINE "${config_machine}-${config_vendor}"
524 system_name="$sysname $release version $version on $vendor $machine"
526 # Not generic uname. We don't need config-name.h at all.
530 if [ "$gnu_ld" ]; then
531 DEFS="$DEFS -DHAVE_GNU_LD"
533 if [ "$gnu_as" ]; then
534 DEFS="$DEFS -DHAVE_GNU_AS"
538 echo '# This file was generated automatically by configure. Do not edit.'
539 echo '# Put configuration parameters in configparms instead.'
540 echo "config-machine = ${config_machine}"
541 echo "config-vendor = ${config_vendor}"
542 echo "config-os = ${config_os}"
543 echo "config-sysdirs = ${sysnames}"
544 if [ "$prefix" ]; then
545 echo "prefix = ${prefix}"
547 if [ "$exec_prefix" ]; then
548 echo "exec_prefix = ${exec_prefix}"
550 echo "config-defines = ${DEFS}"
551 for var in INSTALL INSTALL_PROGRAM INSTALL_DATA RANLIB; do
552 eval "echo \"${var} = \${$var}\""
556 echo "Wrote config.make in $PWD."
559 if [ "$release" ]; then
560 switches="$switches --os-release='$release'"
562 if [ "$version" ]; then
563 switches="$switches --os-version='$version'"
566 if [ $srcdir != . ]; then
567 if [ $srcdir = .. ]; then
569 objdir=`basename $cwd`
574 # This file was generated automatically by configure. Do not edit.
578 \$(MAKE) -C \$(srcdir) objdir=\`pwd\` \$@
581 echo "Wrote Makefile in $PWD."
584 cat > config.status <<END
586 # This file was generated automatically by configure. Do not edit.
587 # The GNU C library was configured in $PWD for
588 # $system_name as follows:
589 $0 $configure_args $switches \$*
591 chmod a+x config.status
592 echo "Wrote config.status in $PWD."
595 dnl This gets rid of the random stuff autoconf has stuffed in weird places.
596 divert(-1)dnl AC_This is here so I can search for `AC_' to find the frobs.
598 dnl compile-command: "autoconf"