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])
9 dnl This is here so we can set $subdirs directly based on configure fragments.
15 if test $host != $build; then
16 AC_CHECK_PROGS(BUILD_CC, gcc cc)
18 AC_SUBST(cross_compiling)
20 # We need the C++ compiler only for testing.
23 if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
24 AC_MSG_ERROR([you must configure in a separate build directory])
27 # This will get text that should go into config.make.
30 # Check for a --with-gd argument and set libgd-LDFLAGS in config.make.
32 AC_HELP_STRING([--with-gd=DIR],
33 [find libgd include dir and library with prefix DIR]),
37 *) libgd_include="-I$withval/include"
38 libgd_ldflags="-L$withval/lib" ;;
41 AC_ARG_WITH([gd-include],
42 AC_HELP_STRING([--with-gd-include=DIR],
43 [find libgd include files in DIR]),
45 case "$with_gd_include" in
47 *) libgd_include="-I$withval" ;;
51 AC_HELP_STRING([--with-gd-lib=DIR],
52 [find libgd library files in DIR]),
54 case "$with_gd_lib" in
56 *) libgd_ldflags="-L$withval" ;;
60 if test -n "$libgd_include"; then
61 config_vars="$config_vars
62 CFLAGS-memusagestat.c = $libgd_include"
64 if test -n "$libgd_ldflags"; then
65 config_vars="$config_vars
66 libgd-LDFLAGS = $libgd_ldflags"
69 dnl Arguments to specify presence of other packages/features.
71 AC_HELP_STRING([--with-fp],
72 [if using floating-point hardware @<:@default=yes@:>@]),
76 AC_ARG_WITH([binutils],
77 AC_HELP_STRING([--with-binutils=PATH],
78 [specify location of binutils (as and ld)]),
79 [path_binutils=$withval],
82 AC_HELP_STRING([--with-elf],
83 [if using the ELF object format]),
86 AC_ARG_WITH([selinux],
87 AC_HELP_STRING([--with-selinux],
88 [if building with SELinux support]),
89 [with_selinux=$withval],
92 AC_HELP_STRING([--with-xcoff],
93 [if using the XCOFF object format]),
97 AC_HELP_STRING([--without-cvs],
98 [if CVS should not be used]),
101 if test "$with_cvs" = yes; then
102 if test -d $srcdir/CVS && grep :pserver: $srcdir/CVS/Root > /dev/null
109 AC_ARG_WITH([headers],
110 AC_HELP_STRING([--with-headers=PATH],
111 [location of system headers to use
112 (for example /usr/src/linux/include)
113 @<:@default=compiler default@:>@]),
114 [sysheaders=$withval],
117 AC_ARG_ENABLE([sanity-checks],
118 AC_HELP_STRING([--disable-sanity-checks],
119 [really do not use threads (should not be used except in special situations) @<:@default=yes@:>@]),
120 [enable_sanity=$enableval],
123 AC_SUBST(enable_check_abi)
124 AC_ARG_ENABLE([check-abi],
125 AC_HELP_STRING([--enable-check-abi],
126 [do "make check-abi" in "make check" (no/warn/yes)
127 @<:@default=no@:>@]),
128 [enable_check_abi=$enableval],
129 [enable_check_abi=no])
131 dnl Arguments to enable or disable building the static, shared, profiled,
132 dnl and -fomit-frame-pointer libraries.
133 dnl I've disabled this for now since we cannot build glibc without static
134 dnl libraries built in the moment.
135 dnl AC_ARG_ENABLE([static],
136 dnl AC_HELP_STRING([--enable-static],
137 dnl [build static library @<:@default=yes@:>@]),
138 dnl [static=$enableval],
141 AC_ARG_ENABLE([shared],
142 AC_HELP_STRING([--enable-shared],
143 [build shared library @<:@default=yes if GNU ld & ELF@:>@]),
146 AC_ARG_ENABLE([profile],
147 AC_HELP_STRING([--enable-profile],
148 [build profiled library @<:@default=no@:>@]),
149 [profile=$enableval],
151 AC_ARG_ENABLE([omitfp],
152 AC_HELP_STRING([--enable-omitfp],
153 [build undebuggable optimized library @<:@default=no@:>@]),
156 AC_ARG_ENABLE([bounded],
157 AC_HELP_STRING([--enable-bounded],
158 [build with runtime bounds checking @<:@default=no@:>@]),
159 [bounded=$enableval],
161 AC_ARG_ENABLE([versioning],
162 AC_HELP_STRING([--disable-versioning],
163 [do not include versioning information in the library objects @<:@default=yes if supported@:>@]),
164 [enable_versioning=$enableval],
165 [enable_versioning=yes])
167 AC_ARG_ENABLE([oldest-abi],
168 AC_HELP_STRING([--enable-oldest-abi=ABI],
169 [configure the oldest ABI supported @<:@e.g. 2.2@:>@ @<:@default=glibc default@:>@]),
170 [oldest_abi=$enableval],
172 if test "$oldest_abi" = yes || test "$oldest_abi" = no; then
175 AC_DEFINE_UNQUOTED(GLIBC_OLDEST_ABI, "$oldest_abi")
179 AC_ARG_ENABLE([stackguard-randomization],
180 AC_HELP_STRING([--enable-stackguard-randomization],
181 [initialize __stack_chk_guard canary with a random number at program start]),
182 [enable_stackguard_randomize=$enableval],
183 [enable_stackguard_randomize=no])
184 if test "$enable_stackguard_randomize" = yes; then
185 AC_DEFINE(ENABLE_STACKGUARD_RANDOMIZE)
188 dnl Generic infrastructure for drop-in additions to libc.
189 AC_ARG_ENABLE([add-ons],
190 AC_HELP_STRING([--enable-add-ons@<:@=DIRS...@:>@],
191 [configure and build add-ons in DIR1,DIR2,...
192 search for add-ons if no parameter given]),
193 , [enable_add_ons=yes])
195 dnl Let the user avoid using TLS. Don't know why but...
197 AC_HELP_STRING([--with-tls],
198 [enable support for TLS]),
202 AC_ARG_WITH([__thread],
203 AC_HELP_STRING([--without-__thread],
204 [do not use TLS features even when supporting them]),
205 [use__thread=$withval],
208 AC_ARG_ENABLE([hidden-plt],
209 AC_HELP_STRING([--disable-hidden-plt],
210 [do not hide internal function calls to avoid PLT]),
213 if test "x$hidden" = xno; then
217 AC_ARG_ENABLE([bind-now],
218 AC_HELP_STRING([--enable-bind-now],
219 [disable lazy relocations in DSOs]),
220 [bindnow=$enableval],
224 dnl On some platforms we cannot use dynamic loading. We must provide
225 dnl static NSS modules.
226 AC_ARG_ENABLE([static-nss],
227 AC_HELP_STRING([--enable-static-nss],
228 [build static NSS modules @<:@default=no@:>@]),
229 [static_nss=$enableval],
231 dnl Enable static NSS also if we build no shared objects.
232 if test x"$static_nss" = xyes || test x"$shared" = xno; then
234 AC_DEFINE(DO_STATIC_NSS)
237 AC_ARG_ENABLE([force-install],
238 AC_HELP_STRING([--disable-force-install],
239 [don't force installation of files from this package, even if they are older than the installed files]),
240 [force_install=$enableval],
242 AC_SUBST(force_install)
244 dnl On some platforms we allow dropping compatibility with all kernel
246 AC_ARG_ENABLE([kernel],
247 AC_HELP_STRING([--enable-kernel=VERSION],
248 [compile for compatibility with kernel not older than VERSION]),
249 [minimum_kernel=$enableval],
251 dnl Prevent unreasonable values.
252 if test "$minimum_kernel" = yes || test "$minimum_kernel" = no; then
253 # Better nothing than this.
256 if test "$minimum_kernel" = current; then
257 minimum_kernel=`uname -r 2>/dev/null` || minimum_kernel=
261 dnl For the development we sometimes want gcc to issue even more warnings.
262 dnl This is not the default since many of the extra warnings are not
264 AC_ARG_ENABLE([all-warnings],
265 AC_HELP_STRING([--enable-all-warnings],
266 [enable all useful warnings gcc can issue]),
267 [all_warnings=$enableval],
269 AC_SUBST(all_warnings)
271 AC_ARG_ENABLE([multi-arch],
272 AC_HELP_STRING([--enable-multi-arch],
273 [enable single DSO with optimizations for multiple architectures]),
274 [multi_arch=$enableval],
275 [multi_arch=default])
276 if test x"$multi_arch" != xno; then
277 multi_arch_d=/multiarch
280 AC_ARG_ENABLE([experimental-malloc],
281 AC_HELP_STRING([--enable-experimental-malloc],
282 [enable experimental malloc features]),
283 [experimental_malloc=$enableval],
285 AC_SUBST(experimental_malloc)
287 AC_ARG_ENABLE([nss-crypt],
288 AC_HELP_STRING([--enable-nss-crypt],
289 [enable libcrypt to use nss]),
290 [nss_crypt=$enableval],
292 if test x$nss_crypt = xyes; then
293 nss_includes=-I$(nss-config --includedir 2>/dev/null)
294 if test $? -ne 0; then
295 AC_MSG_ERROR([cannot find include directory with nss-config])
298 CFLAGS="$CFLAGS $nss_includes"
299 AC_COMPILE_IFELSE([typedef int PRBool;
301 #include <nsslowhash.h>
302 void f (void) { NSSLOW_Init (); }],
303 libc_cv_nss_crypt=yes,
305 cannot find NSS headers with lowlevel hash function interfaces]))
307 LIBS="$LIBS -lfreebl3"
308 AC_LINK_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
310 #include <nsslowhash.h>],
312 libc_cv_nss_crypt=yes,
314 cannot link program using lowlevel NSS hash functions]))
320 AC_SUBST(libc_cv_nss_crypt)
322 # The way shlib-versions is used to generate soversions.mk uses a
323 # fairly simplistic model for name recognition that can't distinguish
324 # i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
325 # of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can
326 # tell. This doesn't get used much beyond that, so it's fairly safe.
331 host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'`
335 # We keep the original values in `$config_*' and never modify them, so we
336 # can write them unchanged into config.make. Everything else uses
337 # $machine, $vendor, and $os, and changes them whenever convenient.
338 config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
340 # Don't allow vendor == "unknown"
341 test "$config_vendor" = unknown && config_vendor=
342 config_os="`echo $config_os | sed 's/^unknown-//'`"
344 # Some configurations imply other options.
346 # i586-linuxaout is mangled into i586-pc-linux-gnuaout
347 linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*)
349 gnu* | linux* | freebsd* | netbsd* | sysv4* | solaris2* | irix6*)
350 # These systems (almost) always use the ELF format.
354 # These systems are always xcoff
360 # The configure fragment of an add-on port can modify these to supplement
361 # or override the table in the case statement below. No fragment should
362 # ever change the config_* variables, however.
363 machine=$config_machine
364 vendor=$config_vendor
368 # config.guess on some IBM machines says `rs6000' instead of `powerpc'.
370 if test "$machine" = rs6000; then
374 # Braindead PowerPC box with absolutely no FPU.
375 case "$machine-$host_os" in
383 AS_HELP_STRING([--with-cpu=CPU], [select code for CPU variant]),
386 yes|'') AC_MSG_ERROR([--with-cpu requires an argument]) ;;
388 *) submachine="$withval" ;;
392 # An add-on can set this when it wants to disable the sanity check below.
395 dnl Having this here, though empty, makes sure that if add-ons' fragments
396 dnl do AC_CONFIG_SUBDIRS([some-dir]), which just sets $subdirs, then
397 dnl our AC_OUTPUT will actually use it.
400 case "$enable_add_ons" in
403 add_ons=`cd $srcdir && ls -d 2> /dev/null */configure */sysdeps |
404 sed 's@/[[^/]]*$@@' | sort | uniq`
405 add_ons_automatic=yes
407 *) add_ons=`echo "$enable_add_ons" | sed 's/,/ /g'`
408 add_ons_automatic=no ;;
414 if test x"$add_ons" != x; then
415 for f in $add_ons; do
420 *** It seems that you're using an old \`crypt' add-on. crypt is now
421 *** part of glibc and using the old add-on will not work with this
422 *** release. Start again with fresh sources and without the old
423 *** \`crypt' add-on.])
427 *** It seems that you're using an old \`localedata' add-on. localedata
428 *** is now part of glibc and using the old add-on will not work with
429 *** this release. Start again with fresh sources and without the old
430 *** \`localedata' add-on.])
435 # Now source each add-on's configure fragment.
436 # The fragments can use $srcdir/$libc_add_on to find themselves,
437 # and test $add_ons_automatic to see if they were explicitly requested.
438 # A fragment can clear (or even change) $libc_add_on to affect
439 # whether it goes into the list to be actually used in the build.
441 for libc_add_on in $add_ons; do
442 # Test whether such a directory really exists.
443 # It can be absolute, or relative to $srcdir, or relative to the build dir.
444 case "$libc_add_on" in
446 libc_add_on_srcdir=$libc_add_on
449 test -d "$srcdir/$libc_add_on" || {
450 if test -d "$libc_add_on"; then
451 libc_add_on="`pwd`/$libc_add_on"
453 AC_MSG_ERROR(add-on directory \"$libc_add_on\" does not exist)
456 libc_add_on_srcdir=$srcdir/$libc_add_on
460 libc_add_on_frag=$libc_add_on_srcdir/configure
461 libc_add_on_canonical=
462 libc_add_on_config_subdirs=
463 if test -r "$libc_add_on_frag"; then
464 AC_MSG_NOTICE(running configure fragment for add-on $libc_add_on)
465 libc_add_on_canonical=unknown
467 . "$libc_add_on_frag"
468 test -z "$libc_add_on" || {
469 configured_add_ons="$configured_add_ons $libc_add_on"
470 if test "x$libc_add_on_canonical" = xunknown; then
471 AC_MSG_ERROR(fragment must set \$libc_add_on_canonical)
473 for d in $libc_add_on_subdirs; do
474 case "$libc_add_on" in
475 /*) subdir_srcdir="$libc_add_on" ;;
476 *) subdir_srcdir="\$(..)$libc_add_on" ;;
480 d="${libc_add_on_canonical:-$libc_add_on}"
486 subdir_srcdir="$subdir_srcdir/$d"
489 d=`echo "$d" | sed 's@/*$@@;s@^.*/@@'`
490 add_on_subdirs="$add_on_subdirs $d"
491 test "$subdir_srcdir" = "\$(..)$d" || config_vars="$config_vars
492 $d-srcdir = $subdir_srcdir"
494 for d in $libc_add_on_config_subdirs; do
497 fragment uses absolute path in \$libc_add_on_config_subdirs) ;;
499 if test ! -d "$libc_add_on_srcdir/$d"; then
500 AC_MSG_ERROR(fragment wants to configure missing directory $d)
502 case "$libc_add_on" in
504 relative path required for add-on using \$libc_add_on_config_subdirs) ;;
506 subdirs="$subdirs $libc_add_on/$d"
510 if test -n "$libc_add_on"; then
511 if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2> /dev/null`
513 AC_MSG_CHECKING(add-on $libc_add_on for preconfigure fragments)
514 for frag in $frags; do
515 name=`echo "$frag" | sed 's@/[[^/]]*$@@;s@^.*/@@'`
516 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
521 use_add_ons="$use_add_ons $libc_add_on"
522 add_ons_pfx="$add_ons_pfx $libc_add_on/"
523 test -z "$libc_add_on_canonical" ||
524 add_ons_sfx="$add_ons_sfx /$libc_add_on_canonical"
527 # Use echo to strip excess whitespace.
528 add_ons="`echo $use_add_ons`"
531 AC_SUBST(add_on_subdirs)
535 ### I put this here to prevent those annoying emails from people who cannot
536 ### read and try to compile glibc on unsupported platforms. --drepper
538 ### By using the undocumented --enable-hacker-mode option for configure
539 ### one can skip this test to make the configuration not fail for unsupported
542 if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then
543 case "$machine-$host_os" in
544 *-linux* | *-gnu* | arm*-none* | powerpc-aix4.3.*)
547 echo "*** The GNU C library is currently not available for this platform."
548 echo "*** So far nobody cared to port it and if there is no volunteer it"
549 echo "*** might never happen. So, if you have interest to see glibc on"
550 echo "*** this platform visit"
551 echo "*** http://www.gnu.org/software/libc/porting.html"
552 echo "*** and join the group of porters"
558 dnl We need to use [ and ] for other purposes for a while now.
560 # Expand the configuration machine name into a subdirectory by architecture
561 # type and particular chip. If an add-on configure fragment already set
562 # base_machine, we don't change it.
563 test -n "$base_machine" || case "$machine" in
564 a29k | am29000) base_machine=a29k machine=a29k ;;
565 c3[012]) base_machine=cx0 machine=cx0/c30 ;;
566 c4[04]) base_machine=cx0 machine=cx0/c40 ;;
567 i[34567]86) base_machine=i386 machine=i386/$machine ;;
568 ia64) base_machine=ia64 machine=ia64 ;;
569 m88???) base_machine=m88k machine=m88k/$machine ;;
570 m88k) base_machine=m88k machine=m88k/m88100 ;;
571 powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;;
572 powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;;
573 s390) base_machine=s390 machine=s390/s390-32 ;;
574 s390x) base_machine=s390 machine=s390/s390-64 ;;
575 sh3*) base_machine=sh machine=sh/sh3 ;;
576 sh4*) base_machine=sh machine=sh/sh4 ;;
578 base_machine=sparc machine=sparc/sparc32 ;;
579 sparcv8 | supersparc | hypersparc)
580 base_machine=sparc machine=sparc/sparc32/sparcv8 ;;
581 sparcv8plus | sparcv8plusa | sparcv9)
582 base_machine=sparc machine=sparc/sparc32/sparcv9 ;;
583 sparcv8plusb | sparcv9b)
584 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;;
586 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v ;;
588 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v2 ;;
590 base_machine=sparc machine=sparc/sparc64 ;;
592 base_machine=sparc machine=sparc/sparc64/sparcv9b ;;
594 base_machine=sparc machine=sparc/sparc64/sparcv9v ;;
596 base_machine=sparc machine=sparc/sparc64/sparcv9v2 ;;
597 *) base_machine=$machine ;;
600 AC_SUBST(base_machine)
602 if test "$base_machine" = "i386"; then
603 AC_DEFINE(USE_REGPARMS)
606 # Compute the list of sysdep directories for this configuration.
607 # This can take a while to compute.
608 sysdep_dir=$srcdir/sysdeps
609 AC_MSG_CHECKING(sysdep dirs)
610 dnl We need to use [ and ] for other purposes for a while now.
612 # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
613 os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
615 test "x$base_os" != x || case "$os" in
618 netbsd* | 386bsd* | freebsd* | bsdi*)
619 base_os=unix/bsd/bsd4.4 ;;
620 osf* | sunos* | ultrix* | newsos* | dynix* | *bsd*)
622 sysv* | isc* | esix* | sco* | minix* | irix4* | linux*)
625 base_os=unix/sysv/irix6/$os ;;
627 base_os=unix/sysv/sysv4 ;;
629 base_os=unix/sysv/hpux/$os ;;
631 base_os=unix/sysv/aix/aix4.3 ;;
633 base_os=standalone ;;
636 # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
639 while o=`echo $tail | sed 's/\.[^.]*$//'`; test $o != $tail; do
643 o=`echo $tail | sed 's/[0-9]*$//'`
644 if test $o != $tail; then
647 # For linux-gnu, try linux-gnu, then linux.
648 o=`echo $tail | sed 's/-.*$//'`
649 if test $o != $tail; then
653 # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
656 while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$b"; do
662 # For sparc/sparc32, try sparc/sparc32 and then sparc.
664 tail=$machine${submachine:+/$submachine}
665 while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
667 # Prepend the machine's FPU directory unless --without-fp.
668 if test "$with_fp" = yes; then
671 mach="$mach /$1/nofpu"
677 dnl We are done with glob and regexp uses of [ and ]; return to autoconf.
680 # Find what sysdep directories exist.
683 for b in $base ''; do
684 for m0 in $mach ''; do
685 for v in /$vendor ''; do
686 test "$v" = / && continue
687 for o in /$ostry ''; do
688 test "$o" = / && continue
689 for m in $multi_arch_d $mach ''; do
690 for d in $add_ons_pfx ''; do
691 for a in $add_ons_sfx ''; do
692 if test -n "$m0$m0sub$b$v$o$m$msub"; then
693 try_srcdir="${srcdir}/"
697 try="${d}sysdeps$m0$m0sub$b$v$o$m$msub$a"
698 test -n "$enable_debug_configure" &&
699 echo "$0 [DEBUG]: try $try" >&2
700 if test -d "$try_srcdir$try"; then
701 sysnames="$sysnames $try"
702 { test -n "$o" || test -n "$b"; } && os_used=t
703 { test -n "$m" || test -n "$m0"; } && machine_used=t
705 x*/$submachine) submachine_used=t ;;
707 if test -n "$d"; then
708 case "$sysnames_add_ons" in
710 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
723 # If the assembler supports gnu_indirect_function symbol type and the
724 # architecture supports multi-arch, we enable multi-arch by default.
725 if test "$multi_arch" = default; then
726 AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support],
727 libc_cv_asm_gnu_indirect_function, [dnl
728 cat > conftest.s <<EOF
729 .type foo,%gnu_indirect_function
731 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
733 libc_cv_asm_gnu_indirect_function=yes
735 libc_cv_asm_gnu_indirect_function=no
739 if test "$libc_cv_asm_gnu_indirect_function" = yes; then
740 case $sysnames_add_ons$sysnames in
747 if test x"$multi_arch" = xyes; then
748 AC_DEFINE(USE_MULTIARCH)
752 if test -z "$os_used" && test "$os" != none; then
753 AC_MSG_ERROR(Operating system $os is not supported.)
755 if test -z "$machine_used" && test "$machine" != none; then
756 AC_MSG_ERROR(The $machine is not supported.)
758 if test -z "$submachine_used" && test -n "$submachine"; then
759 AC_MSG_ERROR(The $submachine subspecies of $host_cpu is not supported.)
763 # We have now validated the configuration.
766 # If using ELF, look for an `elf' subdirectory of each machine directory.
767 # We prepend these rather than inserting them whereever the machine appears
768 # because things specified by the machine's ELF ABI should override
769 # OS-specific things, and should always be the same for any OS on the
770 # machine (otherwise what's the point of an ABI?).
771 if test "$elf" = yes; then
773 for d in $add_ons_pfx ''; do
775 if test -d $srcdir/${d}sysdeps$m/elf; then
776 elf_dirs="$elf_dirs ${d}sysdeps$m/elf"
780 sysnames="`echo $elf_dirs | sed -e 's,//,/,g'` $sysnames"
784 # Expand the list of system names into a full list of directories
785 # from each element's parent name and Implies file (if present).
788 while test $# -gt 0; do
792 case " $names " in *" $name "*)
793 # Already in the list.
797 # Report each name as we discover it, so there is no long pause in output.
798 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
800 name_base=`echo $name | sed -e 's@\(.*sysdeps\)/.*@\1@'`
804 *) xsrcdir=$srcdir/ ;;
806 test -n "$enable_debug_configure" &&
807 echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2
809 if test -f $xsrcdir$name/Implies; then
810 # Collect more names from the `Implies' file (removing comments).
811 implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`"
813 for x in $implied_candidate; do
815 if test -d $xsrcdir$name_base/$x; then
816 implied="$implied $name_base/$x";
819 for d in $add_ons_pfx ''; do
823 *) try_srcdir=$srcdir/ ;;
825 test -n "$enable_debug_configure" &&
826 echo "[DEBUG]: $name implied $x try($d) {$try_srcdir}$try" >&2
827 if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
829 implied="$implied $try"
831 case "$sysnames_add_ons" in
833 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
837 if test $found = no; then
838 AC_MSG_WARN($name/Implies specifies nonexistent $x)
845 # Add NAME to the list of names.
848 # Find the parent of NAME, using the empty string if it has none.
850 parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
853 # Add the names implied by NAME, and NAME's parent (if it has one), to
854 # the list of names to be processed (the argument list). We prepend the
855 # implied names to the list and append the parent. We want implied
856 # directories to come before further directories inferred from the
857 # configuration components; this ensures that for sysv4, unix/common
858 # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
860 sysnames="`echo $implied $* $parent`"
861 test -n "$sysnames" && set $sysnames
864 # Add the default directories.
865 default_sysnames=sysdeps/generic
866 if test "$elf" = yes; then
867 default_sysnames="sysdeps/generic/elf $default_sysnames"
869 sysnames="$names $default_sysnames"
871 # The other names were emitted during the scan.
872 AC_MSG_RESULT($default_sysnames)
874 # Collect the list of add-ons that supply partial sysdeps trees.
876 for add_on in $add_ons; do
879 *) xsrcdir="$srcdir/" ;;
882 test -d "$xsrcdir$add_on/sysdeps" || {
883 case "$configured_add_ons " in
886 AC_MSG_ERROR(add-on $add_on has no configure fragment or sysdeps tree)
892 sysdeps_add_ons="$sysdeps_add_ons $add_on"
893 case "$sysnames_add_ons" in
896 AC_MSG_WARN(add-on $add_on contributed no sysdeps directories)
901 for d in $sysnames; do
903 $add_on/sysdeps/*) ;;
906 (cd "$xsrcdir$d" && for f in *[[!~]]; do
910 test -d "$ff" || { test -e "$ff" && exit 88; }
914 test -d "$f" || { test -e "$f" && exit 88; }
918 if test $? -eq 88; then
923 if test $found = no; then
924 AC_MSG_WARN(add-on $add_on contributed no useful sysdeps directories)
927 AC_SUBST(sysdeps_add_ons)
933 if test "$INSTALL" = "${srcdir}/scripts/install-sh -c"; then
934 # The makefiles need to use a different form to find it in $srcdir.
935 INSTALL='\$(..)./scripts/install-sh -c'
940 AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
942 # Accept binutils 2.13 or newer.
943 AC_CHECK_PROG_VER(AS, $AS, --version,
944 [GNU assembler.* \([0-9]*\.[0-9.]*\)],
945 [2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], AS=: critic_missing="$critic_missing as")
946 AC_CHECK_PROG_VER(LD, $LD, --version,
947 [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
948 [2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], LD=: critic_missing="$critic_missing ld")
950 # We need the physical current working directory. We cannot use the
951 # "pwd -P" shell builtin since that's not portable. Instead we try to
952 # find a pwd binary. Note that assigning to the PWD environment
953 # variable might have some interesting side effects, so we don't do
955 AC_PATH_PROG(PWD_P, pwd, no)
956 if test "$PWD_P" = no; then
957 AC_MSG_ERROR(*** A pwd binary could not be found.)
960 # These programs are version sensitive.
962 AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
963 [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* ],
964 critic_missing="$critic_missing gcc")
965 AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
966 [GNU Make[^0-9]*\([0-9][0-9.]*\)],
967 [3.79* | 3.[89]*], critic_missing="$critic_missing make")
969 AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
970 [GNU gettext.* \([0-9]*\.[0-9.]*\)],
971 [0.10.3[6-9]* | 0.10.[4-9][0-9]* | 0.1[1-9]* | 0.[2-9][0-9]* | [1-9].*],
972 MSGFMT=: aux_missing="$aux_missing msgfmt")
973 AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
974 [GNU texinfo.* \([0-9][0-9.]*\)],
976 MAKEINFO=: aux_missing="$aux_missing makeinfo")
977 AC_CHECK_PROG_VER(SED, sed, --version,
978 [GNU sed version \([0-9]*\.[0-9.]*\)],
979 [3.0[2-9]*|3.[1-9]*|[4-9]*],
980 SED=: aux_missing="$aux_missing sed")
982 AC_CHECK_PROGS(AUTOCONF, autoconf, no)
984 xno|x|x:) AUTOCONF=no ;;
987 whether $AUTOCONF${ACFLAGS:+ }$ACFLAGS works, libc_cv_autoconf_works, [dnl
988 if (cd $srcdir; $AUTOCONF $ACFLAGS configure.in > /dev/null 2>&1); then
989 libc_cv_autoconf_works=yes
991 libc_cv_autoconf_works=no
993 test $libc_cv_autoconf_works = yes || AUTOCONF=no
996 if test "x$with_cvs" = xyes && test "x$AUTOCONF" = xno; then
997 # If --without-cvs they probably won't change configure.in, so no complaints.
998 aux_missing="$aux_missing autoconf"
1001 test -n "$critic_missing" && AC_MSG_ERROR([
1002 *** These critical programs are missing or too old:$critic_missing
1003 *** Check the INSTALL file for required versions.])
1005 test -n "$aux_missing" && AC_MSG_WARN([
1006 *** These auxiliary programs are missing or incompatible versions:$aux_missing
1007 *** some features will be disabled.
1008 *** Check the INSTALL file for required versions.])
1010 # if using special system headers, find out the compiler's sekrit
1011 # header directory and add that to the list. NOTE: Only does the right
1012 # thing on a system that doesn't need fixincludes. (Not presently a problem.)
1013 if test -n "$sysheaders"; then
1014 SYSINCLUDES=-nostdinc
1015 for d in include include-fixed; do
1016 i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
1017 SYSINCLUDES="$SYSINCLUDES -isystem $i"
1019 SYSINCLUDES="$SYSINCLUDES \
1020 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
1021 if test -n "$CXX"; then
1022 cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
1023 cxxmachine=`$CXX -dumpmachine 2>&AS_MESSAGE_LOG_FD` &&
1024 cxxheaders=`$CXX -print-file-name=../../../../include/c++/`"$cxxversion" &&
1025 CXX_SYSINCLUDES="-isystem $cxxheaders \
1026 -isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
1029 AC_SUBST(SYSINCLUDES)
1030 AC_SUBST(CXX_SYSINCLUDES)
1032 # check if ranlib is necessary
1033 AC_CACHE_CHECK(whether ranlib is necessary, libc_cv_ranlib_necessary, [dnl
1034 cat > conftest.c <<EOF
1039 $CC $CFLAGS $CPPFLAGS -c conftest.c
1040 $AR cr conftest.a conftest.o
1041 cp conftest.a conftest2.a
1043 if cmp -s conftest.a conftest2.a; then
1044 libc_cv_ranlib_necessary=no
1046 libc_cv_ranlib_necessary=yes
1049 if test "$libc_cv_ranlib_necessary" = no; then
1053 # Test if LD_LIBRARY_PATH contains the notation for the current directory
1054 # since this would lead to problems installing/building glibc.
1055 # LD_LIBRARY_PATH contains the current directory if one of the following
1057 # - one of the terminals (":" and ";") is the first or last sign
1058 # - two terminals occur directly after each other
1059 # - the path contains an element with a dot in it
1060 AC_MSG_CHECKING(LD_LIBRARY_PATH variable)
1062 case ${LD_LIBRARY_PATH} in
1063 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
1064 ld_library_path_setting="contains current directory"
1067 ld_library_path_setting="ok"
1071 AC_MSG_RESULT($ld_library_path_setting)
1072 if test "$ld_library_path_setting" != "ok"; then
1074 *** LD_LIBRARY_PATH shouldn't contain the current directory when
1075 *** building glibc. Please change the environment variable
1076 *** and run configure again.])
1079 AC_CACHE_CHECK(whether GCC supports -static-libgcc, libc_cv_gcc_static_libgcc, [dnl
1080 if $CC -v -static-libgcc 2>&1 | grep -q 'unrecognized option.*static-libgcc'; then
1081 libc_cv_gcc_static_libgcc=
1083 libc_cv_gcc_static_libgcc=-static-libgcc
1085 AC_SUBST(libc_cv_gcc_static_libgcc)
1087 AC_PATH_PROG(BASH_SHELL, bash, no)
1088 if test "$BASH_SHELL" != no &&
1089 $BASH_SHELL -c 'test "$BASH_VERSINFO" \
1090 && test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then
1091 libc_cv_have_bash2=yes
1093 libc_cv_have_bash2=no
1095 AC_SUBST(libc_cv_have_bash2)
1097 dnl We need a ksh compatible shell for tzselect.
1098 if test "$BASH_SHELL" = no; then
1099 AC_PATH_PROG(KSH, ksh, no)
1100 if test "$KSH" = no; then
1103 libc_cv_have_ksh=yes
1108 libc_cv_have_ksh=yes
1110 AC_SUBST(libc_cv_have_ksh)
1113 AC_PATH_PROG(PERL, perl, no)
1114 if test "$PERL" != no &&
1115 (eval `$PERL -V:apiversion`; test `expr "$apiversion" \< 5` -ne 0); then
1118 AC_PATH_PROG(INSTALL_INFO, install-info, no,
1119 $PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin)
1120 AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin)
1122 AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl
1123 echo '#include <stddef.h>
1124 FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
1125 if eval "$ac_cpp conftest.c 2>/dev/null" \
1126 | grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null; then
1127 libc_cv_signed_size_t=no
1129 libc_cv_signed_size_t=yes
1132 if test $libc_cv_signed_size_t = yes; then
1133 dnl Do this by hand instead of AC_DEFINE so can add #undef to avoid warnings.
1134 cat >> confdefs.h <<\EOF
1135 #undef __SIZE_TYPE__
1136 #define __SIZE_TYPE__ unsigned
1140 AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl
1142 [#define __need_size_t
1143 #define __need_wchar_t
1146 #include <stddef.h>], [size_t size; wchar_t wchar;
1148 #error stddef.h ignored __need_*
1150 if (&size == NULL || &wchar == NULL) abort ();],
1151 libc_cv_friendly_stddef=yes,
1152 libc_cv_friendly_stddef=no)])
1153 if test $libc_cv_friendly_stddef = yes; then
1154 config_vars="$config_vars
1155 override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
1158 AC_CACHE_CHECK(whether we need to use -P to assemble .S files,
1159 libc_cv_need_minus_P, [dnl
1160 cat > conftest.S <<EOF
1161 #include "confdefs.h"
1162 /* Nothing whatsoever. */
1164 if AC_TRY_COMMAND(${CC-cc} $CPPFLAGS $ASFLAGS -c conftest.S 1>&AS_MESSAGE_LOG_FD); then
1165 libc_cv_need_minus_P=no
1167 libc_cv_need_minus_P=yes
1170 if test $libc_cv_need_minus_P = yes; then
1171 config_vars="$config_vars
1172 asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
1175 AC_MSG_CHECKING(whether .text pseudo-op must be used)
1176 AC_CACHE_VAL(libc_cv_dot_text, [dnl
1177 cat > conftest.s <<EOF
1181 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1182 libc_cv_dot_text=.text
1185 if test -z "$libc_cv_dot_text"; then
1191 AC_CACHE_CHECK(for assembler global-symbol directive,
1192 libc_cv_asm_global_directive, [dnl
1193 libc_cv_asm_global_directive=UNKNOWN
1194 for ac_globl in .globl .global .EXPORT; do
1195 cat > conftest.s <<EOF
1200 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1201 libc_cv_asm_global_directive=${ac_globl}
1204 test $libc_cv_asm_global_directive != UNKNOWN && break
1206 if test $libc_cv_asm_global_directive = UNKNOWN; then
1207 AC_MSG_ERROR(cannot determine asm global directive)
1209 AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${libc_cv_asm_global_directive})
1212 AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl
1213 cat > conftest.s <<EOF
1216 .set glibc_conftest_frobozz,foo
1217 $libc_cv_asm_global_directive glibc_conftest_frobozz
1219 # The alpha-dec-osf1 assembler gives only a warning for `.set'
1220 # (but it doesn't work), so we must do a linking check to be sure.
1221 cat > conftest1.c <<\EOF
1222 extern int glibc_conftest_frobozz;
1223 void _start() { glibc_conftest_frobozz = 1; }
1225 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1226 -nostartfiles -nostdlib \
1227 -o conftest conftest.s conftest1.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1228 libc_cv_asm_set_directive=yes
1230 libc_cv_asm_set_directive=no
1233 if test $libc_cv_asm_set_directive = yes; then
1234 AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
1237 AC_CACHE_CHECK(for assembler .type directive prefix,
1238 libc_cv_asm_type_prefix, [dnl
1239 libc_cv_asm_type_prefix=no
1240 for ac_try_prefix in '@' '%' '#'; do
1241 cat > conftest.s <<EOF
1243 ${libc_cv_asm_global_directive} foo
1244 .type foo, ${ac_try_prefix}object
1249 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1250 libc_cv_asm_type_prefix=${ac_try_prefix}
1253 test "x$libc_cv_asm_type_prefix" != xno && break
1255 if test "x$libc_cv_asm_type_prefix" != xno; then
1256 AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix})
1259 AC_CACHE_CHECK(for assembler gnu_unique_object symbol type,
1260 libc_cv_asm_unique_object, [dnl
1261 cat > conftest.s <<EOF
1264 .type _sym, ${libc_cv_asm_type_prefix}gnu_unique_object
1266 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1267 libc_cv_asm_unique_object=yes
1269 libc_cv_asm_unique_object=no
1272 if test $libc_cv_asm_unique_object = yes; then
1273 AC_DEFINE(HAVE_ASM_UNIQUE_OBJECT)
1276 # For the multi-arch option we need support in the assembler.
1277 if test "$multi_arch" = yes; then
1278 if test "x$libc_cv_asm_type_prefix" != xno; then
1279 AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support],
1280 libc_cv_asm_gnu_indirect_function, [dnl
1281 cat > conftest.s <<EOF
1282 .type foo,%gnu_indirect_function
1284 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
1286 libc_cv_asm_gnu_indirect_function=yes
1288 libc_cv_asm_gnu_indirect_function=no
1292 libc_cv_asm_gnu_indirect_function=no
1294 if test x"$libc_cv_asm_gnu_indirect_function" != xyes; then
1295 AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
1299 AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
1300 [cat > conftest.s <<EOF
1303 .symver _sym,sym@VERS
1305 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1306 libc_cv_asm_symver_directive=yes
1308 libc_cv_asm_symver_directive=no
1311 AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl
1312 if test $libc_cv_asm_symver_directive = yes; then
1313 cat > conftest.s <<EOF
1316 .symver _sym,sym@VERS
1318 cat > conftest.map <<EOF
1327 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1328 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
1329 -o conftest.so conftest.o
1330 -nostartfiles -nostdlib
1331 -Wl,--version-script,conftest.map
1332 1>&AS_MESSAGE_LOG_FD]);
1334 libc_cv_ld_version_script_option=yes
1336 libc_cv_ld_version_script_option=no
1339 libc_cv_ld_version_script_option=no
1342 libc_cv_ld_version_script_option=no
1345 if test $shared != no &&
1346 test $libc_cv_asm_symver_directive = yes &&
1347 test $libc_cv_ld_version_script_option = yes &&
1348 test $enable_versioning = yes; then
1350 AC_DEFINE(DO_VERSIONING)
1354 AC_SUBST(VERSIONING)
1356 if test $elf = yes && test $shared != no && test $VERSIONING = no; then
1358 *** WARNING: You should not compile GNU libc without versioning. Not using
1359 *** versioning will introduce incompatibilities so that old binaries
1360 *** will not run anymore.
1361 *** For versioning you need recent binutils (binutils-2.8.1.0.23 or newer)."
1363 if test $elf = yes; then
1364 AC_CACHE_CHECK(for .previous assembler directive,
1365 libc_cv_asm_previous_directive, [dnl
1366 cat > conftest.s <<EOF
1367 .section foo_section
1370 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1371 libc_cv_asm_previous_directive=yes
1373 libc_cv_asm_previous_directive=no
1376 if test $libc_cv_asm_previous_directive = yes; then
1377 AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
1379 AC_CACHE_CHECK(for .popsection assembler directive,
1380 libc_cv_asm_popsection_directive, [dnl
1381 cat > conftest.s <<EOF
1382 .pushsection foo_section
1385 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1386 libc_cv_asm_popsection_directive=yes
1388 libc_cv_asm_popsection_directive=no
1391 if test $libc_cv_asm_popsection_directive = yes; then
1392 AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
1395 AC_CACHE_CHECK(for .protected and .hidden assembler directive,
1396 libc_cv_asm_protected_directive, [dnl
1397 cat > conftest.s <<EOF
1403 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1404 libc_cv_asm_protected_directive=yes
1406 AC_MSG_ERROR(assembler support for symbol visibility is required)
1410 if test $libc_cv_asm_protected_directive = yes; then
1411 AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
1412 libc_cv_visibility_attribute,
1413 [cat > conftest.c <<EOF
1414 int foo __attribute__ ((visibility ("hidden"))) = 1;
1415 int bar __attribute__ ((visibility ("protected"))) = 1;
1417 libc_cv_visibility_attribute=no
1418 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1419 if grep '\.hidden.*foo' conftest.s >/dev/null; then
1420 if grep '\.protected.*bar' conftest.s >/dev/null; then
1421 libc_cv_visibility_attribute=yes
1427 if test $libc_cv_visibility_attribute != yes; then
1428 AC_MSG_ERROR(compiler support for visibility attribute is required)
1432 if test $libc_cv_visibility_attribute = yes; then
1433 AC_CACHE_CHECK(for broken __attribute__((visibility())),
1434 libc_cv_broken_visibility_attribute,
1435 [cat > conftest.c <<EOF
1437 int bar (int x) __asm__ ("foo") __attribute__ ((visibility ("hidden")));
1438 int bar (int x) { return x; }
1440 libc_cv_broken_visibility_attribute=yes
1441 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s1>&AS_MESSAGE_LOG_FD); then
1443 if grep '\.hidden[ _]foo' conftest.s >/dev/null; then
1445 libc_cv_broken_visibility_attribute=no
1448 rm -f conftest.c conftest.s
1450 if test $libc_cv_broken_visibility_attribute = yes; then
1451 AC_MSG_ERROR(working compiler support for visibility attribute is required)
1455 AC_CACHE_CHECK(for broken __attribute__((alias())),
1456 libc_cv_broken_alias_attribute,
1457 [cat > conftest.c <<EOF
1458 extern int foo (int x) __asm ("xyzzy");
1459 int bar (int x) { return x; }
1460 extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
1462 extern __typeof (dfoo) dfoo __asm ("abccb");
1465 libc_cv_broken_alias_attribute=yes
1466 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1467 if grep 'xyzzy' conftest.s >/dev/null &&
1468 grep 'abccb' conftest.s >/dev/null; then
1469 libc_cv_broken_alias_attribute=no
1472 rm -f conftest.c conftest.s
1474 if test $libc_cv_broken_alias_attribute = yes; then
1475 AC_MSG_ERROR(working alias attribute support required)
1478 if test $libc_cv_visibility_attribute = yes; then
1479 AC_CACHE_CHECK(whether to put _rtld_local into .sdata section,
1480 libc_cv_have_sdata_section,
1481 [echo "int i;" > conftest.c
1482 libc_cv_have_sdata_section=no
1483 if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
1484 | grep '\.sdata' >/dev/null; then
1485 libc_cv_have_sdata_section=yes
1487 rm -f conftest.c conftest.so
1489 if test $libc_cv_have_sdata_section = yes; then
1490 AC_DEFINE(HAVE_SDATA_SECTION)
1494 AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
1495 libc_cv_initfini_array, [dnl
1496 cat > conftest.c <<EOF
1497 int _start (void) { return 0; }
1498 int __start (void) { return 0; }
1499 int foo (void) { return 1; }
1500 int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
1502 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c
1503 -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
1505 if readelf -S conftest | fgrep INIT_ARRAY > /dev/null; then
1506 libc_cv_initfini_array=yes
1508 libc_cv_initfini_array=no
1511 libc_cv_initfini_array=no
1514 if test $libc_cv_initfini_array != yes; then
1515 AC_MSG_ERROR([Need linker with .init_array/.fini_array support.])
1518 AC_CACHE_CHECK(for libunwind-support in compiler,
1519 libc_cv_cc_with_libunwind, [
1520 cat > conftest.c <<EOF
1521 int main (void) { return 0; }
1523 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
1524 conftest.c -v 2>&1 >/dev/null | grep -q " -lunwind "; then
1525 libc_cv_cc_with_libunwind=yes
1527 libc_cv_cc_with_libunwind=no
1530 AC_SUBST(libc_cv_cc_with_libunwind)
1531 if test $libc_cv_cc_with_libunwind = yes; then
1532 AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
1535 AC_CACHE_CHECK(for -z nodelete option,
1536 libc_cv_z_nodelete, [dnl
1537 cat > conftest.c <<EOF
1538 int _start (void) { return 42; }
1540 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1541 -fPIC -shared -o conftest.so conftest.c
1542 -nostartfiles -nostdlib
1543 -Wl,--enable-new-dtags,-z,nodelete 1>&AS_MESSAGE_LOG_FD])
1545 libc_cv_z_nodelete=yes
1547 AC_MSG_ERROR(linker with -z nodelete support required)
1551 AC_CACHE_CHECK(for -z nodlopen option,
1552 libc_cv_z_nodlopen, [dnl
1553 cat > conftest.c <<EOF
1554 int _start (void) { return 42; }
1556 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1557 -fPIC -shared -o conftest.so conftest.c
1558 -nostartfiles -nostdlib
1559 -Wl,--enable-new-dtags,-z,nodlopen 1>&AS_MESSAGE_LOG_FD])
1561 libc_cv_z_nodlopen=yes
1563 AC_MSG_ERROR(linker with -z nodlopen support required)
1567 AC_CACHE_CHECK(for -z initfirst option,
1568 libc_cv_z_initfirst, [dnl
1569 cat > conftest.c <<EOF
1570 int _start (void) { return 42; }
1572 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1573 -fPIC -shared -o conftest.so conftest.c
1574 -nostartfiles -nostdlib
1575 -Wl,--enable-new-dtags,-z,initfirst 1>&AS_MESSAGE_LOG_FD])
1577 libc_cv_z_initfirst=yes
1579 AC_MSG_ERROR(linker with -z initfirst support required)
1583 case "$base_machine" in
1585 i[34567]86 | x86_64 | powerpc* | s390* | sparc* | alpha*)
1587 AC_CACHE_CHECK(for -z relro option,
1588 libc_cv_z_relro, [dnl
1590 if AC_TRY_COMMAND([${CC-cc} -v --help 2>&1|grep "z relro" 1>&AS_MESSAGE_LOG_FD])
1592 if AC_TRY_COMMAND([${CC-cc} -Wl,--verbose 2>&1|grep DATA_SEGMENT_RELRO_END 1>&AS_MESSAGE_LOG_FD])
1597 if test "$libc_cv_z_relro" = no; then
1598 AC_MSG_ERROR(linker with -z relro support required)
1604 AC_CACHE_CHECK(for -Bgroup option,
1605 libc_cv_Bgroup, [dnl
1606 cat > conftest.c <<EOF
1607 int _start (void) { return 42; }
1609 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1610 -fPIC -shared -o conftest.so conftest.c
1611 -Wl,-Bgroup -nostdlib 1>&AS_MESSAGE_LOG_FD])
1618 AC_SUBST(libc_cv_Bgroup)
1620 AC_CACHE_CHECK(for libgcc_s suffix,
1621 libc_cv_libgcc_s_suffix, [dnl
1622 cat > conftest.c <<EOF
1623 int main (void) { return 0; }
1626 libc_cv_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1627 -fPIC -shared -shared-libgcc -o conftest.so \
1628 conftest.c -v 2>&1 >/dev/null \
1629 | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
1632 AC_SUBST(libc_cv_libgcc_s_suffix)
1634 AC_CACHE_CHECK(for --as-needed option,
1635 libc_cv_as_needed, [dnl
1636 cat > conftest.c <<EOF
1637 int main (void) { return 0; }
1639 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1640 -fPIC -shared -o conftest.so conftest.c
1641 -lgcc_s$libc_cv_libgcc_s_suffix -Wl,--as-needed
1642 -nostdlib 1>&AS_MESSAGE_LOG_FD])
1644 libc_cv_as_needed=yes
1646 libc_cv_as_needed=no
1649 AC_SUBST(libc_cv_as_needed)
1652 AC_CACHE_CHECK(whether --noexecstack is desirable for .S files,
1653 libc_cv_as_noexecstack, [dnl
1654 cat > conftest.c <<EOF
1657 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS
1658 -S -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD]) \
1659 && grep -q .note.GNU-stack conftest.s \
1660 && AC_TRY_COMMAND([${CC-cc} $ASFLAGS -Wa,--noexecstack
1661 -c -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD])
1663 libc_cv_as_noexecstack=yes
1665 libc_cv_as_noexecstack=no
1668 if test $libc_cv_as_noexecstack = yes; then
1669 ASFLAGS_config="$ASFLAGS_config -Wa,--noexecstack"
1671 AC_SUBST(ASFLAGS_config)
1673 AC_CACHE_CHECK(for -z combreloc,
1674 libc_cv_z_combreloc, [dnl
1675 cat > conftest.c <<EOF
1676 extern int bar (int);
1678 int foo (void) { return bar (mumble); }
1680 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1681 -fPIC -shared -o conftest.so conftest.c
1682 -nostdlib -nostartfiles
1683 -Wl,-z,combreloc 1>&AS_MESSAGE_LOG_FD])
1685 dnl The following test is a bit weak. We must use a tool which can test
1686 dnl cross-platform since the gcc used can be a cross compiler. Without
1687 dnl introducing new options this is not easily doable. Instead use a tool
1688 dnl which always is cross-platform: readelf. To detect whether -z combreloc
1689 dnl look for a section named .rel.dyn.
1690 if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
1691 libc_cv_z_combreloc=yes
1693 libc_cv_z_combreloc=no
1696 libc_cv_z_combreloc=no
1699 if test "$libc_cv_z_combreloc" = yes; then
1700 AC_DEFINE(HAVE_Z_COMBRELOC)
1702 AC_SUBST(libc_cv_z_combreloc)
1704 AC_CACHE_CHECK(for -z execstack,
1705 libc_cv_z_execstack, [dnl
1706 cat > conftest.c <<EOF
1707 int _start (void) { return 42; }
1709 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1710 -fPIC -shared -o conftest.so conftest.c
1711 -Wl,-z,execstack -nostdlib
1712 1>&AS_MESSAGE_LOG_FD])
1714 libc_cv_z_execstack=yes
1716 libc_cv_z_execstack=no
1719 AC_SUBST(libc_cv_z_execstack)
1721 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
1722 cat > conftest.c <<EOF
1724 main () { return 0;}
1726 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
1727 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
1735 AC_SUBST(libc_cv_fpie)
1737 AC_CACHE_CHECK(for --hash-style option,
1738 libc_cv_hashstyle, [dnl
1739 cat > conftest.c <<EOF
1740 int _start (void) { return 42; }
1742 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1743 -fPIC -shared -o conftest.so conftest.c
1744 -Wl,--hash-style=both -nostdlib 1>&AS_MESSAGE_LOG_FD])
1746 libc_cv_hashstyle=yes
1748 libc_cv_hashstyle=no
1751 AC_SUBST(libc_cv_hashstyle)
1754 AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl
1755 cat > conftest.c <<EOF
1758 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder -fno-section-anchors
1759 conftest.c 1>&AS_MESSAGE_LOG_FD])
1761 libc_cv_fno_toplevel_reorder=yes
1763 libc_cv_fno_toplevel_reorder=no
1766 if test $libc_cv_fno_toplevel_reorder = yes; then
1767 fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors"
1769 fno_unit_at_a_time=-fno-unit-at-a-time
1771 AC_SUBST(fno_unit_at_a_time)
1773 AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
1774 cat > conftest.c <<EOF
1776 main () { return 0;}
1778 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -Werror -fstack-protector
1779 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
1786 AC_SUBST(libc_cv_ssp)
1788 AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
1789 cat > conftest.c <<EOF
1791 #ifdef __GNUC_GNU_INLINE__
1792 main () { return 0;}
1797 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -std=gnu99 -fgnu89-inline
1798 -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD])
1800 libc_cv_gnu89_inline=yes
1802 libc_cv_gnu89_inline=no
1805 if test $libc_cv_gnu89_inline = yes; then
1806 libc_cv_gnu89_inline=-fgnu89-inline
1808 libc_cv_gnu89_inline=
1810 AC_SUBST(libc_cv_gnu89_inline)
1812 if test $elf != yes; then
1813 AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
1814 [AC_TRY_COMPILE(, [asm (".section .init");
1815 asm (".section .fini");
1816 asm ("${libc_cv_dot_text}");],
1817 libc_cv_have_initfini=yes,
1818 libc_cv_have_initfini=no)])
1819 AC_SUBST(libc_cv_have_initfini)dnl
1820 if test $libc_cv_have_initfini = yes; then
1821 AC_DEFINE(HAVE_INITFINI)
1825 if test $elf = yes; then
1826 AC_CACHE_CHECK(whether cc puts quotes around section names,
1827 libc_cv_have_section_quotes,
1828 [cat > conftest.c <<EOF
1829 static const int foo
1830 __attribute__ ((section ("bar"))) = 1;
1832 if ${CC-cc} -S conftest.c -o conftest.s; then
1833 if grep '\.section.*"bar"' conftest.s >/dev/null; then
1834 libc_cv_have_section_quotes=yes
1836 libc_cv_have_section_quotes=no
1839 libc_cv_have_section_quotes=unknown
1843 if test $libc_cv_have_section_quotes = yes; then
1844 AC_DEFINE(HAVE_SECTION_QUOTES)
1848 dnl AC_CHECK_ASM_UNDERSCORE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1849 AC_DEFUN(AC_CHECK_ASM_UNDERSCORE,
1850 [cat > conftest.$ac_ext <<EOF
1851 dnl This sometimes fails to find confdefs.h, for some reason.
1852 dnl [#]line $LINENO "[$]0"
1853 [#]line $LINENO "configure"
1854 #include "confdefs.h"
1855 void underscore_test(void) {
1858 if AC_TRY_EVAL(ac_compile); then
1859 if grep _underscore_test conftest* >/dev/null; then
1860 ifelse([$1], , :, [rm -f conftest*
1863 ifelse([$2], , , [rm -f conftest*
1867 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
1868 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
1869 ifelse([$2], , , [rm -f conftest*
1874 if test $elf = yes; then
1875 libc_cv_asm_underscores=no
1877 if test $ac_cv_prog_cc_works = yes; then
1878 AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1879 [AC_TRY_LINK([asm ("_glibc_foobar:");], [glibc_foobar ();],
1880 libc_cv_asm_underscores=yes,
1881 libc_cv_asm_underscores=no)])
1883 AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1884 [AC_CHECK_ASM_UNDERSCORE(libc_cv_asm_underscores=yes,
1885 libc_cv_asm_underscores=no)])
1888 if test $libc_cv_asm_underscores = no; then
1889 AC_DEFINE(NO_UNDERSCORES)
1892 if test $elf = yes; then
1893 libc_cv_weak_symbols=yes
1896 AC_CACHE_CHECK(for assembler .weak directive, libc_cv_asm_weak_directive,
1898 cat > conftest.s <<EOF
1900 ${libc_cv_asm_global_directive} foo
1903 .weak bar; bar = foo
1905 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1906 libc_cv_asm_weak_directive=yes
1908 libc_cv_asm_weak_directive=no
1912 if test $libc_cv_asm_weak_directive = no; then
1913 AC_CACHE_CHECK(for assembler .weakext directive,
1914 libc_cv_asm_weakext_directive,
1916 cat > conftest.s <<EOF
1918 ${libc_cv_asm_global_directive} foo
1922 ${libc_cv_asm_global_directive} baz
1925 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1926 libc_cv_asm_weakext_directive=yes
1928 libc_cv_asm_weakext_directive=no
1934 if test $libc_cv_asm_weak_directive = yes; then
1935 AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
1936 elif test $libc_cv_asm_weakext_directive = yes; then
1937 AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)
1940 AC_CACHE_CHECK(whether CFI directives are supported, libc_cv_asm_cfi_directives, [dnl
1942 sparc/sparc64*) cfi_offset=2047;;
1945 cat > conftest.s <<EOF
1947 .type func,%function
1951 .cfi_rel_offset 1, $cfi_offset
1954 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1955 libc_cv_asm_cfi_directives=yes
1957 libc_cv_asm_cfi_directives=no
1960 if test $libc_cv_asm_cfi_directives = yes; then
1961 AC_DEFINE(HAVE_ASM_CFI_DIRECTIVES)
1964 AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
1965 cat > conftest.c <<\EOF
1970 dnl No \ in command here because it ends up inside ''.
1971 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1972 -nostdlib -nostartfiles -Wl,--no-whole-archive
1973 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1974 libc_cv_ld_no_whole_archive=yes
1976 libc_cv_ld_no_whole_archive=no
1979 if test $libc_cv_ld_no_whole_archive = yes; then
1980 no_whole_archive=-Wl,--no-whole-archive
1982 AC_SUBST(no_whole_archive)dnl
1984 AC_CACHE_CHECK(for gcc -fexceptions, libc_cv_gcc_exceptions, [dnl
1985 cat > conftest.c <<\EOF
1990 dnl No \ in command here because it ends up inside ''.
1991 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1992 -nostdlib -nostartfiles -fexceptions
1993 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1994 libc_cv_gcc_exceptions=yes
1996 libc_cv_gcc_exceptions=no
1999 if test $libc_cv_gcc_exceptions = yes; then
2000 exceptions=-fexceptions
2002 AC_SUBST(exceptions)dnl
2004 if test "$host_cpu" = powerpc ; then
2005 # Check for a bug present in at least versions 2.8.x of GCC
2006 # and versions 1.0.x of EGCS.
2007 AC_CACHE_CHECK(whether clobbering cr0 causes problems,libc_cv_c_asmcr0_bug,[dnl
2008 AC_TRY_COMPILE([int tester(int x) { asm ("" : : : "cc"); return x & 123; }],,
2009 libc_cv_c_asmcr0_bug='no',
2010 libc_cv_c_asmcr0_bug='yes')])
2011 if test "$libc_cv_c_asmcr0_bug" != 'no'; then
2012 AC_DEFINE(BROKEN_PPC_ASM_CR0)
2016 dnl Check whether compiler understands __builtin_expect.
2017 AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
2018 [cat > conftest.c <<EOF
2019 #line $LINENO "configure"
2022 a = __builtin_expect (a, 10);
2023 return a == 10 ? 0 : 1;
2026 dnl No \ in command here because it ends up inside ''.
2027 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles
2028 -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
2029 libc_cv_gcc_builtin_expect=yes
2031 libc_cv_gcc_builtin_expect=no
2034 if test "$libc_cv_gcc_builtin_expect" = yes; then
2035 AC_DEFINE(HAVE_BUILTIN_EXPECT)
2038 AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
2039 cat > conftest.c <<\EOF
2042 __builtin_memset (x, 0, 1000);
2046 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null]);
2048 libc_cv_gcc_builtin_memset=no
2050 libc_cv_gcc_builtin_memset=yes
2053 if test "$libc_cv_gcc_builtin_memset" = yes ; then
2054 AC_DEFINE(HAVE_BUILTIN_MEMSET)
2057 AC_CACHE_CHECK(for redirection of built-in functions, libc_cv_gcc_builtin_redirection, [dnl
2058 cat > conftest.c <<\EOF
2059 extern char *strstr (const char *, const char *) __asm ("my_strstr");
2060 char *foo (const char *a, const char *b)
2062 return __builtin_strstr (a, b);
2066 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "my_strstr" > /dev/null]);
2068 libc_cv_gcc_builtin_redirection=yes
2070 libc_cv_gcc_builtin_redirection=no
2073 if test "$libc_cv_gcc_builtin_redirection" = yes ; then
2074 AC_DEFINE(HAVE_BUILTIN_REDIRECTION)
2077 dnl Check whether the compiler supports the __thread keyword.
2078 if test "x$use__thread" != xno; then
2079 AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
2080 [cat > conftest.c <<\EOF
2081 __thread int a = 42;
2083 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
2084 libc_cv_gcc___thread=yes
2086 libc_cv_gcc___thread=no
2089 if test "$libc_cv_gcc___thread" = yes; then
2090 AC_DEFINE(HAVE___THREAD)
2093 libc_cv_gcc___thread=no
2096 if test "$libc_cv_gcc___thread" = yes; then
2097 dnl Check whether the compiler supports the tls_model attribute.
2098 AC_CACHE_CHECK([for tls_model attribute], libc_cv_gcc_tls_model_attr, [dnl
2099 cat > conftest.c <<\EOF
2100 extern __thread int a __attribute__((tls_model ("initial-exec")));
2102 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&AS_MESSAGE_LOG_FD]); then
2103 libc_cv_gcc_tls_model_attr=yes
2105 libc_cv_gcc_tls_model_attr=no
2108 if test "$libc_cv_gcc_tls_model_attr" = yes; then
2109 AC_DEFINE(HAVE_TLS_MODEL_ATTRIBUTE)
2113 if test -n "$submachine"; then
2114 AC_CACHE_CHECK([for compiler option for CPU variant],
2115 libc_cv_cc_submachine, [dnl
2116 libc_cv_cc_submachine=no
2117 for opt in "-march=$submachine" "-mcpu=$submachine"; do
2118 if AC_TRY_COMMAND([${CC-cc} $opt -xc /dev/null -S -o /dev/null]); then
2119 libc_cv_cc_submachine="$opt"
2123 if test "x$libc_cv_cc_submachine" = xno; then
2124 AC_MSG_ERROR([${CC-cc} does not support $submachine])
2127 AC_SUBST(libc_cv_cc_submachine)
2129 dnl Check whether we have the gd library available.
2130 AC_MSG_CHECKING(for libgd)
2131 if test "$with_gd" != "no"; then
2132 old_CFLAGS="$CFLAGS"
2133 CFLAGS="$CFLAGS $libgd_include"
2134 old_LDFLAGS="$LDFLAGS"
2135 LDFLAGS="$LDFLAGS $libgd_ldflags"
2137 LIBS="$LIBS -lgd -lpng -lz -lm"
2138 AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
2139 CFLAGS="$old_CFLAGS"
2140 LDFLAGS="$old_LDFLAGS"
2145 AC_MSG_RESULT($LIBGD)
2149 if test x$with_selinux = xno ; then
2152 # See if we have the SELinux library
2153 AC_CHECK_LIB(selinux, is_selinux_enabled,
2154 have_selinux=yes, have_selinux=no)
2155 # See if we have the SELinux header with the NSCD permissions in it.
2156 if test x$have_selinux = xyes ; then
2157 AC_MSG_CHECKING([for NSCD Flask permissions in selinux/av_permissions.h])
2158 AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
2159 [#ifdef NSCD__SHMEMHOST
2162 #error NSCD__SHMEMHOST not defined
2164 have_selinux=yes, have_selinux=no)
2165 AC_MSG_RESULT($have_selinux)
2168 if test x$with_selinux = xyes ; then
2169 if test x$have_selinux = xno ; then
2170 AC_MSG_ERROR([SELinux explicitly required, but sufficiently recent SELinux library not found])
2174 # Check if we're building with SELinux support.
2175 if test "x$have_selinux" = xyes; then
2176 AC_DEFINE(HAVE_SELINUX, 1, [SELinux support])
2178 # See if we have the libaudit library
2179 AC_CHECK_LIB(audit, audit_log_user_avc_message,
2180 have_libaudit=yes, have_libaudit=no)
2181 if test "x$have_libaudit" = xyes; then
2182 AC_DEFINE(HAVE_LIBAUDIT, 1, [SELinux libaudit support])
2184 AC_SUBST(have_libaudit)
2186 # See if we have the libcap library
2187 AC_CHECK_LIB(cap, cap_init, have_libcap=yes, have_libcap=no)
2188 if test "x$have_libcap" = xyes; then
2189 AC_DEFINE(HAVE_LIBCAP, 1, [SELinux libcap support])
2191 AC_SUBST(have_libcap)
2193 AC_SUBST(have_selinux)
2195 dnl check for the size of 'long double'.
2196 AC_CHECK_SIZEOF(long double, 0)
2197 sizeof_long_double=$ac_cv_sizeof_long_double
2198 AC_SUBST(sizeof_long_double)
2200 ### End of automated tests.
2201 ### Now run sysdeps configure fragments.
2203 # They also can set these variables.
2205 ldd_rewrite_script=no
2206 libc_cv_sysconfdir=$sysconfdir
2207 libc_cv_gcc_unwind_find_fde=no
2210 # Iterate over all the sysdep directories we will use, running their
2211 # configure fragments, and looking for a uname implementation.
2213 for dir in $sysnames; do
2216 *) dest=$srcdir/$dir ;;
2218 if test -r $dest/configure; then
2219 AC_MSG_RESULT(running configure fragment for $dir)
2223 if test -z "$uname"; then
2224 if test -r $dest/uname.c ||
2225 test -r $dest/uname.S ||
2226 { test -r $dest/syscalls.list &&
2227 grep '^uname[ ]' $dest/syscalls.list >/dev/null; }; then
2234 if test x$libc_cv_gcc_unwind_find_fde = xyes; then
2235 AC_DEFINE(EXPORT_UNWIND_FIND_FDE)
2237 AC_SUBST(libc_cv_gcc_unwind_find_fde)
2239 # If we will use the generic uname implementation, we must figure out what
2240 # it will say by examining the system, and write the results in config-name.h.
2241 if test "$uname" = "sysdeps/generic"; then
2244 uname_sysname=`echo $config_os | sed 's/[0-9.]*$//'`
2246 if test $uname_sysname != $config_os; then
2247 config_release=`echo $config_os | sed s/$uname_sysname//`
2250 AC_DEFUN(LIBC_KERNEL_ID, [dnl
2251 if test -r /vmunix; then
2252 kernel_id=`strings /vmunix | grep UNIX`
2253 elif test -r /dynix; then
2254 kernel_id=`strings /dynix | grep DYNIX`
2260 AC_CACHE_CHECK(OS release for uname, libc_cv_uname_release, [dnl
2263 kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'`
2265 if test x`echo "$config_release" | sed "s/^$kernel_release//"` \
2266 != x$config_release; then
2267 # The configuration release is a substring of the kernel release.
2268 libc_cv_uname_release=$kernel_release
2269 elif test x$config_release != x; then
2270 libc_cv_uname_release=$config_release
2271 elif test x$kernel_release != x; then
2272 libc_cv_uname_release=$kernel_release
2274 libc_cv_uname_release=unknown
2276 uname_release="$libc_cv_uname_release"
2278 AC_CACHE_CHECK(OS version for uname, libc_cv_uname_version, [dnl
2281 kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'`
2283 if test -n "$kernel_version"; then
2284 libc_cv_uname_version="$kernel_version"
2286 libc_cv_uname_version=unknown
2288 uname_version="$libc_cv_uname_version"
2290 AC_SUBST(uname_sysname) AC_SUBST(uname_release) AC_SUBST(uname_version)dnl
2291 config_uname=config-name.h:config-name.in
2293 # For non-generic uname, we don't need to create config-name.h at all.
2297 dnl This is tested by existing code and it's simpler to avoid changing it.
2298 AC_DEFINE(USE_IN_LIBIO)
2300 # Test for old glibc 2.0.x headers so that they can be removed properly
2301 # Search only in includedir.
2302 AC_MSG_CHECKING(for old glibc 2.0.x headers)
2303 if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
2305 old_glibc_headers=yes
2307 old_glibc_headers=no
2309 AC_MSG_RESULT($old_glibc_headers)
2310 if test ${old_glibc_headers} = yes; then
2311 AC_MSG_WARN(*** During \"make install\" old headers from glibc 2.0.x will)
2312 AC_MSG_WARN(*** be removed.)
2314 AC_SUBST(old_glibc_headers)
2316 AC_SUBST(libc_cv_slibdir)
2317 AC_SUBST(libc_cv_localedir)
2318 AC_SUBST(libc_cv_sysconfdir)
2319 AC_SUBST(libc_cv_rootsbindir)
2320 AC_SUBST(libc_cv_forced_unwind)
2322 dnl sysdeps/CPU/configure.in checks set this via arch-specific asm tests
2323 AC_SUBST(libc_cv_cpp_asm_debuginfo)
2324 AC_SUBST(libc_cv_cc_sse4)
2325 AC_SUBST(libc_cv_cc_avx)
2327 AC_SUBST(use_ldconfig)
2328 AC_SUBST(ldd_rewrite_script)
2330 AC_SUBST(elf) AC_SUBST(xcoff)
2331 if test $elf = yes; then
2334 if test $xcoff = yes; then
2335 AC_DEFINE(HAVE_XCOFF)
2340 if test $shared = default; then
2344 AC_CACHE_CHECK([whether -fPIC is default], libc_cv_pic_default,
2345 [libc_cv_pic_default=yes
2346 cat > conftest.c <<EOF
2347 #if defined __PIC__ || defined __pic__ || defined PIC || defined pic
2348 # error PIC is default.
2351 if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
2352 libc_cv_pic_default=no
2355 AC_SUBST(libc_cv_pic_default)
2360 AC_SUBST(static_nss)
2361 AC_SUBST(nopic_initfini)
2365 dnl See sysdeps/mach/configure.in for this variable.
2366 AC_SUBST(mach_interface_list)
2368 if test "`(cd $srcdir; pwd)`" = "`pwd`"; then
2371 config_makefile=Makefile
2374 VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
2375 RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
2379 AC_CONFIG_FILES([config.make ${config_makefile} ${config_uname}])
2380 AC_CONFIG_COMMANDS([default],[[
2381 case $CONFIG_FILES in *config.make*)
2382 echo "$config_vars" >> config.make;;
2384 test -d bits || mkdir bits]],[[config_vars='$config_vars']])