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 ;;
225 base_os=standalone ;;
228 case "$os:$base_os" in
229 gnu* | linux* | bsd4.4* | *:bsd4.4)
234 # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
237 while o=`echo $tail | sed 's/\.[^.]*$//'`; [ $o != $tail ]; do
241 o=`echo $tail | sed 's/[0-9]*$//'`
242 if [ $o != $tail ]; then
246 # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
249 while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; [ "$b" ]; do
255 # For sparc/sparc9, try sparc/sparc9 and then sparc.
258 while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; [ "$m" ]; do
264 # Find what sysdep directories exist.
266 for b in $base ''; do
267 for v in /$vendor ''; do
268 for o in /$ostry ''; do
269 for m in $mach ''; do
270 if [ -d $sysdep_dir$b$v$o$m ]; then
271 sysnames="$sysnames $b$v$o$m"
272 [ "$o" -o "$b" ] && os_used=t
273 [ "$m" ] && machine_used=t
280 if [ ! "$os_used" -a "$os" != none ]; then
281 echo Operating system $os is not supported. >&2
284 if [ ! "$machine_used" -a "$machine" != none ]; then
285 echo The $machine is not supported. >&2
289 # We have now validated the configuration.
292 echo Configuring the GNU C library in $PWD
293 echo on `(hostname || uname -n) 2>/dev/null | sed 1q` for ${config}.
295 # Remove the leading slashes.
296 sysnames="`echo $sysnames | sed -e 's@^/@@' -e 's@ /@ @g'`"
298 # Prepend the machine's FPU directory unless --nfp.
299 if [ ! "$nfp" ]; then
302 if [ -d $sysdep_dir$m/fpu ]; then
303 fpu_dirs="$fpu_dirs $m/fpu"
306 sysnames="`echo $fpu_dirs | sed -e 's,^/,,' -e 's, /,,g'` $sysnames"
309 # Expand the list of system names into a full list of directories
310 # from each element's parent name and Implies file (if present).
312 while [ $# -gt 0 ]; do
316 if [ -f $sysdep_dir/$name/Implies ]; then
317 # Collect more names from the `Implies' file (removing comments).
318 implied="`sed 's/#.*$//' < $sysdep_dir/$name/Implies`"
319 for x in $implied; do
320 test -d $sysdep_dir/$x || echo "Warning: $name implies nonexistent $x">&2
326 # Add NAME to the list of names.
329 # Find the parent of NAME, using the empty string if it has none.
330 parent="`echo $name | sed -n -e '/\//!q' -e 's=/[^/]*$==p'`"
332 # Add the names implied by NAME, and NAME's parent (if it has one), to
333 # the list of names to be processed (the argument list). We prepend the
334 # implied names to the list and append the parent. We want implied
335 # directories to come before further directories inferred from the
336 # configuration components; this ensures that for sysv4, unix/common
337 # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
339 sysnames="`echo $implied $* $parent`"
340 if [ "$sysnames" != "" ]; then
345 # Add the default directories.
346 names="$names generic stub"
348 # Now uniquize the list.
351 for name in $names; do
352 if echo "$seen" | fgrep -x $name >/dev/null; then
353 # Already in the list.
357 if [ "$seen" = "" ]; then
358 seen="$name" sysnames="$name"
362 sysnames="$sysnames $name"
367 echo Using system-dependent files from directories:
368 for dir in $sysnames; do echo " $dir"; done
370 changequote([,])dnl The world is now safe for m4, and unsafe for shell.
371 dnl Be sure to add each macro used here to aclocal.m4 (which see).
374 [if [ "$INSTALL" = "${srcdir}/install.sh" ]; then
375 # The makefiles need to use a different form to find it in $srcdir.
376 INSTALL='$(..)./install.sh'
383 echo checking for signed size_t type
384 echo '#include <stddef.h>
385 FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
386 eval "$CPP conftest.c 2>/dev/null" \
387 | grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null \
389 dnl Do this by hand instead of AC_DEFINE so we can use -U to avoid warnings.
390 DEFS="$DEFS -U__SIZE_TYPE__ -D__SIZE_TYPE__=unsigned"
391 (echo '#undef __SIZE_TYPE__';
392 echo '#define __SIZE_TYPE__ unsigned') >> confdefs.h
393 test -n "$verbose" && echo ' using unsigned int for size_t'
397 AC_COMPILE_CHECK([libc-friendly stddef.h],
398 [#define __need_size_t
399 #define __need_wchar_t
402 #include <stddef.h>], [size_t size; wchar_t wchar;
404 #error stddef.h ignored __need_*
406 if (&size == NULL || &wchar == NULL) abort ();],
407 [config_vars="$config_vars
408 stddef.h = # The installed <stddef.h> seems to be libc-friendly."
409 test -n "$verbose" && echo ' installed stddef.h looks friendly'])
411 changequote(,)dnl The world is again safe for shell scripts.
413 echo 'checking for need to use -P to assemble .S files'
414 cat > conftest.S <<EOF
415 #include "confdefs.h"
416 /* Nothing whatsoever. */
418 ${CC-cc} $CFLAGS -c conftest.S 2>/dev/null || {
419 config_vars="$config_vars
420 asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
421 test -n "$verbose" && echo ' using -P flag'
425 # Iterate over all the sysdep directories we will use, running their
426 # configure fragments, and looking for a uname implementation.
428 for dir in $sysnames; do
429 if test -r $sysdep_dir/$dir/configure; then
430 echo running configure fragment for $dir
431 . $sysdep_dir/$dir/configure
434 test -r $sysdep_dir/$dir/uname.c -o -r $sysdep_dir/$dir/uname.S && uname=$dir
437 # If we will use the generic uname implementation, we must figure out what
438 # it will say by examining the system, and write the results in config-name.h.
439 if [ "$uname" = generic ]; then
441 echo trying to guess OS release and version for uname
446 if [ ! "$release" -o ! "$version" ]; then
447 if [ -r /vmunix ]; then
448 kernel_id=`strings /vmunix | grep UNIX`
449 elif [ -r /dynix ]; then
450 kernel_id=`strings /dynix | grep DYNIX`
454 if [ "$kernel_id" ]; then
455 kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'`
456 kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'`
460 sysname=`echo $os | sed 's/[0-9.]*$//'`
461 if [ $sysname != $os ]; then
462 config_release=`echo $os | sed s/$sysname//`
465 if [ "$release" ]; then
468 elif [ x`echo "$config_release" | sed "s/^$kernel_release//"` \
469 != x$config_release ]; then
470 # The configuration release is a substring of the kernel release.
471 release=$kernel_release
472 elif [ x$config_release != x ]; then
473 release=$config_release
474 elif [ x$kernel_release != x ]; then
475 release=$kernel_release
478 I don't know what release of $sysname you are using. Please enter the
479 release number now. This information is used only for the \`uname' function,
480 so it is not critical.
483 if [ ! "$release" ]; then
488 if [ "$version" ]; then
491 elif [ ! "$kernel_version" ]; then
493 I don't know what version of $sysname $release you are using. Please enter
494 the version number now. This information is used only for the uname
495 function, so it is not critical.
498 if [ ! "$version" ]; then
502 version=$kernel_version
505 cat > config-name.h <<END
506 /* This file was generated automatically by configure. Do not edit.
507 This is used by the generic uname function. */
508 #define UNAME_SYSNAME "${sysname}"
509 #define UNAME_RELEASE "${release}"
510 #define UNAME_VERSION "${version}"
511 #define UNAME_MACHINE "${config_machine}-${config_vendor}"
514 system_name="$sysname $release version $version on $vendor $machine"
516 # Not generic uname. We don't need config-name.h at all.
520 if [ "$gnu_ld" ]; then
521 DEFS="$DEFS -DHAVE_GNU_LD"
523 if [ "$gnu_as" ]; then
524 DEFS="$DEFS -DHAVE_GNU_AS"
528 echo '# This file was generated automatically by configure. Do not edit.'
529 echo '# Put configuration parameters in configparms instead.'
530 echo "config-machine = ${config_machine}"
531 echo "config-vendor = ${config_vendor}"
532 echo "config-os = ${config_os}"
533 echo "config-sysdirs = ${sysnames}"
534 if [ "$prefix" ]; then
535 echo "prefix = ${prefix}"
537 if [ "$exec_prefix" ]; then
538 echo "exec_prefix = ${exec_prefix}"
540 echo "config-defines = ${DEFS}"
541 for var in INSTALL INSTALL_PROGRAM INSTALL_DATA RANLIB; do
542 eval "echo \"${var} = \${$var}\""
546 echo "Wrote config.make in $PWD."
548 if [ $srcdir != . ]; then
549 if [ $srcdir = .. ]; then
551 objdir=`basename $cwd`
556 # This file was generated automatically by configure. Do not edit.
560 \$(MAKE) -C \$(srcdir) objdir=\`pwd\` \$@
563 echo "Wrote Makefile in $PWD."
566 cat > config.status <<END
568 # This file was generated automatically by configure. Do not edit.
569 # The GNU C library was configured in $PWD for
570 # $system_name as follows:
571 release=$release version=$version $0 $configure_args \$*
573 chmod a+x config.status
574 echo "Wrote config.status in $PWD."
577 dnl This gets rid of the random stuff autoconf has stuffed in weird places.
578 divert(-1)dnl AC_This is here so I can search for `AC_' to find the frobs.
580 dnl compile-command: "autoconf"