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([nss-crypt],
278 AC_HELP_STRING([--enable-nss-crypt],
279 [enable libcrypt to use nss]),
280 [nss_crypt=$enableval],
282 if test x$nss_crypt = xyes; then
283 nss_includes=-I$(nss-config --includedir 2>/dev/null)
284 if test $? -ne 0; then
285 AC_MSG_ERROR([cannot find include directory with nss-config])
288 CFLAGS="$CFLAGS $nss_includes"
289 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
291 #include <nsslowhash.h>
292 void f (void) { NSSLOW_Init (); }])],
293 libc_cv_nss_crypt=yes,
295 cannot find NSS headers with lowlevel hash function interfaces]))
297 LIBS="$LIBS -lfreebl3"
298 AC_LINK_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
300 #include <nsslowhash.h>],
302 libc_cv_nss_crypt=yes,
304 cannot link program using lowlevel NSS hash functions]))
310 AC_SUBST(libc_cv_nss_crypt)
312 # The way shlib-versions is used to generate soversions.mk uses a
313 # fairly simplistic model for name recognition that can't distinguish
314 # i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
315 # of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can
316 # tell. This doesn't get used much beyond that, so it's fairly safe.
321 host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'`
325 # We keep the original values in `$config_*' and never modify them, so we
326 # can write them unchanged into config.make. Everything else uses
327 # $machine, $vendor, and $os, and changes them whenever convenient.
328 config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
330 # Don't allow vendor == "unknown"
331 test "$config_vendor" = unknown && config_vendor=
332 config_os="`echo $config_os | sed 's/^unknown-//'`"
334 # Some configurations imply other options.
336 # i586-linuxaout is mangled into i586-pc-linux-gnuaout
337 linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*)
339 gnu* | linux* | freebsd* | netbsd* | sysv4* | solaris2* | irix6*)
340 # These systems (almost) always use the ELF format.
344 # These systems are always xcoff
350 # The configure fragment of an add-on port can modify these to supplement
351 # or override the table in the case statement below. No fragment should
352 # ever change the config_* variables, however.
353 machine=$config_machine
354 vendor=$config_vendor
358 # config.guess on some IBM machines says `rs6000' instead of `powerpc'.
360 if test "$machine" = rs6000; then
364 # Braindead PowerPC box with absolutely no FPU.
365 case "$machine-$host_os" in
373 AS_HELP_STRING([--with-cpu=CPU], [select code for CPU variant]),
376 yes|'') AC_MSG_ERROR([--with-cpu requires an argument]) ;;
378 *) submachine="$withval" ;;
382 # An add-on can set this when it wants to disable the sanity check below.
385 dnl Having this here, though empty, makes sure that if add-ons' fragments
386 dnl do AC_CONFIG_SUBDIRS([some-dir]), which just sets $subdirs, then
387 dnl our AC_OUTPUT will actually use it.
390 case "$enable_add_ons" in
393 add_ons=`cd $srcdir && ls -d 2> /dev/null */configure */sysdeps |
394 sed 's@/[[^/]]*$@@' | sort | uniq`
395 add_ons_automatic=yes
397 *) add_ons=`echo "$enable_add_ons" | sed 's/,/ /g'`
398 add_ons_automatic=no ;;
404 if test x"$add_ons" != x; then
405 for f in $add_ons; do
410 *** It seems that you're using an old \`crypt' add-on. crypt is now
411 *** part of glibc and using the old add-on will not work with this
412 *** release. Start again with fresh sources and without the old
413 *** \`crypt' add-on.])
417 *** It seems that you're using an old \`localedata' add-on. localedata
418 *** is now part of glibc and using the old add-on will not work with
419 *** this release. Start again with fresh sources and without the old
420 *** \`localedata' add-on.])
425 # Now source each add-on's configure fragment.
426 # The fragments can use $srcdir/$libc_add_on to find themselves,
427 # and test $add_ons_automatic to see if they were explicitly requested.
428 # A fragment can clear (or even change) $libc_add_on to affect
429 # whether it goes into the list to be actually used in the build.
431 for libc_add_on in $add_ons; do
432 # Test whether such a directory really exists.
433 # It can be absolute, or relative to $srcdir, or relative to the build dir.
434 case "$libc_add_on" in
436 libc_add_on_srcdir=$libc_add_on
439 test -d "$srcdir/$libc_add_on" || {
440 if test -d "$libc_add_on"; then
441 libc_add_on="`pwd`/$libc_add_on"
443 AC_MSG_ERROR(add-on directory \"$libc_add_on\" does not exist)
446 libc_add_on_srcdir=$srcdir/$libc_add_on
450 libc_add_on_frag=$libc_add_on_srcdir/configure
451 libc_add_on_canonical=
452 libc_add_on_config_subdirs=
453 if test -r "$libc_add_on_frag"; then
454 AC_MSG_NOTICE(running configure fragment for add-on $libc_add_on)
455 libc_add_on_canonical=unknown
457 . "$libc_add_on_frag"
458 test -z "$libc_add_on" || {
459 configured_add_ons="$configured_add_ons $libc_add_on"
460 if test "x$libc_add_on_canonical" = xunknown; then
461 AC_MSG_ERROR(fragment must set \$libc_add_on_canonical)
463 for d in $libc_add_on_subdirs; do
464 case "$libc_add_on" in
465 /*) subdir_srcdir="$libc_add_on" ;;
466 *) subdir_srcdir="\$(..)$libc_add_on" ;;
470 d="${libc_add_on_canonical:-$libc_add_on}"
476 subdir_srcdir="$subdir_srcdir/$d"
479 d=`echo "$d" | sed 's@/*$@@;s@^.*/@@'`
480 add_on_subdirs="$add_on_subdirs $d"
481 test "$subdir_srcdir" = "\$(..)$d" || config_vars="$config_vars
482 $d-srcdir = $subdir_srcdir"
484 for d in $libc_add_on_config_subdirs; do
487 fragment uses absolute path in \$libc_add_on_config_subdirs) ;;
489 if test ! -d "$libc_add_on_srcdir/$d"; then
490 AC_MSG_ERROR(fragment wants to configure missing directory $d)
492 case "$libc_add_on" in
494 relative path required for add-on using \$libc_add_on_config_subdirs) ;;
496 subdirs="$subdirs $libc_add_on/$d"
500 if test -n "$libc_add_on"; then
501 if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2> /dev/null`
503 AC_MSG_CHECKING(add-on $libc_add_on for preconfigure fragments)
504 for frag in $frags; do
505 name=`echo "$frag" | sed 's@/[[^/]]*$@@;s@^.*/@@'`
506 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
511 use_add_ons="$use_add_ons $libc_add_on"
512 add_ons_pfx="$add_ons_pfx $libc_add_on/"
513 test -z "$libc_add_on_canonical" ||
514 add_ons_sfx="$add_ons_sfx /$libc_add_on_canonical"
517 # Use echo to strip excess whitespace.
518 add_ons="`echo $use_add_ons`"
521 AC_SUBST(add_on_subdirs)
525 ### I put this here to prevent those annoying emails from people who cannot
526 ### read and try to compile glibc on unsupported platforms. --drepper
528 ### By using the undocumented --enable-hacker-mode option for configure
529 ### one can skip this test to make the configuration not fail for unsupported
532 if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then
533 case "$machine-$host_os" in
534 *-linux* | *-gnu* | arm*-none* | powerpc-aix4.3.*)
537 echo "*** The GNU C library is currently not available for this platform."
538 echo "*** So far nobody cared to port it and if there is no volunteer it"
539 echo "*** might never happen. So, if you have interest to see glibc on"
540 echo "*** this platform visit"
541 echo "*** http://www.gnu.org/software/libc/porting.html"
542 echo "*** and join the group of porters"
548 dnl We need to use [ and ] for other purposes for a while now.
550 # Expand the configuration machine name into a subdirectory by architecture
551 # type and particular chip. If an add-on configure fragment already set
552 # base_machine, we don't change it.
553 test -n "$base_machine" || case "$machine" in
554 a29k | am29000) base_machine=a29k machine=a29k ;;
555 c3[012]) base_machine=cx0 machine=cx0/c30 ;;
556 c4[04]) base_machine=cx0 machine=cx0/c40 ;;
557 i[34567]86) base_machine=i386 machine=i386/$machine ;;
558 ia64) base_machine=ia64 machine=ia64 ;;
559 m88???) base_machine=m88k machine=m88k/$machine ;;
560 m88k) base_machine=m88k machine=m88k/m88100 ;;
561 powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;;
562 powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;;
563 s390) base_machine=s390 machine=s390/s390-32 ;;
564 s390x) base_machine=s390 machine=s390/s390-64 ;;
565 sh3*) base_machine=sh machine=sh/sh3 ;;
566 sh4*) base_machine=sh machine=sh/sh4 ;;
568 base_machine=sparc machine=sparc/sparc32 ;;
569 sparcv8 | supersparc | hypersparc)
570 base_machine=sparc machine=sparc/sparc32/sparcv8 ;;
571 sparcv8plus | sparcv8plusa | sparcv9)
572 base_machine=sparc machine=sparc/sparc32/sparcv9 ;;
573 sparcv8plusb | sparcv9b)
574 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;;
576 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v ;;
578 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v2 ;;
580 base_machine=sparc machine=sparc/sparc64 ;;
582 base_machine=sparc machine=sparc/sparc64/sparcv9b ;;
584 base_machine=sparc machine=sparc/sparc64/sparcv9v ;;
586 base_machine=sparc machine=sparc/sparc64/sparcv9v2 ;;
587 *) base_machine=$machine ;;
590 AC_SUBST(base_machine)
592 if test "$base_machine" = "i386"; then
593 AC_DEFINE(USE_REGPARMS)
596 # For the multi-arch option we need support in the assembler.
597 AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support],
598 libc_cv_asm_gnu_indirect_function, [dnl
599 cat > conftest.s <<EOF
600 .type foo,%gnu_indirect_function
602 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
604 libc_cv_asm_gnu_indirect_function=yes
606 libc_cv_asm_gnu_indirect_function=no
610 AC_MSG_CHECKING(whether .text pseudo-op must be used)
611 AC_CACHE_VAL(libc_cv_dot_text, [dnl
612 cat > conftest.s <<EOF
616 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
617 libc_cv_dot_text=.text
620 if test -z "$libc_cv_dot_text"; then
626 AC_CACHE_CHECK(for assembler global-symbol directive,
627 libc_cv_asm_global_directive, [dnl
628 libc_cv_asm_global_directive=UNKNOWN
629 for ac_globl in .globl .global .EXPORT; do
630 cat > conftest.s <<EOF
635 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
636 libc_cv_asm_global_directive=${ac_globl}
639 test $libc_cv_asm_global_directive != UNKNOWN && break
641 if test $libc_cv_asm_global_directive = UNKNOWN; then
642 AC_MSG_ERROR(cannot determine asm global directive)
644 AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${libc_cv_asm_global_directive})
647 AC_CACHE_CHECK(for assembler .type directive prefix,
648 libc_cv_asm_type_prefix, [dnl
649 libc_cv_asm_type_prefix=no
650 for ac_try_prefix in '@' '%' '#'; do
651 cat > conftest.s <<EOF
653 ${libc_cv_asm_global_directive} foo
654 .type foo, ${ac_try_prefix}object
659 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
660 libc_cv_asm_type_prefix=${ac_try_prefix}
663 test "x$libc_cv_asm_type_prefix" != xno && break
665 if test "x$libc_cv_asm_type_prefix" != xno; then
666 AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix})
669 if test x"$libc_cv_asm_gnu_indirect_function" != xyes -a x"$libc_cv_asm_type_prefix" = xno; then
670 if test x"$multi_arch" = xyes; then
671 AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
676 if test x"$multi_arch" != xno; then
677 multi_arch_d=/multiarch
680 # Compute the list of sysdep directories for this configuration.
681 # This can take a while to compute.
682 sysdep_dir=$srcdir/sysdeps
683 AC_MSG_CHECKING(sysdep dirs)
684 dnl We need to use [ and ] for other purposes for a while now.
686 # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
687 os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
689 test "x$base_os" != x || case "$os" in
692 netbsd* | 386bsd* | freebsd* | bsdi*)
693 base_os=unix/bsd/bsd4.4 ;;
694 osf* | sunos* | ultrix* | newsos* | dynix* | *bsd*)
696 sysv* | isc* | esix* | sco* | minix* | irix4* | linux*)
699 base_os=unix/sysv/irix6/$os ;;
701 base_os=unix/sysv/sysv4 ;;
703 base_os=unix/sysv/hpux/$os ;;
705 base_os=unix/sysv/aix/aix4.3 ;;
707 base_os=standalone ;;
710 # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
713 while o=`echo $tail | sed 's/\.[^.]*$//'`; test $o != $tail; do
717 o=`echo $tail | sed 's/[0-9]*$//'`
718 if test $o != $tail; then
721 # For linux-gnu, try linux-gnu, then linux.
722 o=`echo $tail | sed 's/-.*$//'`
723 if test $o != $tail; then
727 # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
730 while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$b"; do
736 # For sparc/sparc32, try sparc/sparc32 and then sparc.
738 tail=$machine${submachine:+/$submachine}
739 while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
741 # Prepend the machine's FPU directory unless --without-fp.
742 if test "$with_fp" = yes; then
745 mach="$mach /$1/nofpu"
751 dnl We are done with glob and regexp uses of [ and ]; return to autoconf.
754 # Find what sysdep directories exist.
757 for b in $base ''; do
758 for m0 in $mach ''; do
759 for v in /$vendor ''; do
760 test "$v" = / && continue
761 for o in /$ostry ''; do
762 test "$o" = / && continue
763 for m in $multi_arch_d $mach ''; do
764 for d in $add_ons_pfx ''; do
765 for a in $add_ons_sfx ''; do
766 if test -n "$m0$m0sub$b$v$o$m$msub"; then
767 try_srcdir="${srcdir}/"
771 try="${d}sysdeps$m0$m0sub$b$v$o$m$msub$a"
772 test -n "$enable_debug_configure" &&
773 echo "$0 [DEBUG]: try $try" >&2
774 if test -d "$try_srcdir$try"; then
775 sysnames="$sysnames $try"
776 { test -n "$o" || test -n "$b"; } && os_used=t
777 { test -n "$m" || test -n "$m0"; } && machine_used=t
779 x*/$submachine) submachine_used=t ;;
781 if test -n "$d"; then
782 case "$sysnames_add_ons" in
784 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
797 # If the assembler supports gnu_indirect_function symbol type and the
798 # architecture supports multi-arch, we enable multi-arch by default.
799 case $sysnames_add_ons$sysnames in
803 test x"$multi_arch" = xdefault && multi_arch=no
806 if test x"$multi_arch" != xno; then
807 AC_DEFINE(USE_MULTIARCH)
811 if test -z "$os_used" && test "$os" != none; then
812 AC_MSG_ERROR(Operating system $os is not supported.)
814 if test -z "$machine_used" && test "$machine" != none; then
815 AC_MSG_ERROR(The $machine is not supported.)
817 if test -z "$submachine_used" && test -n "$submachine"; then
818 AC_MSG_ERROR(The $submachine subspecies of $host_cpu is not supported.)
822 # We have now validated the configuration.
825 # If using ELF, look for an `elf' subdirectory of each machine directory.
826 # We prepend these rather than inserting them whereever the machine appears
827 # because things specified by the machine's ELF ABI should override
828 # OS-specific things, and should always be the same for any OS on the
829 # machine (otherwise what's the point of an ABI?).
830 if test "$elf" = yes; then
832 for d in $add_ons_pfx ''; do
834 if test -d $srcdir/${d}sysdeps$m/elf; then
835 elf_dirs="$elf_dirs ${d}sysdeps$m/elf"
839 sysnames="`echo $elf_dirs | sed -e 's,//,/,g'` $sysnames"
843 # Expand the list of system names into a full list of directories
844 # from each element's parent name and Implies file (if present).
847 while test $# -gt 0; do
851 case " $names " in *" $name "*)
852 # Already in the list.
856 # Report each name as we discover it, so there is no long pause in output.
857 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
859 name_base=`echo $name | sed -e 's@\(.*sysdeps\)/.*@\1@'`
863 *) xsrcdir=$srcdir/ ;;
865 test -n "$enable_debug_configure" &&
866 echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2
868 if test -f $xsrcdir$name/Implies; then
869 # Collect more names from the `Implies' file (removing comments).
870 implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`"
872 for x in $implied_candidate; do
874 if test -d $xsrcdir$name_base/$x; then
875 implied="$implied $name_base/$x";
878 for d in $add_ons_pfx ''; do
882 *) try_srcdir=$srcdir/ ;;
884 test -n "$enable_debug_configure" &&
885 echo "[DEBUG]: $name implied $x try($d) {$try_srcdir}$try" >&2
886 if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
888 implied="$implied $try"
890 case "$sysnames_add_ons" in
892 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
896 if test $found = no; then
897 AC_MSG_WARN($name/Implies specifies nonexistent $x)
904 # Add NAME to the list of names.
907 # Find the parent of NAME, using the empty string if it has none.
909 parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
912 # Add the names implied by NAME, and NAME's parent (if it has one), to
913 # the list of names to be processed (the argument list). We prepend the
914 # implied names to the list and append the parent. We want implied
915 # directories to come before further directories inferred from the
916 # configuration components; this ensures that for sysv4, unix/common
917 # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
919 sysnames="`echo $implied $* $parent`"
920 test -n "$sysnames" && set $sysnames
923 # Add the default directories.
924 default_sysnames=sysdeps/generic
925 if test "$elf" = yes; then
926 default_sysnames="sysdeps/generic/elf $default_sysnames"
928 sysnames="$names $default_sysnames"
930 # The other names were emitted during the scan.
931 AC_MSG_RESULT($default_sysnames)
933 # Collect the list of add-ons that supply partial sysdeps trees.
935 for add_on in $add_ons; do
938 *) xsrcdir="$srcdir/" ;;
941 test -d "$xsrcdir$add_on/sysdeps" || {
942 case "$configured_add_ons " in
945 AC_MSG_ERROR(add-on $add_on has no configure fragment or sysdeps tree)
951 sysdeps_add_ons="$sysdeps_add_ons $add_on"
952 case "$sysnames_add_ons" in
955 AC_MSG_WARN(add-on $add_on contributed no sysdeps directories)
960 for d in $sysnames; do
962 $add_on/sysdeps/*) ;;
965 (cd "$xsrcdir$d" && for f in *[[!~]]; do
969 test -d "$ff" || { test -e "$ff" && exit 88; }
973 test -d "$f" || { test -e "$f" && exit 88; }
977 if test $? -eq 88; then
982 if test $found = no; then
983 AC_MSG_WARN(add-on $add_on contributed no useful sysdeps directories)
986 AC_SUBST(sysdeps_add_ons)
992 if test "$INSTALL" = "${srcdir}/scripts/install-sh -c"; then
993 # The makefiles need to use a different form to find it in $srcdir.
994 INSTALL='\$(..)./scripts/install-sh -c'
999 AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
1001 # Accept binutils 2.13 or newer.
1002 AC_CHECK_PROG_VER(AS, $AS, --version,
1003 [GNU assembler.* \([0-9]*\.[0-9.]*\)],
1004 [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")
1005 AC_CHECK_PROG_VER(LD, $LD, --version,
1006 [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
1007 [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")
1009 # We need the physical current working directory. We cannot use the
1010 # "pwd -P" shell builtin since that's not portable. Instead we try to
1011 # find a pwd binary. Note that assigning to the PWD environment
1012 # variable might have some interesting side effects, so we don't do
1014 AC_PATH_PROG(PWD_P, pwd, no)
1015 if test "$PWD_P" = no; then
1016 AC_MSG_ERROR(*** A pwd binary could not be found.)
1019 # These programs are version sensitive.
1020 AC_CHECK_TOOL_PREFIX
1021 AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
1022 [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* ],
1023 critic_missing="$critic_missing gcc")
1024 AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
1025 [GNU Make[^0-9]*\([0-9][0-9.]*\)],
1026 [3.79* | 3.[89]*], critic_missing="$critic_missing make")
1028 AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
1029 [GNU gettext.* \([0-9]*\.[0-9.]*\)],
1030 [0.10.3[6-9]* | 0.10.[4-9][0-9]* | 0.1[1-9]* | 0.[2-9][0-9]* | [1-9].*],
1031 MSGFMT=: aux_missing="$aux_missing msgfmt")
1032 AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
1033 [GNU texinfo.* \([0-9][0-9.]*\)],
1035 MAKEINFO=: aux_missing="$aux_missing makeinfo")
1036 AC_CHECK_PROG_VER(SED, sed, --version,
1037 [GNU sed version \([0-9]*\.[0-9.]*\)],
1038 [3.0[2-9]*|3.[1-9]*|[4-9]*],
1039 SED=: aux_missing="$aux_missing sed")
1041 AC_CHECK_PROGS(AUTOCONF, autoconf, no)
1042 case "x$AUTOCONF" in
1043 xno|x|x:) AUTOCONF=no ;;
1046 whether $AUTOCONF${ACFLAGS:+ }$ACFLAGS works, libc_cv_autoconf_works, [dnl
1047 if (cd $srcdir; $AUTOCONF $ACFLAGS configure.in > /dev/null 2>&1); then
1048 libc_cv_autoconf_works=yes
1050 libc_cv_autoconf_works=no
1052 test $libc_cv_autoconf_works = yes || AUTOCONF=no
1055 if test "x$with_cvs" = xyes && test "x$AUTOCONF" = xno; then
1056 # If --without-cvs they probably won't change configure.in, so no complaints.
1057 aux_missing="$aux_missing autoconf"
1060 test -n "$critic_missing" && AC_MSG_ERROR([
1061 *** These critical programs are missing or too old:$critic_missing
1062 *** Check the INSTALL file for required versions.])
1064 test -n "$aux_missing" && AC_MSG_WARN([
1065 *** These auxiliary programs are missing or incompatible versions:$aux_missing
1066 *** some features will be disabled.
1067 *** Check the INSTALL file for required versions.])
1069 # if using special system headers, find out the compiler's sekrit
1070 # header directory and add that to the list. NOTE: Only does the right
1071 # thing on a system that doesn't need fixincludes. (Not presently a problem.)
1072 if test -n "$sysheaders"; then
1073 SYSINCLUDES=-nostdinc
1074 for d in include include-fixed; do
1075 i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
1076 SYSINCLUDES="$SYSINCLUDES -isystem $i"
1078 SYSINCLUDES="$SYSINCLUDES \
1079 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
1080 if test -n "$CXX"; then
1081 cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
1082 cxxmachine=`$CXX -dumpmachine 2>&AS_MESSAGE_LOG_FD` &&
1083 cxxheaders=`$CXX -print-file-name=../../../../include/c++/`"$cxxversion" &&
1084 CXX_SYSINCLUDES="-isystem $cxxheaders \
1085 -isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
1088 AC_SUBST(SYSINCLUDES)
1089 AC_SUBST(CXX_SYSINCLUDES)
1091 # ranlib is never necessary on Linux and Hurd systems
1094 # Test if LD_LIBRARY_PATH contains the notation for the current directory
1095 # since this would lead to problems installing/building glibc.
1096 # LD_LIBRARY_PATH contains the current directory if one of the following
1098 # - one of the terminals (":" and ";") is the first or last sign
1099 # - two terminals occur directly after each other
1100 # - the path contains an element with a dot in it
1101 AC_MSG_CHECKING(LD_LIBRARY_PATH variable)
1103 case ${LD_LIBRARY_PATH} in
1104 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
1105 ld_library_path_setting="contains current directory"
1108 ld_library_path_setting="ok"
1112 AC_MSG_RESULT($ld_library_path_setting)
1113 if test "$ld_library_path_setting" != "ok"; then
1115 *** LD_LIBRARY_PATH shouldn't contain the current directory when
1116 *** building glibc. Please change the environment variable
1117 *** and run configure again.])
1120 AC_CACHE_CHECK(whether GCC supports -static-libgcc, libc_cv_gcc_static_libgcc, [dnl
1121 if $CC -v -static-libgcc 2>&1 | grep -q 'unrecognized option.*static-libgcc'; then
1122 libc_cv_gcc_static_libgcc=
1124 libc_cv_gcc_static_libgcc=-static-libgcc
1126 AC_SUBST(libc_cv_gcc_static_libgcc)
1128 AC_PATH_PROG(BASH_SHELL, bash, no)
1129 if test "$BASH_SHELL" != no &&
1130 $BASH_SHELL -c 'test "$BASH_VERSINFO" \
1131 && test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then
1132 libc_cv_have_bash2=yes
1134 libc_cv_have_bash2=no
1136 AC_SUBST(libc_cv_have_bash2)
1138 dnl We need a ksh compatible shell for tzselect.
1139 if test "$BASH_SHELL" = no; then
1140 AC_PATH_PROG(KSH, ksh, no)
1141 if test "$KSH" = no; then
1144 libc_cv_have_ksh=yes
1149 libc_cv_have_ksh=yes
1151 AC_SUBST(libc_cv_have_ksh)
1154 AC_PATH_PROG(PERL, perl, no)
1155 if test "$PERL" != no &&
1156 (eval `$PERL -V:apiversion`; test `expr "$apiversion" \< 5` -ne 0); then
1159 AC_PATH_PROG(INSTALL_INFO, install-info, no,
1160 $PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin)
1161 AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin)
1163 AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl
1164 echo '#include <stddef.h>
1165 FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
1166 if eval "$ac_cpp conftest.c 2>/dev/null" \
1167 | grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null; then
1168 libc_cv_signed_size_t=no
1170 libc_cv_signed_size_t=yes
1173 if test $libc_cv_signed_size_t = yes; then
1174 dnl Do this by hand instead of AC_DEFINE so can add #undef to avoid warnings.
1175 cat >> confdefs.h <<\EOF
1176 #undef __SIZE_TYPE__
1177 #define __SIZE_TYPE__ unsigned
1181 AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl
1183 [#define __need_size_t
1184 #define __need_wchar_t
1187 #include <stddef.h>], [size_t size; wchar_t wchar;
1189 #error stddef.h ignored __need_*
1191 if (&size == NULL || &wchar == NULL) abort ();],
1192 libc_cv_friendly_stddef=yes,
1193 libc_cv_friendly_stddef=no)])
1194 if test $libc_cv_friendly_stddef = yes; then
1195 config_vars="$config_vars
1196 override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
1199 AC_CACHE_CHECK(whether we need to use -P to assemble .S files,
1200 libc_cv_need_minus_P, [dnl
1201 cat > conftest.S <<EOF
1202 #include "confdefs.h"
1203 /* Nothing whatsoever. */
1205 if AC_TRY_COMMAND(${CC-cc} $CPPFLAGS $ASFLAGS -c conftest.S 1>&AS_MESSAGE_LOG_FD); then
1206 libc_cv_need_minus_P=no
1208 libc_cv_need_minus_P=yes
1211 if test $libc_cv_need_minus_P = yes; then
1212 config_vars="$config_vars
1213 asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
1216 AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl
1217 cat > conftest.s <<EOF
1220 .set glibc_conftest_frobozz,foo
1221 $libc_cv_asm_global_directive glibc_conftest_frobozz
1223 # The alpha-dec-osf1 assembler gives only a warning for `.set'
1224 # (but it doesn't work), so we must do a linking check to be sure.
1225 cat > conftest1.c <<\EOF
1226 extern int glibc_conftest_frobozz;
1227 void _start() { glibc_conftest_frobozz = 1; }
1229 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1230 -nostartfiles -nostdlib \
1231 -o conftest conftest.s conftest1.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1232 libc_cv_asm_set_directive=yes
1234 libc_cv_asm_set_directive=no
1237 if test $libc_cv_asm_set_directive = yes; then
1238 AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
1241 AC_CACHE_CHECK(for assembler gnu_unique_object symbol type,
1242 libc_cv_asm_unique_object, [dnl
1243 cat > conftest.s <<EOF
1246 .type _sym, ${libc_cv_asm_type_prefix}gnu_unique_object
1248 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1249 libc_cv_asm_unique_object=yes
1251 libc_cv_asm_unique_object=no
1254 if test $libc_cv_asm_unique_object = yes; then
1255 AC_DEFINE(HAVE_ASM_UNIQUE_OBJECT)
1258 AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
1259 [cat > conftest.s <<EOF
1262 .symver _sym,sym@VERS
1264 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1265 libc_cv_asm_symver_directive=yes
1267 libc_cv_asm_symver_directive=no
1270 AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl
1271 if test $libc_cv_asm_symver_directive = yes; then
1272 cat > conftest.s <<EOF
1275 .symver _sym,sym@VERS
1277 cat > conftest.map <<EOF
1286 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1287 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
1288 -o conftest.so conftest.o
1289 -nostartfiles -nostdlib
1290 -Wl,--version-script,conftest.map
1291 1>&AS_MESSAGE_LOG_FD]);
1293 libc_cv_ld_version_script_option=yes
1295 libc_cv_ld_version_script_option=no
1298 libc_cv_ld_version_script_option=no
1301 libc_cv_ld_version_script_option=no
1304 if test $shared != no &&
1305 test $libc_cv_asm_symver_directive = yes &&
1306 test $libc_cv_ld_version_script_option = yes &&
1307 test $enable_versioning = yes; then
1309 AC_DEFINE(DO_VERSIONING)
1313 AC_SUBST(VERSIONING)
1315 if test $elf = yes && test $shared != no && test $VERSIONING = no; then
1317 *** WARNING: You should not compile GNU libc without versioning. Not using
1318 *** versioning will introduce incompatibilities so that old binaries
1319 *** will not run anymore.
1320 *** For versioning you need recent binutils (binutils-2.8.1.0.23 or newer)."
1322 if test $elf = yes; then
1323 AC_CACHE_CHECK(for .previous assembler directive,
1324 libc_cv_asm_previous_directive, [dnl
1325 cat > conftest.s <<EOF
1326 .section foo_section
1329 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1330 libc_cv_asm_previous_directive=yes
1332 libc_cv_asm_previous_directive=no
1335 if test $libc_cv_asm_previous_directive = yes; then
1336 AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
1338 AC_CACHE_CHECK(for .popsection assembler directive,
1339 libc_cv_asm_popsection_directive, [dnl
1340 cat > conftest.s <<EOF
1341 .pushsection foo_section
1344 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1345 libc_cv_asm_popsection_directive=yes
1347 libc_cv_asm_popsection_directive=no
1350 if test $libc_cv_asm_popsection_directive = yes; then
1351 AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
1354 AC_CACHE_CHECK(for .protected and .hidden assembler directive,
1355 libc_cv_asm_protected_directive, [dnl
1356 cat > conftest.s <<EOF
1362 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1363 libc_cv_asm_protected_directive=yes
1365 AC_MSG_ERROR(assembler support for symbol visibility is required)
1369 if test $libc_cv_asm_protected_directive = yes; then
1370 AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
1371 libc_cv_visibility_attribute,
1372 [cat > conftest.c <<EOF
1373 int foo __attribute__ ((visibility ("hidden"))) = 1;
1374 int bar __attribute__ ((visibility ("protected"))) = 1;
1376 libc_cv_visibility_attribute=no
1377 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1378 if grep '\.hidden.*foo' conftest.s >/dev/null; then
1379 if grep '\.protected.*bar' conftest.s >/dev/null; then
1380 libc_cv_visibility_attribute=yes
1384 rm -f conftest.{c,s}
1386 if test $libc_cv_visibility_attribute != yes; then
1387 AC_MSG_ERROR(compiler support for visibility attribute is required)
1391 if test $libc_cv_visibility_attribute = yes; then
1392 AC_CACHE_CHECK(for broken __attribute__((visibility())),
1393 libc_cv_broken_visibility_attribute,
1394 [cat > conftest.c <<EOF
1396 int bar (int x) __asm__ ("foo") __attribute__ ((visibility ("hidden")));
1397 int bar (int x) { return x; }
1399 libc_cv_broken_visibility_attribute=yes
1400 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1402 if grep '\.hidden[ _]foo' conftest.s >/dev/null; then
1404 libc_cv_broken_visibility_attribute=no
1407 rm -f conftest.c conftest.s
1409 if test $libc_cv_broken_visibility_attribute = yes; then
1410 AC_MSG_ERROR(working compiler support for visibility attribute is required)
1414 AC_CACHE_CHECK(for broken __attribute__((alias())),
1415 libc_cv_broken_alias_attribute,
1416 [cat > conftest.c <<EOF
1417 extern int foo (int x) __asm ("xyzzy");
1418 int bar (int x) { return x; }
1419 extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
1421 extern __typeof (dfoo) dfoo __asm ("abccb");
1424 libc_cv_broken_alias_attribute=yes
1425 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1426 if grep 'xyzzy' conftest.s >/dev/null &&
1427 grep 'abccb' conftest.s >/dev/null; then
1428 libc_cv_broken_alias_attribute=no
1431 rm -f conftest.c conftest.s
1433 if test $libc_cv_broken_alias_attribute = yes; then
1434 AC_MSG_ERROR(working alias attribute support required)
1437 if test $libc_cv_visibility_attribute = yes; then
1438 AC_CACHE_CHECK(whether to put _rtld_local into .sdata section,
1439 libc_cv_have_sdata_section,
1440 [echo "int i;" > conftest.c
1441 libc_cv_have_sdata_section=no
1442 if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
1443 | grep '\.sdata' >/dev/null; then
1444 libc_cv_have_sdata_section=yes
1446 rm -f conftest.c conftest.so
1448 if test $libc_cv_have_sdata_section = yes; then
1449 AC_DEFINE(HAVE_SDATA_SECTION)
1453 AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
1454 libc_cv_initfini_array, [dnl
1455 cat > conftest.c <<EOF
1456 int _start (void) { return 0; }
1457 int __start (void) { return 0; }
1458 int foo (void) { return 1; }
1459 int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
1461 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c
1462 -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
1464 if readelf -S conftest | fgrep INIT_ARRAY > /dev/null; then
1465 libc_cv_initfini_array=yes
1467 libc_cv_initfini_array=no
1470 libc_cv_initfini_array=no
1473 if test $libc_cv_initfini_array != yes; then
1474 AC_MSG_ERROR([Need linker with .init_array/.fini_array support.])
1477 AC_CACHE_CHECK(whether to use .ctors/.dtors header and trailer,
1478 libc_cv_ctors_header, [dnl
1479 if AC_TRY_COMMAND([${CC-cc} -Wl,--verbose 2>&1|grep SORT_BY_INIT_PRIORITY 1>&AS_MESSAGE_LOG_FD]); then
1480 libc_cv_ctors_header=no
1482 libc_cv_ctors_header=yes
1485 if test $libc_cv_ctors_header = no; then
1486 AC_DEFINE(NO_CTORS_DTORS_SECTIONS)
1489 AC_CACHE_CHECK(for libunwind-support in compiler,
1490 libc_cv_cc_with_libunwind, [
1491 cat > conftest.c <<EOF
1492 int main (void) { return 0; }
1494 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
1495 conftest.c -v 2>&1 >/dev/null | grep -q " -lunwind "; then
1496 libc_cv_cc_with_libunwind=yes
1498 libc_cv_cc_with_libunwind=no
1501 AC_SUBST(libc_cv_cc_with_libunwind)
1502 if test $libc_cv_cc_with_libunwind = yes; then
1503 AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
1506 AC_CACHE_CHECK(for -z nodelete option,
1507 libc_cv_z_nodelete, [dnl
1508 cat > conftest.c <<EOF
1509 int _start (void) { return 42; }
1511 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1512 -fPIC -shared -o conftest.so conftest.c
1513 -nostartfiles -nostdlib
1514 -Wl,--enable-new-dtags,-z,nodelete 1>&AS_MESSAGE_LOG_FD])
1516 libc_cv_z_nodelete=yes
1518 AC_MSG_ERROR(linker with -z nodelete support required)
1522 AC_CACHE_CHECK(for -z nodlopen option,
1523 libc_cv_z_nodlopen, [dnl
1524 cat > conftest.c <<EOF
1525 int _start (void) { return 42; }
1527 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1528 -fPIC -shared -o conftest.so conftest.c
1529 -nostartfiles -nostdlib
1530 -Wl,--enable-new-dtags,-z,nodlopen 1>&AS_MESSAGE_LOG_FD])
1532 libc_cv_z_nodlopen=yes
1534 AC_MSG_ERROR(linker with -z nodlopen support required)
1538 AC_CACHE_CHECK(for -z initfirst option,
1539 libc_cv_z_initfirst, [dnl
1540 cat > conftest.c <<EOF
1541 int _start (void) { return 42; }
1543 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1544 -fPIC -shared -o conftest.so conftest.c
1545 -nostartfiles -nostdlib
1546 -Wl,--enable-new-dtags,-z,initfirst 1>&AS_MESSAGE_LOG_FD])
1548 libc_cv_z_initfirst=yes
1550 AC_MSG_ERROR(linker with -z initfirst support required)
1554 case "$base_machine" in
1556 i[34567]86 | x86_64 | powerpc* | s390* | sparc* | alpha*)
1558 AC_CACHE_CHECK(for -z relro option,
1559 libc_cv_z_relro, [dnl
1561 if AC_TRY_COMMAND([${CC-cc} -v --help 2>&1|grep "z relro" 1>&AS_MESSAGE_LOG_FD])
1563 if AC_TRY_COMMAND([${CC-cc} -Wl,--verbose 2>&1|grep DATA_SEGMENT_RELRO_END 1>&AS_MESSAGE_LOG_FD])
1568 if test "$libc_cv_z_relro" = no; then
1569 AC_MSG_ERROR(linker with -z relro support required)
1575 AC_CACHE_CHECK(for -Bgroup option,
1576 libc_cv_Bgroup, [dnl
1577 cat > conftest.c <<EOF
1578 int _start (void) { return 42; }
1580 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1581 -fPIC -shared -o conftest.so conftest.c
1582 -Wl,-Bgroup -nostdlib 1>&AS_MESSAGE_LOG_FD])
1589 AC_SUBST(libc_cv_Bgroup)
1591 AC_CACHE_CHECK(for libgcc_s suffix,
1592 libc_cv_libgcc_s_suffix, [dnl
1593 cat > conftest.c <<EOF
1594 int main (void) { return 0; }
1597 libc_cv_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1598 -fPIC -shared -shared-libgcc -o conftest.so \
1599 conftest.c -v 2>&1 >/dev/null \
1600 | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
1603 AC_SUBST(libc_cv_libgcc_s_suffix)
1605 AC_CACHE_CHECK(for --as-needed option,
1606 libc_cv_as_needed, [dnl
1607 cat > conftest.c <<EOF
1608 int main (void) { return 0; }
1610 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1611 -fPIC -shared -o conftest.so conftest.c
1612 -lgcc_s$libc_cv_libgcc_s_suffix -Wl,--as-needed
1613 -nostdlib 1>&AS_MESSAGE_LOG_FD])
1615 libc_cv_as_needed=yes
1617 libc_cv_as_needed=no
1620 AC_SUBST(libc_cv_as_needed)
1623 AC_CACHE_CHECK(whether --noexecstack is desirable for .S files,
1624 libc_cv_as_noexecstack, [dnl
1625 cat > conftest.c <<EOF
1628 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS
1629 -S -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD]) \
1630 && grep -q .note.GNU-stack conftest.s \
1631 && AC_TRY_COMMAND([${CC-cc} $ASFLAGS -Wa,--noexecstack
1632 -c -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD])
1634 libc_cv_as_noexecstack=yes
1636 libc_cv_as_noexecstack=no
1639 if test $libc_cv_as_noexecstack = yes; then
1640 ASFLAGS_config="$ASFLAGS_config -Wa,--noexecstack"
1642 AC_SUBST(ASFLAGS_config)
1644 AC_CACHE_CHECK(for -z combreloc,
1645 libc_cv_z_combreloc, [dnl
1646 cat > conftest.c <<EOF
1647 extern int bar (int);
1649 int foo (void) { return bar (mumble); }
1651 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1652 -fPIC -shared -o conftest.so conftest.c
1653 -nostdlib -nostartfiles
1654 -Wl,-z,combreloc 1>&AS_MESSAGE_LOG_FD])
1656 dnl The following test is a bit weak. We must use a tool which can test
1657 dnl cross-platform since the gcc used can be a cross compiler. Without
1658 dnl introducing new options this is not easily doable. Instead use a tool
1659 dnl which always is cross-platform: readelf. To detect whether -z combreloc
1660 dnl look for a section named .rel.dyn.
1661 if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
1662 libc_cv_z_combreloc=yes
1664 libc_cv_z_combreloc=no
1667 libc_cv_z_combreloc=no
1670 if test "$libc_cv_z_combreloc" = yes; then
1671 AC_DEFINE(HAVE_Z_COMBRELOC)
1673 AC_SUBST(libc_cv_z_combreloc)
1675 AC_CACHE_CHECK(for -z execstack,
1676 libc_cv_z_execstack, [dnl
1677 cat > conftest.c <<EOF
1678 int _start (void) { return 42; }
1680 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1681 -fPIC -shared -o conftest.so conftest.c
1682 -Wl,-z,execstack -nostdlib
1683 1>&AS_MESSAGE_LOG_FD])
1685 libc_cv_z_execstack=yes
1687 libc_cv_z_execstack=no
1690 AC_SUBST(libc_cv_z_execstack)
1692 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
1693 cat > conftest.c <<EOF
1695 main () { return 0;}
1697 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
1698 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
1706 AC_SUBST(libc_cv_fpie)
1708 AC_CACHE_CHECK(for --hash-style option,
1709 libc_cv_hashstyle, [dnl
1710 cat > conftest.c <<EOF
1711 int _start (void) { return 42; }
1713 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1714 -fPIC -shared -o conftest.so conftest.c
1715 -Wl,--hash-style=both -nostdlib 1>&AS_MESSAGE_LOG_FD])
1717 libc_cv_hashstyle=yes
1719 libc_cv_hashstyle=no
1722 AC_SUBST(libc_cv_hashstyle)
1725 AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl
1726 cat > conftest.c <<EOF
1729 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder -fno-section-anchors
1730 conftest.c 1>&AS_MESSAGE_LOG_FD])
1732 libc_cv_fno_toplevel_reorder=yes
1734 libc_cv_fno_toplevel_reorder=no
1737 if test $libc_cv_fno_toplevel_reorder = yes; then
1738 fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors"
1740 fno_unit_at_a_time=-fno-unit-at-a-time
1742 AC_SUBST(fno_unit_at_a_time)
1744 AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
1745 cat > conftest.c <<EOF
1747 main () { return 0;}
1749 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -Werror -fstack-protector
1750 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
1757 AC_SUBST(libc_cv_ssp)
1759 AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
1760 cat > conftest.c <<EOF
1762 #ifdef __GNUC_GNU_INLINE__
1763 main () { return 0;}
1768 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -std=gnu99 -fgnu89-inline
1769 -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD])
1771 libc_cv_gnu89_inline=yes
1773 libc_cv_gnu89_inline=no
1776 if test $libc_cv_gnu89_inline = yes; then
1777 gnu89_inline=-fgnu89-inline
1781 AC_SUBST(gnu89_inline)
1783 if test $elf != yes; then
1784 AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
1785 [AC_TRY_COMPILE(, [asm (".section .init");
1786 asm (".section .fini");
1787 asm ("${libc_cv_dot_text}");],
1788 libc_cv_have_initfini=yes,
1789 libc_cv_have_initfini=no)])
1790 AC_SUBST(libc_cv_have_initfini)dnl
1791 if test $libc_cv_have_initfini = yes; then
1792 AC_DEFINE(HAVE_INITFINI)
1796 if test $elf = yes; then
1797 AC_CACHE_CHECK(whether cc puts quotes around section names,
1798 libc_cv_have_section_quotes,
1799 [cat > conftest.c <<EOF
1800 static const int foo
1801 __attribute__ ((section ("bar"))) = 1;
1803 if ${CC-cc} -S conftest.c -o conftest.s; then
1804 if grep '\.section.*"bar"' conftest.s >/dev/null; then
1805 libc_cv_have_section_quotes=yes
1807 libc_cv_have_section_quotes=no
1810 libc_cv_have_section_quotes=unknown
1812 rm -f conftest.{c,s}
1814 if test $libc_cv_have_section_quotes = yes; then
1815 AC_DEFINE(HAVE_SECTION_QUOTES)
1819 dnl AC_CHECK_ASM_UNDERSCORE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1820 AC_DEFUN(AC_CHECK_ASM_UNDERSCORE,
1821 [cat > conftest.$ac_ext <<EOF
1822 dnl This sometimes fails to find confdefs.h, for some reason.
1823 dnl [#]line $LINENO "[$]0"
1824 [#]line $LINENO "configure"
1825 #include "confdefs.h"
1826 void underscore_test(void) {
1829 if AC_TRY_EVAL(ac_compile); then
1830 if grep _underscore_test conftest* >/dev/null; then
1831 ifelse([$1], , :, [rm -f conftest*
1834 ifelse([$2], , , [rm -f conftest*
1838 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
1839 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
1840 ifelse([$2], , , [rm -f conftest*
1845 if test $elf = yes; then
1846 libc_cv_asm_underscores=no
1848 if test $ac_cv_prog_cc_works = yes; then
1849 AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1850 [AC_TRY_LINK([asm ("_glibc_foobar:");], [glibc_foobar ();],
1851 libc_cv_asm_underscores=yes,
1852 libc_cv_asm_underscores=no)])
1854 AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1855 [AC_CHECK_ASM_UNDERSCORE(libc_cv_asm_underscores=yes,
1856 libc_cv_asm_underscores=no)])
1859 if test $libc_cv_asm_underscores = no; then
1860 AC_DEFINE(NO_UNDERSCORES)
1863 if test $elf = yes; then
1864 libc_cv_weak_symbols=yes
1867 AC_CACHE_CHECK(for assembler .weak directive, libc_cv_asm_weak_directive,
1869 cat > conftest.s <<EOF
1871 ${libc_cv_asm_global_directive} foo
1874 .weak bar; bar = foo
1876 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1877 libc_cv_asm_weak_directive=yes
1879 libc_cv_asm_weak_directive=no
1883 if test $libc_cv_asm_weak_directive = no; then
1884 AC_CACHE_CHECK(for assembler .weakext directive,
1885 libc_cv_asm_weakext_directive,
1887 cat > conftest.s <<EOF
1889 ${libc_cv_asm_global_directive} foo
1893 ${libc_cv_asm_global_directive} baz
1896 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1897 libc_cv_asm_weakext_directive=yes
1899 libc_cv_asm_weakext_directive=no
1905 if test $libc_cv_asm_weak_directive = yes; then
1906 AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
1907 elif test $libc_cv_asm_weakext_directive = yes; then
1908 AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)
1911 AC_CACHE_CHECK(whether CFI directives are supported, libc_cv_asm_cfi_directives, [dnl
1913 sparc/sparc64*) cfi_offset=2047;;
1916 cat > conftest.s <<EOF
1918 .type func,%function
1922 .cfi_rel_offset 1, $cfi_offset
1925 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1926 libc_cv_asm_cfi_directives=yes
1928 libc_cv_asm_cfi_directives=no
1931 if test $libc_cv_asm_cfi_directives = yes; then
1932 AC_DEFINE(HAVE_ASM_CFI_DIRECTIVES)
1935 AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
1936 cat > conftest.c <<\EOF
1941 dnl No \ in command here because it ends up inside ''.
1942 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1943 -nostdlib -nostartfiles -Wl,--no-whole-archive
1944 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1945 libc_cv_ld_no_whole_archive=yes
1947 libc_cv_ld_no_whole_archive=no
1950 if test $libc_cv_ld_no_whole_archive = yes; then
1951 no_whole_archive=-Wl,--no-whole-archive
1953 AC_SUBST(no_whole_archive)dnl
1955 AC_CACHE_CHECK(for gcc -fexceptions, libc_cv_gcc_exceptions, [dnl
1956 cat > conftest.c <<\EOF
1961 dnl No \ in command here because it ends up inside ''.
1962 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1963 -nostdlib -nostartfiles -fexceptions
1964 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1965 libc_cv_gcc_exceptions=yes
1967 libc_cv_gcc_exceptions=no
1970 if test $libc_cv_gcc_exceptions = yes; then
1971 exceptions=-fexceptions
1973 AC_SUBST(exceptions)dnl
1975 if test "$host_cpu" = powerpc ; then
1976 # Check for a bug present in at least versions 2.8.x of GCC
1977 # and versions 1.0.x of EGCS.
1978 AC_CACHE_CHECK(whether clobbering cr0 causes problems,libc_cv_c_asmcr0_bug,[dnl
1979 AC_TRY_COMPILE([int tester(int x) { asm ("" : : : "cc"); return x & 123; }],,
1980 libc_cv_c_asmcr0_bug='no',
1981 libc_cv_c_asmcr0_bug='yes')])
1982 if test "$libc_cv_c_asmcr0_bug" != 'no'; then
1983 AC_DEFINE(BROKEN_PPC_ASM_CR0)
1987 dnl Check whether compiler understands __builtin_expect.
1988 AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
1989 [cat > conftest.c <<EOF
1990 #line $LINENO "configure"
1993 a = __builtin_expect (a, 10);
1994 return a == 10 ? 0 : 1;
1997 dnl No \ in command here because it ends up inside ''.
1998 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles
1999 -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
2000 libc_cv_gcc_builtin_expect=yes
2002 libc_cv_gcc_builtin_expect=no
2005 if test "$libc_cv_gcc_builtin_expect" = yes; then
2006 AC_DEFINE(HAVE_BUILTIN_EXPECT)
2009 AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
2010 cat > conftest.c <<\EOF
2013 __builtin_memset (x, 0, 1000);
2017 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null]);
2019 libc_cv_gcc_builtin_memset=no
2021 libc_cv_gcc_builtin_memset=yes
2024 if test "$libc_cv_gcc_builtin_memset" = yes ; then
2025 AC_DEFINE(HAVE_BUILTIN_MEMSET)
2028 AC_CACHE_CHECK(for redirection of built-in functions, libc_cv_gcc_builtin_redirection, [dnl
2029 cat > conftest.c <<\EOF
2030 extern char *strstr (const char *, const char *) __asm ("my_strstr");
2031 char *foo (const char *a, const char *b)
2033 return __builtin_strstr (a, b);
2037 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "my_strstr" > /dev/null]);
2039 libc_cv_gcc_builtin_redirection=yes
2041 libc_cv_gcc_builtin_redirection=no
2044 if test "$libc_cv_gcc_builtin_redirection" = yes ; then
2045 AC_DEFINE(HAVE_BUILTIN_REDIRECTION)
2048 dnl Check whether the compiler supports the __thread keyword.
2049 if test "x$use__thread" != xno; then
2050 AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
2051 [cat > conftest.c <<\EOF
2052 __thread int a = 42;
2054 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
2055 libc_cv_gcc___thread=yes
2057 libc_cv_gcc___thread=no
2060 if test "$libc_cv_gcc___thread" = yes; then
2061 AC_DEFINE(HAVE___THREAD)
2064 libc_cv_gcc___thread=no
2067 if test "$libc_cv_gcc___thread" = yes; then
2068 dnl Check whether the compiler supports the tls_model attribute.
2069 AC_CACHE_CHECK([for tls_model attribute], libc_cv_gcc_tls_model_attr, [dnl
2070 cat > conftest.c <<\EOF
2071 extern __thread int a __attribute__((tls_model ("initial-exec")));
2073 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&AS_MESSAGE_LOG_FD]); then
2074 libc_cv_gcc_tls_model_attr=yes
2076 libc_cv_gcc_tls_model_attr=no
2079 if test "$libc_cv_gcc_tls_model_attr" = yes; then
2080 AC_DEFINE(HAVE_TLS_MODEL_ATTRIBUTE)
2084 if test -n "$submachine"; then
2085 AC_CACHE_CHECK([for compiler option for CPU variant],
2086 libc_cv_cc_submachine, [dnl
2087 libc_cv_cc_submachine=no
2088 for opt in "-march=$submachine" "-mcpu=$submachine"; do
2089 if AC_TRY_COMMAND([${CC-cc} $opt -xc /dev/null -S -o /dev/null]); then
2090 libc_cv_cc_submachine="$opt"
2094 if test "x$libc_cv_cc_submachine" = xno; then
2095 AC_MSG_ERROR([${CC-cc} does not support $submachine])
2098 AC_SUBST(libc_cv_cc_submachine)
2100 dnl Check whether we have the gd library available.
2101 AC_MSG_CHECKING(for libgd)
2102 if test "$with_gd" != "no"; then
2103 old_CFLAGS="$CFLAGS"
2104 CFLAGS="$CFLAGS $libgd_include"
2105 old_LDFLAGS="$LDFLAGS"
2106 LDFLAGS="$LDFLAGS $libgd_ldflags"
2108 LIBS="$LIBS -lgd -lpng -lz -lm"
2109 AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
2110 CFLAGS="$old_CFLAGS"
2111 LDFLAGS="$old_LDFLAGS"
2116 AC_MSG_RESULT($LIBGD)
2120 if test x$with_selinux = xno ; then
2123 # See if we have the SELinux library
2124 AC_CHECK_LIB(selinux, is_selinux_enabled,
2125 have_selinux=yes, have_selinux=no)
2126 # See if we have the SELinux header with the NSCD permissions in it.
2127 if test x$have_selinux = xyes ; then
2128 AC_MSG_CHECKING([for NSCD Flask permissions in selinux/av_permissions.h])
2129 AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
2130 [#ifdef NSCD__SHMEMHOST
2133 #error NSCD__SHMEMHOST not defined
2135 have_selinux=yes, have_selinux=no)
2136 AC_MSG_RESULT($have_selinux)
2139 if test x$with_selinux = xyes ; then
2140 if test x$have_selinux = xno ; then
2141 AC_MSG_ERROR([SELinux explicitly required, but sufficiently recent SELinux library not found])
2145 # Check if we're building with SELinux support.
2146 if test "x$have_selinux" = xyes; then
2147 AC_DEFINE(HAVE_SELINUX, 1, [SELinux support])
2149 # See if we have the libaudit library
2150 AC_CHECK_LIB(audit, audit_log_user_avc_message,
2151 have_libaudit=yes, have_libaudit=no)
2152 if test "x$have_libaudit" = xyes; then
2153 AC_DEFINE(HAVE_LIBAUDIT, 1, [SELinux libaudit support])
2155 AC_SUBST(have_libaudit)
2157 # See if we have the libcap library
2158 AC_CHECK_LIB(cap, cap_init, have_libcap=yes, have_libcap=no)
2159 if test "x$have_libcap" = xyes; then
2160 AC_DEFINE(HAVE_LIBCAP, 1, [SELinux libcap support])
2162 AC_SUBST(have_libcap)
2164 AC_SUBST(have_selinux)
2166 dnl check for the size of 'long double'.
2167 AC_CHECK_SIZEOF(long double, 0)
2168 sizeof_long_double=$ac_cv_sizeof_long_double
2169 AC_SUBST(sizeof_long_double)
2171 ### End of automated tests.
2172 ### Now run sysdeps configure fragments.
2174 # They also can set these variables.
2176 ldd_rewrite_script=no
2177 libc_cv_sysconfdir=$sysconfdir
2178 libc_cv_gcc_unwind_find_fde=no
2181 # Iterate over all the sysdep directories we will use, running their
2182 # configure fragments.
2183 for dir in $sysnames; do
2186 *) dest=$srcdir/$dir ;;
2188 if test -r $dest/configure; then
2189 AC_MSG_RESULT(running configure fragment for $dir)
2194 if test x$libc_cv_gcc_unwind_find_fde = xyes; then
2195 AC_DEFINE(EXPORT_UNWIND_FIND_FDE)
2197 AC_SUBST(libc_cv_gcc_unwind_find_fde)
2199 dnl This is tested by existing code and it's simpler to avoid changing it.
2200 AC_DEFINE(USE_IN_LIBIO)
2202 # Test for old glibc 2.0.x headers so that they can be removed properly
2203 # Search only in includedir.
2204 AC_MSG_CHECKING(for old glibc 2.0.x headers)
2205 if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
2207 old_glibc_headers=yes
2209 old_glibc_headers=no
2211 AC_MSG_RESULT($old_glibc_headers)
2212 if test ${old_glibc_headers} = yes; then
2213 AC_MSG_WARN(*** During \"make install\" old headers from glibc 2.0.x will)
2214 AC_MSG_WARN(*** be removed.)
2216 AC_SUBST(old_glibc_headers)
2218 AC_SUBST(libc_cv_slibdir)
2219 AC_SUBST(libc_cv_localedir)
2220 AC_SUBST(libc_cv_sysconfdir)
2221 AC_SUBST(libc_cv_rootsbindir)
2222 AC_SUBST(libc_cv_forced_unwind)
2224 dnl sysdeps/CPU/configure.in checks set this via arch-specific asm tests
2225 AC_SUBST(libc_cv_cpp_asm_debuginfo)
2226 AC_SUBST(libc_cv_cc_sse4)
2227 AC_SUBST(libc_cv_cc_avx)
2228 AC_SUBST(libc_cv_cc_novzeroupper)
2229 AC_SUBST(libc_cv_as_i686)
2231 AC_SUBST(use_ldconfig)
2232 AC_SUBST(ldd_rewrite_script)
2234 AC_SUBST(elf) AC_SUBST(xcoff)
2235 if test $elf = yes; then
2238 if test $xcoff = yes; then
2239 AC_DEFINE(HAVE_XCOFF)
2244 if test $shared = default; then
2248 AC_CACHE_CHECK([whether -fPIC is default], libc_cv_pic_default,
2249 [libc_cv_pic_default=yes
2250 cat > conftest.c <<EOF
2251 #if defined __PIC__ || defined __pic__ || defined PIC || defined pic
2252 # error PIC is default.
2255 if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
2256 libc_cv_pic_default=no
2259 AC_SUBST(libc_cv_pic_default)
2264 AC_SUBST(static_nss)
2265 AC_SUBST(nopic_initfini)
2269 dnl See sysdeps/mach/configure.in for this variable.
2270 AC_SUBST(mach_interface_list)
2272 if test "`(cd $srcdir; pwd)`" = "`pwd`"; then
2275 config_makefile=Makefile
2278 VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
2279 RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
2283 AC_CONFIG_FILES([config.make ${config_makefile}])
2284 AC_CONFIG_COMMANDS([default],[[
2285 case $CONFIG_FILES in *config.make*)
2286 echo "$config_vars" >> config.make;;
2288 test -d bits || mkdir bits]],[[config_vars='$config_vars']])