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]*|[2-9].[2-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]*|[2-9].[2-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 AC_CACHE_CHECK(for assembler gnu_unique_object symbol type,
1215 libc_cv_asm_unique_object, [dnl
1216 cat > conftest.s <<EOF
1219 .type _sym, ${libc_cv_asm_type_prefix}gnu_unique_object
1221 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1222 libc_cv_asm_unique_object=yes
1224 libc_cv_asm_unique_object=no
1227 if test $libc_cv_asm_unique_object = yes; then
1228 AC_DEFINE(HAVE_ASM_UNIQUE_OBJECT)
1231 # For the multi-arch option we need support in the assembler.
1232 if test "$multi_arch" = yes; then
1233 if test "x$libc_cv_asm_type_prefix" != xno; then
1234 AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support],
1235 libc_cv_asm_gnu_indirect_function, [dnl
1236 cat > conftest.s <<EOF
1237 .type foo,%gnu_indirect_function
1239 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
1241 libc_cv_asm_gnu_indirect_function=yes
1243 libc_cv_asm_gnu_indirect_function=no
1247 libc_cv_asm_gnu_indirect_function=no
1249 if test x"$libc_cv_asm_gnu_indirect_function" != xyes; then
1250 AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
1254 AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
1255 [cat > conftest.s <<EOF
1258 .symver _sym,sym@VERS
1260 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1261 libc_cv_asm_symver_directive=yes
1263 libc_cv_asm_symver_directive=no
1266 AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl
1267 if test $libc_cv_asm_symver_directive = yes; then
1268 cat > conftest.s <<EOF
1271 .symver _sym,sym@VERS
1273 cat > conftest.map <<EOF
1282 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1283 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
1284 -o conftest.so conftest.o
1285 -nostartfiles -nostdlib
1286 -Wl,--version-script,conftest.map
1287 1>&AS_MESSAGE_LOG_FD]);
1289 libc_cv_ld_version_script_option=yes
1291 libc_cv_ld_version_script_option=no
1294 libc_cv_ld_version_script_option=no
1297 libc_cv_ld_version_script_option=no
1300 if test $shared != no &&
1301 test $libc_cv_asm_symver_directive = yes &&
1302 test $libc_cv_ld_version_script_option = yes &&
1303 test $enable_versioning = yes; then
1305 AC_DEFINE(DO_VERSIONING)
1309 AC_SUBST(VERSIONING)
1311 if test $elf = yes && test $shared != no && test $VERSIONING = no; then
1313 *** WARNING: You should not compile GNU libc without versioning. Not using
1314 *** versioning will introduce incompatibilities so that old binaries
1315 *** will not run anymore.
1316 *** For versioning you need recent binutils (binutils-2.8.1.0.23 or newer)."
1318 if test $elf = yes; then
1319 AC_CACHE_CHECK(for .previous assembler directive,
1320 libc_cv_asm_previous_directive, [dnl
1321 cat > conftest.s <<EOF
1322 .section foo_section
1325 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1326 libc_cv_asm_previous_directive=yes
1328 libc_cv_asm_previous_directive=no
1331 if test $libc_cv_asm_previous_directive = yes; then
1332 AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
1334 AC_CACHE_CHECK(for .popsection assembler directive,
1335 libc_cv_asm_popsection_directive, [dnl
1336 cat > conftest.s <<EOF
1337 .pushsection foo_section
1340 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1341 libc_cv_asm_popsection_directive=yes
1343 libc_cv_asm_popsection_directive=no
1346 if test $libc_cv_asm_popsection_directive = yes; then
1347 AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
1350 AC_CACHE_CHECK(for .protected and .hidden assembler directive,
1351 libc_cv_asm_protected_directive, [dnl
1352 cat > conftest.s <<EOF
1358 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1359 libc_cv_asm_protected_directive=yes
1361 AC_MSG_ERROR(assembler support for symbol visibility is required)
1365 if test $libc_cv_asm_protected_directive = yes; then
1366 AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
1367 libc_cv_visibility_attribute,
1368 [cat > conftest.c <<EOF
1369 int foo __attribute__ ((visibility ("hidden"))) = 1;
1370 int bar __attribute__ ((visibility ("protected"))) = 1;
1372 libc_cv_visibility_attribute=no
1373 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1374 if grep '\.hidden.*foo' conftest.s >/dev/null; then
1375 if grep '\.protected.*bar' conftest.s >/dev/null; then
1376 libc_cv_visibility_attribute=yes
1382 if test $libc_cv_visibility_attribute != yes; then
1383 AC_MSG_ERROR(compiler support for visibility attribute is required)
1387 if test $libc_cv_visibility_attribute = yes; then
1388 AC_CACHE_CHECK(for broken __attribute__((visibility())),
1389 libc_cv_broken_visibility_attribute,
1390 [cat > conftest.c <<EOF
1392 int bar (int x) __asm__ ("foo") __attribute__ ((visibility ("hidden")));
1393 int bar (int x) { return x; }
1395 libc_cv_broken_visibility_attribute=yes
1396 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s1>&AS_MESSAGE_LOG_FD); then
1398 if grep '\.hidden[ _]foo' conftest.s >/dev/null; then
1400 libc_cv_broken_visibility_attribute=no
1403 rm -f conftest.c conftest.s
1405 if test $libc_cv_broken_visibility_attribute = yes; then
1406 AC_MSG_ERROR(working compiler support for visibility attribute is required)
1410 AC_CACHE_CHECK(for broken __attribute__((alias())),
1411 libc_cv_broken_alias_attribute,
1412 [cat > conftest.c <<EOF
1413 extern int foo (int x) __asm ("xyzzy");
1414 int bar (int x) { return x; }
1415 extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
1417 extern __typeof (dfoo) dfoo __asm ("abccb");
1420 libc_cv_broken_alias_attribute=yes
1421 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1422 if grep 'xyzzy' conftest.s >/dev/null &&
1423 grep 'abccb' conftest.s >/dev/null; then
1424 libc_cv_broken_alias_attribute=no
1427 rm -f conftest.c conftest.s
1429 if test $libc_cv_broken_alias_attribute = yes; then
1430 AC_MSG_ERROR(working alias attribute support required)
1433 if test $libc_cv_visibility_attribute = yes; then
1434 AC_CACHE_CHECK(whether to put _rtld_local into .sdata section,
1435 libc_cv_have_sdata_section,
1436 [echo "int i;" > conftest.c
1437 libc_cv_have_sdata_section=no
1438 if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
1439 | grep '\.sdata' >/dev/null; then
1440 libc_cv_have_sdata_section=yes
1442 rm -f conftest.c conftest.so
1444 if test $libc_cv_have_sdata_section = yes; then
1445 AC_DEFINE(HAVE_SDATA_SECTION)
1449 AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
1450 libc_cv_initfini_array, [dnl
1451 cat > conftest.c <<EOF
1452 int _start (void) { return 0; }
1453 int __start (void) { return 0; }
1454 int foo (void) { return 1; }
1455 int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
1457 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c
1458 -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
1460 if readelf -S conftest | fgrep INIT_ARRAY > /dev/null; then
1461 libc_cv_initfini_array=yes
1463 libc_cv_initfini_array=no
1466 libc_cv_initfini_array=no
1469 if test $libc_cv_initfini_array != yes; then
1470 AC_MSG_ERROR([Need linker with .init_array/.fini_array support.])
1473 AC_CACHE_CHECK(for libunwind-support in compiler,
1474 libc_cv_cc_with_libunwind, [
1475 cat > conftest.c <<EOF
1476 int main (void) { return 0; }
1478 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
1479 conftest.c -v 2>&1 >/dev/null | grep -q " -lunwind "; then
1480 libc_cv_cc_with_libunwind=yes
1482 libc_cv_cc_with_libunwind=no
1485 AC_SUBST(libc_cv_cc_with_libunwind)
1486 if test $libc_cv_cc_with_libunwind = yes; then
1487 AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
1490 AC_CACHE_CHECK(for -z nodelete option,
1491 libc_cv_z_nodelete, [dnl
1492 cat > conftest.c <<EOF
1493 int _start (void) { return 42; }
1495 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1496 -fPIC -shared -o conftest.so conftest.c
1497 -nostartfiles -nostdlib
1498 -Wl,--enable-new-dtags,-z,nodelete 1>&AS_MESSAGE_LOG_FD])
1500 libc_cv_z_nodelete=yes
1502 AC_MSG_ERROR(linker with -z nodelete support required)
1506 AC_CACHE_CHECK(for -z nodlopen option,
1507 libc_cv_z_nodlopen, [dnl
1508 cat > conftest.c <<EOF
1509 int _start (void) { return 42; }
1511 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1512 -fPIC -shared -o conftest.so conftest.c
1513 -nostartfiles -nostdlib
1514 -Wl,--enable-new-dtags,-z,nodlopen 1>&AS_MESSAGE_LOG_FD])
1516 libc_cv_z_nodlopen=yes
1518 AC_MSG_ERROR(linker with -z nodlopen support required)
1522 AC_CACHE_CHECK(for -z initfirst option,
1523 libc_cv_z_initfirst, [dnl
1524 cat > conftest.c <<EOF
1525 int _start (void) { return 42; }
1527 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1528 -fPIC -shared -o conftest.so conftest.c
1529 -nostartfiles -nostdlib
1530 -Wl,--enable-new-dtags,-z,initfirst 1>&AS_MESSAGE_LOG_FD])
1532 libc_cv_z_initfirst=yes
1534 AC_MSG_ERROR(linker with -z initfirst support required)
1538 case "$base_machine" in
1540 i[34567]86 | x86_64 | powerpc* | s390* | sparc* | alpha*)
1542 AC_CACHE_CHECK(for -z relro option,
1543 libc_cv_z_relro, [dnl
1545 if AC_TRY_COMMAND([${CC-cc} -v --help 2>&1|grep "z relro" 1>&AS_MESSAGE_LOG_FD])
1547 if AC_TRY_COMMAND([${CC-cc} -Wl,--verbose 2>&1|grep DATA_SEGMENT_RELRO_END 1>&AS_MESSAGE_LOG_FD])
1552 if test "$libc_cv_z_relro" = no; then
1553 AC_MSG_ERROR(linker with -z relro support required)
1559 AC_CACHE_CHECK(for -Bgroup option,
1560 libc_cv_Bgroup, [dnl
1561 cat > conftest.c <<EOF
1562 int _start (void) { return 42; }
1564 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1565 -fPIC -shared -o conftest.so conftest.c
1566 -Wl,-Bgroup -nostdlib 1>&AS_MESSAGE_LOG_FD])
1573 AC_SUBST(libc_cv_Bgroup)
1575 AC_CACHE_CHECK(for libgcc_s suffix,
1576 libc_cv_libgcc_s_suffix, [dnl
1577 cat > conftest.c <<EOF
1578 int main (void) { return 0; }
1581 libc_cv_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1582 -fPIC -shared -shared-libgcc -o conftest.so \
1583 conftest.c -v 2>&1 >/dev/null \
1584 | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
1587 AC_SUBST(libc_cv_libgcc_s_suffix)
1589 AC_CACHE_CHECK(for --as-needed option,
1590 libc_cv_as_needed, [dnl
1591 cat > conftest.c <<EOF
1592 int main (void) { return 0; }
1594 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1595 -fPIC -shared -o conftest.so conftest.c
1596 -lgcc_s$libc_cv_libgcc_s_suffix -Wl,--as-needed
1597 -nostdlib 1>&AS_MESSAGE_LOG_FD])
1599 libc_cv_as_needed=yes
1601 libc_cv_as_needed=no
1604 AC_SUBST(libc_cv_as_needed)
1607 AC_CACHE_CHECK(whether --noexecstack is desirable for .S files,
1608 libc_cv_as_noexecstack, [dnl
1609 cat > conftest.c <<EOF
1612 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS
1613 -S -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD]) \
1614 && grep -q .note.GNU-stack conftest.s \
1615 && AC_TRY_COMMAND([${CC-cc} $ASFLAGS -Wa,--noexecstack
1616 -c -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD])
1618 libc_cv_as_noexecstack=yes
1620 libc_cv_as_noexecstack=no
1623 if test $libc_cv_as_noexecstack = yes; then
1624 ASFLAGS_config="$ASFLAGS_config -Wa,--noexecstack"
1626 AC_SUBST(ASFLAGS_config)
1628 AC_CACHE_CHECK(for -z combreloc,
1629 libc_cv_z_combreloc, [dnl
1630 cat > conftest.c <<EOF
1631 extern int bar (int);
1633 int foo (void) { return bar (mumble); }
1635 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1636 -fPIC -shared -o conftest.so conftest.c
1637 -nostdlib -nostartfiles
1638 -Wl,-z,combreloc 1>&AS_MESSAGE_LOG_FD])
1640 dnl The following test is a bit weak. We must use a tool which can test
1641 dnl cross-platform since the gcc used can be a cross compiler. Without
1642 dnl introducing new options this is not easily doable. Instead use a tool
1643 dnl which always is cross-platform: readelf. To detect whether -z combreloc
1644 dnl look for a section named .rel.dyn.
1645 if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
1646 libc_cv_z_combreloc=yes
1648 libc_cv_z_combreloc=no
1651 libc_cv_z_combreloc=no
1654 if test "$libc_cv_z_combreloc" = yes; then
1655 AC_DEFINE(HAVE_Z_COMBRELOC)
1657 AC_SUBST(libc_cv_z_combreloc)
1659 AC_CACHE_CHECK(for -z execstack,
1660 libc_cv_z_execstack, [dnl
1661 cat > conftest.c <<EOF
1662 int _start (void) { return 42; }
1664 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1665 -fPIC -shared -o conftest.so conftest.c
1666 -Wl,-z,execstack -nostdlib
1667 1>&AS_MESSAGE_LOG_FD])
1669 libc_cv_z_execstack=yes
1671 libc_cv_z_execstack=no
1674 AC_SUBST(libc_cv_z_execstack)
1676 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
1677 cat > conftest.c <<EOF
1679 main () { return 0;}
1681 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
1682 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
1690 AC_SUBST(libc_cv_fpie)
1692 AC_CACHE_CHECK(for --hash-style option,
1693 libc_cv_hashstyle, [dnl
1694 cat > conftest.c <<EOF
1695 int _start (void) { return 42; }
1697 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1698 -fPIC -shared -o conftest.so conftest.c
1699 -Wl,--hash-style=both -nostdlib 1>&AS_MESSAGE_LOG_FD])
1701 libc_cv_hashstyle=yes
1703 libc_cv_hashstyle=no
1706 AC_SUBST(libc_cv_hashstyle)
1709 AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl
1710 cat > conftest.c <<EOF
1713 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder -fno-section-anchors
1714 conftest.c 1>&AS_MESSAGE_LOG_FD])
1716 libc_cv_fno_toplevel_reorder=yes
1718 libc_cv_fno_toplevel_reorder=no
1721 if test $libc_cv_fno_toplevel_reorder = yes; then
1722 fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors"
1724 fno_unit_at_a_time=-fno-unit-at-a-time
1726 AC_SUBST(fno_unit_at_a_time)
1728 AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
1729 cat > conftest.c <<EOF
1731 main () { return 0;}
1733 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -Werror -fstack-protector
1734 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
1741 AC_SUBST(libc_cv_ssp)
1743 AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
1744 cat > conftest.c <<EOF
1746 #ifdef __GNUC_GNU_INLINE__
1747 main () { return 0;}
1752 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -std=gnu99 -fgnu89-inline
1753 -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD])
1755 libc_cv_gnu89_inline=yes
1757 libc_cv_gnu89_inline=no
1760 if test $libc_cv_gnu89_inline = yes; then
1761 libc_cv_gnu89_inline=-fgnu89-inline
1763 libc_cv_gnu89_inline=
1765 AC_SUBST(libc_cv_gnu89_inline)
1767 if test $elf != yes; then
1768 AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
1769 [AC_TRY_COMPILE(, [asm (".section .init");
1770 asm (".section .fini");
1771 asm ("${libc_cv_dot_text}");],
1772 libc_cv_have_initfini=yes,
1773 libc_cv_have_initfini=no)])
1774 AC_SUBST(libc_cv_have_initfini)dnl
1775 if test $libc_cv_have_initfini = yes; then
1776 AC_DEFINE(HAVE_INITFINI)
1780 if test $elf = yes; then
1781 AC_CACHE_CHECK(whether cc puts quotes around section names,
1782 libc_cv_have_section_quotes,
1783 [cat > conftest.c <<EOF
1784 static const int foo
1785 __attribute__ ((section ("bar"))) = 1;
1787 if ${CC-cc} -S conftest.c -o conftest.s; then
1788 if grep '\.section.*"bar"' conftest.s >/dev/null; then
1789 libc_cv_have_section_quotes=yes
1791 libc_cv_have_section_quotes=no
1794 libc_cv_have_section_quotes=unknown
1798 if test $libc_cv_have_section_quotes = yes; then
1799 AC_DEFINE(HAVE_SECTION_QUOTES)
1803 dnl AC_CHECK_ASM_UNDERSCORE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1804 AC_DEFUN(AC_CHECK_ASM_UNDERSCORE,
1805 [cat > conftest.$ac_ext <<EOF
1806 dnl This sometimes fails to find confdefs.h, for some reason.
1807 dnl [#]line $LINENO "[$]0"
1808 [#]line $LINENO "configure"
1809 #include "confdefs.h"
1810 void underscore_test(void) {
1813 if AC_TRY_EVAL(ac_compile); then
1814 if grep _underscore_test conftest* >/dev/null; then
1815 ifelse([$1], , :, [rm -f conftest*
1818 ifelse([$2], , , [rm -f conftest*
1822 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
1823 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
1824 ifelse([$2], , , [rm -f conftest*
1829 if test $elf = yes; then
1830 libc_cv_asm_underscores=no
1832 if test $ac_cv_prog_cc_works = yes; then
1833 AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1834 [AC_TRY_LINK([asm ("_glibc_foobar:");], [glibc_foobar ();],
1835 libc_cv_asm_underscores=yes,
1836 libc_cv_asm_underscores=no)])
1838 AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1839 [AC_CHECK_ASM_UNDERSCORE(libc_cv_asm_underscores=yes,
1840 libc_cv_asm_underscores=no)])
1843 if test $libc_cv_asm_underscores = no; then
1844 AC_DEFINE(NO_UNDERSCORES)
1847 if test $elf = yes; then
1848 libc_cv_weak_symbols=yes
1851 AC_CACHE_CHECK(for assembler .weak directive, libc_cv_asm_weak_directive,
1853 cat > conftest.s <<EOF
1855 ${libc_cv_asm_global_directive} foo
1858 .weak bar; bar = foo
1860 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1861 libc_cv_asm_weak_directive=yes
1863 libc_cv_asm_weak_directive=no
1867 if test $libc_cv_asm_weak_directive = no; then
1868 AC_CACHE_CHECK(for assembler .weakext directive,
1869 libc_cv_asm_weakext_directive,
1871 cat > conftest.s <<EOF
1873 ${libc_cv_asm_global_directive} foo
1877 ${libc_cv_asm_global_directive} baz
1880 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1881 libc_cv_asm_weakext_directive=yes
1883 libc_cv_asm_weakext_directive=no
1889 if test $libc_cv_asm_weak_directive = yes; then
1890 AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
1891 elif test $libc_cv_asm_weakext_directive = yes; then
1892 AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)
1895 AC_CACHE_CHECK(whether CFI directives are supported, libc_cv_asm_cfi_directives, [dnl
1897 sparc/sparc64*) cfi_offset=2047;;
1900 cat > conftest.s <<EOF
1902 .type func,%function
1906 .cfi_rel_offset 1, $cfi_offset
1909 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1910 libc_cv_asm_cfi_directives=yes
1912 libc_cv_asm_cfi_directives=no
1915 if test $libc_cv_asm_cfi_directives = yes; then
1916 AC_DEFINE(HAVE_ASM_CFI_DIRECTIVES)
1919 AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
1920 cat > conftest.c <<\EOF
1925 dnl No \ in command here because it ends up inside ''.
1926 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1927 -nostdlib -nostartfiles -Wl,--no-whole-archive
1928 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1929 libc_cv_ld_no_whole_archive=yes
1931 libc_cv_ld_no_whole_archive=no
1934 if test $libc_cv_ld_no_whole_archive = yes; then
1935 no_whole_archive=-Wl,--no-whole-archive
1937 AC_SUBST(no_whole_archive)dnl
1939 AC_CACHE_CHECK(for gcc -fexceptions, libc_cv_gcc_exceptions, [dnl
1940 cat > conftest.c <<\EOF
1945 dnl No \ in command here because it ends up inside ''.
1946 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1947 -nostdlib -nostartfiles -fexceptions
1948 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1949 libc_cv_gcc_exceptions=yes
1951 libc_cv_gcc_exceptions=no
1954 if test $libc_cv_gcc_exceptions = yes; then
1955 exceptions=-fexceptions
1957 AC_SUBST(exceptions)dnl
1959 if test "$host_cpu" = powerpc ; then
1960 # Check for a bug present in at least versions 2.8.x of GCC
1961 # and versions 1.0.x of EGCS.
1962 AC_CACHE_CHECK(whether clobbering cr0 causes problems,libc_cv_c_asmcr0_bug,[dnl
1963 AC_TRY_COMPILE([int tester(int x) { asm ("" : : : "cc"); return x & 123; }],,
1964 libc_cv_c_asmcr0_bug='no',
1965 libc_cv_c_asmcr0_bug='yes')])
1966 if test "$libc_cv_c_asmcr0_bug" != 'no'; then
1967 AC_DEFINE(BROKEN_PPC_ASM_CR0)
1971 dnl Check whether compiler understands __builtin_expect.
1972 AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
1973 [cat > conftest.c <<EOF
1974 #line $LINENO "configure"
1977 a = __builtin_expect (a, 10);
1978 return a == 10 ? 0 : 1;
1981 dnl No \ in command here because it ends up inside ''.
1982 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles
1983 -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
1984 libc_cv_gcc_builtin_expect=yes
1986 libc_cv_gcc_builtin_expect=no
1989 if test "$libc_cv_gcc_builtin_expect" = yes; then
1990 AC_DEFINE(HAVE_BUILTIN_EXPECT)
1993 AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
1994 cat > conftest.c <<\EOF
1997 __builtin_memset (x, 0, 1000);
2001 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null]);
2003 libc_cv_gcc_builtin_memset=no
2005 libc_cv_gcc_builtin_memset=yes
2008 if test "$libc_cv_gcc_builtin_memset" = yes ; then
2009 AC_DEFINE(HAVE_BUILTIN_MEMSET)
2012 AC_CACHE_CHECK(for redirection of built-in functions, libc_cv_gcc_builtin_redirection, [dnl
2013 cat > conftest.c <<\EOF
2014 extern char *strstr (const char *, const char *) __asm ("my_strstr");
2015 char *foo (const char *a, const char *b)
2017 return __builtin_strstr (a, b);
2021 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "my_strstr" > /dev/null]);
2023 libc_cv_gcc_builtin_redirection=yes
2025 libc_cv_gcc_builtin_redirection=no
2028 if test "$libc_cv_gcc_builtin_redirection" = yes ; then
2029 AC_DEFINE(HAVE_BUILTIN_REDIRECTION)
2032 dnl Check whether the compiler supports the __thread keyword.
2033 if test "x$use__thread" != xno; then
2034 AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
2035 [cat > conftest.c <<\EOF
2036 __thread int a = 42;
2038 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
2039 libc_cv_gcc___thread=yes
2041 libc_cv_gcc___thread=no
2044 if test "$libc_cv_gcc___thread" = yes; then
2045 AC_DEFINE(HAVE___THREAD)
2048 libc_cv_gcc___thread=no
2051 if test "$libc_cv_gcc___thread" = yes; then
2052 dnl Check whether the compiler supports the tls_model attribute.
2053 AC_CACHE_CHECK([for tls_model attribute], libc_cv_gcc_tls_model_attr, [dnl
2054 cat > conftest.c <<\EOF
2055 extern __thread int a __attribute__((tls_model ("initial-exec")));
2057 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&AS_MESSAGE_LOG_FD]); then
2058 libc_cv_gcc_tls_model_attr=yes
2060 libc_cv_gcc_tls_model_attr=no
2063 if test "$libc_cv_gcc_tls_model_attr" = yes; then
2064 AC_DEFINE(HAVE_TLS_MODEL_ATTRIBUTE)
2068 if test -n "$submachine"; then
2069 AC_CACHE_CHECK([for compiler option for CPU variant],
2070 libc_cv_cc_submachine, [dnl
2071 libc_cv_cc_submachine=no
2072 for opt in "-march=$submachine" "-mcpu=$submachine"; do
2073 if AC_TRY_COMMAND([${CC-cc} $opt -xc /dev/null -S -o /dev/null]); then
2074 libc_cv_cc_submachine="$opt"
2078 if test "x$libc_cv_cc_submachine" = xno; then
2079 AC_MSG_ERROR([${CC-cc} does not support $submachine])
2082 AC_SUBST(libc_cv_cc_submachine)
2084 dnl Check whether we have the gd library available.
2085 AC_MSG_CHECKING(for libgd)
2086 if test "$with_gd" != "no"; then
2087 old_CFLAGS="$CFLAGS"
2088 CFLAGS="$CFLAGS $libgd_include"
2089 old_LDFLAGS="$LDFLAGS"
2090 LDFLAGS="$LDFLAGS $libgd_ldflags"
2092 LIBS="$LIBS -lgd -lpng -lz -lm"
2093 AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
2094 CFLAGS="$old_CFLAGS"
2095 LDFLAGS="$old_LDFLAGS"
2100 AC_MSG_RESULT($LIBGD)
2104 if test x$with_selinux = xno ; then
2107 # See if we have the SELinux library
2108 AC_CHECK_LIB(selinux, is_selinux_enabled,
2109 have_selinux=yes, have_selinux=no)
2110 # See if we have the SELinux header with the NSCD permissions in it.
2111 if test x$have_selinux = xyes ; then
2112 AC_MSG_CHECKING([for NSCD Flask permissions in selinux/av_permissions.h])
2113 AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
2114 [#ifdef NSCD__SHMEMHOST
2117 #error NSCD__SHMEMHOST not defined
2119 have_selinux=yes, have_selinux=no)
2120 AC_MSG_RESULT($have_selinux)
2123 if test x$with_selinux = xyes ; then
2124 if test x$have_selinux = xno ; then
2125 AC_MSG_ERROR([SELinux explicitly required, but sufficiently recent SELinux library not found])
2129 # Check if we're building with SELinux support.
2130 if test "x$have_selinux" = xyes; then
2131 AC_DEFINE(HAVE_SELINUX, 1, [SELinux support])
2133 # See if we have the libaudit library
2134 AC_CHECK_LIB(audit, audit_log_user_avc_message,
2135 have_libaudit=yes, have_libaudit=no)
2136 if test "x$have_libaudit" = xyes; then
2137 AC_DEFINE(HAVE_LIBAUDIT, 1, [SELinux libaudit support])
2139 AC_SUBST(have_libaudit)
2141 # See if we have the libcap library
2142 AC_CHECK_LIB(cap, cap_init, have_libcap=yes, have_libcap=no)
2143 if test "x$have_libcap" = xyes; then
2144 AC_DEFINE(HAVE_LIBCAP, 1, [SELinux libcap support])
2146 AC_SUBST(have_libcap)
2148 AC_SUBST(have_selinux)
2150 dnl check for the size of 'long double'.
2151 AC_CHECK_SIZEOF(long double, 0)
2152 sizeof_long_double=$ac_cv_sizeof_long_double
2153 AC_SUBST(sizeof_long_double)
2155 ### End of automated tests.
2156 ### Now run sysdeps configure fragments.
2158 # They also can set these variables.
2160 ldd_rewrite_script=no
2161 libc_cv_sysconfdir=$sysconfdir
2162 libc_cv_gcc_unwind_find_fde=no
2165 # Iterate over all the sysdep directories we will use, running their
2166 # configure fragments, and looking for a uname implementation.
2168 for dir in $sysnames; do
2171 *) dest=$srcdir/$dir ;;
2173 if test -r $dest/configure; then
2174 AC_MSG_RESULT(running configure fragment for $dir)
2178 if test -z "$uname"; then
2179 if test -r $dest/uname.c ||
2180 test -r $dest/uname.S ||
2181 { test -r $dest/syscalls.list &&
2182 grep '^uname[ ]' $dest/syscalls.list >/dev/null; }; then
2189 if test x$libc_cv_gcc_unwind_find_fde = xyes; then
2190 AC_DEFINE(EXPORT_UNWIND_FIND_FDE)
2192 AC_SUBST(libc_cv_gcc_unwind_find_fde)
2194 # If we will use the generic uname implementation, we must figure out what
2195 # it will say by examining the system, and write the results in config-name.h.
2196 if test "$uname" = "sysdeps/generic"; then
2199 uname_sysname=`echo $config_os | sed 's/[0-9.]*$//'`
2201 if test $uname_sysname != $config_os; then
2202 config_release=`echo $config_os | sed s/$uname_sysname//`
2205 AC_DEFUN(LIBC_KERNEL_ID, [dnl
2206 if test -r /vmunix; then
2207 kernel_id=`strings /vmunix | grep UNIX`
2208 elif test -r /dynix; then
2209 kernel_id=`strings /dynix | grep DYNIX`
2215 AC_CACHE_CHECK(OS release for uname, libc_cv_uname_release, [dnl
2218 kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'`
2220 if test x`echo "$config_release" | sed "s/^$kernel_release//"` \
2221 != x$config_release; then
2222 # The configuration release is a substring of the kernel release.
2223 libc_cv_uname_release=$kernel_release
2224 elif test x$config_release != x; then
2225 libc_cv_uname_release=$config_release
2226 elif test x$kernel_release != x; then
2227 libc_cv_uname_release=$kernel_release
2229 libc_cv_uname_release=unknown
2231 uname_release="$libc_cv_uname_release"
2233 AC_CACHE_CHECK(OS version for uname, libc_cv_uname_version, [dnl
2236 kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'`
2238 if test -n "$kernel_version"; then
2239 libc_cv_uname_version="$kernel_version"
2241 libc_cv_uname_version=unknown
2243 uname_version="$libc_cv_uname_version"
2245 AC_SUBST(uname_sysname) AC_SUBST(uname_release) AC_SUBST(uname_version)dnl
2246 config_uname=config-name.h:config-name.in
2248 # For non-generic uname, we don't need to create config-name.h at all.
2252 dnl This is tested by existing code and it's simpler to avoid changing it.
2253 AC_DEFINE(USE_IN_LIBIO)
2255 # Test for old glibc 2.0.x headers so that they can be removed properly
2256 # Search only in includedir.
2257 AC_MSG_CHECKING(for old glibc 2.0.x headers)
2258 if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
2260 old_glibc_headers=yes
2262 old_glibc_headers=no
2264 AC_MSG_RESULT($old_glibc_headers)
2265 if test ${old_glibc_headers} = yes; then
2266 AC_MSG_WARN(*** During \"make install\" old headers from glibc 2.0.x will)
2267 AC_MSG_WARN(*** be removed.)
2269 AC_SUBST(old_glibc_headers)
2271 AC_SUBST(libc_cv_slibdir)
2272 AC_SUBST(libc_cv_localedir)
2273 AC_SUBST(libc_cv_sysconfdir)
2274 AC_SUBST(libc_cv_rootsbindir)
2275 AC_SUBST(libc_cv_forced_unwind)
2277 dnl sysdeps/CPU/configure.in checks set this via arch-specific asm tests
2278 AC_SUBST(libc_cv_cpp_asm_debuginfo)
2279 AC_SUBST(libc_cv_cc_sse4)
2280 AC_SUBST(libc_cv_cc_avx)
2282 AC_SUBST(use_ldconfig)
2283 AC_SUBST(ldd_rewrite_script)
2285 AC_SUBST(elf) AC_SUBST(xcoff)
2286 if test $elf = yes; then
2289 if test $xcoff = yes; then
2290 AC_DEFINE(HAVE_XCOFF)
2295 if test $shared = default; then
2299 AC_CACHE_CHECK([whether -fPIC is default], libc_cv_pic_default,
2300 [libc_cv_pic_default=yes
2301 cat > conftest.c <<EOF
2302 #if defined __PIC__ || defined __pic__ || defined PIC || defined pic
2303 # error PIC is default.
2306 if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
2307 libc_cv_pic_default=no
2310 AC_SUBST(libc_cv_pic_default)
2315 AC_SUBST(static_nss)
2316 AC_SUBST(nopic_initfini)
2320 dnl See sysdeps/mach/configure.in for this variable.
2321 AC_SUBST(mach_interface_list)
2323 if test "`(cd $srcdir; pwd)`" = "`pwd`"; then
2326 config_makefile=Makefile
2329 VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
2330 RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
2334 AC_CONFIG_FILES([config.make ${config_makefile} ${config_uname}])
2335 AC_CONFIG_COMMANDS([default],[[
2336 case $CONFIG_FILES in *config.make*)
2337 echo "$config_vars" >> config.make;;
2339 test -d bits || mkdir bits]],[[config_vars='$config_vars']])