1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.53)dnl dnl Minimum Autoconf version required.
4 AC_INIT([GNU C Library], [(see version.h)], [glibc])
5 AC_CONFIG_SRCDIR([include/features.h])
6 AC_CONFIG_HEADERS([config.h])
7 AC_CONFIG_AUX_DIR([scripts])
12 if test $host != $build; then
13 AC_CHECK_PROGS(BUILD_CC, gcc cc)
15 AC_SUBST(cross_compiling)
17 # We need the C++ compiler only for testing.
20 if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
21 AC_MSG_ERROR([you must configure in a separate build directory])
24 # This will get text that should go into config.make.
27 # Check for a --with-gd argument and set libgd-LDFLAGS in config.make.
29 AC_HELP_STRING([--with-gd=DIR],
30 [find libgd include dir and library with prefix DIR]),
34 *) libgd_include="-I$withval/include"
35 libgd_ldflags="-L$withval/lib" ;;
38 AC_ARG_WITH([gd-include],
39 AC_HELP_STRING([--with-gd-include=DIR],
40 [find libgd include files in DIR]),
42 case "$with_gd_include" in
44 *) libgd_include="-I$withval" ;;
48 AC_HELP_STRING([--with-gd-lib=DIR],
49 [find libgd library files in DIR]),
51 case "$with_gd_lib" in
53 *) libgd_ldflags="-L$withval" ;;
57 if test -n "$libgd_include"; then
58 config_vars="$config_vars
59 CFLAGS-memusagestat.c = $libgd_include"
61 if test -n "$libgd_ldflags"; then
62 config_vars="$config_vars
63 libgd-LDFLAGS = $libgd_ldflags"
66 dnl Arguments to specify presence of other packages/features.
68 AC_HELP_STRING([--with-fp],
69 [if using floating-point hardware @<:@default=yes@:>@]),
73 AC_ARG_WITH([binutils],
74 AC_HELP_STRING([--with-binutils=PATH],
75 [specify location of binutils (as and ld)]),
76 [path_binutils=$withval],
79 AC_HELP_STRING([--with-elf],
80 [if using the ELF object format]),
83 AC_ARG_WITH([selinux],
84 AC_HELP_STRING([--with-selinux],
85 [if building with SELinux support]),
86 [with_selinux=$withval],
89 AC_HELP_STRING([--with-xcoff],
90 [if using the XCOFF object format]),
94 AC_HELP_STRING([--without-cvs],
95 [if CVS should not be used]),
98 if test "$with_cvs" = yes; then
99 if test -d $srcdir/CVS && grep :pserver: $srcdir/CVS/Root > /dev/null
106 AC_ARG_WITH([headers],
107 AC_HELP_STRING([--with-headers=PATH],
108 [location of system headers to use
109 (for example /usr/src/linux/include)
110 @<:@default=compiler default@:>@]),
111 [sysheaders=$withval],
114 AC_ARG_ENABLE([sanity-checks],
115 AC_HELP_STRING([--disable-sanity-checks],
116 [really do not use threads (should not be used except in special situations) @<:@default=yes@:>@]),
117 [enable_sanity=$enableval],
120 AC_SUBST(enable_check_abi)
121 AC_ARG_ENABLE([check-abi],
122 AC_HELP_STRING([--enable-check-abi],
123 [do "make check-abi" in "make check" (no/warn/yes)
124 @<:@default=no@:>@]),
125 [enable_check_abi=$enableval],
126 [enable_check_abi=no])
128 dnl Arguments to enable or disable building the static, shared, profiled,
129 dnl and -fomit-frame-pointer libraries.
130 dnl I've disabled this for now since we cannot build glibc without static
131 dnl libraries built in the moment.
132 dnl AC_ARG_ENABLE([static],
133 dnl AC_HELP_STRING([--enable-static],
134 dnl [build static library @<:@default=yes@:>@]),
135 dnl [static=$enableval],
138 AC_ARG_ENABLE([shared],
139 AC_HELP_STRING([--enable-shared],
140 [build shared library @<:@default=yes if GNU ld & ELF@:>@]),
143 AC_ARG_ENABLE([profile],
144 AC_HELP_STRING([--enable-profile],
145 [build profiled library @<:@default=no@:>@]),
146 [profile=$enableval],
148 AC_ARG_ENABLE([omitfp],
149 AC_HELP_STRING([--enable-omitfp],
150 [build undebuggable optimized library @<:@default=no@:>@]),
153 AC_ARG_ENABLE([bounded],
154 AC_HELP_STRING([--enable-bounded],
155 [build with runtime bounds checking @<:@default=no@:>@]),
156 [bounded=$enableval],
158 AC_ARG_ENABLE([versioning],
159 AC_HELP_STRING([--disable-versioning],
160 [do not include versioning information in the library objects @<:@default=yes if supported@:>@]),
161 [enable_versioning=$enableval],
162 [enable_versioning=yes])
164 AC_ARG_ENABLE([oldest-abi],
165 AC_HELP_STRING([--enable-oldest-abi=ABI],
166 [configure the oldest ABI supported @<:@e.g. 2.2@:>@ @<:@default=glibc default@:>@]),
167 [oldest_abi=$enableval],
169 if test "$oldest_abi" = yes || test "$oldest_abi" = no; then
172 AC_DEFINE_UNQUOTED(GLIBC_OLDEST_ABI, "$oldest_abi")
176 AC_ARG_ENABLE([stackguard-randomization],
177 AC_HELP_STRING([--enable-stackguard-randomization],
178 [initialize __stack_chk_guard canary with a random number at program start]),
179 [enable_stackguard_randomize=$enableval],
180 [enable_stackguard_randomize=no])
181 if test "$enable_stackguard_randomize" = yes; then
182 AC_DEFINE(ENABLE_STACKGUARD_RANDOMIZE)
185 dnl Generic infrastructure for drop-in additions to libc.
186 AC_ARG_ENABLE([add-ons],
187 AC_HELP_STRING([--enable-add-ons@<:@=DIRS...@:>@],
188 [configure and build add-ons in DIR1,DIR2,...
189 search for add-ons if no parameter given]),
190 , [enable_add_ons=yes])
192 dnl Let the user avoid using TLS. Don't know why but...
194 AC_HELP_STRING([--with-tls],
195 [enable support for TLS]),
199 AC_ARG_WITH([__thread],
200 AC_HELP_STRING([--without-__thread],
201 [do not use TLS features even when supporting them]),
202 [use__thread=$withval],
205 AC_ARG_ENABLE([hidden-plt],
206 AC_HELP_STRING([--disable-hidden-plt],
207 [do not hide internal function calls to avoid PLT]),
210 if test "x$hidden" = xno; then
214 AC_ARG_ENABLE([bind-now],
215 AC_HELP_STRING([--enable-bind-now],
216 [disable lazy relocations in DSOs]),
217 [bindnow=$enableval],
221 dnl On some platforms we cannot use dynamic loading. We must provide
222 dnl static NSS modules.
223 AC_ARG_ENABLE([static-nss],
224 AC_HELP_STRING([--enable-static-nss],
225 [build static NSS modules @<:@default=no@:>@]),
226 [static_nss=$enableval],
228 dnl Enable static NSS also if we build no shared objects.
229 if test x"$static_nss" = xyes || test x"$shared" = xno; then
231 AC_DEFINE(DO_STATIC_NSS)
234 AC_ARG_ENABLE([force-install],
235 AC_HELP_STRING([--disable-force-install],
236 [don't force installation of files from this package, even if they are older than the installed files]),
237 [force_install=$enableval],
239 AC_SUBST(force_install)
241 dnl On some platforms we allow dropping compatibility with all kernel
243 AC_ARG_ENABLE([kernel],
244 AC_HELP_STRING([--enable-kernel=VERSION],
245 [compile for compatibility with kernel not older than VERSION]),
246 [minimum_kernel=$enableval],
248 dnl Prevent unreasonable values.
249 if test "$minimum_kernel" = yes || test "$minimum_kernel" = no; then
250 # Better nothing than this.
253 if test "$minimum_kernel" = current; then
254 minimum_kernel=`uname -r 2>/dev/null` || minimum_kernel=
258 dnl For the development we sometimes want gcc to issue even more warnings.
259 dnl This is not the default since many of the extra warnings are not
261 AC_ARG_ENABLE([all-warnings],
262 AC_HELP_STRING([--enable-all-warnings],
263 [enable all useful warnings gcc can issue]),
264 [all_warnings=$enableval],
266 AC_SUBST(all_warnings)
268 AC_ARG_ENABLE([multi-arch],
269 AC_HELP_STRING([--enable-multi-arch],
270 [enable single DSO with optimizations for multiple architectures]),
271 [multi_arch=$enableval],
273 if test x"$multi_arch" = xyes; then
274 AC_DEFINE(USE_MULTIARCH)
275 multi_arch_d=/multiarch
279 AC_ARG_ENABLE([experimental-malloc],
280 AC_HELP_STRING([--enable-experimental-malloc],
281 [enable experimental malloc features]),
282 [experimental_malloc=$enableval],
284 AC_SUBST(experimental_malloc)
286 AC_ARG_ENABLE([nss-crypt],
287 AC_HELP_STRING([--enable-nss-crypt],
288 [enable libcrypt to use nss]),
289 [nss_crypt=$enableval],
291 if test x$nss_crypt = xyes; then
292 nss_includes=-I$(nss-config --includedir 2>/dev/null)
293 if test $? -ne 0; then
294 AC_MSG_ERROR([cannot find include directory with nss-config])
297 CFLAGS="$CFLAGS $nss_includes"
298 AC_COMPILE_IFELSE([typedef int PRBool;
300 #include <nsslowhash.h>
301 void f (void) { NSSLOW_Init (); }],
302 libc_cv_nss_crypt=yes,
304 cannot find NSS headers with lowlevel hash function interfaces]))
306 LIBS="$LIBS -lfreebl3"
307 AC_LINK_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
309 #include <nsslowhash.h>],
311 libc_cv_nss_crypt=yes,
313 cannot link program using lowlevel NSS hash functions]))
319 AC_SUBST(libc_cv_nss_crypt)
321 # The way shlib-versions is used to generate soversions.mk uses a
322 # fairly simplistic model for name recognition that can't distinguish
323 # i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
324 # of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can
325 # tell. This doesn't get used much beyond that, so it's fairly safe.
330 host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'`
334 # We keep the original values in `$config_*' and never modify them, so we
335 # can write them unchanged into config.make. Everything else uses
336 # $machine, $vendor, and $os, and changes them whenever convenient.
337 config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
339 # Don't allow vendor == "unknown"
340 test "$config_vendor" = unknown && config_vendor=
341 config_os="`echo $config_os | sed 's/^unknown-//'`"
343 # Some configurations imply other options.
345 # i586-linuxaout is mangled into i586-pc-linux-gnuaout
346 linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*)
348 gnu* | linux* | freebsd* | netbsd* | sysv4* | solaris2* | irix6*)
349 # These systems (almost) always use the ELF format.
353 # These systems are always xcoff
359 # The configure fragment of an add-on port can modify these to supplement
360 # or override the table in the case statement below. No fragment should
361 # ever change the config_* variables, however.
362 machine=$config_machine
363 vendor=$config_vendor
367 # config.guess on some IBM machines says `rs6000' instead of `powerpc'.
369 if test "$machine" = rs6000; then
373 # Braindead PowerPC box with absolutely no FPU.
374 case "$machine-$host_os" in
382 AS_HELP_STRING([--with-cpu=CPU], [select code for CPU variant]),
385 yes|'') AC_MSG_ERROR([--with-cpu requires an argument]) ;;
387 *) submachine="$withval" ;;
391 # An add-on can set this when it wants to disable the sanity check below.
394 dnl Having this here, though empty, makes sure that if add-ons' fragments
395 dnl do AC_CONFIG_SUBDIRS([some-dir]), which just sets $subdirs, then
396 dnl our AC_OUTPUT will actually use it.
399 case "$enable_add_ons" in
402 add_ons=`cd $srcdir && ls -d 2> /dev/null */configure */sysdeps |
403 sed 's@/[[^/]]*$@@' | sort | uniq`
404 add_ons_automatic=yes
406 *) add_ons=`echo "$enable_add_ons" | sed 's/,/ /g'`
407 add_ons_automatic=no ;;
413 if test x"$add_ons" != x; then
414 for f in $add_ons; do
419 *** It seems that you're using an old \`crypt' add-on. crypt is now
420 *** part of glibc and using the old add-on will not work with this
421 *** release. Start again with fresh sources and without the old
422 *** \`crypt' add-on.])
426 *** It seems that you're using an old \`localedata' add-on. localedata
427 *** is now part of glibc and using the old add-on will not work with
428 *** this release. Start again with fresh sources and without the old
429 *** \`localedata' add-on.])
434 # Now source each add-on's configure fragment.
435 # The fragments can use $srcdir/$libc_add_on to find themselves,
436 # and test $add_ons_automatic to see if they were explicitly requested.
437 # A fragment can clear (or even change) $libc_add_on to affect
438 # whether it goes into the list to be actually used in the build.
440 for libc_add_on in $add_ons; do
441 # Test whether such a directory really exists.
442 # It can be absolute, or relative to $srcdir, or relative to the build dir.
443 case "$libc_add_on" in
445 libc_add_on_srcdir=$libc_add_on
448 test -d "$srcdir/$libc_add_on" || {
449 if test -d "$libc_add_on"; then
450 libc_add_on="`pwd`/$libc_add_on"
452 AC_MSG_ERROR(add-on directory \"$libc_add_on\" does not exist)
455 libc_add_on_srcdir=$srcdir/$libc_add_on
459 libc_add_on_frag=$libc_add_on_srcdir/configure
460 libc_add_on_canonical=
461 if test -r "$libc_add_on_frag"; then
462 AC_MSG_NOTICE(running configure fragment for add-on $libc_add_on)
463 libc_add_on_canonical=unknown
465 . "$libc_add_on_frag"
466 test -z "$libc_add_on" || {
467 configured_add_ons="$configured_add_ons $libc_add_on"
468 if test "x$libc_add_on_canonical" = xunknown; then
469 AC_MSG_ERROR(fragment must set \$libc_add_on_canonical)
471 for d in $libc_add_on_subdirs; do
472 case "$libc_add_on" in
473 /*) subdir_srcdir="$libc_add_on" ;;
474 *) subdir_srcdir="\$(..)$libc_add_on" ;;
478 d="${libc_add_on_canonical:-$libc_add_on}"
484 subdir_srcdir="$subdir_srcdir/$d"
487 d=`echo "$d" | sed 's@/*$@@;s@^.*/@@'`
488 add_on_subdirs="$add_on_subdirs $d"
489 test "$subdir_srcdir" = "\$(..)$d" || config_vars="$config_vars
490 $d-srcdir = $subdir_srcdir"
494 if test -n "$libc_add_on"; then
495 if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2> /dev/null`
497 AC_MSG_CHECKING(add-on $libc_add_on for preconfigure fragments)
498 for frag in $frags; do
499 name=`echo "$frag" | sed 's@/[[^/]]*$@@;s@^.*/@@'`
500 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
505 use_add_ons="$use_add_ons $libc_add_on"
506 add_ons_pfx="$add_ons_pfx $libc_add_on/"
507 test -z "$libc_add_on_canonical" ||
508 add_ons_sfx="$add_ons_sfx /$libc_add_on_canonical"
511 # Use echo to strip excess whitespace.
512 add_ons="`echo $use_add_ons`"
515 AC_SUBST(add_on_subdirs)
519 ### I put this here to prevent those annoying emails from people who cannot
520 ### read and try to compile glibc on unsupported platforms. --drepper
522 ### By using the undocumented --enable-hacker-mode option for configure
523 ### one can skip this test to make the configuration not fail for unsupported
526 if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then
527 case "$machine-$host_os" in
528 *-linux* | *-gnu* | arm*-none* | powerpc-aix4.3.*)
531 echo "*** The GNU C library is currently not available for this platform."
532 echo "*** So far nobody cared to port it and if there is no volunteer it"
533 echo "*** might never happen. So, if you have interest to see glibc on"
534 echo "*** this platform visit"
535 echo "*** http://www.gnu.org/software/libc/porting.html"
536 echo "*** and join the group of porters"
542 dnl We need to use [ and ] for other purposes for a while now.
544 # Expand the configuration machine name into a subdirectory by architecture
545 # type and particular chip. If an add-on configure fragment already set
546 # base_machine, we don't change it.
547 test -n "$base_machine" || case "$machine" in
548 a29k | am29000) base_machine=a29k machine=a29k ;;
549 c3[012]) base_machine=cx0 machine=cx0/c30 ;;
550 c4[04]) base_machine=cx0 machine=cx0/c40 ;;
551 i[34567]86) base_machine=i386 machine=i386/$machine ;;
552 ia64) base_machine=ia64 machine=ia64 ;;
553 m88???) base_machine=m88k machine=m88k/$machine ;;
554 m88k) base_machine=m88k machine=m88k/m88100 ;;
555 powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;;
556 powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;;
557 s390) base_machine=s390 machine=s390/s390-32 ;;
558 s390x) base_machine=s390 machine=s390/s390-64 ;;
559 sh3*) base_machine=sh machine=sh/sh3 ;;
560 sh4*) base_machine=sh machine=sh/sh4 ;;
562 base_machine=sparc machine=sparc/sparc32 ;;
563 sparcv8 | supersparc | hypersparc)
564 base_machine=sparc machine=sparc/sparc32/sparcv8 ;;
565 sparcv8plus | sparcv8plusa | sparcv9)
566 base_machine=sparc machine=sparc/sparc32/sparcv9 ;;
567 sparcv8plusb | sparcv9b)
568 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;;
570 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v ;;
572 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v2 ;;
574 base_machine=sparc machine=sparc/sparc64 ;;
576 base_machine=sparc machine=sparc/sparc64/sparcv9b ;;
578 base_machine=sparc machine=sparc/sparc64/sparcv9v ;;
580 base_machine=sparc machine=sparc/sparc64/sparcv9v2 ;;
581 *) base_machine=$machine ;;
584 AC_SUBST(base_machine)
586 if test "$base_machine" = "i386"; then
587 AC_DEFINE(USE_REGPARMS)
590 # Compute the list of sysdep directories for this configuration.
591 # This can take a while to compute.
592 sysdep_dir=$srcdir/sysdeps
593 AC_MSG_CHECKING(sysdep dirs)
594 dnl We need to use [ and ] for other purposes for a while now.
596 # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
597 os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
599 test "x$base_os" != x || case "$os" in
602 netbsd* | 386bsd* | freebsd* | bsdi*)
603 base_os=unix/bsd/bsd4.4 ;;
604 osf* | sunos* | ultrix* | newsos* | dynix* | *bsd*)
606 sysv* | isc* | esix* | sco* | minix* | irix4* | linux*)
609 base_os=unix/sysv/irix6/$os ;;
611 base_os=unix/sysv/sysv4 ;;
613 base_os=unix/sysv/hpux/$os ;;
615 base_os=unix/sysv/aix/aix4.3 ;;
617 base_os=standalone ;;
620 # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
623 while o=`echo $tail | sed 's/\.[^.]*$//'`; test $o != $tail; do
627 o=`echo $tail | sed 's/[0-9]*$//'`
628 if test $o != $tail; then
631 # For linux-gnu, try linux-gnu, then linux.
632 o=`echo $tail | sed 's/-.*$//'`
633 if test $o != $tail; then
637 # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
640 while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$b"; do
646 # For sparc/sparc32, try sparc/sparc32 and then sparc.
648 tail=$machine${submachine:+/$submachine}
649 while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
651 # Prepend the machine's FPU directory unless --without-fp.
652 if test "$with_fp" = yes; then
655 mach="$mach /$1/nofpu"
661 dnl We are done with glob and regexp uses of [ and ]; return to autoconf.
664 # Find what sysdep directories exist.
667 for b in $base ''; do
668 for m0 in $mach ''; do
669 for v in /$vendor ''; do
670 test "$v" = / && continue
671 for o in /$ostry ''; do
672 test "$o" = / && continue
673 for m in $multi_arch_d $mach ''; do
674 for d in $add_ons_pfx ''; do
675 for a in $add_ons_sfx ''; do
676 if test -n "$m0$m0sub$b$v$o$m$msub"; then
677 try_srcdir="${srcdir}/"
681 try="${d}sysdeps$m0$m0sub$b$v$o$m$msub$a"
682 test -n "$enable_debug_configure" &&
683 echo "$0 [DEBUG]: try $try" >&2
684 if test -d "$try_srcdir$try"; then
685 sysnames="$sysnames $try"
686 { test -n "$o" || test -n "$b"; } && os_used=t
687 { test -n "$m" || test -n "$m0"; } && machine_used=t
689 x*/$submachine) submachine_used=t ;;
691 if test -n "$d"; then
692 case "$sysnames_add_ons" in
694 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
707 if test -z "$os_used" && test "$os" != none; then
708 AC_MSG_ERROR(Operating system $os is not supported.)
710 if test -z "$machine_used" && test "$machine" != none; then
711 AC_MSG_ERROR(The $machine is not supported.)
713 if test -z "$submachine_used" && test -n "$submachine"; then
714 AC_MSG_ERROR(The $submachine subspecies of $host_cpu is not supported.)
718 # We have now validated the configuration.
721 # If using ELF, look for an `elf' subdirectory of each machine directory.
722 # We prepend these rather than inserting them whereever the machine appears
723 # because things specified by the machine's ELF ABI should override
724 # OS-specific things, and should always be the same for any OS on the
725 # machine (otherwise what's the point of an ABI?).
726 if test "$elf" = yes; then
728 for d in $add_ons_pfx ''; do
730 if test -d $srcdir/${d}sysdeps$m/elf; then
731 elf_dirs="$elf_dirs ${d}sysdeps$m/elf"
735 sysnames="`echo $elf_dirs | sed -e 's,//,/,g'` $sysnames"
739 # Expand the list of system names into a full list of directories
740 # from each element's parent name and Implies file (if present).
743 while test $# -gt 0; do
747 case " $names " in *" $name "*)
748 # Already in the list.
752 # Report each name as we discover it, so there is no long pause in output.
753 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
755 name_base=`echo $name | sed -e 's@\(.*sysdeps\)/.*@\1@'`
759 *) xsrcdir=$srcdir/ ;;
761 test -n "$enable_debug_configure" &&
762 echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2
764 if test -f $xsrcdir$name/Implies; then
765 # Collect more names from the `Implies' file (removing comments).
766 implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`"
768 for x in $implied_candidate; do
770 if test -d $xsrcdir$name_base/$x; then
771 implied="$implied $name_base/$x";
774 for d in $add_ons_pfx ''; do
778 *) try_srcdir=$srcdir/ ;;
780 test -n "$enable_debug_configure" &&
781 echo "[DEBUG]: $name implied $x try($d) {$try_srcdir}$try" >&2
782 if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
784 implied="$implied $try"
786 case "$sysnames_add_ons" in
788 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
792 if test $found = no; then
793 AC_MSG_WARN($name/Implies specifies nonexistent $x)
800 # Add NAME to the list of names.
803 # Find the parent of NAME, using the empty string if it has none.
805 parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
808 # Add the names implied by NAME, and NAME's parent (if it has one), to
809 # the list of names to be processed (the argument list). We prepend the
810 # implied names to the list and append the parent. We want implied
811 # directories to come before further directories inferred from the
812 # configuration components; this ensures that for sysv4, unix/common
813 # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
815 sysnames="`echo $implied $* $parent`"
816 test -n "$sysnames" && set $sysnames
819 # Add the default directories.
820 default_sysnames=sysdeps/generic
821 if test "$elf" = yes; then
822 default_sysnames="sysdeps/generic/elf $default_sysnames"
824 sysnames="$names $default_sysnames"
826 # The other names were emitted during the scan.
827 AC_MSG_RESULT($default_sysnames)
829 # Collect the list of add-ons that supply partial sysdeps trees.
831 for add_on in $add_ons; do
834 *) xsrcdir="$srcdir/" ;;
837 test -d "$xsrcdir$add_on/sysdeps" || {
838 case "$configured_add_ons " in
841 AC_MSG_ERROR(add-on $add_on has no configure fragment or sysdeps tree)
847 sysdeps_add_ons="$sysdeps_add_ons $add_on"
848 case "$sysnames_add_ons" in
851 AC_MSG_WARN(add-on $add_on contributed no sysdeps directories)
856 for d in $sysnames; do
858 $add_on/sysdeps/*) ;;
861 (cd "$xsrcdir$d" && for f in *[[!~]]; do
865 test -d "$ff" || { test -e "$ff" && exit 88; }
869 test -d "$f" || { test -e "$f" && exit 88; }
873 if test $? -eq 88; then
878 if test $found = no; then
879 AC_MSG_WARN(add-on $add_on contributed no useful sysdeps directories)
882 AC_SUBST(sysdeps_add_ons)
888 if test "$INSTALL" = "${srcdir}/scripts/install-sh -c"; then
889 # The makefiles need to use a different form to find it in $srcdir.
890 INSTALL='\$(..)./scripts/install-sh -c'
895 AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
897 # Accept binutils 2.13 or newer.
898 AC_CHECK_PROG_VER(AS, $AS, --version,
899 [GNU assembler.* \([0-9]*\.[0-9.]*\)],
900 [2.1[3-9]*], AS=: critic_missing="$critic_missing as")
901 AC_CHECK_PROG_VER(LD, $LD, --version,
902 [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
903 [2.1[3-9]*], LD=: critic_missing="$critic_missing ld")
905 # We need the physical current working directory. We cannot use the
906 # "pwd -P" shell builtin since that's not portable. Instead we try to
907 # find a pwd binary. Note that assigning to the PWD environment
908 # variable might have some interesting side effects, so we don't do
910 AC_PATH_PROG(PWD_P, pwd, no)
911 if test "$PWD_P" = no; then
912 AC_MSG_ERROR(*** A pwd binary could not be found.)
915 # These programs are version sensitive.
917 AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
918 [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* ],
919 critic_missing="$critic_missing gcc")
920 AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
921 [GNU Make[^0-9]*\([0-9][0-9.]*\)],
922 [3.79* | 3.[89]*], critic_missing="$critic_missing make")
924 AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
925 [GNU gettext.* \([0-9]*\.[0-9.]*\)],
926 [0.10.3[6-9]* | 0.10.[4-9][0-9]* | 0.1[1-9]* | 0.[2-9][0-9]* | [1-9].*],
927 MSGFMT=: aux_missing="$aux_missing msgfmt")
928 AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
929 [GNU texinfo.* \([0-9][0-9.]*\)],
931 MAKEINFO=: aux_missing="$aux_missing makeinfo")
932 AC_CHECK_PROG_VER(SED, sed, --version,
933 [GNU sed version \([0-9]*\.[0-9.]*\)],
934 [3.0[2-9]*|3.[1-9]*|[4-9]*],
935 SED=: aux_missing="$aux_missing sed")
937 AC_CHECK_PROGS(AUTOCONF, autoconf, no)
939 xno|x|x:) AUTOCONF=no ;;
942 whether $AUTOCONF${ACFLAGS:+ }$ACFLAGS works, libc_cv_autoconf_works, [dnl
943 if (cd $srcdir; $AUTOCONF $ACFLAGS configure.in > /dev/null 2>&1); then
944 libc_cv_autoconf_works=yes
946 libc_cv_autoconf_works=no
948 test $libc_cv_autoconf_works = yes || AUTOCONF=no
951 if test "x$with_cvs" = xyes && test "x$AUTOCONF" = xno; then
952 # If --without-cvs they probably won't change configure.in, so no complaints.
953 aux_missing="$aux_missing autoconf"
956 test -n "$critic_missing" && AC_MSG_ERROR([
957 *** These critical programs are missing or too old:$critic_missing
958 *** Check the INSTALL file for required versions.])
960 test -n "$aux_missing" && AC_MSG_WARN([
961 *** These auxiliary programs are missing or incompatible versions:$aux_missing
962 *** some features will be disabled.
963 *** Check the INSTALL file for required versions.])
965 # if using special system headers, find out the compiler's sekrit
966 # header directory and add that to the list. NOTE: Only does the right
967 # thing on a system that doesn't need fixincludes. (Not presently a problem.)
968 if test -n "$sysheaders"; then
969 SYSINCLUDES=-nostdinc
970 for d in include include-fixed; do
971 i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
972 SYSINCLUDES="$SYSINCLUDES -isystem $i"
974 SYSINCLUDES="$SYSINCLUDES \
975 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
976 if test -n "$CXX"; then
977 cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
978 cxxmachine=`$CXX -dumpmachine 2>&AS_MESSAGE_LOG_FD` &&
979 cxxheaders=`$CXX -print-file-name=../../../../include/c++/`"$cxxversion" &&
980 CXX_SYSINCLUDES="-isystem $cxxheaders \
981 -isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
984 AC_SUBST(SYSINCLUDES)
985 AC_SUBST(CXX_SYSINCLUDES)
987 # check if ranlib is necessary
988 AC_CACHE_CHECK(whether ranlib is necessary, libc_cv_ranlib_necessary, [dnl
989 cat > conftest.c <<EOF
994 $CC $CFLAGS $CPPFLAGS -c conftest.c
995 $AR cr conftest.a conftest.o
996 cp conftest.a conftest2.a
998 if cmp -s conftest.a conftest2.a; then
999 libc_cv_ranlib_necessary=no
1001 libc_cv_ranlib_necessary=yes
1004 if test "$libc_cv_ranlib_necessary" = no; then
1008 # Test if LD_LIBRARY_PATH contains the notation for the current directory
1009 # since this would lead to problems installing/building glibc.
1010 # LD_LIBRARY_PATH contains the current directory if one of the following
1012 # - one of the terminals (":" and ";") is the first or last sign
1013 # - two terminals occur directly after each other
1014 # - the path contains an element with a dot in it
1015 AC_MSG_CHECKING(LD_LIBRARY_PATH variable)
1017 case ${LD_LIBRARY_PATH} in
1018 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
1019 ld_library_path_setting="contains current directory"
1022 ld_library_path_setting="ok"
1026 AC_MSG_RESULT($ld_library_path_setting)
1027 if test "$ld_library_path_setting" != "ok"; then
1029 *** LD_LIBRARY_PATH shouldn't contain the current directory when
1030 *** building glibc. Please change the environment variable
1031 *** and run configure again.])
1034 AC_CACHE_CHECK(whether GCC supports -static-libgcc, libc_cv_gcc_static_libgcc, [dnl
1035 if $CC -v -static-libgcc 2>&1 | grep -q 'unrecognized option.*static-libgcc'; then
1036 libc_cv_gcc_static_libgcc=
1038 libc_cv_gcc_static_libgcc=-static-libgcc
1040 AC_SUBST(libc_cv_gcc_static_libgcc)
1042 AC_PATH_PROG(BASH_SHELL, bash, no)
1043 if test "$BASH_SHELL" != no &&
1044 $BASH_SHELL -c 'test "$BASH_VERSINFO" \
1045 && test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then
1046 libc_cv_have_bash2=yes
1048 libc_cv_have_bash2=no
1050 AC_SUBST(libc_cv_have_bash2)
1052 dnl We need a ksh compatible shell for tzselect.
1053 if test "$BASH_SHELL" = no; then
1054 AC_PATH_PROG(KSH, ksh, no)
1055 if test "$KSH" = no; then
1058 libc_cv_have_ksh=yes
1063 libc_cv_have_ksh=yes
1065 AC_SUBST(libc_cv_have_ksh)
1068 AC_PATH_PROG(PERL, perl, no)
1069 if test "$PERL" != no &&
1070 (eval `$PERL -V:apiversion`; test `expr "$apiversion" \< 5` -ne 0); then
1073 AC_PATH_PROG(INSTALL_INFO, install-info, no,
1074 $PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin)
1075 AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin)
1077 AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl
1078 echo '#include <stddef.h>
1079 FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
1080 if eval "$ac_cpp conftest.c 2>/dev/null" \
1081 | grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null; then
1082 libc_cv_signed_size_t=no
1084 libc_cv_signed_size_t=yes
1087 if test $libc_cv_signed_size_t = yes; then
1088 dnl Do this by hand instead of AC_DEFINE so can add #undef to avoid warnings.
1089 cat >> confdefs.h <<\EOF
1090 #undef __SIZE_TYPE__
1091 #define __SIZE_TYPE__ unsigned
1095 AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl
1097 [#define __need_size_t
1098 #define __need_wchar_t
1101 #include <stddef.h>], [size_t size; wchar_t wchar;
1103 #error stddef.h ignored __need_*
1105 if (&size == NULL || &wchar == NULL) abort ();],
1106 libc_cv_friendly_stddef=yes,
1107 libc_cv_friendly_stddef=no)])
1108 if test $libc_cv_friendly_stddef = yes; then
1109 config_vars="$config_vars
1110 override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
1113 AC_CACHE_CHECK(whether we need to use -P to assemble .S files,
1114 libc_cv_need_minus_P, [dnl
1115 cat > conftest.S <<EOF
1116 #include "confdefs.h"
1117 /* Nothing whatsoever. */
1119 if AC_TRY_COMMAND(${CC-cc} $CPPFLAGS $ASFLAGS -c conftest.S 1>&AS_MESSAGE_LOG_FD); then
1120 libc_cv_need_minus_P=no
1122 libc_cv_need_minus_P=yes
1125 if test $libc_cv_need_minus_P = yes; then
1126 config_vars="$config_vars
1127 asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
1130 AC_MSG_CHECKING(whether .text pseudo-op must be used)
1131 AC_CACHE_VAL(libc_cv_dot_text, [dnl
1132 cat > conftest.s <<EOF
1136 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1137 libc_cv_dot_text=.text
1140 if test -z "$libc_cv_dot_text"; then
1146 AC_CACHE_CHECK(for assembler global-symbol directive,
1147 libc_cv_asm_global_directive, [dnl
1148 libc_cv_asm_global_directive=UNKNOWN
1149 for ac_globl in .globl .global .EXPORT; do
1150 cat > conftest.s <<EOF
1155 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1156 libc_cv_asm_global_directive=${ac_globl}
1159 test $libc_cv_asm_global_directive != UNKNOWN && break
1161 if test $libc_cv_asm_global_directive = UNKNOWN; then
1162 AC_MSG_ERROR(cannot determine asm global directive)
1164 AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${libc_cv_asm_global_directive})
1167 AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl
1168 cat > conftest.s <<EOF
1171 .set glibc_conftest_frobozz,foo
1172 $libc_cv_asm_global_directive glibc_conftest_frobozz
1174 # The alpha-dec-osf1 assembler gives only a warning for `.set'
1175 # (but it doesn't work), so we must do a linking check to be sure.
1176 cat > conftest1.c <<\EOF
1177 extern int glibc_conftest_frobozz;
1178 void _start() { glibc_conftest_frobozz = 1; }
1180 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1181 -nostartfiles -nostdlib \
1182 -o conftest conftest.s conftest1.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1183 libc_cv_asm_set_directive=yes
1185 libc_cv_asm_set_directive=no
1188 if test $libc_cv_asm_set_directive = yes; then
1189 AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
1192 AC_CACHE_CHECK(for assembler .type directive prefix,
1193 libc_cv_asm_type_prefix, [dnl
1194 libc_cv_asm_type_prefix=no
1195 for ac_try_prefix in '@' '%' '#'; do
1196 cat > conftest.s <<EOF
1198 ${libc_cv_asm_global_directive} foo
1199 .type foo, ${ac_try_prefix}object
1204 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1205 libc_cv_asm_type_prefix=${ac_try_prefix}
1208 test "x$libc_cv_asm_type_prefix" != xno && break
1210 if test "x$libc_cv_asm_type_prefix" != xno; then
1211 AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix})
1214 # For the multi-arch option we need support in the assembler.
1215 if test "$multi_arch" = yes; then
1216 if test "x$libc_cv_asm_type_prefix" != xno; then
1217 AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support],
1218 libc_cv_asm_gnu_indirect_function, [dnl
1219 cat > conftest.s <<EOF
1220 .type foo,%gnu_indirect_function
1222 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
1224 libc_cv_asm_gnu_indirect_function=yes
1226 libc_cv_asm_gnu_indirect_function=no
1230 libc_cv_asm_gnu_indirect_function=no
1232 if test x"$libc_cv_asm_gnu_indirect_function" != xyes; then
1233 AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
1237 AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
1238 [cat > conftest.s <<EOF
1241 .symver _sym,sym@VERS
1243 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1244 libc_cv_asm_symver_directive=yes
1246 libc_cv_asm_symver_directive=no
1249 AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl
1250 if test $libc_cv_asm_symver_directive = yes; then
1251 cat > conftest.s <<EOF
1254 .symver _sym,sym@VERS
1256 cat > conftest.map <<EOF
1265 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1266 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
1267 -o conftest.so conftest.o
1268 -nostartfiles -nostdlib
1269 -Wl,--version-script,conftest.map
1270 1>&AS_MESSAGE_LOG_FD]);
1272 libc_cv_ld_version_script_option=yes
1274 libc_cv_ld_version_script_option=no
1277 libc_cv_ld_version_script_option=no
1280 libc_cv_ld_version_script_option=no
1283 if test $shared != no &&
1284 test $libc_cv_asm_symver_directive = yes &&
1285 test $libc_cv_ld_version_script_option = yes &&
1286 test $enable_versioning = yes; then
1288 AC_DEFINE(DO_VERSIONING)
1292 AC_SUBST(VERSIONING)
1294 if test $elf = yes && test $shared != no && test $VERSIONING = no; then
1296 *** WARNING: You should not compile GNU libc without versioning. Not using
1297 *** versioning will introduce incompatibilities so that old binaries
1298 *** will not run anymore.
1299 *** For versioning you need recent binutils (binutils-2.8.1.0.23 or newer)."
1301 if test $elf = yes; then
1302 AC_CACHE_CHECK(for .previous assembler directive,
1303 libc_cv_asm_previous_directive, [dnl
1304 cat > conftest.s <<EOF
1305 .section foo_section
1308 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1309 libc_cv_asm_previous_directive=yes
1311 libc_cv_asm_previous_directive=no
1314 if test $libc_cv_asm_previous_directive = yes; then
1315 AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
1317 AC_CACHE_CHECK(for .popsection assembler directive,
1318 libc_cv_asm_popsection_directive, [dnl
1319 cat > conftest.s <<EOF
1320 .pushsection foo_section
1323 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1324 libc_cv_asm_popsection_directive=yes
1326 libc_cv_asm_popsection_directive=no
1329 if test $libc_cv_asm_popsection_directive = yes; then
1330 AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
1333 AC_CACHE_CHECK(for .protected and .hidden assembler directive,
1334 libc_cv_asm_protected_directive, [dnl
1335 cat > conftest.s <<EOF
1341 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1342 libc_cv_asm_protected_directive=yes
1344 AC_MSG_ERROR(assembler support for symbol visibility is required)
1348 if test $libc_cv_asm_protected_directive = yes; then
1349 AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
1350 libc_cv_visibility_attribute,
1351 [cat > conftest.c <<EOF
1352 int foo __attribute__ ((visibility ("hidden"))) = 1;
1353 int bar __attribute__ ((visibility ("protected"))) = 1;
1355 libc_cv_visibility_attribute=no
1356 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1357 if grep '\.hidden.*foo' conftest.s >/dev/null; then
1358 if grep '\.protected.*bar' conftest.s >/dev/null; then
1359 libc_cv_visibility_attribute=yes
1365 if test $libc_cv_visibility_attribute != yes; then
1366 AC_MSG_ERROR(compiler support for visibility attribute is required)
1370 if test $libc_cv_visibility_attribute = yes; then
1371 AC_CACHE_CHECK(for broken __attribute__((visibility())),
1372 libc_cv_broken_visibility_attribute,
1373 [cat > conftest.c <<EOF
1375 int bar (int x) __asm__ ("foo") __attribute__ ((visibility ("hidden")));
1376 int bar (int x) { return x; }
1378 libc_cv_broken_visibility_attribute=yes
1379 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s1>&AS_MESSAGE_LOG_FD); then
1381 if grep '\.hidden[ _]foo' conftest.s >/dev/null; then
1383 libc_cv_broken_visibility_attribute=no
1386 rm -f conftest.c conftest.s
1388 if test $libc_cv_broken_visibility_attribute = yes; then
1389 AC_MSG_ERROR(working compiler support for visibility attribute is required)
1393 AC_CACHE_CHECK(for broken __attribute__((alias())),
1394 libc_cv_broken_alias_attribute,
1395 [cat > conftest.c <<EOF
1396 extern int foo (int x) __asm ("xyzzy");
1397 int bar (int x) { return x; }
1398 extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
1400 extern __typeof (dfoo) dfoo __asm ("abccb");
1403 libc_cv_broken_alias_attribute=yes
1404 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1405 if grep 'xyzzy' conftest.s >/dev/null &&
1406 grep 'abccb' conftest.s >/dev/null; then
1407 libc_cv_broken_alias_attribute=no
1410 rm -f conftest.c conftest.s
1412 if test $libc_cv_broken_alias_attribute = yes; then
1413 AC_MSG_ERROR(working alias attribute support required)
1416 if test $libc_cv_visibility_attribute = yes; then
1417 AC_CACHE_CHECK(whether to put _rtld_local into .sdata section,
1418 libc_cv_have_sdata_section,
1419 [echo "int i;" > conftest.c
1420 libc_cv_have_sdata_section=no
1421 if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
1422 | grep '\.sdata' >/dev/null; then
1423 libc_cv_have_sdata_section=yes
1425 rm -f conftest.c conftest.so
1427 if test $libc_cv_have_sdata_section = yes; then
1428 AC_DEFINE(HAVE_SDATA_SECTION)
1432 AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
1433 libc_cv_initfini_array, [dnl
1434 cat > conftest.c <<EOF
1435 int _start (void) { return 0; }
1436 int __start (void) { return 0; }
1437 int foo (void) { return 1; }
1438 int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
1440 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c
1441 -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
1443 if readelf -S conftest | fgrep INIT_ARRAY > /dev/null; then
1444 libc_cv_initfini_array=yes
1446 libc_cv_initfini_array=no
1449 libc_cv_initfini_array=no
1452 if test $libc_cv_initfini_array != yes; then
1453 AC_MSG_ERROR([Need linker with .init_array/.fini_array support.])
1456 AC_CACHE_CHECK(for libunwind-support in compiler,
1457 libc_cv_cc_with_libunwind, [
1458 cat > conftest.c <<EOF
1459 int main (void) { return 0; }
1461 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
1462 conftest.c -v 2>&1 >/dev/null | grep -q " -lunwind "; then
1463 libc_cv_cc_with_libunwind=yes
1465 libc_cv_cc_with_libunwind=no
1468 AC_SUBST(libc_cv_cc_with_libunwind)
1469 if test $libc_cv_cc_with_libunwind = yes; then
1470 AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
1473 AC_CACHE_CHECK(for -z nodelete option,
1474 libc_cv_z_nodelete, [dnl
1475 cat > conftest.c <<EOF
1476 int _start (void) { return 42; }
1478 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1479 -fPIC -shared -o conftest.so conftest.c
1480 -nostartfiles -nostdlib
1481 -Wl,--enable-new-dtags,-z,nodelete 1>&AS_MESSAGE_LOG_FD])
1483 libc_cv_z_nodelete=yes
1485 AC_MSG_ERROR(linker with -z nodelete support required)
1489 AC_CACHE_CHECK(for -z nodlopen option,
1490 libc_cv_z_nodlopen, [dnl
1491 cat > conftest.c <<EOF
1492 int _start (void) { return 42; }
1494 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1495 -fPIC -shared -o conftest.so conftest.c
1496 -nostartfiles -nostdlib
1497 -Wl,--enable-new-dtags,-z,nodlopen 1>&AS_MESSAGE_LOG_FD])
1499 libc_cv_z_nodlopen=yes
1501 AC_MSG_ERROR(linker with -z nodlopen support required)
1505 AC_CACHE_CHECK(for -z initfirst option,
1506 libc_cv_z_initfirst, [dnl
1507 cat > conftest.c <<EOF
1508 int _start (void) { return 42; }
1510 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1511 -fPIC -shared -o conftest.so conftest.c
1512 -nostartfiles -nostdlib
1513 -Wl,--enable-new-dtags,-z,initfirst 1>&AS_MESSAGE_LOG_FD])
1515 libc_cv_z_initfirst=yes
1517 AC_MSG_ERROR(linker with -z initfirst support required)
1521 case "$base_machine" in
1523 i[34567]86 | x86_64 | powerpc* | s390* | sparc* | alpha*)
1525 AC_CACHE_CHECK(for -z relro option,
1526 libc_cv_z_relro, [dnl
1528 if AC_TRY_COMMAND([${CC-cc} -v --help 2>&1|grep "z relro" 1>&AS_MESSAGE_LOG_FD])
1530 if AC_TRY_COMMAND([${CC-cc} -Wl,--verbose 2>&1|grep DATA_SEGMENT_RELRO_END 1>&AS_MESSAGE_LOG_FD])
1535 if test "$libc_cv_z_relro" = no; then
1536 AC_MSG_ERROR(linker with -z relro support required)
1542 AC_CACHE_CHECK(for -Bgroup option,
1543 libc_cv_Bgroup, [dnl
1544 cat > conftest.c <<EOF
1545 int _start (void) { return 42; }
1547 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1548 -fPIC -shared -o conftest.so conftest.c
1549 -Wl,-Bgroup -nostdlib 1>&AS_MESSAGE_LOG_FD])
1556 AC_SUBST(libc_cv_Bgroup)
1558 AC_CACHE_CHECK(for libgcc_s suffix,
1559 libc_cv_libgcc_s_suffix, [dnl
1560 cat > conftest.c <<EOF
1561 int main (void) { return 0; }
1564 libc_cv_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1565 -fPIC -shared -shared-libgcc -o conftest.so \
1566 conftest.c -v 2>&1 >/dev/null \
1567 | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
1570 AC_SUBST(libc_cv_libgcc_s_suffix)
1572 AC_CACHE_CHECK(for --as-needed option,
1573 libc_cv_as_needed, [dnl
1574 cat > conftest.c <<EOF
1575 int main (void) { return 0; }
1577 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1578 -fPIC -shared -o conftest.so conftest.c
1579 -lgcc_s$libc_cv_libgcc_s_suffix -Wl,--as-needed
1580 -nostdlib 1>&AS_MESSAGE_LOG_FD])
1582 libc_cv_as_needed=yes
1584 libc_cv_as_needed=no
1587 AC_SUBST(libc_cv_as_needed)
1590 AC_CACHE_CHECK(whether --noexecstack is desirable for .S files,
1591 libc_cv_as_noexecstack, [dnl
1592 cat > conftest.c <<EOF
1595 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS
1596 -S -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD]) \
1597 && grep -q .note.GNU-stack conftest.s \
1598 && AC_TRY_COMMAND([${CC-cc} $ASFLAGS -Wa,--noexecstack
1599 -c -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD])
1601 libc_cv_as_noexecstack=yes
1603 libc_cv_as_noexecstack=no
1606 if test $libc_cv_as_noexecstack = yes; then
1607 ASFLAGS_config="$ASFLAGS_config -Wa,--noexecstack"
1609 AC_SUBST(ASFLAGS_config)
1611 AC_CACHE_CHECK(for -z combreloc,
1612 libc_cv_z_combreloc, [dnl
1613 cat > conftest.c <<EOF
1614 extern int bar (int);
1616 int foo (void) { return bar (mumble); }
1618 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1619 -fPIC -shared -o conftest.so conftest.c
1620 -nostdlib -nostartfiles
1621 -Wl,-z,combreloc 1>&AS_MESSAGE_LOG_FD])
1623 dnl The following test is a bit weak. We must use a tool which can test
1624 dnl cross-platform since the gcc used can be a cross compiler. Without
1625 dnl introducing new options this is not easily doable. Instead use a tool
1626 dnl which always is cross-platform: readelf. To detect whether -z combreloc
1627 dnl look for a section named .rel.dyn.
1628 if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
1629 libc_cv_z_combreloc=yes
1631 libc_cv_z_combreloc=no
1634 libc_cv_z_combreloc=no
1637 if test "$libc_cv_z_combreloc" = yes; then
1638 AC_DEFINE(HAVE_Z_COMBRELOC)
1640 AC_SUBST(libc_cv_z_combreloc)
1642 AC_CACHE_CHECK(for -z execstack,
1643 libc_cv_z_execstack, [dnl
1644 cat > conftest.c <<EOF
1645 int _start (void) { return 42; }
1647 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1648 -fPIC -shared -o conftest.so conftest.c
1649 -Wl,-z,execstack -nostdlib
1650 1>&AS_MESSAGE_LOG_FD])
1652 libc_cv_z_execstack=yes
1654 libc_cv_z_execstack=no
1657 AC_SUBST(libc_cv_z_execstack)
1659 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
1660 cat > conftest.c <<EOF
1662 main () { return 0;}
1664 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
1665 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
1673 AC_SUBST(libc_cv_fpie)
1675 AC_CACHE_CHECK(for --hash-style option,
1676 libc_cv_hashstyle, [dnl
1677 cat > conftest.c <<EOF
1678 int _start (void) { return 42; }
1680 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1681 -fPIC -shared -o conftest.so conftest.c
1682 -Wl,--hash-style=both -nostdlib 1>&AS_MESSAGE_LOG_FD])
1684 libc_cv_hashstyle=yes
1686 libc_cv_hashstyle=no
1689 AC_SUBST(libc_cv_hashstyle)
1692 AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl
1693 cat > conftest.c <<EOF
1696 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder -fno-section-anchors
1697 conftest.c 1>&AS_MESSAGE_LOG_FD])
1699 libc_cv_fno_toplevel_reorder=yes
1701 libc_cv_fno_toplevel_reorder=no
1704 if test $libc_cv_fno_toplevel_reorder = yes; then
1705 fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors"
1707 fno_unit_at_a_time=-fno-unit-at-a-time
1709 AC_SUBST(fno_unit_at_a_time)
1711 AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
1712 cat > conftest.c <<EOF
1714 main () { return 0;}
1716 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -Werror -fstack-protector
1717 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
1724 AC_SUBST(libc_cv_ssp)
1726 AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
1727 cat > conftest.c <<EOF
1729 #ifdef __GNUC_GNU_INLINE__
1730 main () { return 0;}
1735 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -std=gnu99 -fgnu89-inline
1736 -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD])
1738 libc_cv_gnu89_inline=yes
1740 libc_cv_gnu89_inline=no
1743 if test $libc_cv_gnu89_inline = yes; then
1744 libc_cv_gnu89_inline=-fgnu89-inline
1746 libc_cv_gnu89_inline=
1748 AC_SUBST(libc_cv_gnu89_inline)
1750 if test $elf != yes; then
1751 AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
1752 [AC_TRY_COMPILE(, [asm (".section .init");
1753 asm (".section .fini");
1754 asm ("${libc_cv_dot_text}");],
1755 libc_cv_have_initfini=yes,
1756 libc_cv_have_initfini=no)])
1757 AC_SUBST(libc_cv_have_initfini)dnl
1758 if test $libc_cv_have_initfini = yes; then
1759 AC_DEFINE(HAVE_INITFINI)
1763 if test $elf = yes; then
1764 AC_CACHE_CHECK(whether cc puts quotes around section names,
1765 libc_cv_have_section_quotes,
1766 [cat > conftest.c <<EOF
1767 static const int foo
1768 __attribute__ ((section ("bar"))) = 1;
1770 if ${CC-cc} -S conftest.c -o conftest.s; then
1771 if grep '\.section.*"bar"' conftest.s >/dev/null; then
1772 libc_cv_have_section_quotes=yes
1774 libc_cv_have_section_quotes=no
1777 libc_cv_have_section_quotes=unknown
1781 if test $libc_cv_have_section_quotes = yes; then
1782 AC_DEFINE(HAVE_SECTION_QUOTES)
1786 dnl AC_CHECK_ASM_UNDERSCORE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1787 AC_DEFUN(AC_CHECK_ASM_UNDERSCORE,
1788 [cat > conftest.$ac_ext <<EOF
1789 dnl This sometimes fails to find confdefs.h, for some reason.
1790 dnl [#]line $LINENO "[$]0"
1791 [#]line $LINENO "configure"
1792 #include "confdefs.h"
1793 void underscore_test(void) {
1796 if AC_TRY_EVAL(ac_compile); then
1797 if grep _underscore_test conftest* >/dev/null; then
1798 ifelse([$1], , :, [rm -f conftest*
1801 ifelse([$2], , , [rm -f conftest*
1805 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
1806 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
1807 ifelse([$2], , , [rm -f conftest*
1812 if test $elf = yes; then
1813 libc_cv_asm_underscores=no
1815 if test $ac_cv_prog_cc_works = yes; then
1816 AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1817 [AC_TRY_LINK([asm ("_glibc_foobar:");], [glibc_foobar ();],
1818 libc_cv_asm_underscores=yes,
1819 libc_cv_asm_underscores=no)])
1821 AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1822 [AC_CHECK_ASM_UNDERSCORE(libc_cv_asm_underscores=yes,
1823 libc_cv_asm_underscores=no)])
1826 if test $libc_cv_asm_underscores = no; then
1827 AC_DEFINE(NO_UNDERSCORES)
1830 if test $elf = yes; then
1831 libc_cv_weak_symbols=yes
1834 AC_CACHE_CHECK(for assembler .weak directive, libc_cv_asm_weak_directive,
1836 cat > conftest.s <<EOF
1838 ${libc_cv_asm_global_directive} foo
1841 .weak bar; bar = foo
1843 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1844 libc_cv_asm_weak_directive=yes
1846 libc_cv_asm_weak_directive=no
1850 if test $libc_cv_asm_weak_directive = no; then
1851 AC_CACHE_CHECK(for assembler .weakext directive,
1852 libc_cv_asm_weakext_directive,
1854 cat > conftest.s <<EOF
1856 ${libc_cv_asm_global_directive} foo
1860 ${libc_cv_asm_global_directive} baz
1863 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1864 libc_cv_asm_weakext_directive=yes
1866 libc_cv_asm_weakext_directive=no
1872 if test $libc_cv_asm_weak_directive = yes; then
1873 AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
1874 elif test $libc_cv_asm_weakext_directive = yes; then
1875 AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)
1878 AC_CACHE_CHECK(whether CFI directives are supported, libc_cv_asm_cfi_directives, [dnl
1880 sparc/sparc64*) cfi_offset=2047;;
1883 cat > conftest.s <<EOF
1885 .type func,%function
1889 .cfi_rel_offset 1, $cfi_offset
1892 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1893 libc_cv_asm_cfi_directives=yes
1895 libc_cv_asm_cfi_directives=no
1898 if test $libc_cv_asm_cfi_directives = yes; then
1899 AC_DEFINE(HAVE_ASM_CFI_DIRECTIVES)
1902 AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
1903 cat > conftest.c <<\EOF
1908 dnl No \ in command here because it ends up inside ''.
1909 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1910 -nostdlib -nostartfiles -Wl,--no-whole-archive
1911 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1912 libc_cv_ld_no_whole_archive=yes
1914 libc_cv_ld_no_whole_archive=no
1917 if test $libc_cv_ld_no_whole_archive = yes; then
1918 no_whole_archive=-Wl,--no-whole-archive
1920 AC_SUBST(no_whole_archive)dnl
1922 AC_CACHE_CHECK(for gcc -fexceptions, libc_cv_gcc_exceptions, [dnl
1923 cat > conftest.c <<\EOF
1928 dnl No \ in command here because it ends up inside ''.
1929 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1930 -nostdlib -nostartfiles -fexceptions
1931 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1932 libc_cv_gcc_exceptions=yes
1934 libc_cv_gcc_exceptions=no
1937 if test $libc_cv_gcc_exceptions = yes; then
1938 exceptions=-fexceptions
1940 AC_SUBST(exceptions)dnl
1942 if test "$host_cpu" = powerpc ; then
1943 # Check for a bug present in at least versions 2.8.x of GCC
1944 # and versions 1.0.x of EGCS.
1945 AC_CACHE_CHECK(whether clobbering cr0 causes problems,libc_cv_c_asmcr0_bug,[dnl
1946 AC_TRY_COMPILE([int tester(int x) { asm ("" : : : "cc"); return x & 123; }],,
1947 libc_cv_c_asmcr0_bug='no',
1948 libc_cv_c_asmcr0_bug='yes')])
1949 if test "$libc_cv_c_asmcr0_bug" != 'no'; then
1950 AC_DEFINE(BROKEN_PPC_ASM_CR0)
1954 dnl Check whether compiler understands __builtin_expect.
1955 AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
1956 [cat > conftest.c <<EOF
1957 #line $LINENO "configure"
1960 a = __builtin_expect (a, 10);
1961 return a == 10 ? 0 : 1;
1964 dnl No \ in command here because it ends up inside ''.
1965 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles
1966 -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
1967 libc_cv_gcc_builtin_expect=yes
1969 libc_cv_gcc_builtin_expect=no
1972 if test "$libc_cv_gcc_builtin_expect" = yes; then
1973 AC_DEFINE(HAVE_BUILTIN_EXPECT)
1976 AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
1977 cat > conftest.c <<\EOF
1980 __builtin_memset (x, 0, 1000);
1984 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null]);
1986 libc_cv_gcc_builtin_memset=no
1988 libc_cv_gcc_builtin_memset=yes
1991 if test "$libc_cv_gcc_builtin_memset" = yes ; then
1992 AC_DEFINE(HAVE_BUILTIN_MEMSET)
1995 AC_CACHE_CHECK(for redirection of built-in functions, libc_cv_gcc_builtin_redirection, [dnl
1996 cat > conftest.c <<\EOF
1997 extern char *strstr (const char *, const char *) __asm ("my_strstr");
1998 char *foo (const char *a, const char *b)
2000 return __builtin_strstr (a, b);
2004 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "my_strstr" > /dev/null]);
2006 libc_cv_gcc_builtin_redirection=yes
2008 libc_cv_gcc_builtin_redirection=no
2011 if test "$libc_cv_gcc_builtin_redirection" = yes ; then
2012 AC_DEFINE(HAVE_BUILTIN_REDIRECTION)
2015 dnl Check whether the compiler supports the __thread keyword.
2016 if test "x$use__thread" != xno; then
2017 AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
2018 [cat > conftest.c <<\EOF
2019 __thread int a = 42;
2021 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
2022 libc_cv_gcc___thread=yes
2024 libc_cv_gcc___thread=no
2027 if test "$libc_cv_gcc___thread" = yes; then
2028 AC_DEFINE(HAVE___THREAD)
2031 libc_cv_gcc___thread=no
2034 if test "$libc_cv_gcc___thread" = yes; then
2035 dnl Check whether the compiler supports the tls_model attribute.
2036 AC_CACHE_CHECK([for tls_model attribute], libc_cv_gcc_tls_model_attr, [dnl
2037 cat > conftest.c <<\EOF
2038 extern __thread int a __attribute__((tls_model ("initial-exec")));
2040 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&AS_MESSAGE_LOG_FD]); then
2041 libc_cv_gcc_tls_model_attr=yes
2043 libc_cv_gcc_tls_model_attr=no
2046 if test "$libc_cv_gcc_tls_model_attr" = yes; then
2047 AC_DEFINE(HAVE_TLS_MODEL_ATTRIBUTE)
2051 if test -n "$submachine"; then
2052 AC_CACHE_CHECK([for compiler option for CPU variant],
2053 libc_cv_cc_submachine, [dnl
2054 libc_cv_cc_submachine=no
2055 for opt in "-march=$submachine" "-mcpu=$submachine"; do
2056 if AC_TRY_COMMAND([${CC-cc} $opt -xc /dev/null -S -o /dev/null]); then
2057 libc_cv_cc_submachine="$opt"
2061 if test "x$libc_cv_cc_submachine" = xno; then
2062 AC_MSG_ERROR([${CC-cc} does not support $submachine])
2065 AC_SUBST(libc_cv_cc_submachine)
2067 dnl Check whether we have the gd library available.
2068 AC_MSG_CHECKING(for libgd)
2069 if test "$with_gd" != "no"; then
2070 old_CFLAGS="$CFLAGS"
2071 CFLAGS="$CFLAGS $libgd_include"
2072 old_LDFLAGS="$LDFLAGS"
2073 LDFLAGS="$LDFLAGS $libgd_ldflags"
2075 LIBS="$LIBS -lgd -lpng -lz -lm"
2076 AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
2077 CFLAGS="$old_CFLAGS"
2078 LDFLAGS="$old_LDFLAGS"
2083 AC_MSG_RESULT($LIBGD)
2087 if test x$with_selinux = xno ; then
2090 # See if we have the SELinux library
2091 AC_CHECK_LIB(selinux, is_selinux_enabled,
2092 have_selinux=yes, have_selinux=no)
2093 # See if we have the SELinux header with the NSCD permissions in it.
2094 if test x$have_selinux = xyes ; then
2095 AC_MSG_CHECKING([for NSCD Flask permissions in selinux/av_permissions.h])
2096 AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
2097 [#ifdef NSCD__SHMEMHOST
2100 #error NSCD__SHMEMHOST not defined
2102 have_selinux=yes, have_selinux=no)
2103 AC_MSG_RESULT($have_selinux)
2106 if test x$with_selinux = xyes ; then
2107 if test x$have_selinux = xno ; then
2108 AC_MSG_ERROR([SELinux explicitly required, but sufficiently recent SELinux library not found])
2112 # Check if we're building with SELinux support.
2113 if test "x$have_selinux" = xyes; then
2114 AC_DEFINE(HAVE_SELINUX, 1, [SELinux support])
2116 # See if we have the libaudit library
2117 AC_CHECK_LIB(audit, audit_log_user_avc_message,
2118 have_libaudit=yes, have_libaudit=no)
2119 if test "x$have_libaudit" = xyes; then
2120 AC_DEFINE(HAVE_LIBAUDIT, 1, [SELinux libaudit support])
2122 AC_SUBST(have_libaudit)
2124 # See if we have the libcap library
2125 AC_CHECK_LIB(cap, cap_init, have_libcap=yes, have_libcap=no)
2126 if test "x$have_libcap" = xyes; then
2127 AC_DEFINE(HAVE_LIBCAP, 1, [SELinux libcap support])
2129 AC_SUBST(have_libcap)
2131 AC_SUBST(have_selinux)
2133 dnl check for the size of 'long double'.
2134 AC_CHECK_SIZEOF(long double, 0)
2135 sizeof_long_double=$ac_cv_sizeof_long_double
2136 AC_SUBST(sizeof_long_double)
2138 ### End of automated tests.
2139 ### Now run sysdeps configure fragments.
2141 # They also can set these variables.
2143 ldd_rewrite_script=no
2144 libc_cv_sysconfdir=$sysconfdir
2145 libc_cv_gcc_unwind_find_fde=no
2148 # Iterate over all the sysdep directories we will use, running their
2149 # configure fragments, and looking for a uname implementation.
2151 for dir in $sysnames; do
2154 *) dest=$srcdir/$dir ;;
2156 if test -r $dest/configure; then
2157 AC_MSG_RESULT(running configure fragment for $dir)
2161 if test -z "$uname"; then
2162 if test -r $dest/uname.c ||
2163 test -r $dest/uname.S ||
2164 { test -r $dest/syscalls.list &&
2165 grep '^uname[ ]' $dest/syscalls.list >/dev/null; }; then
2172 if test x$libc_cv_gcc_unwind_find_fde = xyes; then
2173 AC_DEFINE(EXPORT_UNWIND_FIND_FDE)
2175 AC_SUBST(libc_cv_gcc_unwind_find_fde)
2177 # If we will use the generic uname implementation, we must figure out what
2178 # it will say by examining the system, and write the results in config-name.h.
2179 if test "$uname" = "sysdeps/generic"; then
2182 uname_sysname=`echo $config_os | sed 's/[0-9.]*$//'`
2184 if test $uname_sysname != $config_os; then
2185 config_release=`echo $config_os | sed s/$uname_sysname//`
2188 AC_DEFUN(LIBC_KERNEL_ID, [dnl
2189 if test -r /vmunix; then
2190 kernel_id=`strings /vmunix | grep UNIX`
2191 elif test -r /dynix; then
2192 kernel_id=`strings /dynix | grep DYNIX`
2198 AC_CACHE_CHECK(OS release for uname, libc_cv_uname_release, [dnl
2201 kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'`
2203 if test x`echo "$config_release" | sed "s/^$kernel_release//"` \
2204 != x$config_release; then
2205 # The configuration release is a substring of the kernel release.
2206 libc_cv_uname_release=$kernel_release
2207 elif test x$config_release != x; then
2208 libc_cv_uname_release=$config_release
2209 elif test x$kernel_release != x; then
2210 libc_cv_uname_release=$kernel_release
2212 libc_cv_uname_release=unknown
2214 uname_release="$libc_cv_uname_release"
2216 AC_CACHE_CHECK(OS version for uname, libc_cv_uname_version, [dnl
2219 kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'`
2221 if test -n "$kernel_version"; then
2222 libc_cv_uname_version="$kernel_version"
2224 libc_cv_uname_version=unknown
2226 uname_version="$libc_cv_uname_version"
2228 AC_SUBST(uname_sysname) AC_SUBST(uname_release) AC_SUBST(uname_version)dnl
2229 config_uname=config-name.h:config-name.in
2231 # For non-generic uname, we don't need to create config-name.h at all.
2235 dnl This is tested by existing code and it's simpler to avoid changing it.
2236 AC_DEFINE(USE_IN_LIBIO)
2238 # Test for old glibc 2.0.x headers so that they can be removed properly
2239 # Search only in includedir.
2240 AC_MSG_CHECKING(for old glibc 2.0.x headers)
2241 if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
2243 old_glibc_headers=yes
2245 old_glibc_headers=no
2247 AC_MSG_RESULT($old_glibc_headers)
2248 if test ${old_glibc_headers} = yes; then
2249 AC_MSG_WARN(*** During \"make install\" old headers from glibc 2.0.x will)
2250 AC_MSG_WARN(*** be removed.)
2252 AC_SUBST(old_glibc_headers)
2254 AC_SUBST(libc_cv_slibdir)
2255 AC_SUBST(libc_cv_localedir)
2256 AC_SUBST(libc_cv_sysconfdir)
2257 AC_SUBST(libc_cv_rootsbindir)
2258 AC_SUBST(libc_cv_forced_unwind)
2260 dnl sysdeps/CPU/configure.in checks set this via arch-specific asm tests
2261 AC_SUBST(libc_cv_cpp_asm_debuginfo)
2263 AC_SUBST(use_ldconfig)
2264 AC_SUBST(ldd_rewrite_script)
2266 AC_SUBST(elf) AC_SUBST(xcoff)
2267 if test $elf = yes; then
2270 if test $xcoff = yes; then
2271 AC_DEFINE(HAVE_XCOFF)
2276 if test $shared = default; then
2280 AC_CACHE_CHECK([whether -fPIC is default], libc_cv_pic_default,
2281 [libc_cv_pic_default=yes
2282 cat > conftest.c <<EOF
2283 #if defined __PIC__ || defined __pic__ || defined PIC || defined pic
2284 # error PIC is default.
2287 if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
2288 libc_cv_pic_default=no
2291 AC_SUBST(libc_cv_pic_default)
2296 AC_SUBST(static_nss)
2297 AC_SUBST(nopic_initfini)
2301 dnl See sysdeps/mach/configure.in for this variable.
2302 AC_SUBST(mach_interface_list)
2304 if test "`(cd $srcdir; pwd)`" = "`pwd`"; then
2307 config_makefile=Makefile
2310 VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
2311 RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
2315 AC_CONFIG_FILES([config.make ${config_makefile} ${config_uname}])
2316 AC_CONFIG_COMMANDS([default],[[
2317 case $CONFIG_FILES in *config.make*)
2318 echo "$config_vars" >> config.make;;
2320 test -d bits || mkdir bits]],[[config_vars='$config_vars']])