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])
277 AC_ARG_ENABLE([experimental-malloc],
278 AC_HELP_STRING([--enable-experimental-malloc],
279 [enable experimental malloc features]),
280 [experimental_malloc=$enableval],
282 AC_SUBST(experimental_malloc)
284 AC_ARG_ENABLE([nss-crypt],
285 AC_HELP_STRING([--enable-nss-crypt],
286 [enable libcrypt to use nss]),
287 [nss_crypt=$enableval],
289 if test x$nss_crypt = xyes; then
290 nss_includes=-I$(nss-config --includedir 2>/dev/null)
291 if test $? -ne 0; then
292 AC_MSG_ERROR([cannot find include directory with nss-config])
295 CFLAGS="$CFLAGS $nss_includes"
296 AC_COMPILE_IFELSE([typedef int PRBool;
298 #include <nsslowhash.h>
299 void f (void) { NSSLOW_Init (); }],
300 libc_cv_nss_crypt=yes,
302 cannot find NSS headers with lowlevel hash function interfaces]))
304 LIBS="$LIBS -lfreebl3"
305 AC_LINK_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
307 #include <nsslowhash.h>],
309 libc_cv_nss_crypt=yes,
311 cannot link program using lowlevel NSS hash functions]))
317 AC_SUBST(libc_cv_nss_crypt)
319 # The way shlib-versions is used to generate soversions.mk uses a
320 # fairly simplistic model for name recognition that can't distinguish
321 # i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
322 # of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can
323 # tell. This doesn't get used much beyond that, so it's fairly safe.
328 host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'`
332 # We keep the original values in `$config_*' and never modify them, so we
333 # can write them unchanged into config.make. Everything else uses
334 # $machine, $vendor, and $os, and changes them whenever convenient.
335 config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
337 # Don't allow vendor == "unknown"
338 test "$config_vendor" = unknown && config_vendor=
339 config_os="`echo $config_os | sed 's/^unknown-//'`"
341 # Some configurations imply other options.
343 # i586-linuxaout is mangled into i586-pc-linux-gnuaout
344 linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*)
346 gnu* | linux* | freebsd* | netbsd* | sysv4* | solaris2* | irix6*)
347 # These systems (almost) always use the ELF format.
351 # These systems are always xcoff
357 # The configure fragment of an add-on port can modify these to supplement
358 # or override the table in the case statement below. No fragment should
359 # ever change the config_* variables, however.
360 machine=$config_machine
361 vendor=$config_vendor
365 # config.guess on some IBM machines says `rs6000' instead of `powerpc'.
367 if test "$machine" = rs6000; then
371 # Braindead PowerPC box with absolutely no FPU.
372 case "$machine-$host_os" in
380 AS_HELP_STRING([--with-cpu=CPU], [select code for CPU variant]),
383 yes|'') AC_MSG_ERROR([--with-cpu requires an argument]) ;;
385 *) submachine="$withval" ;;
389 # An add-on can set this when it wants to disable the sanity check below.
392 dnl Having this here, though empty, makes sure that if add-ons' fragments
393 dnl do AC_CONFIG_SUBDIRS([some-dir]), which just sets $subdirs, then
394 dnl our AC_OUTPUT will actually use it.
397 case "$enable_add_ons" in
400 add_ons=`cd $srcdir && ls -d 2> /dev/null */configure */sysdeps |
401 sed 's@/[[^/]]*$@@' | sort | uniq`
402 add_ons_automatic=yes
404 *) add_ons=`echo "$enable_add_ons" | sed 's/,/ /g'`
405 add_ons_automatic=no ;;
411 if test x"$add_ons" != x; then
412 for f in $add_ons; do
417 *** It seems that you're using an old \`crypt' add-on. crypt is now
418 *** part of glibc and using the old add-on will not work with this
419 *** release. Start again with fresh sources and without the old
420 *** \`crypt' add-on.])
424 *** It seems that you're using an old \`localedata' add-on. localedata
425 *** is now part of glibc and using the old add-on will not work with
426 *** this release. Start again with fresh sources and without the old
427 *** \`localedata' add-on.])
432 # Now source each add-on's configure fragment.
433 # The fragments can use $srcdir/$libc_add_on to find themselves,
434 # and test $add_ons_automatic to see if they were explicitly requested.
435 # A fragment can clear (or even change) $libc_add_on to affect
436 # whether it goes into the list to be actually used in the build.
438 for libc_add_on in $add_ons; do
439 # Test whether such a directory really exists.
440 # It can be absolute, or relative to $srcdir, or relative to the build dir.
441 case "$libc_add_on" in
443 libc_add_on_srcdir=$libc_add_on
446 test -d "$srcdir/$libc_add_on" || {
447 if test -d "$libc_add_on"; then
448 libc_add_on="`pwd`/$libc_add_on"
450 AC_MSG_ERROR(add-on directory \"$libc_add_on\" does not exist)
453 libc_add_on_srcdir=$srcdir/$libc_add_on
457 libc_add_on_frag=$libc_add_on_srcdir/configure
458 libc_add_on_canonical=
459 libc_add_on_config_subdirs=
460 if test -r "$libc_add_on_frag"; then
461 AC_MSG_NOTICE(running configure fragment for add-on $libc_add_on)
462 libc_add_on_canonical=unknown
464 . "$libc_add_on_frag"
465 test -z "$libc_add_on" || {
466 configured_add_ons="$configured_add_ons $libc_add_on"
467 if test "x$libc_add_on_canonical" = xunknown; then
468 AC_MSG_ERROR(fragment must set \$libc_add_on_canonical)
470 for d in $libc_add_on_subdirs; do
471 case "$libc_add_on" in
472 /*) subdir_srcdir="$libc_add_on" ;;
473 *) subdir_srcdir="\$(..)$libc_add_on" ;;
477 d="${libc_add_on_canonical:-$libc_add_on}"
483 subdir_srcdir="$subdir_srcdir/$d"
486 d=`echo "$d" | sed 's@/*$@@;s@^.*/@@'`
487 add_on_subdirs="$add_on_subdirs $d"
488 test "$subdir_srcdir" = "\$(..)$d" || config_vars="$config_vars
489 $d-srcdir = $subdir_srcdir"
491 for d in $libc_add_on_config_subdirs; do
494 fragment uses absolute path in \$libc_add_on_config_subdirs) ;;
496 if test ! -d "$libc_add_on_srcdir/$d"; then
497 AC_MSG_ERROR(fragment wants to configure missing directory $d)
499 case "$libc_add_on" in
501 relative path required for add-on using \$libc_add_on_config_subdirs) ;;
503 subdirs="$subdirs $libc_add_on/$d"
507 if test -n "$libc_add_on"; then
508 if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2> /dev/null`
510 AC_MSG_CHECKING(add-on $libc_add_on for preconfigure fragments)
511 for frag in $frags; do
512 name=`echo "$frag" | sed 's@/[[^/]]*$@@;s@^.*/@@'`
513 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
518 use_add_ons="$use_add_ons $libc_add_on"
519 add_ons_pfx="$add_ons_pfx $libc_add_on/"
520 test -z "$libc_add_on_canonical" ||
521 add_ons_sfx="$add_ons_sfx /$libc_add_on_canonical"
524 # Use echo to strip excess whitespace.
525 add_ons="`echo $use_add_ons`"
528 AC_SUBST(add_on_subdirs)
532 ### I put this here to prevent those annoying emails from people who cannot
533 ### read and try to compile glibc on unsupported platforms. --drepper
535 ### By using the undocumented --enable-hacker-mode option for configure
536 ### one can skip this test to make the configuration not fail for unsupported
539 if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then
540 case "$machine-$host_os" in
541 *-linux* | *-gnu* | arm*-none* | powerpc-aix4.3.*)
544 echo "*** The GNU C library is currently not available for this platform."
545 echo "*** So far nobody cared to port it and if there is no volunteer it"
546 echo "*** might never happen. So, if you have interest to see glibc on"
547 echo "*** this platform visit"
548 echo "*** http://www.gnu.org/software/libc/porting.html"
549 echo "*** and join the group of porters"
555 dnl We need to use [ and ] for other purposes for a while now.
557 # Expand the configuration machine name into a subdirectory by architecture
558 # type and particular chip. If an add-on configure fragment already set
559 # base_machine, we don't change it.
560 test -n "$base_machine" || case "$machine" in
561 a29k | am29000) base_machine=a29k machine=a29k ;;
562 c3[012]) base_machine=cx0 machine=cx0/c30 ;;
563 c4[04]) base_machine=cx0 machine=cx0/c40 ;;
564 i[34567]86) base_machine=i386 machine=i386/$machine ;;
565 ia64) base_machine=ia64 machine=ia64 ;;
566 m88???) base_machine=m88k machine=m88k/$machine ;;
567 m88k) base_machine=m88k machine=m88k/m88100 ;;
568 powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;;
569 powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;;
570 s390) base_machine=s390 machine=s390/s390-32 ;;
571 s390x) base_machine=s390 machine=s390/s390-64 ;;
572 sh3*) base_machine=sh machine=sh/sh3 ;;
573 sh4*) base_machine=sh machine=sh/sh4 ;;
575 base_machine=sparc machine=sparc/sparc32 ;;
576 sparcv8 | supersparc | hypersparc)
577 base_machine=sparc machine=sparc/sparc32/sparcv8 ;;
578 sparcv8plus | sparcv8plusa | sparcv9)
579 base_machine=sparc machine=sparc/sparc32/sparcv9 ;;
580 sparcv8plusb | sparcv9b)
581 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;;
583 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v ;;
585 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v2 ;;
587 base_machine=sparc machine=sparc/sparc64 ;;
589 base_machine=sparc machine=sparc/sparc64/sparcv9b ;;
591 base_machine=sparc machine=sparc/sparc64/sparcv9v ;;
593 base_machine=sparc machine=sparc/sparc64/sparcv9v2 ;;
594 *) base_machine=$machine ;;
597 AC_SUBST(base_machine)
599 if test "$base_machine" = "i386"; then
600 AC_DEFINE(USE_REGPARMS)
603 # For the multi-arch option we need support in the assembler.
604 AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support],
605 libc_cv_asm_gnu_indirect_function, [dnl
606 cat > conftest.s <<EOF
607 .type foo,%gnu_indirect_function
609 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
611 libc_cv_asm_gnu_indirect_function=yes
613 libc_cv_asm_gnu_indirect_function=no
617 AC_MSG_CHECKING(whether .text pseudo-op must be used)
618 AC_CACHE_VAL(libc_cv_dot_text, [dnl
619 cat > conftest.s <<EOF
623 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
624 libc_cv_dot_text=.text
627 if test -z "$libc_cv_dot_text"; then
633 AC_CACHE_CHECK(for assembler global-symbol directive,
634 libc_cv_asm_global_directive, [dnl
635 libc_cv_asm_global_directive=UNKNOWN
636 for ac_globl in .globl .global .EXPORT; do
637 cat > conftest.s <<EOF
642 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
643 libc_cv_asm_global_directive=${ac_globl}
646 test $libc_cv_asm_global_directive != UNKNOWN && break
648 if test $libc_cv_asm_global_directive = UNKNOWN; then
649 AC_MSG_ERROR(cannot determine asm global directive)
651 AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${libc_cv_asm_global_directive})
654 AC_CACHE_CHECK(for assembler .type directive prefix,
655 libc_cv_asm_type_prefix, [dnl
656 libc_cv_asm_type_prefix=no
657 for ac_try_prefix in '@' '%' '#'; do
658 cat > conftest.s <<EOF
660 ${libc_cv_asm_global_directive} foo
661 .type foo, ${ac_try_prefix}object
666 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
667 libc_cv_asm_type_prefix=${ac_try_prefix}
670 test "x$libc_cv_asm_type_prefix" != xno && break
672 if test "x$libc_cv_asm_type_prefix" != xno; then
673 AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix})
676 if test x"$libc_cv_asm_gnu_indirect_function" != xyes -a x"$libc_cv_asm_type_prefix" = xno; then
677 if test x"$multi_arch" = xyes; then
678 AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
683 if test x"$multi_arch" != xno; then
684 multi_arch_d=/multiarch
687 # Compute the list of sysdep directories for this configuration.
688 # This can take a while to compute.
689 sysdep_dir=$srcdir/sysdeps
690 AC_MSG_CHECKING(sysdep dirs)
691 dnl We need to use [ and ] for other purposes for a while now.
693 # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
694 os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
696 test "x$base_os" != x || case "$os" in
699 netbsd* | 386bsd* | freebsd* | bsdi*)
700 base_os=unix/bsd/bsd4.4 ;;
701 osf* | sunos* | ultrix* | newsos* | dynix* | *bsd*)
703 sysv* | isc* | esix* | sco* | minix* | irix4* | linux*)
706 base_os=unix/sysv/irix6/$os ;;
708 base_os=unix/sysv/sysv4 ;;
710 base_os=unix/sysv/hpux/$os ;;
712 base_os=unix/sysv/aix/aix4.3 ;;
714 base_os=standalone ;;
717 # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
720 while o=`echo $tail | sed 's/\.[^.]*$//'`; test $o != $tail; do
724 o=`echo $tail | sed 's/[0-9]*$//'`
725 if test $o != $tail; then
728 # For linux-gnu, try linux-gnu, then linux.
729 o=`echo $tail | sed 's/-.*$//'`
730 if test $o != $tail; then
734 # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
737 while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$b"; do
743 # For sparc/sparc32, try sparc/sparc32 and then sparc.
745 tail=$machine${submachine:+/$submachine}
746 while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
748 # Prepend the machine's FPU directory unless --without-fp.
749 if test "$with_fp" = yes; then
752 mach="$mach /$1/nofpu"
758 dnl We are done with glob and regexp uses of [ and ]; return to autoconf.
761 # Find what sysdep directories exist.
764 for b in $base ''; do
765 for m0 in $mach ''; do
766 for v in /$vendor ''; do
767 test "$v" = / && continue
768 for o in /$ostry ''; do
769 test "$o" = / && continue
770 for m in $multi_arch_d $mach ''; do
771 for d in $add_ons_pfx ''; do
772 for a in $add_ons_sfx ''; do
773 if test -n "$m0$m0sub$b$v$o$m$msub"; then
774 try_srcdir="${srcdir}/"
778 try="${d}sysdeps$m0$m0sub$b$v$o$m$msub$a"
779 test -n "$enable_debug_configure" &&
780 echo "$0 [DEBUG]: try $try" >&2
781 if test -d "$try_srcdir$try"; then
782 sysnames="$sysnames $try"
783 { test -n "$o" || test -n "$b"; } && os_used=t
784 { test -n "$m" || test -n "$m0"; } && machine_used=t
786 x*/$submachine) submachine_used=t ;;
788 if test -n "$d"; then
789 case "$sysnames_add_ons" in
791 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
804 # If the assembler supports gnu_indirect_function symbol type and the
805 # architecture supports multi-arch, we enable multi-arch by default.
806 case $sysnames_add_ons$sysnames in
810 test x"$multi_arch" = xdefault && multi_arch=no
813 if test x"$multi_arch" != xno; then
814 AC_DEFINE(USE_MULTIARCH)
818 if test -z "$os_used" && test "$os" != none; then
819 AC_MSG_ERROR(Operating system $os is not supported.)
821 if test -z "$machine_used" && test "$machine" != none; then
822 AC_MSG_ERROR(The $machine is not supported.)
824 if test -z "$submachine_used" && test -n "$submachine"; then
825 AC_MSG_ERROR(The $submachine subspecies of $host_cpu is not supported.)
829 # We have now validated the configuration.
832 # If using ELF, look for an `elf' subdirectory of each machine directory.
833 # We prepend these rather than inserting them whereever the machine appears
834 # because things specified by the machine's ELF ABI should override
835 # OS-specific things, and should always be the same for any OS on the
836 # machine (otherwise what's the point of an ABI?).
837 if test "$elf" = yes; then
839 for d in $add_ons_pfx ''; do
841 if test -d $srcdir/${d}sysdeps$m/elf; then
842 elf_dirs="$elf_dirs ${d}sysdeps$m/elf"
846 sysnames="`echo $elf_dirs | sed -e 's,//,/,g'` $sysnames"
850 # Expand the list of system names into a full list of directories
851 # from each element's parent name and Implies file (if present).
854 while test $# -gt 0; do
858 case " $names " in *" $name "*)
859 # Already in the list.
863 # Report each name as we discover it, so there is no long pause in output.
864 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
866 name_base=`echo $name | sed -e 's@\(.*sysdeps\)/.*@\1@'`
870 *) xsrcdir=$srcdir/ ;;
872 test -n "$enable_debug_configure" &&
873 echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2
875 if test -f $xsrcdir$name/Implies; then
876 # Collect more names from the `Implies' file (removing comments).
877 implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`"
879 for x in $implied_candidate; do
881 if test -d $xsrcdir$name_base/$x; then
882 implied="$implied $name_base/$x";
885 for d in $add_ons_pfx ''; do
889 *) try_srcdir=$srcdir/ ;;
891 test -n "$enable_debug_configure" &&
892 echo "[DEBUG]: $name implied $x try($d) {$try_srcdir}$try" >&2
893 if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
895 implied="$implied $try"
897 case "$sysnames_add_ons" in
899 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
903 if test $found = no; then
904 AC_MSG_WARN($name/Implies specifies nonexistent $x)
911 # Add NAME to the list of names.
914 # Find the parent of NAME, using the empty string if it has none.
916 parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
919 # Add the names implied by NAME, and NAME's parent (if it has one), to
920 # the list of names to be processed (the argument list). We prepend the
921 # implied names to the list and append the parent. We want implied
922 # directories to come before further directories inferred from the
923 # configuration components; this ensures that for sysv4, unix/common
924 # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
926 sysnames="`echo $implied $* $parent`"
927 test -n "$sysnames" && set $sysnames
930 # Add the default directories.
931 default_sysnames=sysdeps/generic
932 if test "$elf" = yes; then
933 default_sysnames="sysdeps/generic/elf $default_sysnames"
935 sysnames="$names $default_sysnames"
937 # The other names were emitted during the scan.
938 AC_MSG_RESULT($default_sysnames)
940 # Collect the list of add-ons that supply partial sysdeps trees.
942 for add_on in $add_ons; do
945 *) xsrcdir="$srcdir/" ;;
948 test -d "$xsrcdir$add_on/sysdeps" || {
949 case "$configured_add_ons " in
952 AC_MSG_ERROR(add-on $add_on has no configure fragment or sysdeps tree)
958 sysdeps_add_ons="$sysdeps_add_ons $add_on"
959 case "$sysnames_add_ons" in
962 AC_MSG_WARN(add-on $add_on contributed no sysdeps directories)
967 for d in $sysnames; do
969 $add_on/sysdeps/*) ;;
972 (cd "$xsrcdir$d" && for f in *[[!~]]; do
976 test -d "$ff" || { test -e "$ff" && exit 88; }
980 test -d "$f" || { test -e "$f" && exit 88; }
984 if test $? -eq 88; then
989 if test $found = no; then
990 AC_MSG_WARN(add-on $add_on contributed no useful sysdeps directories)
993 AC_SUBST(sysdeps_add_ons)
999 if test "$INSTALL" = "${srcdir}/scripts/install-sh -c"; then
1000 # The makefiles need to use a different form to find it in $srcdir.
1001 INSTALL='\$(..)./scripts/install-sh -c'
1006 AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
1008 # Accept binutils 2.13 or newer.
1009 AC_CHECK_PROG_VER(AS, $AS, --version,
1010 [GNU assembler.* \([0-9]*\.[0-9.]*\)],
1011 [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")
1012 AC_CHECK_PROG_VER(LD, $LD, --version,
1013 [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
1014 [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")
1016 # We need the physical current working directory. We cannot use the
1017 # "pwd -P" shell builtin since that's not portable. Instead we try to
1018 # find a pwd binary. Note that assigning to the PWD environment
1019 # variable might have some interesting side effects, so we don't do
1021 AC_PATH_PROG(PWD_P, pwd, no)
1022 if test "$PWD_P" = no; then
1023 AC_MSG_ERROR(*** A pwd binary could not be found.)
1026 # These programs are version sensitive.
1027 AC_CHECK_TOOL_PREFIX
1028 AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
1029 [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* ],
1030 critic_missing="$critic_missing gcc")
1031 AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
1032 [GNU Make[^0-9]*\([0-9][0-9.]*\)],
1033 [3.79* | 3.[89]*], critic_missing="$critic_missing make")
1035 AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
1036 [GNU gettext.* \([0-9]*\.[0-9.]*\)],
1037 [0.10.3[6-9]* | 0.10.[4-9][0-9]* | 0.1[1-9]* | 0.[2-9][0-9]* | [1-9].*],
1038 MSGFMT=: aux_missing="$aux_missing msgfmt")
1039 AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
1040 [GNU texinfo.* \([0-9][0-9.]*\)],
1042 MAKEINFO=: aux_missing="$aux_missing makeinfo")
1043 AC_CHECK_PROG_VER(SED, sed, --version,
1044 [GNU sed version \([0-9]*\.[0-9.]*\)],
1045 [3.0[2-9]*|3.[1-9]*|[4-9]*],
1046 SED=: aux_missing="$aux_missing sed")
1048 AC_CHECK_PROGS(AUTOCONF, autoconf, no)
1049 case "x$AUTOCONF" in
1050 xno|x|x:) AUTOCONF=no ;;
1053 whether $AUTOCONF${ACFLAGS:+ }$ACFLAGS works, libc_cv_autoconf_works, [dnl
1054 if (cd $srcdir; $AUTOCONF $ACFLAGS configure.in > /dev/null 2>&1); then
1055 libc_cv_autoconf_works=yes
1057 libc_cv_autoconf_works=no
1059 test $libc_cv_autoconf_works = yes || AUTOCONF=no
1062 if test "x$with_cvs" = xyes && test "x$AUTOCONF" = xno; then
1063 # If --without-cvs they probably won't change configure.in, so no complaints.
1064 aux_missing="$aux_missing autoconf"
1067 test -n "$critic_missing" && AC_MSG_ERROR([
1068 *** These critical programs are missing or too old:$critic_missing
1069 *** Check the INSTALL file for required versions.])
1071 test -n "$aux_missing" && AC_MSG_WARN([
1072 *** These auxiliary programs are missing or incompatible versions:$aux_missing
1073 *** some features will be disabled.
1074 *** Check the INSTALL file for required versions.])
1076 # if using special system headers, find out the compiler's sekrit
1077 # header directory and add that to the list. NOTE: Only does the right
1078 # thing on a system that doesn't need fixincludes. (Not presently a problem.)
1079 if test -n "$sysheaders"; then
1080 SYSINCLUDES=-nostdinc
1081 for d in include include-fixed; do
1082 i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
1083 SYSINCLUDES="$SYSINCLUDES -isystem $i"
1085 SYSINCLUDES="$SYSINCLUDES \
1086 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
1087 if test -n "$CXX"; then
1088 cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
1089 cxxmachine=`$CXX -dumpmachine 2>&AS_MESSAGE_LOG_FD` &&
1090 cxxheaders=`$CXX -print-file-name=../../../../include/c++/`"$cxxversion" &&
1091 CXX_SYSINCLUDES="-isystem $cxxheaders \
1092 -isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
1095 AC_SUBST(SYSINCLUDES)
1096 AC_SUBST(CXX_SYSINCLUDES)
1098 # ranlib is never necessary on Linux and Hurd systems
1101 # Test if LD_LIBRARY_PATH contains the notation for the current directory
1102 # since this would lead to problems installing/building glibc.
1103 # LD_LIBRARY_PATH contains the current directory if one of the following
1105 # - one of the terminals (":" and ";") is the first or last sign
1106 # - two terminals occur directly after each other
1107 # - the path contains an element with a dot in it
1108 AC_MSG_CHECKING(LD_LIBRARY_PATH variable)
1110 case ${LD_LIBRARY_PATH} in
1111 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
1112 ld_library_path_setting="contains current directory"
1115 ld_library_path_setting="ok"
1119 AC_MSG_RESULT($ld_library_path_setting)
1120 if test "$ld_library_path_setting" != "ok"; then
1122 *** LD_LIBRARY_PATH shouldn't contain the current directory when
1123 *** building glibc. Please change the environment variable
1124 *** and run configure again.])
1127 AC_CACHE_CHECK(whether GCC supports -static-libgcc, libc_cv_gcc_static_libgcc, [dnl
1128 if $CC -v -static-libgcc 2>&1 | grep -q 'unrecognized option.*static-libgcc'; then
1129 libc_cv_gcc_static_libgcc=
1131 libc_cv_gcc_static_libgcc=-static-libgcc
1133 AC_SUBST(libc_cv_gcc_static_libgcc)
1135 AC_PATH_PROG(BASH_SHELL, bash, no)
1136 if test "$BASH_SHELL" != no &&
1137 $BASH_SHELL -c 'test "$BASH_VERSINFO" \
1138 && test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then
1139 libc_cv_have_bash2=yes
1141 libc_cv_have_bash2=no
1143 AC_SUBST(libc_cv_have_bash2)
1145 dnl We need a ksh compatible shell for tzselect.
1146 if test "$BASH_SHELL" = no; then
1147 AC_PATH_PROG(KSH, ksh, no)
1148 if test "$KSH" = no; then
1151 libc_cv_have_ksh=yes
1156 libc_cv_have_ksh=yes
1158 AC_SUBST(libc_cv_have_ksh)
1161 AC_PATH_PROG(PERL, perl, no)
1162 if test "$PERL" != no &&
1163 (eval `$PERL -V:apiversion`; test `expr "$apiversion" \< 5` -ne 0); then
1166 AC_PATH_PROG(INSTALL_INFO, install-info, no,
1167 $PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin)
1168 AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin)
1170 AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl
1171 echo '#include <stddef.h>
1172 FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
1173 if eval "$ac_cpp conftest.c 2>/dev/null" \
1174 | grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null; then
1175 libc_cv_signed_size_t=no
1177 libc_cv_signed_size_t=yes
1180 if test $libc_cv_signed_size_t = yes; then
1181 dnl Do this by hand instead of AC_DEFINE so can add #undef to avoid warnings.
1182 cat >> confdefs.h <<\EOF
1183 #undef __SIZE_TYPE__
1184 #define __SIZE_TYPE__ unsigned
1188 AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl
1190 [#define __need_size_t
1191 #define __need_wchar_t
1194 #include <stddef.h>], [size_t size; wchar_t wchar;
1196 #error stddef.h ignored __need_*
1198 if (&size == NULL || &wchar == NULL) abort ();],
1199 libc_cv_friendly_stddef=yes,
1200 libc_cv_friendly_stddef=no)])
1201 if test $libc_cv_friendly_stddef = yes; then
1202 config_vars="$config_vars
1203 override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
1206 AC_CACHE_CHECK(whether we need to use -P to assemble .S files,
1207 libc_cv_need_minus_P, [dnl
1208 cat > conftest.S <<EOF
1209 #include "confdefs.h"
1210 /* Nothing whatsoever. */
1212 if AC_TRY_COMMAND(${CC-cc} $CPPFLAGS $ASFLAGS -c conftest.S 1>&AS_MESSAGE_LOG_FD); then
1213 libc_cv_need_minus_P=no
1215 libc_cv_need_minus_P=yes
1218 if test $libc_cv_need_minus_P = yes; then
1219 config_vars="$config_vars
1220 asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
1223 AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl
1224 cat > conftest.s <<EOF
1227 .set glibc_conftest_frobozz,foo
1228 $libc_cv_asm_global_directive glibc_conftest_frobozz
1230 # The alpha-dec-osf1 assembler gives only a warning for `.set'
1231 # (but it doesn't work), so we must do a linking check to be sure.
1232 cat > conftest1.c <<\EOF
1233 extern int glibc_conftest_frobozz;
1234 void _start() { glibc_conftest_frobozz = 1; }
1236 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1237 -nostartfiles -nostdlib \
1238 -o conftest conftest.s conftest1.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1239 libc_cv_asm_set_directive=yes
1241 libc_cv_asm_set_directive=no
1244 if test $libc_cv_asm_set_directive = yes; then
1245 AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
1248 AC_CACHE_CHECK(for assembler gnu_unique_object symbol type,
1249 libc_cv_asm_unique_object, [dnl
1250 cat > conftest.s <<EOF
1253 .type _sym, ${libc_cv_asm_type_prefix}gnu_unique_object
1255 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1256 libc_cv_asm_unique_object=yes
1258 libc_cv_asm_unique_object=no
1261 if test $libc_cv_asm_unique_object = yes; then
1262 AC_DEFINE(HAVE_ASM_UNIQUE_OBJECT)
1265 AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
1266 [cat > conftest.s <<EOF
1269 .symver _sym,sym@VERS
1271 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1272 libc_cv_asm_symver_directive=yes
1274 libc_cv_asm_symver_directive=no
1277 AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl
1278 if test $libc_cv_asm_symver_directive = yes; then
1279 cat > conftest.s <<EOF
1282 .symver _sym,sym@VERS
1284 cat > conftest.map <<EOF
1293 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1294 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
1295 -o conftest.so conftest.o
1296 -nostartfiles -nostdlib
1297 -Wl,--version-script,conftest.map
1298 1>&AS_MESSAGE_LOG_FD]);
1300 libc_cv_ld_version_script_option=yes
1302 libc_cv_ld_version_script_option=no
1305 libc_cv_ld_version_script_option=no
1308 libc_cv_ld_version_script_option=no
1311 if test $shared != no &&
1312 test $libc_cv_asm_symver_directive = yes &&
1313 test $libc_cv_ld_version_script_option = yes &&
1314 test $enable_versioning = yes; then
1316 AC_DEFINE(DO_VERSIONING)
1320 AC_SUBST(VERSIONING)
1322 if test $elf = yes && test $shared != no && test $VERSIONING = no; then
1324 *** WARNING: You should not compile GNU libc without versioning. Not using
1325 *** versioning will introduce incompatibilities so that old binaries
1326 *** will not run anymore.
1327 *** For versioning you need recent binutils (binutils-2.8.1.0.23 or newer)."
1329 if test $elf = yes; then
1330 AC_CACHE_CHECK(for .previous assembler directive,
1331 libc_cv_asm_previous_directive, [dnl
1332 cat > conftest.s <<EOF
1333 .section foo_section
1336 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1337 libc_cv_asm_previous_directive=yes
1339 libc_cv_asm_previous_directive=no
1342 if test $libc_cv_asm_previous_directive = yes; then
1343 AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
1345 AC_CACHE_CHECK(for .popsection assembler directive,
1346 libc_cv_asm_popsection_directive, [dnl
1347 cat > conftest.s <<EOF
1348 .pushsection foo_section
1351 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1352 libc_cv_asm_popsection_directive=yes
1354 libc_cv_asm_popsection_directive=no
1357 if test $libc_cv_asm_popsection_directive = yes; then
1358 AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
1361 AC_CACHE_CHECK(for .protected and .hidden assembler directive,
1362 libc_cv_asm_protected_directive, [dnl
1363 cat > conftest.s <<EOF
1369 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1370 libc_cv_asm_protected_directive=yes
1372 AC_MSG_ERROR(assembler support for symbol visibility is required)
1376 if test $libc_cv_asm_protected_directive = yes; then
1377 AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
1378 libc_cv_visibility_attribute,
1379 [cat > conftest.c <<EOF
1380 int foo __attribute__ ((visibility ("hidden"))) = 1;
1381 int bar __attribute__ ((visibility ("protected"))) = 1;
1383 libc_cv_visibility_attribute=no
1384 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1385 if grep '\.hidden.*foo' conftest.s >/dev/null; then
1386 if grep '\.protected.*bar' conftest.s >/dev/null; then
1387 libc_cv_visibility_attribute=yes
1393 if test $libc_cv_visibility_attribute != yes; then
1394 AC_MSG_ERROR(compiler support for visibility attribute is required)
1398 if test $libc_cv_visibility_attribute = yes; then
1399 AC_CACHE_CHECK(for broken __attribute__((visibility())),
1400 libc_cv_broken_visibility_attribute,
1401 [cat > conftest.c <<EOF
1403 int bar (int x) __asm__ ("foo") __attribute__ ((visibility ("hidden")));
1404 int bar (int x) { return x; }
1406 libc_cv_broken_visibility_attribute=yes
1407 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s1>&AS_MESSAGE_LOG_FD); then
1409 if grep '\.hidden[ _]foo' conftest.s >/dev/null; then
1411 libc_cv_broken_visibility_attribute=no
1414 rm -f conftest.c conftest.s
1416 if test $libc_cv_broken_visibility_attribute = yes; then
1417 AC_MSG_ERROR(working compiler support for visibility attribute is required)
1421 AC_CACHE_CHECK(for broken __attribute__((alias())),
1422 libc_cv_broken_alias_attribute,
1423 [cat > conftest.c <<EOF
1424 extern int foo (int x) __asm ("xyzzy");
1425 int bar (int x) { return x; }
1426 extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
1428 extern __typeof (dfoo) dfoo __asm ("abccb");
1431 libc_cv_broken_alias_attribute=yes
1432 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1433 if grep 'xyzzy' conftest.s >/dev/null &&
1434 grep 'abccb' conftest.s >/dev/null; then
1435 libc_cv_broken_alias_attribute=no
1438 rm -f conftest.c conftest.s
1440 if test $libc_cv_broken_alias_attribute = yes; then
1441 AC_MSG_ERROR(working alias attribute support required)
1444 if test $libc_cv_visibility_attribute = yes; then
1445 AC_CACHE_CHECK(whether to put _rtld_local into .sdata section,
1446 libc_cv_have_sdata_section,
1447 [echo "int i;" > conftest.c
1448 libc_cv_have_sdata_section=no
1449 if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
1450 | grep '\.sdata' >/dev/null; then
1451 libc_cv_have_sdata_section=yes
1453 rm -f conftest.c conftest.so
1455 if test $libc_cv_have_sdata_section = yes; then
1456 AC_DEFINE(HAVE_SDATA_SECTION)
1460 AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
1461 libc_cv_initfini_array, [dnl
1462 cat > conftest.c <<EOF
1463 int _start (void) { return 0; }
1464 int __start (void) { return 0; }
1465 int foo (void) { return 1; }
1466 int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
1468 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c
1469 -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
1471 if readelf -S conftest | fgrep INIT_ARRAY > /dev/null; then
1472 libc_cv_initfini_array=yes
1474 libc_cv_initfini_array=no
1477 libc_cv_initfini_array=no
1480 if test $libc_cv_initfini_array != yes; then
1481 AC_MSG_ERROR([Need linker with .init_array/.fini_array support.])
1482 elif AC_TRY_COMMAND([${CC-cc} -Wl,--verbose 2>&1|grep SORT_BY_INIT_PRIORITY 1>&AS_MESSAGE_LOG_FD]); then
1483 AC_DEFINE(NO_CTORS_DTORS_SECTIONS)
1486 AC_CACHE_CHECK(for libunwind-support in compiler,
1487 libc_cv_cc_with_libunwind, [
1488 cat > conftest.c <<EOF
1489 int main (void) { return 0; }
1491 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
1492 conftest.c -v 2>&1 >/dev/null | grep -q " -lunwind "; then
1493 libc_cv_cc_with_libunwind=yes
1495 libc_cv_cc_with_libunwind=no
1498 AC_SUBST(libc_cv_cc_with_libunwind)
1499 if test $libc_cv_cc_with_libunwind = yes; then
1500 AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
1503 AC_CACHE_CHECK(for -z nodelete option,
1504 libc_cv_z_nodelete, [dnl
1505 cat > conftest.c <<EOF
1506 int _start (void) { return 42; }
1508 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1509 -fPIC -shared -o conftest.so conftest.c
1510 -nostartfiles -nostdlib
1511 -Wl,--enable-new-dtags,-z,nodelete 1>&AS_MESSAGE_LOG_FD])
1513 libc_cv_z_nodelete=yes
1515 AC_MSG_ERROR(linker with -z nodelete support required)
1519 AC_CACHE_CHECK(for -z nodlopen option,
1520 libc_cv_z_nodlopen, [dnl
1521 cat > conftest.c <<EOF
1522 int _start (void) { return 42; }
1524 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1525 -fPIC -shared -o conftest.so conftest.c
1526 -nostartfiles -nostdlib
1527 -Wl,--enable-new-dtags,-z,nodlopen 1>&AS_MESSAGE_LOG_FD])
1529 libc_cv_z_nodlopen=yes
1531 AC_MSG_ERROR(linker with -z nodlopen support required)
1535 AC_CACHE_CHECK(for -z initfirst option,
1536 libc_cv_z_initfirst, [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,initfirst 1>&AS_MESSAGE_LOG_FD])
1545 libc_cv_z_initfirst=yes
1547 AC_MSG_ERROR(linker with -z initfirst support required)
1551 case "$base_machine" in
1553 i[34567]86 | x86_64 | powerpc* | s390* | sparc* | alpha*)
1555 AC_CACHE_CHECK(for -z relro option,
1556 libc_cv_z_relro, [dnl
1558 if AC_TRY_COMMAND([${CC-cc} -v --help 2>&1|grep "z relro" 1>&AS_MESSAGE_LOG_FD])
1560 if AC_TRY_COMMAND([${CC-cc} -Wl,--verbose 2>&1|grep DATA_SEGMENT_RELRO_END 1>&AS_MESSAGE_LOG_FD])
1565 if test "$libc_cv_z_relro" = no; then
1566 AC_MSG_ERROR(linker with -z relro support required)
1572 AC_CACHE_CHECK(for -Bgroup option,
1573 libc_cv_Bgroup, [dnl
1574 cat > conftest.c <<EOF
1575 int _start (void) { return 42; }
1577 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1578 -fPIC -shared -o conftest.so conftest.c
1579 -Wl,-Bgroup -nostdlib 1>&AS_MESSAGE_LOG_FD])
1586 AC_SUBST(libc_cv_Bgroup)
1588 AC_CACHE_CHECK(for libgcc_s suffix,
1589 libc_cv_libgcc_s_suffix, [dnl
1590 cat > conftest.c <<EOF
1591 int main (void) { return 0; }
1594 libc_cv_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1595 -fPIC -shared -shared-libgcc -o conftest.so \
1596 conftest.c -v 2>&1 >/dev/null \
1597 | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
1600 AC_SUBST(libc_cv_libgcc_s_suffix)
1602 AC_CACHE_CHECK(for --as-needed option,
1603 libc_cv_as_needed, [dnl
1604 cat > conftest.c <<EOF
1605 int main (void) { return 0; }
1607 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1608 -fPIC -shared -o conftest.so conftest.c
1609 -lgcc_s$libc_cv_libgcc_s_suffix -Wl,--as-needed
1610 -nostdlib 1>&AS_MESSAGE_LOG_FD])
1612 libc_cv_as_needed=yes
1614 libc_cv_as_needed=no
1617 AC_SUBST(libc_cv_as_needed)
1620 AC_CACHE_CHECK(whether --noexecstack is desirable for .S files,
1621 libc_cv_as_noexecstack, [dnl
1622 cat > conftest.c <<EOF
1625 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS
1626 -S -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD]) \
1627 && grep -q .note.GNU-stack conftest.s \
1628 && AC_TRY_COMMAND([${CC-cc} $ASFLAGS -Wa,--noexecstack
1629 -c -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD])
1631 libc_cv_as_noexecstack=yes
1633 libc_cv_as_noexecstack=no
1636 if test $libc_cv_as_noexecstack = yes; then
1637 ASFLAGS_config="$ASFLAGS_config -Wa,--noexecstack"
1639 AC_SUBST(ASFLAGS_config)
1641 AC_CACHE_CHECK(for -z combreloc,
1642 libc_cv_z_combreloc, [dnl
1643 cat > conftest.c <<EOF
1644 extern int bar (int);
1646 int foo (void) { return bar (mumble); }
1648 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1649 -fPIC -shared -o conftest.so conftest.c
1650 -nostdlib -nostartfiles
1651 -Wl,-z,combreloc 1>&AS_MESSAGE_LOG_FD])
1653 dnl The following test is a bit weak. We must use a tool which can test
1654 dnl cross-platform since the gcc used can be a cross compiler. Without
1655 dnl introducing new options this is not easily doable. Instead use a tool
1656 dnl which always is cross-platform: readelf. To detect whether -z combreloc
1657 dnl look for a section named .rel.dyn.
1658 if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
1659 libc_cv_z_combreloc=yes
1661 libc_cv_z_combreloc=no
1664 libc_cv_z_combreloc=no
1667 if test "$libc_cv_z_combreloc" = yes; then
1668 AC_DEFINE(HAVE_Z_COMBRELOC)
1670 AC_SUBST(libc_cv_z_combreloc)
1672 AC_CACHE_CHECK(for -z execstack,
1673 libc_cv_z_execstack, [dnl
1674 cat > conftest.c <<EOF
1675 int _start (void) { return 42; }
1677 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1678 -fPIC -shared -o conftest.so conftest.c
1679 -Wl,-z,execstack -nostdlib
1680 1>&AS_MESSAGE_LOG_FD])
1682 libc_cv_z_execstack=yes
1684 libc_cv_z_execstack=no
1687 AC_SUBST(libc_cv_z_execstack)
1689 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
1690 cat > conftest.c <<EOF
1692 main () { return 0;}
1694 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
1695 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
1703 AC_SUBST(libc_cv_fpie)
1705 AC_CACHE_CHECK(for --hash-style option,
1706 libc_cv_hashstyle, [dnl
1707 cat > conftest.c <<EOF
1708 int _start (void) { return 42; }
1710 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1711 -fPIC -shared -o conftest.so conftest.c
1712 -Wl,--hash-style=both -nostdlib 1>&AS_MESSAGE_LOG_FD])
1714 libc_cv_hashstyle=yes
1716 libc_cv_hashstyle=no
1719 AC_SUBST(libc_cv_hashstyle)
1722 AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl
1723 cat > conftest.c <<EOF
1726 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder -fno-section-anchors
1727 conftest.c 1>&AS_MESSAGE_LOG_FD])
1729 libc_cv_fno_toplevel_reorder=yes
1731 libc_cv_fno_toplevel_reorder=no
1734 if test $libc_cv_fno_toplevel_reorder = yes; then
1735 fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors"
1737 fno_unit_at_a_time=-fno-unit-at-a-time
1739 AC_SUBST(fno_unit_at_a_time)
1741 AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
1742 cat > conftest.c <<EOF
1744 main () { return 0;}
1746 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -Werror -fstack-protector
1747 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
1754 AC_SUBST(libc_cv_ssp)
1756 AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
1757 cat > conftest.c <<EOF
1759 #ifdef __GNUC_GNU_INLINE__
1760 main () { return 0;}
1765 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -std=gnu99 -fgnu89-inline
1766 -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD])
1768 libc_cv_gnu89_inline=yes
1770 libc_cv_gnu89_inline=no
1773 if test $libc_cv_gnu89_inline = yes; then
1774 gnu89_inline=-fgnu89-inline
1778 AC_SUBST(gnu89_inline)
1780 if test $elf != yes; then
1781 AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
1782 [AC_TRY_COMPILE(, [asm (".section .init");
1783 asm (".section .fini");
1784 asm ("${libc_cv_dot_text}");],
1785 libc_cv_have_initfini=yes,
1786 libc_cv_have_initfini=no)])
1787 AC_SUBST(libc_cv_have_initfini)dnl
1788 if test $libc_cv_have_initfini = yes; then
1789 AC_DEFINE(HAVE_INITFINI)
1793 if test $elf = yes; then
1794 AC_CACHE_CHECK(whether cc puts quotes around section names,
1795 libc_cv_have_section_quotes,
1796 [cat > conftest.c <<EOF
1797 static const int foo
1798 __attribute__ ((section ("bar"))) = 1;
1800 if ${CC-cc} -S conftest.c -o conftest.s; then
1801 if grep '\.section.*"bar"' conftest.s >/dev/null; then
1802 libc_cv_have_section_quotes=yes
1804 libc_cv_have_section_quotes=no
1807 libc_cv_have_section_quotes=unknown
1811 if test $libc_cv_have_section_quotes = yes; then
1812 AC_DEFINE(HAVE_SECTION_QUOTES)
1816 dnl AC_CHECK_ASM_UNDERSCORE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1817 AC_DEFUN(AC_CHECK_ASM_UNDERSCORE,
1818 [cat > conftest.$ac_ext <<EOF
1819 dnl This sometimes fails to find confdefs.h, for some reason.
1820 dnl [#]line $LINENO "[$]0"
1821 [#]line $LINENO "configure"
1822 #include "confdefs.h"
1823 void underscore_test(void) {
1826 if AC_TRY_EVAL(ac_compile); then
1827 if grep _underscore_test conftest* >/dev/null; then
1828 ifelse([$1], , :, [rm -f conftest*
1831 ifelse([$2], , , [rm -f conftest*
1835 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
1836 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
1837 ifelse([$2], , , [rm -f conftest*
1842 if test $elf = yes; then
1843 libc_cv_asm_underscores=no
1845 if test $ac_cv_prog_cc_works = yes; then
1846 AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1847 [AC_TRY_LINK([asm ("_glibc_foobar:");], [glibc_foobar ();],
1848 libc_cv_asm_underscores=yes,
1849 libc_cv_asm_underscores=no)])
1851 AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1852 [AC_CHECK_ASM_UNDERSCORE(libc_cv_asm_underscores=yes,
1853 libc_cv_asm_underscores=no)])
1856 if test $libc_cv_asm_underscores = no; then
1857 AC_DEFINE(NO_UNDERSCORES)
1860 if test $elf = yes; then
1861 libc_cv_weak_symbols=yes
1864 AC_CACHE_CHECK(for assembler .weak directive, libc_cv_asm_weak_directive,
1866 cat > conftest.s <<EOF
1868 ${libc_cv_asm_global_directive} foo
1871 .weak bar; bar = foo
1873 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1874 libc_cv_asm_weak_directive=yes
1876 libc_cv_asm_weak_directive=no
1880 if test $libc_cv_asm_weak_directive = no; then
1881 AC_CACHE_CHECK(for assembler .weakext directive,
1882 libc_cv_asm_weakext_directive,
1884 cat > conftest.s <<EOF
1886 ${libc_cv_asm_global_directive} foo
1890 ${libc_cv_asm_global_directive} baz
1893 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1894 libc_cv_asm_weakext_directive=yes
1896 libc_cv_asm_weakext_directive=no
1902 if test $libc_cv_asm_weak_directive = yes; then
1903 AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
1904 elif test $libc_cv_asm_weakext_directive = yes; then
1905 AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)
1908 AC_CACHE_CHECK(whether CFI directives are supported, libc_cv_asm_cfi_directives, [dnl
1910 sparc/sparc64*) cfi_offset=2047;;
1913 cat > conftest.s <<EOF
1915 .type func,%function
1919 .cfi_rel_offset 1, $cfi_offset
1922 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1923 libc_cv_asm_cfi_directives=yes
1925 libc_cv_asm_cfi_directives=no
1928 if test $libc_cv_asm_cfi_directives = yes; then
1929 AC_DEFINE(HAVE_ASM_CFI_DIRECTIVES)
1932 AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
1933 cat > conftest.c <<\EOF
1938 dnl No \ in command here because it ends up inside ''.
1939 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1940 -nostdlib -nostartfiles -Wl,--no-whole-archive
1941 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1942 libc_cv_ld_no_whole_archive=yes
1944 libc_cv_ld_no_whole_archive=no
1947 if test $libc_cv_ld_no_whole_archive = yes; then
1948 no_whole_archive=-Wl,--no-whole-archive
1950 AC_SUBST(no_whole_archive)dnl
1952 AC_CACHE_CHECK(for gcc -fexceptions, libc_cv_gcc_exceptions, [dnl
1953 cat > conftest.c <<\EOF
1958 dnl No \ in command here because it ends up inside ''.
1959 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1960 -nostdlib -nostartfiles -fexceptions
1961 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1962 libc_cv_gcc_exceptions=yes
1964 libc_cv_gcc_exceptions=no
1967 if test $libc_cv_gcc_exceptions = yes; then
1968 exceptions=-fexceptions
1970 AC_SUBST(exceptions)dnl
1972 if test "$host_cpu" = powerpc ; then
1973 # Check for a bug present in at least versions 2.8.x of GCC
1974 # and versions 1.0.x of EGCS.
1975 AC_CACHE_CHECK(whether clobbering cr0 causes problems,libc_cv_c_asmcr0_bug,[dnl
1976 AC_TRY_COMPILE([int tester(int x) { asm ("" : : : "cc"); return x & 123; }],,
1977 libc_cv_c_asmcr0_bug='no',
1978 libc_cv_c_asmcr0_bug='yes')])
1979 if test "$libc_cv_c_asmcr0_bug" != 'no'; then
1980 AC_DEFINE(BROKEN_PPC_ASM_CR0)
1984 dnl Check whether compiler understands __builtin_expect.
1985 AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
1986 [cat > conftest.c <<EOF
1987 #line $LINENO "configure"
1990 a = __builtin_expect (a, 10);
1991 return a == 10 ? 0 : 1;
1994 dnl No \ in command here because it ends up inside ''.
1995 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles
1996 -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
1997 libc_cv_gcc_builtin_expect=yes
1999 libc_cv_gcc_builtin_expect=no
2002 if test "$libc_cv_gcc_builtin_expect" = yes; then
2003 AC_DEFINE(HAVE_BUILTIN_EXPECT)
2006 AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
2007 cat > conftest.c <<\EOF
2010 __builtin_memset (x, 0, 1000);
2014 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null]);
2016 libc_cv_gcc_builtin_memset=no
2018 libc_cv_gcc_builtin_memset=yes
2021 if test "$libc_cv_gcc_builtin_memset" = yes ; then
2022 AC_DEFINE(HAVE_BUILTIN_MEMSET)
2025 AC_CACHE_CHECK(for redirection of built-in functions, libc_cv_gcc_builtin_redirection, [dnl
2026 cat > conftest.c <<\EOF
2027 extern char *strstr (const char *, const char *) __asm ("my_strstr");
2028 char *foo (const char *a, const char *b)
2030 return __builtin_strstr (a, b);
2034 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "my_strstr" > /dev/null]);
2036 libc_cv_gcc_builtin_redirection=yes
2038 libc_cv_gcc_builtin_redirection=no
2041 if test "$libc_cv_gcc_builtin_redirection" = yes ; then
2042 AC_DEFINE(HAVE_BUILTIN_REDIRECTION)
2045 dnl Check whether the compiler supports the __thread keyword.
2046 if test "x$use__thread" != xno; then
2047 AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
2048 [cat > conftest.c <<\EOF
2049 __thread int a = 42;
2051 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
2052 libc_cv_gcc___thread=yes
2054 libc_cv_gcc___thread=no
2057 if test "$libc_cv_gcc___thread" = yes; then
2058 AC_DEFINE(HAVE___THREAD)
2061 libc_cv_gcc___thread=no
2064 if test "$libc_cv_gcc___thread" = yes; then
2065 dnl Check whether the compiler supports the tls_model attribute.
2066 AC_CACHE_CHECK([for tls_model attribute], libc_cv_gcc_tls_model_attr, [dnl
2067 cat > conftest.c <<\EOF
2068 extern __thread int a __attribute__((tls_model ("initial-exec")));
2070 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&AS_MESSAGE_LOG_FD]); then
2071 libc_cv_gcc_tls_model_attr=yes
2073 libc_cv_gcc_tls_model_attr=no
2076 if test "$libc_cv_gcc_tls_model_attr" = yes; then
2077 AC_DEFINE(HAVE_TLS_MODEL_ATTRIBUTE)
2081 if test -n "$submachine"; then
2082 AC_CACHE_CHECK([for compiler option for CPU variant],
2083 libc_cv_cc_submachine, [dnl
2084 libc_cv_cc_submachine=no
2085 for opt in "-march=$submachine" "-mcpu=$submachine"; do
2086 if AC_TRY_COMMAND([${CC-cc} $opt -xc /dev/null -S -o /dev/null]); then
2087 libc_cv_cc_submachine="$opt"
2091 if test "x$libc_cv_cc_submachine" = xno; then
2092 AC_MSG_ERROR([${CC-cc} does not support $submachine])
2095 AC_SUBST(libc_cv_cc_submachine)
2097 dnl Check whether we have the gd library available.
2098 AC_MSG_CHECKING(for libgd)
2099 if test "$with_gd" != "no"; then
2100 old_CFLAGS="$CFLAGS"
2101 CFLAGS="$CFLAGS $libgd_include"
2102 old_LDFLAGS="$LDFLAGS"
2103 LDFLAGS="$LDFLAGS $libgd_ldflags"
2105 LIBS="$LIBS -lgd -lpng -lz -lm"
2106 AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
2107 CFLAGS="$old_CFLAGS"
2108 LDFLAGS="$old_LDFLAGS"
2113 AC_MSG_RESULT($LIBGD)
2117 if test x$with_selinux = xno ; then
2120 # See if we have the SELinux library
2121 AC_CHECK_LIB(selinux, is_selinux_enabled,
2122 have_selinux=yes, have_selinux=no)
2123 # See if we have the SELinux header with the NSCD permissions in it.
2124 if test x$have_selinux = xyes ; then
2125 AC_MSG_CHECKING([for NSCD Flask permissions in selinux/av_permissions.h])
2126 AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
2127 [#ifdef NSCD__SHMEMHOST
2130 #error NSCD__SHMEMHOST not defined
2132 have_selinux=yes, have_selinux=no)
2133 AC_MSG_RESULT($have_selinux)
2136 if test x$with_selinux = xyes ; then
2137 if test x$have_selinux = xno ; then
2138 AC_MSG_ERROR([SELinux explicitly required, but sufficiently recent SELinux library not found])
2142 # Check if we're building with SELinux support.
2143 if test "x$have_selinux" = xyes; then
2144 AC_DEFINE(HAVE_SELINUX, 1, [SELinux support])
2146 # See if we have the libaudit library
2147 AC_CHECK_LIB(audit, audit_log_user_avc_message,
2148 have_libaudit=yes, have_libaudit=no)
2149 if test "x$have_libaudit" = xyes; then
2150 AC_DEFINE(HAVE_LIBAUDIT, 1, [SELinux libaudit support])
2152 AC_SUBST(have_libaudit)
2154 # See if we have the libcap library
2155 AC_CHECK_LIB(cap, cap_init, have_libcap=yes, have_libcap=no)
2156 if test "x$have_libcap" = xyes; then
2157 AC_DEFINE(HAVE_LIBCAP, 1, [SELinux libcap support])
2159 AC_SUBST(have_libcap)
2161 AC_SUBST(have_selinux)
2163 dnl check for the size of 'long double'.
2164 AC_CHECK_SIZEOF(long double, 0)
2165 sizeof_long_double=$ac_cv_sizeof_long_double
2166 AC_SUBST(sizeof_long_double)
2168 ### End of automated tests.
2169 ### Now run sysdeps configure fragments.
2171 # They also can set these variables.
2173 ldd_rewrite_script=no
2174 libc_cv_sysconfdir=$sysconfdir
2175 libc_cv_gcc_unwind_find_fde=no
2178 # Iterate over all the sysdep directories we will use, running their
2179 # configure fragments.
2180 for dir in $sysnames; do
2183 *) dest=$srcdir/$dir ;;
2185 if test -r $dest/configure; then
2186 AC_MSG_RESULT(running configure fragment for $dir)
2191 if test x$libc_cv_gcc_unwind_find_fde = xyes; then
2192 AC_DEFINE(EXPORT_UNWIND_FIND_FDE)
2194 AC_SUBST(libc_cv_gcc_unwind_find_fde)
2196 dnl This is tested by existing code and it's simpler to avoid changing it.
2197 AC_DEFINE(USE_IN_LIBIO)
2199 # Test for old glibc 2.0.x headers so that they can be removed properly
2200 # Search only in includedir.
2201 AC_MSG_CHECKING(for old glibc 2.0.x headers)
2202 if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
2204 old_glibc_headers=yes
2206 old_glibc_headers=no
2208 AC_MSG_RESULT($old_glibc_headers)
2209 if test ${old_glibc_headers} = yes; then
2210 AC_MSG_WARN(*** During \"make install\" old headers from glibc 2.0.x will)
2211 AC_MSG_WARN(*** be removed.)
2213 AC_SUBST(old_glibc_headers)
2215 AC_SUBST(libc_cv_slibdir)
2216 AC_SUBST(libc_cv_localedir)
2217 AC_SUBST(libc_cv_sysconfdir)
2218 AC_SUBST(libc_cv_rootsbindir)
2219 AC_SUBST(libc_cv_forced_unwind)
2221 dnl sysdeps/CPU/configure.in checks set this via arch-specific asm tests
2222 AC_SUBST(libc_cv_cpp_asm_debuginfo)
2223 AC_SUBST(libc_cv_cc_sse4)
2224 AC_SUBST(libc_cv_cc_avx)
2225 AC_SUBST(libc_cv_cc_novzeroupper)
2226 AC_SUBST(libc_cv_as_i686)
2228 AC_SUBST(use_ldconfig)
2229 AC_SUBST(ldd_rewrite_script)
2231 AC_SUBST(elf) AC_SUBST(xcoff)
2232 if test $elf = yes; then
2235 if test $xcoff = yes; then
2236 AC_DEFINE(HAVE_XCOFF)
2241 if test $shared = default; then
2245 AC_CACHE_CHECK([whether -fPIC is default], libc_cv_pic_default,
2246 [libc_cv_pic_default=yes
2247 cat > conftest.c <<EOF
2248 #if defined __PIC__ || defined __pic__ || defined PIC || defined pic
2249 # error PIC is default.
2252 if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
2253 libc_cv_pic_default=no
2256 AC_SUBST(libc_cv_pic_default)
2261 AC_SUBST(static_nss)
2262 AC_SUBST(nopic_initfini)
2266 dnl See sysdeps/mach/configure.in for this variable.
2267 AC_SUBST(mach_interface_list)
2269 if test "`(cd $srcdir; pwd)`" = "`pwd`"; then
2272 config_makefile=Makefile
2275 VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
2276 RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
2280 AC_CONFIG_FILES([config.make ${config_makefile}])
2281 AC_CONFIG_COMMANDS([default],[[
2282 case $CONFIG_FILES in *config.make*)
2283 echo "$config_vars" >> config.make;;
2285 test -d bits || mkdir bits]],[[config_vars='$config_vars']])