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_SUBST(use_default_link)
118 AC_ARG_WITH([default-link],
119 AC_HELP_STRING([--with-default-link],
120 [do not use explicit linker scripts
121 @<:@default=no@:>@]),
122 [use_default_link=$withval],
123 [use_default_link=no])
125 AC_ARG_ENABLE([sanity-checks],
126 AC_HELP_STRING([--disable-sanity-checks],
127 [really do not use threads (should not be used except in special situations) @<:@default=yes@:>@]),
128 [enable_sanity=$enableval],
131 AC_SUBST(enable_check_abi)
132 AC_ARG_ENABLE([check-abi],
133 AC_HELP_STRING([--enable-check-abi],
134 [do "make check-abi" in "make check" (no/warn/yes)
135 @<:@default=no@:>@]),
136 [enable_check_abi=$enableval],
137 [enable_check_abi=no])
139 dnl Arguments to enable or disable building the static, shared, profiled,
140 dnl and -fomit-frame-pointer libraries.
141 dnl I've disabled this for now since we cannot build glibc without static
142 dnl libraries built in the moment.
143 dnl AC_ARG_ENABLE([static],
144 dnl AC_HELP_STRING([--enable-static],
145 dnl [build static library @<:@default=yes@:>@]),
146 dnl [static=$enableval],
149 AC_ARG_ENABLE([shared],
150 AC_HELP_STRING([--enable-shared],
151 [build shared library @<:@default=yes if GNU ld & ELF@:>@]),
154 AC_ARG_ENABLE([profile],
155 AC_HELP_STRING([--enable-profile],
156 [build profiled library @<:@default=no@:>@]),
157 [profile=$enableval],
159 AC_ARG_ENABLE([omitfp],
160 AC_HELP_STRING([--enable-omitfp],
161 [build undebuggable optimized library @<:@default=no@:>@]),
164 AC_ARG_ENABLE([bounded],
165 AC_HELP_STRING([--enable-bounded],
166 [build with runtime bounds checking @<:@default=no@:>@]),
167 [bounded=$enableval],
169 AC_ARG_ENABLE([versioning],
170 AC_HELP_STRING([--disable-versioning],
171 [do not include versioning information in the library objects @<:@default=yes if supported@:>@]),
172 [enable_versioning=$enableval],
173 [enable_versioning=yes])
175 AC_ARG_ENABLE([oldest-abi],
176 AC_HELP_STRING([--enable-oldest-abi=ABI],
177 [configure the oldest ABI supported @<:@e.g. 2.2@:>@ @<:@default=glibc default@:>@]),
178 [oldest_abi=$enableval],
180 if test "$oldest_abi" = yes || test "$oldest_abi" = no; then
183 AC_DEFINE_UNQUOTED(GLIBC_OLDEST_ABI, "$oldest_abi")
187 AC_ARG_ENABLE([stackguard-randomization],
188 AC_HELP_STRING([--enable-stackguard-randomization],
189 [initialize __stack_chk_guard canary with a random number at program start]),
190 [enable_stackguard_randomize=$enableval],
191 [enable_stackguard_randomize=no])
192 if test "$enable_stackguard_randomize" = yes; then
193 AC_DEFINE(ENABLE_STACKGUARD_RANDOMIZE)
196 dnl Generic infrastructure for drop-in additions to libc.
197 AC_ARG_ENABLE([add-ons],
198 AC_HELP_STRING([--enable-add-ons@<:@=DIRS...@:>@],
199 [configure and build add-ons in DIR1,DIR2,...
200 search for add-ons if no parameter given]),
201 , [enable_add_ons=yes])
203 dnl Let the user avoid using TLS. Don't know why but...
205 AC_HELP_STRING([--with-tls],
206 [enable support for TLS]),
210 AC_ARG_WITH([__thread],
211 AC_HELP_STRING([--without-__thread],
212 [do not use TLS features even when supporting them]),
213 [use__thread=$withval],
216 AC_ARG_ENABLE([hidden-plt],
217 AC_HELP_STRING([--disable-hidden-plt],
218 [do not hide internal function calls to avoid PLT]),
221 if test "x$hidden" = xno; then
225 AC_ARG_ENABLE([bind-now],
226 AC_HELP_STRING([--enable-bind-now],
227 [disable lazy relocations in DSOs]),
228 [bindnow=$enableval],
232 dnl On some platforms we cannot use dynamic loading. We must provide
233 dnl static NSS modules.
234 AC_ARG_ENABLE([static-nss],
235 AC_HELP_STRING([--enable-static-nss],
236 [build static NSS modules @<:@default=no@:>@]),
237 [static_nss=$enableval],
239 dnl Enable static NSS also if we build no shared objects.
240 if test x"$static_nss" = xyes || test x"$shared" = xno; then
242 AC_DEFINE(DO_STATIC_NSS)
245 AC_ARG_ENABLE([force-install],
246 AC_HELP_STRING([--disable-force-install],
247 [don't force installation of files from this package, even if they are older than the installed files]),
248 [force_install=$enableval],
250 AC_SUBST(force_install)
252 dnl On some platforms we allow dropping compatibility with all kernel
254 AC_ARG_ENABLE([kernel],
255 AC_HELP_STRING([--enable-kernel=VERSION],
256 [compile for compatibility with kernel not older than VERSION]),
257 [minimum_kernel=$enableval],
259 dnl Prevent unreasonable values.
260 if test "$minimum_kernel" = yes || test "$minimum_kernel" = no; then
261 # Better nothing than this.
264 if test "$minimum_kernel" = current; then
265 minimum_kernel=`uname -r 2>/dev/null` || minimum_kernel=
269 dnl For the development we sometimes want gcc to issue even more warnings.
270 dnl This is not the default since many of the extra warnings are not
272 AC_ARG_ENABLE([all-warnings],
273 AC_HELP_STRING([--enable-all-warnings],
274 [enable all useful warnings gcc can issue]),
275 [all_warnings=$enableval],
277 AC_SUBST(all_warnings)
279 AC_ARG_ENABLE([multi-arch],
280 AC_HELP_STRING([--enable-multi-arch],
281 [enable single DSO with optimizations for multiple architectures]),
282 [multi_arch=$enableval],
283 [multi_arch=default])
285 AC_ARG_ENABLE([nss-crypt],
286 AC_HELP_STRING([--enable-nss-crypt],
287 [enable libcrypt to use nss]),
288 [nss_crypt=$enableval],
290 if test x$nss_crypt = xyes; then
291 nss_includes=-I$(nss-config --includedir 2>/dev/null)
292 if test $? -ne 0; then
293 AC_MSG_ERROR([cannot find include directory with nss-config])
296 CFLAGS="$CFLAGS $nss_includes"
297 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
299 #include <nsslowhash.h>
300 void f (void) { NSSLOW_Init (); }])],
301 libc_cv_nss_crypt=yes,
303 cannot find NSS headers with lowlevel hash function interfaces]))
305 LIBS="$LIBS -lfreebl3"
306 AC_LINK_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
308 #include <nsslowhash.h>],
310 libc_cv_nss_crypt=yes,
312 cannot link program using lowlevel NSS hash functions]))
318 AC_SUBST(libc_cv_nss_crypt)
320 # The way shlib-versions is used to generate soversions.mk uses a
321 # fairly simplistic model for name recognition that can't distinguish
322 # i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
323 # of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can
324 # tell. This doesn't get used much beyond that, so it's fairly safe.
329 host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'`
333 # We keep the original values in `$config_*' and never modify them, so we
334 # can write them unchanged into config.make. Everything else uses
335 # $machine, $vendor, and $os, and changes them whenever convenient.
336 config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
338 # Don't allow vendor == "unknown"
339 test "$config_vendor" = unknown && config_vendor=
340 config_os="`echo $config_os | sed 's/^unknown-//'`"
342 # Some configurations imply other options.
344 # i586-linuxaout is mangled into i586-pc-linux-gnuaout
345 linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*)
347 gnu* | linux* | freebsd* | netbsd* | sysv4* | solaris2* | irix6*)
348 # These systems (almost) always use the ELF format.
352 # These systems are always xcoff
358 # The configure fragment of an add-on port can modify these to supplement
359 # or override the table in the case statement below. No fragment should
360 # ever change the config_* variables, however.
361 machine=$config_machine
362 vendor=$config_vendor
366 # config.guess on some IBM machines says `rs6000' instead of `powerpc'.
368 if test "$machine" = rs6000; then
372 # Braindead PowerPC box with absolutely no FPU.
373 case "$machine-$host_os" in
381 AS_HELP_STRING([--with-cpu=CPU], [select code for CPU variant]),
384 yes|'') AC_MSG_ERROR([--with-cpu requires an argument]) ;;
386 *) submachine="$withval" ;;
390 # An add-on can set this when it wants to disable the sanity check below.
393 dnl Having this here, though empty, makes sure that if add-ons' fragments
394 dnl do AC_CONFIG_SUBDIRS([some-dir]), which just sets $subdirs, then
395 dnl our AC_OUTPUT will actually use it.
398 case "$enable_add_ons" in
401 add_ons=`cd $srcdir && ls -d 2> /dev/null */configure */sysdeps |
402 sed 's@/[[^/]]*$@@' | sort | uniq`
403 add_ons_automatic=yes
405 *) add_ons=`echo "$enable_add_ons" | sed 's/,/ /g'`
406 add_ons_automatic=no ;;
412 if test x"$add_ons" != x; then
413 for f in $add_ons; do
418 *** It seems that you're using an old \`crypt' add-on. crypt is now
419 *** part of glibc and using the old add-on will not work with this
420 *** release. Start again with fresh sources and without the old
421 *** \`crypt' add-on.])
425 *** It seems that you're using an old \`localedata' add-on. localedata
426 *** is now part of glibc and using the old add-on will not work with
427 *** this release. Start again with fresh sources and without the old
428 *** \`localedata' add-on.])
433 # Now source each add-on's configure fragment.
434 # The fragments can use $srcdir/$libc_add_on to find themselves,
435 # and test $add_ons_automatic to see if they were explicitly requested.
436 # A fragment can clear (or even change) $libc_add_on to affect
437 # whether it goes into the list to be actually used in the build.
439 for libc_add_on in $add_ons; do
440 # Test whether such a directory really exists.
441 # It can be absolute, or relative to $srcdir, or relative to the build dir.
442 case "$libc_add_on" in
444 libc_add_on_srcdir=$libc_add_on
447 test -d "$srcdir/$libc_add_on" || {
448 if test -d "$libc_add_on"; then
449 libc_add_on="`pwd`/$libc_add_on"
451 AC_MSG_ERROR(add-on directory \"$libc_add_on\" does not exist)
454 libc_add_on_srcdir=$srcdir/$libc_add_on
458 libc_add_on_frag=$libc_add_on_srcdir/configure
459 libc_add_on_canonical=
460 libc_add_on_config_subdirs=
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"
492 for d in $libc_add_on_config_subdirs; do
495 fragment uses absolute path in \$libc_add_on_config_subdirs) ;;
497 if test ! -d "$libc_add_on_srcdir/$d"; then
498 AC_MSG_ERROR(fragment wants to configure missing directory $d)
500 case "$libc_add_on" in
502 relative path required for add-on using \$libc_add_on_config_subdirs) ;;
504 subdirs="$subdirs $libc_add_on/$d"
508 if test -n "$libc_add_on"; then
509 if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2> /dev/null`
511 AC_MSG_CHECKING(add-on $libc_add_on for preconfigure fragments)
512 for frag in $frags; do
513 name=`echo "$frag" | sed 's@/[[^/]]*$@@;s@^.*/@@'`
514 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
519 use_add_ons="$use_add_ons $libc_add_on"
520 add_ons_pfx="$add_ons_pfx $libc_add_on/"
521 test -z "$libc_add_on_canonical" ||
522 add_ons_sfx="$add_ons_sfx /$libc_add_on_canonical"
525 # Use echo to strip excess whitespace.
526 add_ons="`echo $use_add_ons`"
529 AC_SUBST(add_on_subdirs)
533 ### I put this here to prevent those annoying emails from people who cannot
534 ### read and try to compile glibc on unsupported platforms. --drepper
536 ### By using the undocumented --enable-hacker-mode option for configure
537 ### one can skip this test to make the configuration not fail for unsupported
540 if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then
541 case "$machine-$host_os" in
542 *-linux* | *-gnu* | arm*-none* | powerpc-aix4.3.*)
545 echo "*** The GNU C library is currently not available for this platform."
546 echo "*** So far nobody cared to port it and if there is no volunteer it"
547 echo "*** might never happen. So, if you have interest to see glibc on"
548 echo "*** this platform visit"
549 echo "*** http://www.gnu.org/software/libc/porting.html"
550 echo "*** and join the group of porters"
556 dnl We need to use [ and ] for other purposes for a while now.
558 # Expand the configuration machine name into a subdirectory by architecture
559 # type and particular chip. If an add-on configure fragment already set
560 # base_machine, we don't change it.
561 test -n "$base_machine" || case "$machine" in
562 a29k | am29000) base_machine=a29k machine=a29k ;;
563 c3[012]) base_machine=cx0 machine=cx0/c30 ;;
564 c4[04]) base_machine=cx0 machine=cx0/c40 ;;
565 i[34567]86) base_machine=i386 machine=i386/$machine ;;
566 ia64) base_machine=ia64 machine=ia64 ;;
567 m88???) base_machine=m88k machine=m88k/$machine ;;
568 m88k) base_machine=m88k machine=m88k/m88100 ;;
569 powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;;
570 powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;;
571 s390) base_machine=s390 machine=s390/s390-32 ;;
572 s390x) base_machine=s390 machine=s390/s390-64 ;;
573 sh3*) base_machine=sh machine=sh/sh3 ;;
574 sh4*) base_machine=sh machine=sh/sh4 ;;
576 base_machine=sparc machine=sparc/sparc32 ;;
577 sparcv8 | supersparc | hypersparc)
578 base_machine=sparc machine=sparc/sparc32/sparcv8 ;;
579 sparcv8plus | sparcv8plusa | sparcv9)
580 base_machine=sparc machine=sparc/sparc32/sparcv9 ;;
581 sparcv8plusb | sparcv9b)
582 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;;
584 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v ;;
586 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v2 ;;
588 base_machine=sparc machine=sparc/sparc64 ;;
590 base_machine=sparc machine=sparc/sparc64/sparcv9b ;;
592 base_machine=sparc machine=sparc/sparc64/sparcv9v ;;
594 base_machine=sparc machine=sparc/sparc64/sparcv9v2 ;;
595 *) base_machine=$machine ;;
598 AC_SUBST(base_machine)
600 if test "$base_machine" = "i386"; then
601 AC_DEFINE(USE_REGPARMS)
604 # For the multi-arch option we need support in the assembler.
605 AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support],
606 libc_cv_asm_gnu_indirect_function, [dnl
607 cat > conftest.s <<EOF
608 .type foo,%gnu_indirect_function
610 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
612 libc_cv_asm_gnu_indirect_function=yes
614 libc_cv_asm_gnu_indirect_function=no
618 AC_MSG_CHECKING(whether .text pseudo-op must be used)
619 AC_CACHE_VAL(libc_cv_dot_text, [dnl
620 cat > conftest.s <<EOF
624 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
625 libc_cv_dot_text=.text
628 if test -z "$libc_cv_dot_text"; then
634 AC_CACHE_CHECK(for assembler global-symbol directive,
635 libc_cv_asm_global_directive, [dnl
636 libc_cv_asm_global_directive=UNKNOWN
637 for ac_globl in .globl .global .EXPORT; do
638 cat > conftest.s <<EOF
643 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
644 libc_cv_asm_global_directive=${ac_globl}
647 test $libc_cv_asm_global_directive != UNKNOWN && break
649 if test $libc_cv_asm_global_directive = UNKNOWN; then
650 AC_MSG_ERROR(cannot determine asm global directive)
652 AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${libc_cv_asm_global_directive})
655 AC_CACHE_CHECK(for assembler .type directive prefix,
656 libc_cv_asm_type_prefix, [dnl
657 libc_cv_asm_type_prefix=no
658 for ac_try_prefix in '@' '%' '#'; do
659 cat > conftest.s <<EOF
661 ${libc_cv_asm_global_directive} foo
662 .type foo, ${ac_try_prefix}object
667 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
668 libc_cv_asm_type_prefix=${ac_try_prefix}
671 test "x$libc_cv_asm_type_prefix" != xno && break
673 if test "x$libc_cv_asm_type_prefix" != xno; then
674 AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix})
677 if test x"$libc_cv_asm_gnu_indirect_function" != xyes -a x"$libc_cv_asm_type_prefix" = xno; then
678 if test x"$multi_arch" = xyes; then
679 AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
684 if test x"$multi_arch" != xno; then
685 multi_arch_d=/multiarch
688 # Compute the list of sysdep directories for this configuration.
689 # This can take a while to compute.
690 sysdep_dir=$srcdir/sysdeps
691 AC_MSG_CHECKING(sysdep dirs)
692 dnl We need to use [ and ] for other purposes for a while now.
694 # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
695 os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
697 test "x$base_os" != x || case "$os" in
700 netbsd* | 386bsd* | freebsd* | bsdi*)
701 base_os=unix/bsd/bsd4.4 ;;
702 osf* | sunos* | ultrix* | newsos* | dynix* | *bsd*)
704 sysv* | isc* | esix* | sco* | minix* | irix4* | linux*)
707 base_os=unix/sysv/irix6/$os ;;
709 base_os=unix/sysv/sysv4 ;;
711 base_os=unix/sysv/hpux/$os ;;
713 base_os=unix/sysv/aix/aix4.3 ;;
715 base_os=standalone ;;
718 # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
721 while o=`echo $tail | sed 's/\.[^.]*$//'`; test $o != $tail; do
725 o=`echo $tail | sed 's/[0-9]*$//'`
726 if test $o != $tail; then
729 # For linux-gnu, try linux-gnu, then linux.
730 o=`echo $tail | sed 's/-.*$//'`
731 if test $o != $tail; then
735 # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
738 while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$b"; do
744 # For sparc/sparc32, try sparc/sparc32 and then sparc.
746 tail=$machine${submachine:+/$submachine}
747 while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
749 # Prepend the machine's FPU directory unless --without-fp.
750 if test "$with_fp" = yes; then
753 mach="$mach /$1/nofpu"
759 dnl We are done with glob and regexp uses of [ and ]; return to autoconf.
762 # Find what sysdep directories exist.
765 for b in $base ''; do
766 for m0 in $mach ''; do
767 for v in /$vendor ''; do
768 test "$v" = / && continue
769 for o in /$ostry ''; do
770 test "$o" = / && continue
771 for m in $multi_arch_d $mach ''; do
772 for d in $add_ons_pfx ''; do
773 for a in $add_ons_sfx ''; do
774 if test -n "$m0$m0sub$b$v$o$m$msub"; then
775 try_srcdir="${srcdir}/"
779 try="${d}sysdeps$m0$m0sub$b$v$o$m$msub$a"
780 test -n "$enable_debug_configure" &&
781 echo "$0 [DEBUG]: try $try" >&2
782 if test -d "$try_srcdir$try"; then
783 sysnames="$sysnames $try"
784 { test -n "$o" || test -n "$b"; } && os_used=t
785 { test -n "$m" || test -n "$m0"; } && machine_used=t
787 x*/$submachine) submachine_used=t ;;
789 if test -n "$d"; then
790 case "$sysnames_add_ons" in
792 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
805 # If the assembler supports gnu_indirect_function symbol type and the
806 # architecture supports multi-arch, we enable multi-arch by default.
807 case $sysnames_add_ons$sysnames in
811 test x"$multi_arch" = xdefault && multi_arch=no
814 if test x"$multi_arch" != xno; then
815 AC_DEFINE(USE_MULTIARCH)
819 if test -z "$os_used" && test "$os" != none; then
820 AC_MSG_ERROR(Operating system $os is not supported.)
822 if test -z "$machine_used" && test "$machine" != none; then
823 AC_MSG_ERROR(The $machine is not supported.)
825 if test -z "$submachine_used" && test -n "$submachine"; then
826 AC_MSG_ERROR(The $submachine subspecies of $host_cpu is not supported.)
830 # We have now validated the configuration.
833 # If using ELF, look for an `elf' subdirectory of each machine directory.
834 # We prepend these rather than inserting them whereever the machine appears
835 # because things specified by the machine's ELF ABI should override
836 # OS-specific things, and should always be the same for any OS on the
837 # machine (otherwise what's the point of an ABI?).
838 if test "$elf" = yes; then
840 for d in $add_ons_pfx ''; do
842 if test -d $srcdir/${d}sysdeps$m/elf; then
843 elf_dirs="$elf_dirs ${d}sysdeps$m/elf"
847 sysnames="`echo $elf_dirs | sed -e 's,//,/,g'` $sysnames"
851 # Expand the list of system names into a full list of directories
852 # from each element's parent name and Implies file (if present).
855 while test $# -gt 0; do
859 case " $names " in *" $name "*)
860 # Already in the list.
864 # Report each name as we discover it, so there is no long pause in output.
865 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
867 name_base=`echo $name | sed -e 's@\(.*sysdeps\)/.*@\1@'`
871 *) xsrcdir=$srcdir/ ;;
873 test -n "$enable_debug_configure" &&
874 echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2
876 if test -f $xsrcdir$name/Implies; then
877 # Collect more names from the `Implies' file (removing comments).
878 implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`"
880 for x in $implied_candidate; do
882 if test -d $xsrcdir$name_base/$x; then
883 implied="$implied $name_base/$x";
886 for d in $add_ons_pfx ''; do
890 *) try_srcdir=$srcdir/ ;;
892 test -n "$enable_debug_configure" &&
893 echo "[DEBUG]: $name implied $x try($d) {$try_srcdir}$try" >&2
894 if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
896 implied="$implied $try"
898 case "$sysnames_add_ons" in
900 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
904 if test $found = no; then
905 AC_MSG_WARN($name/Implies specifies nonexistent $x)
912 # Add NAME to the list of names.
915 # Find the parent of NAME, using the empty string if it has none.
917 parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
920 # Add the names implied by NAME, and NAME's parent (if it has one), to
921 # the list of names to be processed (the argument list). We prepend the
922 # implied names to the list and append the parent. We want implied
923 # directories to come before further directories inferred from the
924 # configuration components; this ensures that for sysv4, unix/common
925 # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
927 sysnames="`echo $implied $* $parent`"
928 test -n "$sysnames" && set $sysnames
931 # Add the default directories.
932 default_sysnames=sysdeps/generic
933 if test "$elf" = yes; then
934 default_sysnames="sysdeps/generic/elf $default_sysnames"
936 sysnames="$names $default_sysnames"
938 # The other names were emitted during the scan.
939 AC_MSG_RESULT($default_sysnames)
941 # Collect the list of add-ons that supply partial sysdeps trees.
943 for add_on in $add_ons; do
946 *) xsrcdir="$srcdir/" ;;
949 test -d "$xsrcdir$add_on/sysdeps" || {
950 case "$configured_add_ons " in
953 AC_MSG_ERROR(add-on $add_on has no configure fragment or sysdeps tree)
959 sysdeps_add_ons="$sysdeps_add_ons $add_on"
960 case "$sysnames_add_ons" in
963 AC_MSG_WARN(add-on $add_on contributed no sysdeps directories)
968 for d in $sysnames; do
970 $add_on/sysdeps/*) ;;
973 (cd "$xsrcdir$d" && for f in *[[!~]]; do
977 test -d "$ff" || { test -e "$ff" && exit 88; }
981 test -d "$f" || { test -e "$f" && exit 88; }
985 if test $? -eq 88; then
990 if test $found = no; then
991 AC_MSG_WARN(add-on $add_on contributed no useful sysdeps directories)
994 AC_SUBST(sysdeps_add_ons)
1000 if test "$INSTALL" = "${srcdir}/scripts/install-sh -c"; then
1001 # The makefiles need to use a different form to find it in $srcdir.
1002 INSTALL='\$(..)./scripts/install-sh -c'
1007 AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
1009 # Accept binutils 2.13 or newer.
1010 AC_CHECK_PROG_VER(AS, $AS, --version,
1011 [GNU assembler.* \([0-9]*\.[0-9.]*\)],
1012 [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")
1013 AC_CHECK_PROG_VER(LD, $LD, --version,
1014 [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
1015 [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")
1017 # We need the physical current working directory. We cannot use the
1018 # "pwd -P" shell builtin since that's not portable. Instead we try to
1019 # find a pwd binary. Note that assigning to the PWD environment
1020 # variable might have some interesting side effects, so we don't do
1022 AC_PATH_PROG(PWD_P, pwd, no)
1023 if test "$PWD_P" = no; then
1024 AC_MSG_ERROR(*** A pwd binary could not be found.)
1027 # These programs are version sensitive.
1028 AC_CHECK_TOOL_PREFIX
1029 AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
1030 [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* ],
1031 critic_missing="$critic_missing gcc")
1032 AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
1033 [GNU Make[^0-9]*\([0-9][0-9.]*\)],
1034 [3.79* | 3.[89]*], critic_missing="$critic_missing make")
1036 AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
1037 [GNU gettext.* \([0-9]*\.[0-9.]*\)],
1038 [0.10.3[6-9]* | 0.10.[4-9][0-9]* | 0.1[1-9]* | 0.[2-9][0-9]* | [1-9].*],
1039 MSGFMT=: aux_missing="$aux_missing msgfmt")
1040 AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
1041 [GNU texinfo.* \([0-9][0-9.]*\)],
1043 MAKEINFO=: aux_missing="$aux_missing makeinfo")
1044 AC_CHECK_PROG_VER(SED, sed, --version,
1045 [GNU sed version \([0-9]*\.[0-9.]*\)],
1046 [3.0[2-9]*|3.[1-9]*|[4-9]*],
1047 SED=: aux_missing="$aux_missing sed")
1049 AC_CHECK_PROGS(AUTOCONF, autoconf, no)
1050 case "x$AUTOCONF" in
1051 xno|x|x:) AUTOCONF=no ;;
1054 whether $AUTOCONF${ACFLAGS:+ }$ACFLAGS works, libc_cv_autoconf_works, [dnl
1055 if (cd $srcdir; $AUTOCONF $ACFLAGS configure.in > /dev/null 2>&1); then
1056 libc_cv_autoconf_works=yes
1058 libc_cv_autoconf_works=no
1060 test $libc_cv_autoconf_works = yes || AUTOCONF=no
1063 if test "x$with_cvs" = xyes && test "x$AUTOCONF" = xno; then
1064 # If --without-cvs they probably won't change configure.in, so no complaints.
1065 aux_missing="$aux_missing autoconf"
1068 test -n "$critic_missing" && AC_MSG_ERROR([
1069 *** These critical programs are missing or too old:$critic_missing
1070 *** Check the INSTALL file for required versions.])
1072 test -n "$aux_missing" && AC_MSG_WARN([
1073 *** These auxiliary programs are missing or incompatible versions:$aux_missing
1074 *** some features will be disabled.
1075 *** Check the INSTALL file for required versions.])
1077 # if using special system headers, find out the compiler's sekrit
1078 # header directory and add that to the list. NOTE: Only does the right
1079 # thing on a system that doesn't need fixincludes. (Not presently a problem.)
1080 if test -n "$sysheaders"; then
1081 SYSINCLUDES=-nostdinc
1082 for d in include include-fixed; do
1083 i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
1084 SYSINCLUDES="$SYSINCLUDES -isystem $i"
1086 SYSINCLUDES="$SYSINCLUDES \
1087 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
1088 if test -n "$CXX"; then
1089 cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
1090 cxxmachine=`$CXX -dumpmachine 2>&AS_MESSAGE_LOG_FD` &&
1091 cxxheaders=`$CXX -print-file-name=../../../../include/c++/`"$cxxversion" &&
1092 CXX_SYSINCLUDES="-isystem $cxxheaders \
1093 -isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
1096 AC_SUBST(SYSINCLUDES)
1097 AC_SUBST(CXX_SYSINCLUDES)
1099 # ranlib is never necessary on Linux and Hurd systems
1102 # Test if LD_LIBRARY_PATH contains the notation for the current directory
1103 # since this would lead to problems installing/building glibc.
1104 # LD_LIBRARY_PATH contains the current directory if one of the following
1106 # - one of the terminals (":" and ";") is the first or last sign
1107 # - two terminals occur directly after each other
1108 # - the path contains an element with a dot in it
1109 AC_MSG_CHECKING(LD_LIBRARY_PATH variable)
1111 case ${LD_LIBRARY_PATH} in
1112 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
1113 ld_library_path_setting="contains current directory"
1116 ld_library_path_setting="ok"
1120 AC_MSG_RESULT($ld_library_path_setting)
1121 if test "$ld_library_path_setting" != "ok"; then
1123 *** LD_LIBRARY_PATH shouldn't contain the current directory when
1124 *** building glibc. Please change the environment variable
1125 *** and run configure again.])
1128 AC_CACHE_CHECK(whether GCC supports -static-libgcc, libc_cv_gcc_static_libgcc, [dnl
1129 if $CC -v -static-libgcc 2>&1 | grep -q 'unrecognized option.*static-libgcc'; then
1130 libc_cv_gcc_static_libgcc=
1132 libc_cv_gcc_static_libgcc=-static-libgcc
1134 AC_SUBST(libc_cv_gcc_static_libgcc)
1136 AC_PATH_PROG(BASH_SHELL, bash, no)
1137 if test "$BASH_SHELL" != no &&
1138 $BASH_SHELL -c 'test "$BASH_VERSINFO" \
1139 && test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then
1140 libc_cv_have_bash2=yes
1142 libc_cv_have_bash2=no
1144 AC_SUBST(libc_cv_have_bash2)
1146 dnl We need a ksh compatible shell for tzselect.
1147 if test "$BASH_SHELL" = no; then
1148 AC_PATH_PROG(KSH, ksh, no)
1149 if test "$KSH" = no; then
1152 libc_cv_have_ksh=yes
1157 libc_cv_have_ksh=yes
1159 AC_SUBST(libc_cv_have_ksh)
1162 AC_PATH_PROG(PERL, perl, no)
1163 if test "$PERL" != no &&
1164 (eval `$PERL -V:apiversion`; test `expr "$apiversion" \< 5` -ne 0); then
1167 AC_PATH_PROG(INSTALL_INFO, install-info, no,
1168 $PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin)
1169 AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin)
1171 AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl
1172 echo '#include <stddef.h>
1173 FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
1174 if eval "$ac_cpp conftest.c 2>/dev/null" \
1175 | grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null; then
1176 libc_cv_signed_size_t=no
1178 libc_cv_signed_size_t=yes
1181 if test $libc_cv_signed_size_t = yes; then
1182 dnl Do this by hand instead of AC_DEFINE so can add #undef to avoid warnings.
1183 cat >> confdefs.h <<\EOF
1184 #undef __SIZE_TYPE__
1185 #define __SIZE_TYPE__ unsigned
1189 AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl
1191 [#define __need_size_t
1192 #define __need_wchar_t
1195 #include <stddef.h>], [size_t size; wchar_t wchar;
1197 #error stddef.h ignored __need_*
1199 if (&size == NULL || &wchar == NULL) abort ();],
1200 libc_cv_friendly_stddef=yes,
1201 libc_cv_friendly_stddef=no)])
1202 if test $libc_cv_friendly_stddef = yes; then
1203 config_vars="$config_vars
1204 override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
1207 AC_CACHE_CHECK(whether we need to use -P to assemble .S files,
1208 libc_cv_need_minus_P, [dnl
1209 cat > conftest.S <<EOF
1210 #include "confdefs.h"
1211 /* Nothing whatsoever. */
1213 if AC_TRY_COMMAND(${CC-cc} $CPPFLAGS $ASFLAGS -c conftest.S 1>&AS_MESSAGE_LOG_FD); then
1214 libc_cv_need_minus_P=no
1216 libc_cv_need_minus_P=yes
1219 if test $libc_cv_need_minus_P = yes; then
1220 config_vars="$config_vars
1221 asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
1224 AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl
1225 cat > conftest.s <<EOF
1228 .set glibc_conftest_frobozz,foo
1229 $libc_cv_asm_global_directive glibc_conftest_frobozz
1231 # The alpha-dec-osf1 assembler gives only a warning for `.set'
1232 # (but it doesn't work), so we must do a linking check to be sure.
1233 cat > conftest1.c <<\EOF
1234 extern int glibc_conftest_frobozz;
1235 void _start() { glibc_conftest_frobozz = 1; }
1237 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1238 -nostartfiles -nostdlib \
1239 -o conftest conftest.s conftest1.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1240 libc_cv_asm_set_directive=yes
1242 libc_cv_asm_set_directive=no
1245 if test $libc_cv_asm_set_directive = yes; then
1246 AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
1249 AC_CACHE_CHECK(for assembler gnu_unique_object symbol type,
1250 libc_cv_asm_unique_object, [dnl
1251 cat > conftest.s <<EOF
1254 .type _sym, ${libc_cv_asm_type_prefix}gnu_unique_object
1256 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1257 libc_cv_asm_unique_object=yes
1259 libc_cv_asm_unique_object=no
1262 if test $libc_cv_asm_unique_object = yes; then
1263 AC_DEFINE(HAVE_ASM_UNIQUE_OBJECT)
1266 AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
1267 [cat > conftest.s <<EOF
1270 .symver _sym,sym@VERS
1272 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1273 libc_cv_asm_symver_directive=yes
1275 libc_cv_asm_symver_directive=no
1278 AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl
1279 if test $libc_cv_asm_symver_directive = yes; then
1280 cat > conftest.s <<EOF
1283 .symver _sym,sym@VERS
1285 cat > conftest.map <<EOF
1294 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1295 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
1296 -o conftest.so conftest.o
1297 -nostartfiles -nostdlib
1298 -Wl,--version-script,conftest.map
1299 1>&AS_MESSAGE_LOG_FD]);
1301 libc_cv_ld_version_script_option=yes
1303 libc_cv_ld_version_script_option=no
1306 libc_cv_ld_version_script_option=no
1309 libc_cv_ld_version_script_option=no
1312 if test $shared != no &&
1313 test $libc_cv_asm_symver_directive = yes &&
1314 test $libc_cv_ld_version_script_option = yes &&
1315 test $enable_versioning = yes; then
1317 AC_DEFINE(DO_VERSIONING)
1321 AC_SUBST(VERSIONING)
1323 if test $elf = yes && test $shared != no && test $VERSIONING = no; then
1325 *** WARNING: You should not compile GNU libc without versioning. Not using
1326 *** versioning will introduce incompatibilities so that old binaries
1327 *** will not run anymore.
1328 *** For versioning you need recent binutils (binutils-2.8.1.0.23 or newer)."
1330 if test $elf = yes; then
1331 AC_CACHE_CHECK(for .previous assembler directive,
1332 libc_cv_asm_previous_directive, [dnl
1333 cat > conftest.s <<EOF
1334 .section foo_section
1337 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1338 libc_cv_asm_previous_directive=yes
1340 libc_cv_asm_previous_directive=no
1343 if test $libc_cv_asm_previous_directive = yes; then
1344 AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
1346 AC_CACHE_CHECK(for .popsection assembler directive,
1347 libc_cv_asm_popsection_directive, [dnl
1348 cat > conftest.s <<EOF
1349 .pushsection foo_section
1352 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1353 libc_cv_asm_popsection_directive=yes
1355 libc_cv_asm_popsection_directive=no
1358 if test $libc_cv_asm_popsection_directive = yes; then
1359 AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
1362 AC_CACHE_CHECK(for .protected and .hidden assembler directive,
1363 libc_cv_asm_protected_directive, [dnl
1364 cat > conftest.s <<EOF
1370 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1371 libc_cv_asm_protected_directive=yes
1373 AC_MSG_ERROR(assembler support for symbol visibility is required)
1377 if test $libc_cv_asm_protected_directive = yes; then
1378 AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
1379 libc_cv_visibility_attribute,
1380 [cat > conftest.c <<EOF
1381 int foo __attribute__ ((visibility ("hidden"))) = 1;
1382 int bar __attribute__ ((visibility ("protected"))) = 1;
1384 libc_cv_visibility_attribute=no
1385 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1386 if grep '\.hidden.*foo' conftest.s >/dev/null; then
1387 if grep '\.protected.*bar' conftest.s >/dev/null; then
1388 libc_cv_visibility_attribute=yes
1392 rm -f conftest.{c,s}
1394 if test $libc_cv_visibility_attribute != yes; then
1395 AC_MSG_ERROR(compiler support for visibility attribute is required)
1399 if test $libc_cv_visibility_attribute = yes; then
1400 AC_CACHE_CHECK(for broken __attribute__((visibility())),
1401 libc_cv_broken_visibility_attribute,
1402 [cat > conftest.c <<EOF
1404 int bar (int x) __asm__ ("foo") __attribute__ ((visibility ("hidden")));
1405 int bar (int x) { return x; }
1407 libc_cv_broken_visibility_attribute=yes
1408 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1410 if grep '\.hidden[ _]foo' conftest.s >/dev/null; then
1412 libc_cv_broken_visibility_attribute=no
1415 rm -f conftest.c conftest.s
1417 if test $libc_cv_broken_visibility_attribute = yes; then
1418 AC_MSG_ERROR(working compiler support for visibility attribute is required)
1422 AC_CACHE_CHECK(for broken __attribute__((alias())),
1423 libc_cv_broken_alias_attribute,
1424 [cat > conftest.c <<EOF
1425 extern int foo (int x) __asm ("xyzzy");
1426 int bar (int x) { return x; }
1427 extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
1429 extern __typeof (dfoo) dfoo __asm ("abccb");
1432 libc_cv_broken_alias_attribute=yes
1433 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1434 if grep 'xyzzy' conftest.s >/dev/null &&
1435 grep 'abccb' conftest.s >/dev/null; then
1436 libc_cv_broken_alias_attribute=no
1439 rm -f conftest.c conftest.s
1441 if test $libc_cv_broken_alias_attribute = yes; then
1442 AC_MSG_ERROR(working alias attribute support required)
1445 if test $libc_cv_visibility_attribute = yes; then
1446 AC_CACHE_CHECK(whether to put _rtld_local into .sdata section,
1447 libc_cv_have_sdata_section,
1448 [echo "int i;" > conftest.c
1449 libc_cv_have_sdata_section=no
1450 if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
1451 | grep '\.sdata' >/dev/null; then
1452 libc_cv_have_sdata_section=yes
1454 rm -f conftest.c conftest.so
1456 if test $libc_cv_have_sdata_section = yes; then
1457 AC_DEFINE(HAVE_SDATA_SECTION)
1461 AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
1462 libc_cv_initfini_array, [dnl
1463 cat > conftest.c <<EOF
1464 int _start (void) { return 0; }
1465 int __start (void) { return 0; }
1466 int foo (void) { return 1; }
1467 int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
1469 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c
1470 -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
1472 if readelf -S conftest | fgrep INIT_ARRAY > /dev/null; then
1473 libc_cv_initfini_array=yes
1475 libc_cv_initfini_array=no
1478 libc_cv_initfini_array=no
1481 if test $libc_cv_initfini_array != yes; then
1482 AC_MSG_ERROR([Need linker with .init_array/.fini_array support.])
1485 AC_CACHE_CHECK(whether to use .ctors/.dtors header and trailer,
1486 libc_cv_ctors_header, [dnl
1487 if AC_TRY_COMMAND([${CC-cc} -Wl,--verbose 2>&1|grep SORT_BY_INIT_PRIORITY 1>&AS_MESSAGE_LOG_FD]); then
1488 libc_cv_ctors_header=no
1490 libc_cv_ctors_header=yes
1493 if test $libc_cv_ctors_header = no; then
1494 AC_DEFINE(NO_CTORS_DTORS_SECTIONS)
1497 AC_CACHE_CHECK(for libunwind-support in compiler,
1498 libc_cv_cc_with_libunwind, [
1499 cat > conftest.c <<EOF
1500 int main (void) { return 0; }
1502 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
1503 conftest.c -v 2>&1 >/dev/null | grep -q " -lunwind "; then
1504 libc_cv_cc_with_libunwind=yes
1506 libc_cv_cc_with_libunwind=no
1509 AC_SUBST(libc_cv_cc_with_libunwind)
1510 if test $libc_cv_cc_with_libunwind = yes; then
1511 AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
1514 AC_CACHE_CHECK(for -z nodelete option,
1515 libc_cv_z_nodelete, [dnl
1516 cat > conftest.c <<EOF
1517 int _start (void) { return 42; }
1519 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1520 -fPIC -shared -o conftest.so conftest.c
1521 -nostartfiles -nostdlib
1522 -Wl,--enable-new-dtags,-z,nodelete 1>&AS_MESSAGE_LOG_FD])
1524 libc_cv_z_nodelete=yes
1526 AC_MSG_ERROR(linker with -z nodelete support required)
1530 AC_CACHE_CHECK(for -z nodlopen option,
1531 libc_cv_z_nodlopen, [dnl
1532 cat > conftest.c <<EOF
1533 int _start (void) { return 42; }
1535 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1536 -fPIC -shared -o conftest.so conftest.c
1537 -nostartfiles -nostdlib
1538 -Wl,--enable-new-dtags,-z,nodlopen 1>&AS_MESSAGE_LOG_FD])
1540 libc_cv_z_nodlopen=yes
1542 AC_MSG_ERROR(linker with -z nodlopen support required)
1546 AC_CACHE_CHECK(for -z initfirst option,
1547 libc_cv_z_initfirst, [dnl
1548 cat > conftest.c <<EOF
1549 int _start (void) { return 42; }
1551 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1552 -fPIC -shared -o conftest.so conftest.c
1553 -nostartfiles -nostdlib
1554 -Wl,--enable-new-dtags,-z,initfirst 1>&AS_MESSAGE_LOG_FD])
1556 libc_cv_z_initfirst=yes
1558 AC_MSG_ERROR(linker with -z initfirst support required)
1562 case "$base_machine" in
1564 i[34567]86 | x86_64 | powerpc* | s390* | sparc* | alpha*)
1566 AC_CACHE_CHECK(for -z relro option,
1567 libc_cv_z_relro, [dnl
1569 if AC_TRY_COMMAND([${CC-cc} -v --help 2>&1|grep "z relro" 1>&AS_MESSAGE_LOG_FD])
1571 if AC_TRY_COMMAND([${CC-cc} -Wl,--verbose 2>&1|grep DATA_SEGMENT_RELRO_END 1>&AS_MESSAGE_LOG_FD])
1576 if test "$libc_cv_z_relro" = no; then
1577 AC_MSG_ERROR(linker with -z relro support required)
1583 AC_CACHE_CHECK(for -Bgroup option,
1584 libc_cv_Bgroup, [dnl
1585 cat > conftest.c <<EOF
1586 int _start (void) { return 42; }
1588 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1589 -fPIC -shared -o conftest.so conftest.c
1590 -Wl,-Bgroup -nostdlib 1>&AS_MESSAGE_LOG_FD])
1597 AC_SUBST(libc_cv_Bgroup)
1599 AC_CACHE_CHECK(for libgcc_s suffix,
1600 libc_cv_libgcc_s_suffix, [dnl
1601 cat > conftest.c <<EOF
1602 int main (void) { return 0; }
1605 libc_cv_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1606 -fPIC -shared -shared-libgcc -o conftest.so \
1607 conftest.c -v 2>&1 >/dev/null \
1608 | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
1611 AC_SUBST(libc_cv_libgcc_s_suffix)
1613 AC_CACHE_CHECK(for --as-needed option,
1614 libc_cv_as_needed, [dnl
1615 cat > conftest.c <<EOF
1616 int main (void) { return 0; }
1618 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1619 -fPIC -shared -o conftest.so conftest.c
1620 -lgcc_s$libc_cv_libgcc_s_suffix -Wl,--as-needed
1621 -nostdlib 1>&AS_MESSAGE_LOG_FD])
1623 libc_cv_as_needed=yes
1625 libc_cv_as_needed=no
1628 AC_SUBST(libc_cv_as_needed)
1631 AC_CACHE_CHECK(whether --noexecstack is desirable for .S files,
1632 libc_cv_as_noexecstack, [dnl
1633 cat > conftest.c <<EOF
1636 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS
1637 -S -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD]) \
1638 && grep -q .note.GNU-stack conftest.s \
1639 && AC_TRY_COMMAND([${CC-cc} $ASFLAGS -Wa,--noexecstack
1640 -c -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD])
1642 libc_cv_as_noexecstack=yes
1644 libc_cv_as_noexecstack=no
1647 if test $libc_cv_as_noexecstack = yes; then
1648 ASFLAGS_config="$ASFLAGS_config -Wa,--noexecstack"
1650 AC_SUBST(ASFLAGS_config)
1652 AC_CACHE_CHECK(for -z combreloc,
1653 libc_cv_z_combreloc, [dnl
1654 cat > conftest.c <<EOF
1655 extern int bar (int);
1657 int foo (void) { return bar (mumble); }
1659 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1660 -fPIC -shared -o conftest.so conftest.c
1661 -nostdlib -nostartfiles
1662 -Wl,-z,combreloc 1>&AS_MESSAGE_LOG_FD])
1664 dnl The following test is a bit weak. We must use a tool which can test
1665 dnl cross-platform since the gcc used can be a cross compiler. Without
1666 dnl introducing new options this is not easily doable. Instead use a tool
1667 dnl which always is cross-platform: readelf. To detect whether -z combreloc
1668 dnl look for a section named .rel.dyn.
1669 if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
1670 libc_cv_z_combreloc=yes
1672 libc_cv_z_combreloc=no
1675 libc_cv_z_combreloc=no
1678 if test "$libc_cv_z_combreloc" = yes; then
1679 AC_DEFINE(HAVE_Z_COMBRELOC)
1681 AC_SUBST(libc_cv_z_combreloc)
1683 AC_CACHE_CHECK(for -z execstack,
1684 libc_cv_z_execstack, [dnl
1685 cat > conftest.c <<EOF
1686 int _start (void) { return 42; }
1688 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1689 -fPIC -shared -o conftest.so conftest.c
1690 -Wl,-z,execstack -nostdlib
1691 1>&AS_MESSAGE_LOG_FD])
1693 libc_cv_z_execstack=yes
1695 libc_cv_z_execstack=no
1698 AC_SUBST(libc_cv_z_execstack)
1700 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
1701 cat > conftest.c <<EOF
1703 main () { return 0;}
1705 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
1706 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
1714 AC_SUBST(libc_cv_fpie)
1716 AC_CACHE_CHECK(for --hash-style option,
1717 libc_cv_hashstyle, [dnl
1718 cat > conftest.c <<EOF
1719 int _start (void) { return 42; }
1721 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1722 -fPIC -shared -o conftest.so conftest.c
1723 -Wl,--hash-style=both -nostdlib 1>&AS_MESSAGE_LOG_FD])
1725 libc_cv_hashstyle=yes
1727 libc_cv_hashstyle=no
1730 AC_SUBST(libc_cv_hashstyle)
1733 AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl
1734 cat > conftest.c <<EOF
1737 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder -fno-section-anchors
1738 conftest.c 1>&AS_MESSAGE_LOG_FD])
1740 libc_cv_fno_toplevel_reorder=yes
1742 libc_cv_fno_toplevel_reorder=no
1745 if test $libc_cv_fno_toplevel_reorder = yes; then
1746 fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors"
1748 fno_unit_at_a_time=-fno-unit-at-a-time
1750 AC_SUBST(fno_unit_at_a_time)
1752 AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
1753 cat > conftest.c <<EOF
1755 main () { return 0;}
1757 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -Werror -fstack-protector
1758 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
1765 AC_SUBST(libc_cv_ssp)
1767 AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
1768 cat > conftest.c <<EOF
1770 #ifdef __GNUC_GNU_INLINE__
1771 main () { return 0;}
1776 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -std=gnu99 -fgnu89-inline
1777 -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD])
1779 libc_cv_gnu89_inline=yes
1781 libc_cv_gnu89_inline=no
1784 if test $libc_cv_gnu89_inline = yes; then
1785 gnu89_inline=-fgnu89-inline
1789 AC_SUBST(gnu89_inline)
1791 if test $elf != yes; then
1792 AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
1793 [AC_TRY_COMPILE(, [asm (".section .init");
1794 asm (".section .fini");
1795 asm ("${libc_cv_dot_text}");],
1796 libc_cv_have_initfini=yes,
1797 libc_cv_have_initfini=no)])
1798 AC_SUBST(libc_cv_have_initfini)dnl
1799 if test $libc_cv_have_initfini = yes; then
1800 AC_DEFINE(HAVE_INITFINI)
1804 if test $elf = yes; then
1805 AC_CACHE_CHECK(whether cc puts quotes around section names,
1806 libc_cv_have_section_quotes,
1807 [cat > conftest.c <<EOF
1808 static const int foo
1809 __attribute__ ((section ("bar"))) = 1;
1811 if ${CC-cc} -S conftest.c -o conftest.s; then
1812 if grep '\.section.*"bar"' conftest.s >/dev/null; then
1813 libc_cv_have_section_quotes=yes
1815 libc_cv_have_section_quotes=no
1818 libc_cv_have_section_quotes=unknown
1820 rm -f conftest.{c,s}
1822 if test $libc_cv_have_section_quotes = yes; then
1823 AC_DEFINE(HAVE_SECTION_QUOTES)
1827 dnl AC_CHECK_ASM_UNDERSCORE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1828 AC_DEFUN(AC_CHECK_ASM_UNDERSCORE,
1829 [cat > conftest.$ac_ext <<EOF
1830 dnl This sometimes fails to find confdefs.h, for some reason.
1831 dnl [#]line $LINENO "[$]0"
1832 [#]line $LINENO "configure"
1833 #include "confdefs.h"
1834 void underscore_test(void) {
1837 if AC_TRY_EVAL(ac_compile); then
1838 if grep _underscore_test conftest* >/dev/null; then
1839 ifelse([$1], , :, [rm -f conftest*
1842 ifelse([$2], , , [rm -f conftest*
1846 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
1847 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
1848 ifelse([$2], , , [rm -f conftest*
1853 if test $elf = yes; then
1854 libc_cv_asm_underscores=no
1856 if test $ac_cv_prog_cc_works = yes; then
1857 AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1858 [AC_TRY_LINK([asm ("_glibc_foobar:");], [glibc_foobar ();],
1859 libc_cv_asm_underscores=yes,
1860 libc_cv_asm_underscores=no)])
1862 AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1863 [AC_CHECK_ASM_UNDERSCORE(libc_cv_asm_underscores=yes,
1864 libc_cv_asm_underscores=no)])
1867 if test $libc_cv_asm_underscores = no; then
1868 AC_DEFINE(NO_UNDERSCORES)
1871 if test $elf = yes; then
1872 libc_cv_weak_symbols=yes
1875 AC_CACHE_CHECK(for assembler .weak directive, libc_cv_asm_weak_directive,
1877 cat > conftest.s <<EOF
1879 ${libc_cv_asm_global_directive} foo
1882 .weak bar; bar = foo
1884 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1885 libc_cv_asm_weak_directive=yes
1887 libc_cv_asm_weak_directive=no
1891 if test $libc_cv_asm_weak_directive = no; then
1892 AC_CACHE_CHECK(for assembler .weakext directive,
1893 libc_cv_asm_weakext_directive,
1895 cat > conftest.s <<EOF
1897 ${libc_cv_asm_global_directive} foo
1901 ${libc_cv_asm_global_directive} baz
1904 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1905 libc_cv_asm_weakext_directive=yes
1907 libc_cv_asm_weakext_directive=no
1913 if test $libc_cv_asm_weak_directive = yes; then
1914 AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
1915 elif test $libc_cv_asm_weakext_directive = yes; then
1916 AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)
1919 AC_CACHE_CHECK(whether CFI directives are supported, libc_cv_asm_cfi_directives, [dnl
1921 sparc/sparc64*) cfi_offset=2047;;
1924 cat > conftest.s <<EOF
1926 .type func,%function
1930 .cfi_rel_offset 1, $cfi_offset
1933 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1934 libc_cv_asm_cfi_directives=yes
1936 libc_cv_asm_cfi_directives=no
1939 if test $libc_cv_asm_cfi_directives = yes; then
1940 AC_DEFINE(HAVE_ASM_CFI_DIRECTIVES)
1943 AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
1944 cat > conftest.c <<\EOF
1949 dnl No \ in command here because it ends up inside ''.
1950 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1951 -nostdlib -nostartfiles -Wl,--no-whole-archive
1952 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1953 libc_cv_ld_no_whole_archive=yes
1955 libc_cv_ld_no_whole_archive=no
1958 if test $libc_cv_ld_no_whole_archive = yes; then
1959 no_whole_archive=-Wl,--no-whole-archive
1961 AC_SUBST(no_whole_archive)dnl
1963 AC_CACHE_CHECK(for gcc -fexceptions, libc_cv_gcc_exceptions, [dnl
1964 cat > conftest.c <<\EOF
1969 dnl No \ in command here because it ends up inside ''.
1970 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1971 -nostdlib -nostartfiles -fexceptions
1972 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1973 libc_cv_gcc_exceptions=yes
1975 libc_cv_gcc_exceptions=no
1978 if test $libc_cv_gcc_exceptions = yes; then
1979 exceptions=-fexceptions
1981 AC_SUBST(exceptions)dnl
1983 if test "$host_cpu" = powerpc ; then
1984 # Check for a bug present in at least versions 2.8.x of GCC
1985 # and versions 1.0.x of EGCS.
1986 AC_CACHE_CHECK(whether clobbering cr0 causes problems,libc_cv_c_asmcr0_bug,[dnl
1987 AC_TRY_COMPILE([int tester(int x) { asm ("" : : : "cc"); return x & 123; }],,
1988 libc_cv_c_asmcr0_bug='no',
1989 libc_cv_c_asmcr0_bug='yes')])
1990 if test "$libc_cv_c_asmcr0_bug" != 'no'; then
1991 AC_DEFINE(BROKEN_PPC_ASM_CR0)
1995 dnl Check whether compiler understands __builtin_expect.
1996 AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
1997 [cat > conftest.c <<EOF
1998 #line $LINENO "configure"
2001 a = __builtin_expect (a, 10);
2002 return a == 10 ? 0 : 1;
2005 dnl No \ in command here because it ends up inside ''.
2006 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles
2007 -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
2008 libc_cv_gcc_builtin_expect=yes
2010 libc_cv_gcc_builtin_expect=no
2013 if test "$libc_cv_gcc_builtin_expect" = yes; then
2014 AC_DEFINE(HAVE_BUILTIN_EXPECT)
2017 AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
2018 cat > conftest.c <<\EOF
2021 __builtin_memset (x, 0, 1000);
2025 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null]);
2027 libc_cv_gcc_builtin_memset=no
2029 libc_cv_gcc_builtin_memset=yes
2032 if test "$libc_cv_gcc_builtin_memset" = yes ; then
2033 AC_DEFINE(HAVE_BUILTIN_MEMSET)
2036 AC_CACHE_CHECK(for redirection of built-in functions, libc_cv_gcc_builtin_redirection, [dnl
2037 cat > conftest.c <<\EOF
2038 extern char *strstr (const char *, const char *) __asm ("my_strstr");
2039 char *foo (const char *a, const char *b)
2041 return __builtin_strstr (a, b);
2045 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "my_strstr" > /dev/null]);
2047 libc_cv_gcc_builtin_redirection=yes
2049 libc_cv_gcc_builtin_redirection=no
2052 if test "$libc_cv_gcc_builtin_redirection" = yes ; then
2053 AC_DEFINE(HAVE_BUILTIN_REDIRECTION)
2056 dnl Check whether the compiler supports the __thread keyword.
2057 if test "x$use__thread" != xno; then
2058 AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
2059 [cat > conftest.c <<\EOF
2060 __thread int a = 42;
2062 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
2063 libc_cv_gcc___thread=yes
2065 libc_cv_gcc___thread=no
2068 if test "$libc_cv_gcc___thread" = yes; then
2069 AC_DEFINE(HAVE___THREAD)
2072 libc_cv_gcc___thread=no
2075 if test "$libc_cv_gcc___thread" = yes; then
2076 dnl Check whether the compiler supports the tls_model attribute.
2077 AC_CACHE_CHECK([for tls_model attribute], libc_cv_gcc_tls_model_attr, [dnl
2078 cat > conftest.c <<\EOF
2079 extern __thread int a __attribute__((tls_model ("initial-exec")));
2081 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&AS_MESSAGE_LOG_FD]); then
2082 libc_cv_gcc_tls_model_attr=yes
2084 libc_cv_gcc_tls_model_attr=no
2087 if test "$libc_cv_gcc_tls_model_attr" = yes; then
2088 AC_DEFINE(HAVE_TLS_MODEL_ATTRIBUTE)
2092 if test -n "$submachine"; then
2093 AC_CACHE_CHECK([for compiler option for CPU variant],
2094 libc_cv_cc_submachine, [dnl
2095 libc_cv_cc_submachine=no
2096 for opt in "-march=$submachine" "-mcpu=$submachine"; do
2097 if AC_TRY_COMMAND([${CC-cc} $opt -xc /dev/null -S -o /dev/null]); then
2098 libc_cv_cc_submachine="$opt"
2102 if test "x$libc_cv_cc_submachine" = xno; then
2103 AC_MSG_ERROR([${CC-cc} does not support $submachine])
2106 AC_SUBST(libc_cv_cc_submachine)
2108 dnl Check whether we have the gd library available.
2109 AC_MSG_CHECKING(for libgd)
2110 if test "$with_gd" != "no"; then
2111 old_CFLAGS="$CFLAGS"
2112 CFLAGS="$CFLAGS $libgd_include"
2113 old_LDFLAGS="$LDFLAGS"
2114 LDFLAGS="$LDFLAGS $libgd_ldflags"
2116 LIBS="$LIBS -lgd -lpng -lz -lm"
2117 AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
2118 CFLAGS="$old_CFLAGS"
2119 LDFLAGS="$old_LDFLAGS"
2124 AC_MSG_RESULT($LIBGD)
2128 if test x$with_selinux = xno ; then
2131 # See if we have the SELinux library
2132 AC_CHECK_LIB(selinux, is_selinux_enabled,
2133 have_selinux=yes, have_selinux=no)
2134 # See if we have the SELinux header with the NSCD permissions in it.
2135 if test x$have_selinux = xyes ; then
2136 AC_MSG_CHECKING([for NSCD Flask permissions in selinux/av_permissions.h])
2137 AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
2138 [#ifdef NSCD__SHMEMHOST
2141 #error NSCD__SHMEMHOST not defined
2143 have_selinux=yes, have_selinux=no)
2144 AC_MSG_RESULT($have_selinux)
2147 if test x$with_selinux = xyes ; then
2148 if test x$have_selinux = xno ; then
2149 AC_MSG_ERROR([SELinux explicitly required, but sufficiently recent SELinux library not found])
2153 # Check if we're building with SELinux support.
2154 if test "x$have_selinux" = xyes; then
2155 AC_DEFINE(HAVE_SELINUX, 1, [SELinux support])
2157 # See if we have the libaudit library
2158 AC_CHECK_LIB(audit, audit_log_user_avc_message,
2159 have_libaudit=yes, have_libaudit=no)
2160 if test "x$have_libaudit" = xyes; then
2161 AC_DEFINE(HAVE_LIBAUDIT, 1, [SELinux libaudit support])
2163 AC_SUBST(have_libaudit)
2165 # See if we have the libcap library
2166 AC_CHECK_LIB(cap, cap_init, have_libcap=yes, have_libcap=no)
2167 if test "x$have_libcap" = xyes; then
2168 AC_DEFINE(HAVE_LIBCAP, 1, [SELinux libcap support])
2170 AC_SUBST(have_libcap)
2172 AC_SUBST(have_selinux)
2174 dnl check for the size of 'long double'.
2175 AC_CHECK_SIZEOF(long double, 0)
2176 sizeof_long_double=$ac_cv_sizeof_long_double
2177 AC_SUBST(sizeof_long_double)
2179 ### End of automated tests.
2180 ### Now run sysdeps configure fragments.
2182 # They also can set these variables.
2184 ldd_rewrite_script=no
2185 libc_cv_sysconfdir=$sysconfdir
2186 libc_cv_gcc_unwind_find_fde=no
2189 # Iterate over all the sysdep directories we will use, running their
2190 # configure fragments.
2191 for dir in $sysnames; do
2194 *) dest=$srcdir/$dir ;;
2196 if test -r $dest/configure; then
2197 AC_MSG_RESULT(running configure fragment for $dir)
2202 if test x$libc_cv_gcc_unwind_find_fde = xyes; then
2203 AC_DEFINE(EXPORT_UNWIND_FIND_FDE)
2205 AC_SUBST(libc_cv_gcc_unwind_find_fde)
2207 dnl This is tested by existing code and it's simpler to avoid changing it.
2208 AC_DEFINE(USE_IN_LIBIO)
2210 # Test for old glibc 2.0.x headers so that they can be removed properly
2211 # Search only in includedir.
2212 AC_MSG_CHECKING(for old glibc 2.0.x headers)
2213 if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
2215 old_glibc_headers=yes
2217 old_glibc_headers=no
2219 AC_MSG_RESULT($old_glibc_headers)
2220 if test ${old_glibc_headers} = yes; then
2221 AC_MSG_WARN(*** During \"make install\" old headers from glibc 2.0.x will)
2222 AC_MSG_WARN(*** be removed.)
2224 AC_SUBST(old_glibc_headers)
2226 AC_SUBST(libc_cv_slibdir)
2227 AC_SUBST(libc_cv_localedir)
2228 AC_SUBST(libc_cv_sysconfdir)
2229 AC_SUBST(libc_cv_rootsbindir)
2230 AC_SUBST(libc_cv_forced_unwind)
2232 dnl sysdeps/CPU/configure.in checks set this via arch-specific asm tests
2233 AC_SUBST(libc_cv_cpp_asm_debuginfo)
2234 AC_SUBST(libc_cv_cc_sse4)
2235 AC_SUBST(libc_cv_cc_avx)
2236 AC_SUBST(libc_cv_cc_novzeroupper)
2237 AC_SUBST(libc_cv_as_i686)
2239 AC_SUBST(use_ldconfig)
2240 AC_SUBST(ldd_rewrite_script)
2242 AC_SUBST(elf) AC_SUBST(xcoff)
2243 if test $elf = yes; then
2246 if test $xcoff = yes; then
2247 AC_DEFINE(HAVE_XCOFF)
2252 if test $shared = default; then
2256 AC_CACHE_CHECK([whether -fPIC is default], libc_cv_pic_default,
2257 [libc_cv_pic_default=yes
2258 cat > conftest.c <<EOF
2259 #if defined __PIC__ || defined __pic__ || defined PIC || defined pic
2260 # error PIC is default.
2263 if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
2264 libc_cv_pic_default=no
2267 AC_SUBST(libc_cv_pic_default)
2272 AC_SUBST(static_nss)
2273 AC_SUBST(nopic_initfini)
2277 dnl See sysdeps/mach/configure.in for this variable.
2278 AC_SUBST(mach_interface_list)
2280 if test "`(cd $srcdir; pwd)`" = "`pwd`"; then
2283 config_makefile=Makefile
2286 VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
2287 RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
2291 AC_CONFIG_FILES([config.make ${config_makefile}])
2292 AC_CONFIG_COMMANDS([default],[[
2293 case $CONFIG_FILES in *config.make*)
2294 echo "$config_vars" >> config.make;;
2296 test -d bits || mkdir bits]],[[config_vars='$config_vars']])