1 dnl Process this file with autoconf to produce a configure script.
2 dnl Note we do not use AC_PREREQ here! See aclocal.m4 for what we use instead.
3 AC_INIT([GNU C Library], [(see version.h)], [http://sourceware.org/bugzilla/], [glibc])
4 AC_CONFIG_SRCDIR([include/features.h])
5 AC_CONFIG_HEADERS([config.h])
6 AC_CONFIG_AUX_DIR([scripts])
8 ACX_PKGVERSION([GNU libc])
9 ACX_BUGURL([http://www.gnu.org/software/libc/bugs.html])
10 AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"],
11 [Package description])
12 AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"],
13 [Bug reporting address])
15 # Glibc should not depend on any header files
16 AC_DEFUN([_AC_INCLUDES_DEFAULT_REQUIREMENTS],
17 [m4_divert_text([DEFAULTS],
18 [ac_includes_default='/* none */'])])
20 # We require GCC, and by default use its preprocessor. Override AC_PROG_CPP
21 # here to work around the Autoconf issue discussed in
22 # <http://sourceware.org/ml/libc-alpha/2013-01/msg00721.html>.
23 AC_DEFUN([AC_PROG_CPP],
24 [AC_REQUIRE([AC_PROG_CC])dnl
25 AC_ARG_VAR([CPP], [C preprocessor])dnl
26 _AC_ARG_VAR_CPPFLAGS()dnl
27 # On Suns, sometimes $CPP names a directory.
28 if test -n "$CPP" && test -d "$CPP"; then
31 if test -z "$CPP"; then
37 # We require GCC. Override _AC_PROG_CC_C89 here to work around the Autoconf
39 # <http://sourceware.org/ml/libc-alpha/2013-01/msg00757.html>.
40 AC_DEFUN([_AC_PROG_CC_C89], [[$1]])
42 dnl This is here so we can set $subdirs directly based on configure fragments.
48 if test $host != $build; then
49 AC_CHECK_PROGS(BUILD_CC, gcc cc)
51 AC_SUBST(cross_compiling)
53 # We need the C++ compiler only for testing.
55 AC_CHECK_TOOL(READELF, readelf, false)
57 if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
58 AC_MSG_ERROR([you must configure in a separate build directory])
61 # This will get text that should go into config.make.
64 # Check for a --with-gd argument and set libgd-LDFLAGS in config.make.
66 AC_HELP_STRING([--with-gd=DIR],
67 [find libgd include dir and library with prefix DIR]),
71 *) libgd_include="-I$withval/include"
72 libgd_ldflags="-L$withval/lib" ;;
75 AC_ARG_WITH([gd-include],
76 AC_HELP_STRING([--with-gd-include=DIR],
77 [find libgd include files in DIR]),
79 case "$with_gd_include" in
81 *) libgd_include="-I$withval" ;;
85 AC_HELP_STRING([--with-gd-lib=DIR],
86 [find libgd library files in DIR]),
88 case "$with_gd_lib" in
90 *) libgd_ldflags="-L$withval" ;;
94 if test -n "$libgd_include"; then
95 config_vars="$config_vars
96 CFLAGS-memusagestat.c = $libgd_include"
98 if test -n "$libgd_ldflags"; then
99 config_vars="$config_vars
100 libgd-LDFLAGS = $libgd_ldflags"
103 dnl Arguments to specify presence of other packages/features.
105 AC_HELP_STRING([--with-fp],
106 [if using floating-point hardware @<:@default=yes@:>@]),
110 AC_ARG_WITH([binutils],
111 AC_HELP_STRING([--with-binutils=PATH],
112 [specify location of binutils (as and ld)]),
113 [path_binutils=$withval],
115 AC_ARG_WITH([selinux],
116 AC_HELP_STRING([--with-selinux],
117 [if building with SELinux support]),
118 [with_selinux=$withval],
121 AC_ARG_WITH([headers],
122 AC_HELP_STRING([--with-headers=PATH],
123 [location of system headers to use
124 (for example /usr/src/linux/include)
125 @<:@default=compiler default@:>@]),
126 [sysheaders=$withval],
130 AC_SUBST(use_default_link)
131 AC_ARG_WITH([default-link],
132 AC_HELP_STRING([--with-default-link],
133 [do not use explicit linker scripts]),
134 [use_default_link=$withval],
135 [use_default_link=default])
137 AC_ARG_ENABLE([sanity-checks],
138 AC_HELP_STRING([--disable-sanity-checks],
139 [really do not use threads (should not be used except in special situations) @<:@default=yes@:>@]),
140 [enable_sanity=$enableval],
143 AC_ARG_ENABLE([shared],
144 AC_HELP_STRING([--enable-shared],
145 [build shared library @<:@default=yes if GNU ld@:>@]),
148 AC_ARG_ENABLE([profile],
149 AC_HELP_STRING([--enable-profile],
150 [build profiled library @<:@default=no@:>@]),
151 [profile=$enableval],
154 AC_ARG_ENABLE([oldest-abi],
155 AC_HELP_STRING([--enable-oldest-abi=ABI],
156 [configure the oldest ABI supported @<:@e.g. 2.2@:>@ @<:@default=glibc default@:>@]),
157 [oldest_abi=$enableval],
159 if test "$oldest_abi" = yes || test "$oldest_abi" = no; then
162 AC_DEFINE_UNQUOTED(GLIBC_OLDEST_ABI, "$oldest_abi")
166 AC_ARG_ENABLE([hardcoded-path-in-tests],
167 AC_HELP_STRING([--enable-hardcoded-path-in-tests],
168 [hardcode newly built glibc path in tests @<:@default=no@:>@]),
169 [hardcoded_path_in_tests=$enableval],
170 [hardcoded_path_in_tests=no])
171 AC_SUBST(hardcoded_path_in_tests)
173 AC_ARG_ENABLE([stackguard-randomization],
174 AC_HELP_STRING([--enable-stackguard-randomization],
175 [initialize __stack_chk_guard canary with a random number at program start]),
176 [enable_stackguard_randomize=$enableval],
177 [enable_stackguard_randomize=no])
178 if test "$enable_stackguard_randomize" = yes; then
179 AC_DEFINE(ENABLE_STACKGUARD_RANDOMIZE)
182 AC_ARG_ENABLE([lock-elision],
183 AC_HELP_STRING([--enable-lock-elision[=yes/no]],
184 [Enable lock elision for pthread mutexes by default]),
185 [enable_lock_elision=$enableval],
186 [enable_lock_elision=no])
187 if test "$enable_lock_elision" = yes ; then
188 AC_DEFINE(ENABLE_LOCK_ELISION)
191 dnl Generic infrastructure for drop-in additions to libc.
192 AC_ARG_ENABLE([add-ons],
193 AC_HELP_STRING([--enable-add-ons@<:@=DIRS...@:>@],
194 [configure and build add-ons in DIR1,DIR2,...
195 search for add-ons if no parameter given]),
196 , [enable_add_ons=yes])
198 AC_ARG_ENABLE([hidden-plt],
199 AC_HELP_STRING([--disable-hidden-plt],
200 [do not hide internal function calls to avoid PLT]),
203 if test "x$hidden" = xno; then
207 AC_ARG_ENABLE([bind-now],
208 AC_HELP_STRING([--enable-bind-now],
209 [disable lazy relocations in DSOs]),
210 [bindnow=$enableval],
214 dnl On some platforms we cannot use dynamic loading. We must provide
215 dnl static NSS modules.
216 AC_ARG_ENABLE([static-nss],
217 AC_HELP_STRING([--enable-static-nss],
218 [build static NSS modules @<:@default=no@:>@]),
219 [static_nss=$enableval],
221 dnl Enable static NSS also if we build no shared objects.
222 if test x"$static_nss" = xyes || test x"$shared" = xno; then
224 AC_DEFINE(DO_STATIC_NSS)
227 AC_ARG_ENABLE([force-install],
228 AC_HELP_STRING([--disable-force-install],
229 [don't force installation of files from this package, even if they are older than the installed files]),
230 [force_install=$enableval],
232 AC_SUBST(force_install)
234 dnl On some platforms we allow dropping compatibility with all kernel
236 AC_ARG_ENABLE([kernel],
237 AC_HELP_STRING([--enable-kernel=VERSION],
238 [compile for compatibility with kernel not older than VERSION]),
239 [minimum_kernel=$enableval],
241 dnl Prevent unreasonable values.
242 if test "$minimum_kernel" = yes || test "$minimum_kernel" = no; then
243 # Better nothing than this.
246 if test "$minimum_kernel" = current; then
247 minimum_kernel=`uname -r 2>/dev/null` || minimum_kernel=
251 dnl For the development we sometimes want gcc to issue even more warnings.
252 dnl This is not the default since many of the extra warnings are not
254 AC_ARG_ENABLE([all-warnings],
255 AC_HELP_STRING([--enable-all-warnings],
256 [enable all useful warnings gcc can issue]),
257 [all_warnings=$enableval],
259 AC_SUBST(all_warnings)
261 AC_ARG_ENABLE([multi-arch],
262 AC_HELP_STRING([--enable-multi-arch],
263 [enable single DSO with optimizations for multiple architectures]),
264 [multi_arch=$enableval],
265 [multi_arch=default])
267 AC_ARG_ENABLE([nss-crypt],
268 AC_HELP_STRING([--enable-nss-crypt],
269 [enable libcrypt to use nss]),
270 [nss_crypt=$enableval],
272 if test x$nss_crypt = xyes; then
273 nss_includes=-I$(nss-config --includedir 2>/dev/null)
274 if test $? -ne 0; then
275 AC_MSG_ERROR([cannot find include directory with nss-config])
278 CFLAGS="$CFLAGS $nss_includes"
279 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
281 #include <nsslowhash.h>
282 void f (void) { NSSLOW_Init (); }])],
283 libc_cv_nss_crypt=yes,
285 cannot find NSS headers with lowlevel hash function interfaces]))
287 LIBS="$LIBS -lfreebl3"
288 AC_LINK_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
290 #include <nsslowhash.h>],
292 libc_cv_nss_crypt=yes,
294 cannot link program using lowlevel NSS hash functions]))
300 AC_SUBST(libc_cv_nss_crypt)
303 AC_ARG_ENABLE([obsolete-rpc],
304 AC_HELP_STRING([--enable-obsolete-rpc],
305 [build and install the obsolete RPC code for link-time usage]),
306 [link_obsolete_rpc=$enableval],
307 [link_obsolete_rpc=no])
308 AC_SUBST(link_obsolete_rpc)
310 if test "$link_obsolete_rpc" = yes; then
311 AC_DEFINE(LINK_OBSOLETE_RPC)
314 AC_ARG_ENABLE([systemtap],
315 [AS_HELP_STRING([--enable-systemtap],
316 [enable systemtap static probe points @<:@default=no@:>@])],
317 [systemtap=$enableval],
319 if test "x$systemtap" != xno; then
320 AC_CACHE_CHECK([for systemtap static probe support], libc_cv_sdt, [dnl
322 CFLAGS="-std=gnu99 $CFLAGS"
323 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <sys/sdt.h>
324 void foo (int i, void *p)
326 asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
327 :: STAP_PROBE_ASM_OPERANDS (2, i, p));
328 }]])], [libc_cv_sdt=yes], [libc_cv_sdt=no])
329 CFLAGS="$old_CFLAGS"])
330 if test $libc_cv_sdt = yes; then
331 AC_DEFINE([USE_STAP_PROBE])
332 elif test "x$systemtap" != xauto; then
333 AC_MSG_FAILURE([systemtap support needs sys/sdt.h with asm support])
337 AC_ARG_ENABLE([build-nscd],
338 [AS_HELP_STRING([--disable-build-nscd],
339 [disable building and installing the nscd daemon])],
340 [build_nscd=$enableval],
341 [build_nscd=default])
344 # Note the use of $use_nscd is near the bottom of the file.
345 AC_ARG_ENABLE([nscd],
346 [AS_HELP_STRING([--disable-nscd],
347 [library functions will not contact the nscd daemon])],
348 [use_nscd=$enableval],
351 AC_ARG_ENABLE([pt_chown],
352 [AS_HELP_STRING([--enable-pt_chown],
353 [Enable building and installing pt_chown])],
354 [build_pt_chown=$enableval],
356 AC_SUBST(build_pt_chown)
357 if test "$build_pt_chown" = yes; then
358 AC_DEFINE(HAVE_PT_CHOWN)
361 # The way shlib-versions is used to generate soversions.mk uses a
362 # fairly simplistic model for name recognition that can't distinguish
363 # i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
364 # of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can
365 # tell. This doesn't get used much beyond that, so it's fairly safe.
370 host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'`
374 # We keep the original values in `$config_*' and never modify them, so we
375 # can write them unchanged into config.make. Everything else uses
376 # $machine, $vendor, and $os, and changes them whenever convenient.
377 config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
379 # Don't allow vendor == "unknown"
380 test "$config_vendor" = unknown && config_vendor=
381 config_os="`echo $config_os | sed 's/^unknown-//'`"
383 # Some configurations imply other options.
386 # The configure fragment of an add-on port can modify these to supplement
387 # or override the table in the case statement below. No fragment should
388 # ever change the config_* variables, however.
389 machine=$config_machine
390 vendor=$config_vendor
394 # config.guess on some IBM machines says `rs6000' instead of `powerpc'.
396 if test "$machine" = rs6000; then
400 # Braindead PowerPC box with absolutely no FPU.
401 case "$machine-$host_os" in
409 AS_HELP_STRING([--with-cpu=CPU], [select code for CPU variant]),
412 yes|'') AC_MSG_ERROR([--with-cpu requires an argument]) ;;
414 *) submachine="$withval" ;;
418 dnl Let sysdeps/*/preconfigure act here, like they can in add-ons.
419 LIBC_PRECONFIGURE([$srcdir], [for sysdeps])
421 # An add-on can set this when it wants to disable the sanity check below.
424 dnl Having this here, though empty, makes sure that if add-ons' fragments
425 dnl do AC_CONFIG_SUBDIRS([some-dir]), which just sets $subdirs, then
426 dnl our AC_OUTPUT will actually use it.
429 case "$enable_add_ons" in
432 add_ons=`cd $srcdir && ls -d 2> /dev/null */configure */sysdeps |
433 sed 's@/[[^/]]*$@@' | sort | uniq`
434 add_ons_automatic=yes
436 *) add_ons=`echo "$enable_add_ons" | sed 's/,/ /g'`
437 add_ons_automatic=no ;;
443 if test x"$add_ons" != x; then
444 for f in $add_ons; do
449 *** It seems that you're using an old \`crypt' add-on. crypt is now
450 *** part of glibc and using the old add-on will not work with this
451 *** release. Start again with fresh sources and without the old
452 *** \`crypt' add-on.])
456 *** It seems that you're using an old \`localedata' add-on. localedata
457 *** is now part of glibc and using the old add-on will not work with
458 *** this release. Start again with fresh sources and without the old
459 *** \`localedata' add-on.])
464 # Now source each add-on's configure fragment.
465 # The fragments can use $srcdir/$libc_add_on to find themselves,
466 # and test $add_ons_automatic to see if they were explicitly requested.
467 # A fragment can clear (or even change) $libc_add_on to affect
468 # whether it goes into the list to be actually used in the build.
470 for libc_add_on in $add_ons; do
471 # Test whether such a directory really exists.
472 # It can be absolute, or relative to $srcdir, or relative to the build dir.
473 case "$libc_add_on" in
475 libc_add_on_srcdir=$libc_add_on
478 test -d "$srcdir/$libc_add_on" || {
479 if test -d "$libc_add_on"; then
480 libc_add_on="`pwd`/$libc_add_on"
482 AC_MSG_ERROR(add-on directory \"$libc_add_on\" does not exist)
485 libc_add_on_srcdir=$srcdir/$libc_add_on
489 libc_add_on_frag=$libc_add_on_srcdir/configure
490 libc_add_on_canonical=
491 libc_add_on_config_subdirs=
492 if test -r "$libc_add_on_frag"; then
493 AC_MSG_NOTICE(running configure fragment for add-on $libc_add_on)
494 libc_add_on_canonical=unknown
496 . "$libc_add_on_frag"
497 test -z "$libc_add_on" || {
498 configured_add_ons="$configured_add_ons $libc_add_on"
499 if test "x$libc_add_on_canonical" = xunknown; then
500 AC_MSG_ERROR(fragment must set \$libc_add_on_canonical)
502 for d in $libc_add_on_subdirs; do
503 case "$libc_add_on" in
504 /*) subdir_srcdir="$libc_add_on" ;;
505 *) subdir_srcdir="\$(..)$libc_add_on" ;;
509 d="${libc_add_on_canonical:-$libc_add_on}"
515 subdir_srcdir="$subdir_srcdir/$d"
518 d=`echo "$d" | sed 's@/*$@@;s@^.*/@@'`
519 add_on_subdirs="$add_on_subdirs $d"
520 test "$subdir_srcdir" = "\$(..)$d" || config_vars="$config_vars
521 $d-srcdir = $subdir_srcdir"
523 for d in $libc_add_on_config_subdirs; do
526 fragment uses absolute path in \$libc_add_on_config_subdirs) ;;
528 if test ! -d "$libc_add_on_srcdir/$d"; then
529 AC_MSG_ERROR(fragment wants to configure missing directory $d)
531 case "$libc_add_on" in
533 relative path required for add-on using \$libc_add_on_config_subdirs) ;;
535 subdirs="$subdirs $libc_add_on/$d"
539 if test -n "$libc_add_on"; then
540 LIBC_PRECONFIGURE([$libc_add_on_srcdir], [add-on $libc_add_on for])
541 use_add_ons="$use_add_ons $libc_add_on"
542 add_ons_pfx="$add_ons_pfx $libc_add_on/"
543 test -z "$libc_add_on_canonical" ||
544 add_ons_sfx="$add_ons_sfx /$libc_add_on_canonical"
547 # Use echo to strip excess whitespace.
548 add_ons="`echo $use_add_ons`"
551 AC_SUBST(add_on_subdirs)
555 ### I put this here to prevent those annoying emails from people who cannot
556 ### read and try to compile glibc on unsupported platforms. --drepper
558 ### By using the undocumented --enable-hacker-mode option for configure
559 ### one can skip this test to make the configuration not fail for unsupported
562 if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then
563 case "$machine-$host_os" in
567 echo "*** The GNU C library is currently not available for this platform."
568 echo "*** So far nobody cared to port it and if there is no volunteer it"
569 echo "*** might never happen. So, if you have interest to see glibc on"
570 echo "*** this platform visit"
571 echo "*** http://www.gnu.org/software/libc/porting.html"
572 echo "*** and join the group of porters"
578 dnl We need to use [ and ] for other purposes for a while now.
580 # Expand the configuration machine name into a subdirectory by architecture
581 # type and particular chip. If an add-on configure fragment already set
582 # base_machine, we don't change it.
583 test -n "$base_machine" || case "$machine" in
584 i[4567]86) base_machine=i386 machine=i386/$machine ;;
585 powerpc64*) base_machine=powerpc machine=powerpc/powerpc64 ;;
586 powerpc*) base_machine=powerpc machine=powerpc/powerpc32 ;;
587 s390) base_machine=s390 machine=s390/s390-32 ;;
588 s390x) base_machine=s390 machine=s390/s390-64 ;;
589 sh3*) base_machine=sh machine=sh/sh3 ;;
590 sh4*) base_machine=sh machine=sh/sh4 ;;
592 base_machine=sparc machine=sparc/sparc32 ;;
593 sparcv8 | supersparc | hypersparc)
594 base_machine=sparc machine=sparc/sparc32/sparcv8 ;;
595 sparcv8plus | sparcv8plusa | sparcv9)
596 base_machine=sparc machine=sparc/sparc32/sparcv9 ;;
597 sparcv8plusb | sparcv9b)
598 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;;
600 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v ;;
602 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v2 ;;
604 base_machine=sparc machine=sparc/sparc64 ;;
606 base_machine=sparc machine=sparc/sparc64/sparcv9b ;;
608 base_machine=sparc machine=sparc/sparc64/sparcv9v ;;
610 base_machine=sparc machine=sparc/sparc64/sparcv9v2 ;;
611 *) base_machine=$machine ;;
614 AC_SUBST(base_machine)
616 if test "$base_machine" = "i386"; then
617 AC_DEFINE(USE_REGPARMS)
620 # For the multi-arch option we need support in the assembler & linker.
621 AC_CACHE_CHECK([for assembler and linker STT_GNU_IFUNC support],
622 libc_cv_ld_gnu_indirect_function, [dnl
623 cat > conftest.S <<EOF
624 .type foo,%gnu_indirect_function
637 libc_cv_ld_gnu_indirect_function=no
638 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
639 -nostartfiles -nostdlib \
640 -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
641 # Do a link to see if the backend supports IFUNC relocs.
642 $READELF -r conftest 1>&AS_MESSAGE_LOG_FD
643 LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || {
644 libc_cv_ld_gnu_indirect_function=yes
649 AC_MSG_CHECKING(whether .text pseudo-op must be used)
650 AC_CACHE_VAL(libc_cv_dot_text, [dnl
651 cat > conftest.s <<EOF
655 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
656 libc_cv_dot_text=.text
659 if test -z "$libc_cv_dot_text"; then
665 if test x"$libc_cv_ld_gnu_indirect_function" != xyes; then
666 if test x"$multi_arch" = xyes; then
667 AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
673 if test x"$multi_arch" != xno; then
674 multi_arch_d=/multiarch
677 # Compute the list of sysdep directories for this configuration.
678 # This can take a while to compute.
679 sysdep_dir=$srcdir/sysdeps
680 AC_MSG_CHECKING(sysdep dirs)
681 dnl We need to use [ and ] for other purposes for a while now.
683 # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
684 os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
686 test "x$base_os" != x || case "$os" in
693 # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
696 while o=`echo $tail | sed 's/\.[^.]*$//'`; test $o != $tail; do
700 o=`echo $tail | sed 's/[0-9]*$//'`
701 if test $o != $tail; then
704 # For linux-gnu, try linux-gnu, then linux.
705 o=`echo $tail | sed 's/-.*$//'`
706 if test $o != $tail; then
710 # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
713 while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$b"; do
719 # For sparc/sparc32, try sparc/sparc32 and then sparc.
721 tail=$machine${submachine:+/$submachine}
722 while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
724 # Prepend the machine's FPU directory unless --without-fp.
725 if test "$with_fp" = yes; then
730 # For each machine term, try it with and then without /multiarch.
731 for try_fpu in $maybe_fpu ''; do
732 for try_multi in $multi_arch_d ''; do
733 mach="$mach /$1$try_fpu$try_multi"
739 dnl We are done with glob and regexp uses of [ and ]; return to autoconf.
742 # Find what sysdep directories exist.
745 for b in $base ''; do
746 for m0 in $mach ''; do
747 for v in /$vendor ''; do
748 test "$v" = / && continue
749 for o in /$ostry ''; do
750 test "$o" = / && continue
751 for m in $mach ''; do
752 for d in $add_ons_pfx ''; do
753 for a in $add_ons_sfx ''; do
754 try_suffix="$m0$b$v$o$m"
755 if test -n "$try_suffix"; then
756 try_srcdir="${srcdir}/"
760 try="${d}sysdeps$try_suffix$a"
761 test -n "$enable_debug_configure" &&
762 echo "$0 [DEBUG]: try $try" >&2
763 if test -d "$try_srcdir$try"; then
764 sysnames="$sysnames $try"
765 { test -n "$o" || test -n "$b"; } && os_used=t
766 { test -n "$m" || test -n "$m0"; } && machine_used=t
768 x*/$submachine) submachine_used=t ;;
770 if test -n "$d"; then
771 case "$sysnames_add_ons" in
773 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
786 # If the assembler supports gnu_indirect_function symbol type and the
787 # architecture supports multi-arch, we enable multi-arch by default.
788 case $sysnames_add_ons$sysnames in
792 test x"$multi_arch" = xdefault && multi_arch=no
795 if test x"$multi_arch" != xno; then
796 AC_DEFINE(USE_MULTIARCH)
800 if test -z "$os_used" && test "$os" != none; then
801 AC_MSG_ERROR(Operating system $os is not supported.)
803 if test -z "$machine_used" && test "$machine" != none; then
804 AC_MSG_ERROR(The $machine is not supported.)
806 if test -z "$submachine_used" && test -n "$submachine"; then
807 AC_MSG_ERROR(The $submachine subspecies of $host_cpu is not supported.)
811 # We have now validated the configuration.
813 # Expand the list of system names into a full list of directories
814 # from each element's parent name and Implies file (if present).
817 while test $# -gt 0; do
821 case " $names " in *" $name "*)
822 # Already in the list.
826 # Report each name as we discover it, so there is no long pause in output.
827 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
829 name_base=`echo $name | sed -e 's@\(.*sysdeps\)/.*@\1@'`
833 *) xsrcdir=$srcdir/ ;;
835 test -n "$enable_debug_configure" &&
836 echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2
838 for implies_file in Implies Implies-before Implies-after; do
839 implies_type=`echo $implies_file | sed s/-/_/`
840 eval ${implies_type}=
841 if test -f $xsrcdir$name/$implies_file; then
842 # Collect more names from the `Implies' file (removing comments).
843 implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/$implies_file`"
844 for x in $implied_candidate; do
846 if test -d $xsrcdir$name_base/$x; then
847 eval "${implies_type}=\"\$${implies_type} \$name_base/\$x\""
850 for d in $add_ons_pfx ''; do
854 *) try_srcdir=$srcdir/ ;;
856 test -n "$enable_debug_configure" &&
857 echo "[DEBUG]: $name $implies_file $x try($d) {$try_srcdir}$try" >&2
858 if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
860 eval "${implies_type}=\"\$${implies_type} \$try\""
862 case "$sysnames_add_ons" in
864 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
868 if test $found = no; then
869 AC_MSG_WARN($name/$implies_file specifies nonexistent $x)
875 # Add NAME to the list of names.
878 # Find the parent of NAME, using the empty string if it has none.
880 parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
883 test -n "$enable_debug_configure" &&
884 echo "[DEBUG]: $name Implies='$Implies' rest='$*' parent='$parent' \
885 Implies_before='$Implies_before' Implies_after='$Implies_after'" >&2
887 # Add the names implied by NAME, and NAME's parent (if it has one), to
888 # the list of names to be processed (the argument list). We prepend the
889 # implied names to the list and append the parent. We want implied
890 # directories to come before further directories inferred from the
891 # configuration components; this ensures that for sysv4, unix/common
892 # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
894 sysnames="`echo $Implies $* $Implies_before $parent $Implies_after`"
895 test -n "$sysnames" && set $sysnames
898 # Add the default directories.
899 default_sysnames="sysdeps/generic"
900 sysnames="$names $default_sysnames"
902 # The other names were emitted during the scan.
903 AC_MSG_RESULT($default_sysnames)
905 # Collect the list of add-ons that supply partial sysdeps trees.
907 for add_on in $add_ons; do
910 *) xsrcdir="$srcdir/" ;;
913 test -d "$xsrcdir$add_on/sysdeps" || {
914 case "$configured_add_ons " in
917 AC_MSG_ERROR(add-on $add_on has no configure fragment or sysdeps tree)
923 sysdeps_add_ons="$sysdeps_add_ons $add_on"
924 case "$sysnames_add_ons" in
927 AC_MSG_WARN(add-on $add_on contributed no sysdeps directories)
932 for d in $sysnames; do
934 $add_on/sysdeps/*) ;;
937 (cd "$xsrcdir$d" && for f in *[[!~]]; do
941 test -d "$ff" || { test -e "$ff" && exit 88; }
945 test -d "$f" || { test -e "$f" && exit 88; }
949 if test $? -eq 88; then
954 if test $found = no; then
955 AC_MSG_WARN(add-on $add_on contributed no useful sysdeps directories)
958 AC_SUBST(sysdeps_add_ons)
964 if test "$INSTALL" = "${srcdir}/scripts/install-sh -c"; then
965 # The makefiles need to use a different form to find it in $srcdir.
966 INSTALL='\$(..)./scripts/install-sh -c'
972 # Accept binutils 2.20 or newer.
973 AC_CHECK_PROG_VER(AS, $AS, --version,
974 [GNU assembler.* \([0-9]*\.[0-9.]*\)],
975 [2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], AS=: critic_missing="$critic_missing as")
976 AC_CHECK_PROG_VER(LD, $LD, --version,
977 [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
978 [2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], LD=: critic_missing="$critic_missing ld")
980 # These programs are version sensitive.
982 AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
983 [version \([egcygnustpi-]*[0-9.]*\)], [4.[4-9].* | 4.[1-9][0-9].* | [5-9].* ],
984 critic_missing="$critic_missing gcc")
985 AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
986 [GNU Make[^0-9]*\([0-9][0-9.]*\)],
987 [3.79* | 3.[89]*], critic_missing="$critic_missing make")
989 AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
990 [GNU gettext.* \([0-9]*\.[0-9.]*\)],
991 [0.10.3[6-9]* | 0.10.[4-9][0-9]* | 0.1[1-9]* | 0.[2-9][0-9]* | [1-9].*],
992 MSGFMT=: aux_missing="$aux_missing msgfmt")
993 AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
994 [GNU texinfo.* \([0-9][0-9.]*\)],
995 [4.[5-9]*|4.[1-9][0-9]*|[5-9].*],
996 MAKEINFO=: aux_missing="$aux_missing makeinfo")
997 AC_CHECK_PROG_VER(SED, sed, --version,
998 [GNU sed[^0-9]* \([0-9]*\.[0-9.]*\)],
999 [3.0[2-9]*|3.[1-9]*|[4-9]*],
1000 SED=: aux_missing="$aux_missing sed")
1001 AC_CHECK_PROG_VER(AWK, gawk, --version,
1002 [GNU Awk[^0-9]*\([0-9][0-9.]*\)],
1003 [3.1.[2-9]*|3.[2-9]*|[4-9]*], critic_missing="$critic_missing gawk")
1005 AC_CHECK_TOOL(NM, nm, false)
1007 AC_CHECK_PROGS(AUTOCONF, autoconf, no)
1008 case "x$AUTOCONF" in
1009 xno|x|x:) AUTOCONF=no ;;
1012 whether $AUTOCONF${ACFLAGS:+ }$ACFLAGS works, libc_cv_autoconf_works, [dnl
1013 if (cd $srcdir; $AUTOCONF $ACFLAGS configure.ac > /dev/null 2>&1); then
1014 libc_cv_autoconf_works=yes
1016 libc_cv_autoconf_works=no
1018 test $libc_cv_autoconf_works = yes || AUTOCONF=no
1021 if test "x$AUTOCONF" = xno; then
1022 aux_missing="$aux_missing autoconf"
1025 test -n "$critic_missing" && AC_MSG_ERROR([
1026 *** These critical programs are missing or too old:$critic_missing
1027 *** Check the INSTALL file for required versions.])
1029 test -n "$aux_missing" && AC_MSG_WARN([
1030 *** These auxiliary programs are missing or incompatible versions:$aux_missing
1031 *** some features will be disabled.
1032 *** Check the INSTALL file for required versions.])
1034 # if using special system headers, find out the compiler's sekrit
1035 # header directory and add that to the list. NOTE: Only does the right
1036 # thing on a system that doesn't need fixincludes. (Not presently a problem.)
1037 if test -n "$sysheaders"; then
1038 SYSINCLUDES=-nostdinc
1039 for d in include include-fixed; do
1040 i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
1041 SYSINCLUDES="$SYSINCLUDES -isystem $i"
1043 SYSINCLUDES="$SYSINCLUDES \
1044 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
1045 if test -n "$CXX"; then
1047 for cxxheaders in `$CXX -v -S -x c++ /dev/null -o /dev/null 2>&1 \
1048 | sed -n -e '1,/#include/d' -e 's/^ \(\/.*\/[cg]++\)/\1/p'`; do
1049 test "x$cxxheaders" != x &&
1050 CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders"
1054 AC_SUBST(SYSINCLUDES)
1055 AC_SUBST(CXX_SYSINCLUDES)
1057 # Test if LD_LIBRARY_PATH contains the notation for the current directory
1058 # since this would lead to problems installing/building glibc.
1059 # LD_LIBRARY_PATH contains the current directory if one of the following
1061 # - one of the terminals (":" and ";") is the first or last sign
1062 # - two terminals occur directly after each other
1063 # - the path contains an element with a dot in it
1064 AC_MSG_CHECKING(LD_LIBRARY_PATH variable)
1066 case ${LD_LIBRARY_PATH} in
1067 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
1068 ld_library_path_setting="contains current directory"
1071 ld_library_path_setting="ok"
1075 AC_MSG_RESULT($ld_library_path_setting)
1076 if test "$ld_library_path_setting" != "ok"; then
1078 *** LD_LIBRARY_PATH shouldn't contain the current directory when
1079 *** building glibc. Please change the environment variable
1080 *** and run configure again.])
1083 AC_CACHE_CHECK(whether GCC supports -static-libgcc, libc_cv_gcc_static_libgcc, [dnl
1084 if $CC -v -static-libgcc 2>&1 | grep 'unrecognized option.*static-libgcc' >/dev/null; then
1085 libc_cv_gcc_static_libgcc=
1087 libc_cv_gcc_static_libgcc=-static-libgcc
1089 AC_SUBST(libc_cv_gcc_static_libgcc)
1091 AC_PATH_PROG(BASH_SHELL, bash, no)
1092 if test "$BASH_SHELL" != no &&
1093 $BASH_SHELL -c 'test "$BASH_VERSINFO" \
1094 && test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then
1095 libc_cv_have_bash2=yes
1097 libc_cv_have_bash2=no
1099 AC_SUBST(libc_cv_have_bash2)
1101 dnl We need a ksh compatible shell for tzselect.
1102 if test "$BASH_SHELL" = no; then
1103 AC_PATH_PROG(KSH, ksh, no)
1104 if test "$KSH" = no; then
1107 libc_cv_have_ksh=yes
1112 libc_cv_have_ksh=yes
1114 AC_SUBST(libc_cv_have_ksh)
1116 AC_PATH_PROG(PERL, perl, no)
1117 if test "$PERL" != no &&
1118 (eval `$PERL -V:apiversion`; test `expr "$apiversion" \< 5` -ne 0); then
1121 AC_PATH_PROG(INSTALL_INFO, install-info, no,
1122 $PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin)
1123 AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin)
1125 AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl
1127 [#define __need_size_t
1128 #define __need_wchar_t
1131 #include <stddef.h>], [size_t size; wchar_t wchar;
1133 #error stddef.h ignored __need_*
1135 if (&size == NULL || &wchar == NULL) abort ();],
1136 libc_cv_friendly_stddef=yes,
1137 libc_cv_friendly_stddef=no)])
1138 if test $libc_cv_friendly_stddef = yes; then
1139 config_vars="$config_vars
1140 override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
1143 AC_CACHE_CHECK(whether we need to use -P to assemble .S files,
1144 libc_cv_need_minus_P, [dnl
1145 cat > conftest.S <<EOF
1146 #include "confdefs.h"
1147 /* Nothing whatsoever. */
1149 if AC_TRY_COMMAND(${CC-cc} $CPPFLAGS $ASFLAGS -c conftest.S 1>&AS_MESSAGE_LOG_FD); then
1150 libc_cv_need_minus_P=no
1152 libc_cv_need_minus_P=yes
1155 if test $libc_cv_need_minus_P = yes; then
1156 config_vars="$config_vars
1157 asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
1160 AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl
1161 cat > conftest.s <<EOF
1164 .set glibc_conftest_frobozz,foo
1165 .globl glibc_conftest_frobozz
1167 # The alpha-dec-osf1 assembler gives only a warning for `.set'
1168 # (but it doesn't work), so we must do a linking check to be sure.
1169 cat > conftest1.c <<\EOF
1170 extern int glibc_conftest_frobozz;
1171 void _start() { glibc_conftest_frobozz = 1; }
1173 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1174 -nostartfiles -nostdlib \
1175 -o conftest conftest.s conftest1.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1176 libc_cv_asm_set_directive=yes
1178 libc_cv_asm_set_directive=no
1181 if test $libc_cv_asm_set_directive = yes; then
1182 AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
1185 AC_CACHE_CHECK(for assembler gnu_unique_object symbol type,
1186 libc_cv_asm_unique_object, [dnl
1187 cat > conftest.s <<EOF
1190 .type _sym, %gnu_unique_object
1192 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1193 libc_cv_asm_unique_object=yes
1195 libc_cv_asm_unique_object=no
1198 if test $libc_cv_asm_unique_object = yes; then
1199 AC_DEFINE(HAVE_ASM_UNIQUE_OBJECT)
1202 AC_CACHE_CHECK(for .previous assembler directive,
1203 libc_cv_asm_previous_directive, [dnl
1204 cat > conftest.s <<EOF
1205 .section foo_section
1208 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1209 libc_cv_asm_previous_directive=yes
1211 libc_cv_asm_previous_directive=no
1214 if test $libc_cv_asm_previous_directive = yes; then
1215 AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
1217 AC_CACHE_CHECK(for .popsection assembler directive,
1218 libc_cv_asm_popsection_directive, [dnl
1219 cat > conftest.s <<EOF
1220 .pushsection foo_section
1223 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1224 libc_cv_asm_popsection_directive=yes
1226 libc_cv_asm_popsection_directive=no
1229 if test $libc_cv_asm_popsection_directive = yes; then
1230 AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
1233 AC_CACHE_CHECK(for .protected and .hidden assembler directive,
1234 libc_cv_asm_protected_directive, [dnl
1235 cat > conftest.s <<EOF
1241 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1242 libc_cv_asm_protected_directive=yes
1244 AC_MSG_ERROR(assembler support for symbol visibility is required)
1248 if test $libc_cv_asm_protected_directive = yes; then
1249 AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
1250 libc_cv_visibility_attribute,
1251 [cat > conftest.c <<EOF
1252 int foo __attribute__ ((visibility ("hidden"))) = 1;
1253 int bar __attribute__ ((visibility ("protected"))) = 1;
1255 libc_cv_visibility_attribute=no
1256 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1257 if grep '\.hidden.*foo' conftest.s >/dev/null; then
1258 if grep '\.protected.*bar' conftest.s >/dev/null; then
1259 libc_cv_visibility_attribute=yes
1263 rm -f conftest.{c,s}
1265 if test $libc_cv_visibility_attribute != yes; then
1266 AC_MSG_ERROR(compiler support for visibility attribute is required)
1270 if test $libc_cv_visibility_attribute = yes; then
1271 AC_CACHE_CHECK(for broken __attribute__((visibility())),
1272 libc_cv_broken_visibility_attribute,
1273 [cat > conftest.c <<EOF
1275 int bar (int x) __asm__ ("foo") __attribute__ ((visibility ("hidden")));
1276 int bar (int x) { return x; }
1278 libc_cv_broken_visibility_attribute=yes
1279 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1281 if grep '\.hidden[ _]foo' conftest.s >/dev/null; then
1283 libc_cv_broken_visibility_attribute=no
1286 rm -f conftest.c conftest.s
1288 if test $libc_cv_broken_visibility_attribute = yes; then
1289 AC_MSG_ERROR(working compiler support for visibility attribute is required)
1293 AC_CACHE_CHECK(for broken __attribute__((alias())),
1294 libc_cv_broken_alias_attribute,
1295 [cat > conftest.c <<EOF
1296 extern int foo (int x) __asm ("xyzzy");
1297 int bar (int x) { return x; }
1298 extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
1300 extern __typeof (dfoo) dfoo __asm ("abccb");
1303 libc_cv_broken_alias_attribute=yes
1304 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1305 if grep 'xyzzy' conftest.s >/dev/null &&
1306 grep 'abccb' conftest.s >/dev/null; then
1307 libc_cv_broken_alias_attribute=no
1310 rm -f conftest.c conftest.s
1312 if test $libc_cv_broken_alias_attribute = yes; then
1313 AC_MSG_ERROR(working alias attribute support required)
1316 if test $libc_cv_visibility_attribute = yes; then
1317 AC_CACHE_CHECK(whether to put _rtld_local into .sdata section,
1318 libc_cv_have_sdata_section,
1319 [echo "int i;" > conftest.c
1320 libc_cv_have_sdata_section=no
1321 if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
1322 | grep '\.sdata' >/dev/null; then
1323 libc_cv_have_sdata_section=yes
1325 rm -f conftest.c conftest.so
1327 if test $libc_cv_have_sdata_section = yes; then
1328 AC_DEFINE(HAVE_SDATA_SECTION)
1332 AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
1333 libc_cv_initfini_array, [dnl
1334 LIBC_TRY_LINK_STATIC([
1335 int foo (void) { return 1; }
1336 int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
1338 [if $READELF -S conftest | fgrep INIT_ARRAY > /dev/null; then
1339 libc_cv_initfini_array=yes
1341 libc_cv_initfini_array=no
1343 [libc_cv_initfini_array=no])
1345 if test $libc_cv_initfini_array != yes; then
1346 AC_MSG_ERROR([Need linker with .init_array/.fini_array support.])
1349 AC_CACHE_CHECK(whether to use .ctors/.dtors header and trailer,
1350 libc_cv_ctors_header, [dnl
1351 libc_cv_ctors_header=yes
1352 LIBC_TRY_LINK_STATIC([
1353 __attribute__ ((constructor)) void ctor (void) { asm (""); }
1354 __attribute__ ((destructor)) void dtor (void) { asm (""); }
1357 AS_IF([$READELF -WS conftest$ac_exeext | $AWK '
1358 { gsub(/\@<:@ */, "@<:@") }
1359 $2 == ".ctors" || $2 == ".dtors" {
1360 size = strtonum("0x" $6)
1361 align = strtonum("0x" $NF)
1363 stub@<:@$2@:>@ = size == align * 2
1366 ctors_ok = !seen@<:@".ctors"@:>@ || stub@<:@".ctors"@:>@
1367 dtors_ok = !seen@<:@".dtors"@:>@ || stub@<:@".dtors"@:>@
1368 exit ((ctors_ok && dtors_ok) ? 0 : 1)
1370 '], [libc_cv_ctors_header=no])
1372 AC_MSG_ERROR([missing __attribute__ ((constructor)) support??])
1375 if test $libc_cv_ctors_header = no; then
1376 AC_DEFINE(NO_CTORS_DTORS_SECTIONS)
1379 AC_CACHE_CHECK(for libunwind-support in compiler,
1380 libc_cv_cc_with_libunwind, [
1381 cat > conftest.c <<EOF
1382 int main (void) { return 0; }
1384 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
1385 conftest.c -v 2>&1 >/dev/null | grep ' -lunwind ' >/dev/null; then
1386 libc_cv_cc_with_libunwind=yes
1388 libc_cv_cc_with_libunwind=no
1391 AC_SUBST(libc_cv_cc_with_libunwind)
1392 if test $libc_cv_cc_with_libunwind = yes; then
1393 AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
1396 LIBC_LINKER_FEATURE([-z nodelete], [-Wl,--enable-new-dtags,-z,nodelete],
1397 [libc_cv_z_nodelete=yes],
1398 [AC_MSG_ERROR(linker with -z nodelete support required)])
1400 LIBC_LINKER_FEATURE([-z nodlopen], [-Wl,--enable-new-dtags,-z,nodlopen],
1401 [libc_cv_z_nodlopen=yes],
1402 [AC_MSG_ERROR(linker with -z nodlopen support required)])
1404 LIBC_LINKER_FEATURE([-z initfirst], [-Wl,--enable-new-dtags,-z,initfirst],
1405 [libc_cv_z_initfirst=yes],
1406 [AC_MSG_ERROR(linker with -z initfirst support required)])
1408 # Add-on fragments can set these for other machines.
1409 libc_commonpagesize=${libc_commonpagesize:-no}
1410 libc_relro_required=${libc_relro_required:-no}
1411 case "$base_machine" in
1412 i[[34567]]86 | x86_64 | powerpc* | s390*)
1413 libc_commonpagesize=0x1000
1414 libc_relro_required=yes
1417 libc_commonpagesize=0x2000
1418 libc_relro_required=yes
1422 if test $libc_commonpagesize != no; then
1423 AC_CACHE_CHECK(for -z relro option,
1424 libc_cv_z_relro, [dnl
1426 AC_LANG_CONFTEST([AC_LANG_SOURCE([[
1427 int _start (void) { return 42; }
1428 extern void _exit (int);
1429 /* Since these pointers are const, they should go in rodata.
1430 Since they refer to functions that have to be resolved by
1431 dynamic linking, they should instead go in RELRO data. */
1432 const void *const relro[] = { &_start, &_exit, 0 };
1433 /* GNU ld fails to produce RELRO data when it's very small and there is no
1434 normal writable data following it, or if only uninitialized (.bss) data
1435 follows it, or only very small writable data. */
1436 int data[0x10000] = { 1, };
1438 cat > conftest.awk <<\EOF
1441 commonpagesize = strtonum(commonpagesize)
1443 { print "LINE:", $0 > "/dev/stderr" }
1445 vaddr = strtonum($3)
1446 memsz = strtonum($6)
1448 printf "vaddr %#x memsz %#x end %#x commonpagesize %#x\n", \
1449 vaddr, memsz, end, commonpagesize > "/dev/stderr"
1450 result = (end % commonpagesize == 0) ? "yes" : "broken"
1452 END { print result }
1454 AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1455 -fPIC -shared -o conftest.so conftest.c
1456 -nostartfiles -nostdlib
1457 -Wl,-z,relro 1>&AS_MESSAGE_LOG_FD]) &&
1458 AC_TRY_COMMAND([$READELF -Wl conftest.so > conftest.ph]) &&
1460 $AWK -v commonpagesize=$libc_commonpagesize -f conftest.awk
1461 conftest.ph > conftest.cps
1463 libc_cv_z_relro=`cat conftest.cps 2>&AS_MESSAGE_LOG_FD`
1465 if { test "x$libc_relro_required" = xyes &&
1466 test "x$libc_cv_z_relro" != xyes
1469 AC_MSG_ERROR(linker with -z relro support required)
1472 AC_MSG_WARN([missing architecture parameter to check for working -z relro])
1475 AC_CACHE_CHECK(for -Bgroup option,
1476 libc_cv_Bgroup, [dnl
1477 cat > conftest.c <<EOF
1478 int _start (void) { return 42; }
1480 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1481 -fPIC -shared -o conftest.so conftest.c
1482 -Wl,-Bgroup -nostdlib 1>&AS_MESSAGE_LOG_FD])
1489 AC_SUBST(libc_cv_Bgroup)
1492 AC_CACHE_CHECK(whether --noexecstack is desirable for .S files,
1493 libc_cv_as_noexecstack, [dnl
1494 cat > conftest.c <<EOF
1497 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS
1498 -S -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD]) \
1499 && grep .note.GNU-stack conftest.s >/dev/null \
1500 && AC_TRY_COMMAND([${CC-cc} $ASFLAGS -Wa,--noexecstack
1501 -c -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD])
1503 libc_cv_as_noexecstack=yes
1505 libc_cv_as_noexecstack=no
1508 if test $libc_cv_as_noexecstack = yes; then
1509 ASFLAGS_config="$ASFLAGS_config -Wa,--noexecstack"
1511 AC_SUBST(ASFLAGS_config)
1513 AC_CACHE_CHECK(for -z combreloc,
1514 libc_cv_z_combreloc, [dnl
1515 cat > conftest.c <<EOF
1516 extern int bar (int);
1518 int foo (void) { return bar (mumble); }
1520 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1521 -fPIC -shared -o conftest.so conftest.c
1522 -nostdlib -nostartfiles
1523 -Wl,-z,combreloc 1>&AS_MESSAGE_LOG_FD])
1525 dnl The following test is a bit weak. We must use a tool which can test
1526 dnl cross-platform since the gcc used can be a cross compiler. Without
1527 dnl introducing new options this is not easily doable. Instead use a tool
1528 dnl which always is cross-platform: readelf. To detect whether -z combreloc
1529 dnl look for a section named .rel.dyn.
1530 if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
1531 libc_cv_z_combreloc=yes
1533 libc_cv_z_combreloc=no
1536 libc_cv_z_combreloc=no
1539 if test "$libc_cv_z_combreloc" = yes; then
1540 AC_DEFINE(HAVE_Z_COMBRELOC)
1542 AC_SUBST(libc_cv_z_combreloc)
1544 LIBC_LINKER_FEATURE([-z execstack], [-Wl,-z,execstack],
1545 [libc_cv_z_execstack=yes], [libc_cv_z_execstack=no])
1546 AC_SUBST(libc_cv_z_execstack)
1548 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
1549 LIBC_TRY_CC_OPTION([-fpie], [libc_cv_fpie=yes], [libc_cv_fpie=no])
1552 AC_SUBST(libc_cv_fpie)
1554 AC_CACHE_CHECK(for --hash-style option,
1555 libc_cv_hashstyle, [dnl
1556 cat > conftest.c <<EOF
1557 int _start (void) { return 42; }
1559 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1560 -fPIC -shared -o conftest.so conftest.c
1561 -Wl,--hash-style=both -nostdlib 1>&AS_MESSAGE_LOG_FD])
1563 libc_cv_hashstyle=yes
1565 libc_cv_hashstyle=no
1568 AC_SUBST(libc_cv_hashstyle)
1570 # The linker's default -shared behavior is good enough if it
1571 # does these things that our custom linker scripts ensure that
1572 # all allocated NOTE sections come first.
1573 if test "$use_default_link" = default; then
1574 AC_CACHE_CHECK([for sufficient default -shared layout],
1575 libc_cv_use_default_link, [dnl
1576 libc_cv_use_default_link=no
1577 cat > conftest.s <<\EOF
1578 .section .note.a,"a",%note
1583 .section .note.b,"a",%note
1589 if AC_TRY_COMMAND([dnl
1590 ${CC-cc} $ASFLAGS -shared -o conftest.so conftest.s 1>&AS_MESSAGE_LOG_FD]) &&
1591 ac_try=`$READELF -S conftest.so | sed -n \
1593 s/^ *\[ *[1-9][0-9]*\] *\([^ ][^ ]*\) *\([^ ][^ ]*\) .*$/\2 \1/
1599 libc_seen_a=no libc_seen_b=no
1601 while test $# -ge 2 -a "$1" = NOTE; do
1603 .note.a) libc_seen_a=yes ;;
1604 .note.b) libc_seen_b=yes ;;
1608 case "$libc_seen_a$libc_seen_b" in
1610 libc_cv_use_default_link=yes
1613 echo >&AS_MESSAGE_LOG_FD "\
1614 $libc_seen_a$libc_seen_b from:
1620 use_default_link=$libc_cv_use_default_link
1623 AC_CACHE_CHECK(linker output format, libc_cv_output_format, [dnl
1624 if libc_cv_output_format=`
1625 ${CC-cc} -nostartfiles -nostdlib -Wl,--print-output-format 2>&AS_MESSAGE_LOG_FD`
1629 libc_cv_output_format=
1631 test -n "$libc_cv_output_format" || libc_cv_output_format=unknown])
1632 AC_SUBST(libc_cv_output_format)
1634 AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl
1635 cat > conftest.c <<EOF
1638 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder -fno-section-anchors
1639 conftest.c 1>&AS_MESSAGE_LOG_FD])
1641 libc_cv_fno_toplevel_reorder=yes
1643 libc_cv_fno_toplevel_reorder=no
1646 if test $libc_cv_fno_toplevel_reorder = yes; then
1647 fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors"
1649 fno_unit_at_a_time=-fno-unit-at-a-time
1651 AC_SUBST(fno_unit_at_a_time)
1653 AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
1654 LIBC_TRY_CC_OPTION([$CFLAGS $CPPFLAGS -Werror -fstack-protector],
1658 AC_SUBST(libc_cv_ssp)
1660 AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
1661 cat > conftest.c <<EOF
1663 #ifdef __GNUC_GNU_INLINE__
1664 main () { return 0;}
1669 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -std=gnu99 -fgnu89-inline
1670 -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD])
1672 libc_cv_gnu89_inline=yes
1674 libc_cv_gnu89_inline=no
1677 if test $libc_cv_gnu89_inline = yes; then
1678 gnu89_inline=-fgnu89-inline
1682 AC_SUBST(gnu89_inline)
1684 AC_CACHE_CHECK(whether cc puts quotes around section names,
1685 libc_cv_have_section_quotes,
1686 [cat > conftest.c <<EOF
1687 static const int foo
1688 __attribute__ ((section ("bar"))) = 1;
1690 if ${CC-cc} -S conftest.c -o conftest.s; then
1691 if grep '\.section.*"bar"' conftest.s >/dev/null; then
1692 libc_cv_have_section_quotes=yes
1694 libc_cv_have_section_quotes=no
1697 libc_cv_have_section_quotes=unknown
1699 rm -f conftest.{c,s}
1701 if test $libc_cv_have_section_quotes = yes; then
1702 AC_DEFINE(HAVE_SECTION_QUOTES)
1705 AC_CACHE_CHECK(for assembler .weak directive, libc_cv_asm_weak_directive,
1707 cat > conftest.s <<EOF
1712 .weak bar; bar = foo
1714 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1715 libc_cv_asm_weak_directive=yes
1717 libc_cv_asm_weak_directive=no
1721 if test $libc_cv_asm_weak_directive = no; then
1722 AC_CACHE_CHECK(for assembler .weakext directive,
1723 libc_cv_asm_weakext_directive,
1725 cat > conftest.s <<EOF
1734 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1735 libc_cv_asm_weakext_directive=yes
1737 libc_cv_asm_weakext_directive=no
1743 if test $libc_cv_asm_weak_directive = yes; then
1744 AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
1745 elif test $libc_cv_asm_weakext_directive = yes; then
1746 AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)
1749 AC_CACHE_CHECK(whether CFI directives are supported, libc_cv_asm_cfi_directives, [dnl
1751 sparc/sparc64*) cfi_offset=2047;;
1754 cat > conftest.s <<EOF
1756 .type func,%function
1760 .cfi_rel_offset 1, $cfi_offset
1763 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1764 libc_cv_asm_cfi_directives=yes
1766 libc_cv_asm_cfi_directives=no
1769 if test $libc_cv_asm_cfi_directives = yes; then
1770 AC_DEFINE(HAVE_ASM_CFI_DIRECTIVES)
1773 AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
1774 cat > conftest.c <<\EOF
1779 dnl No \ in command here because it ends up inside ''.
1780 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1781 -nostdlib -nostartfiles -Wl,--no-whole-archive
1782 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1783 libc_cv_ld_no_whole_archive=yes
1785 libc_cv_ld_no_whole_archive=no
1788 if test $libc_cv_ld_no_whole_archive = no; then
1789 AC_MSG_ERROR([support for --no-whole-archive is needed])
1792 AC_CACHE_CHECK(for gcc -fexceptions, libc_cv_gcc_exceptions, [dnl
1793 cat > conftest.c <<\EOF
1798 dnl No \ in command here because it ends up inside ''.
1799 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1800 -nostdlib -nostartfiles -fexceptions
1801 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1802 libc_cv_gcc_exceptions=yes
1804 libc_cv_gcc_exceptions=no
1807 if test $libc_cv_gcc_exceptions = yes; then
1808 exceptions=-fexceptions
1810 AC_SUBST(exceptions)dnl
1812 if test "$host_cpu" = powerpc ; then
1813 # Check for a bug present in at least versions 2.8.x of GCC
1814 # and versions 1.0.x of EGCS.
1815 AC_CACHE_CHECK(whether clobbering cr0 causes problems,libc_cv_c_asmcr0_bug,[dnl
1816 AC_TRY_COMPILE([int tester(int x) { asm ("" : : : "cc"); return x & 123; }],,
1817 libc_cv_c_asmcr0_bug='no',
1818 libc_cv_c_asmcr0_bug='yes')])
1819 if test "$libc_cv_c_asmcr0_bug" != 'no'; then
1820 AC_DEFINE(BROKEN_PPC_ASM_CR0)
1824 AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
1825 cat > conftest.c <<\EOF
1828 __builtin_memset (x, 0, 1000);
1832 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null]);
1834 libc_cv_gcc_builtin_memset=no
1836 libc_cv_gcc_builtin_memset=yes
1839 if test "$libc_cv_gcc_builtin_memset" = yes ; then
1840 AC_DEFINE(HAVE_BUILTIN_MEMSET)
1843 AC_CACHE_CHECK(for redirection of built-in functions, libc_cv_gcc_builtin_redirection, [dnl
1844 cat > conftest.c <<\EOF
1845 extern char *strstr (const char *, const char *) __asm ("my_strstr");
1846 char *foo (const char *a, const char *b)
1848 return __builtin_strstr (a, b);
1852 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "my_strstr" > /dev/null]);
1854 libc_cv_gcc_builtin_redirection=yes
1856 libc_cv_gcc_builtin_redirection=no
1859 if test "$libc_cv_gcc_builtin_redirection" = no; then
1860 AC_MSG_ERROR([support for the symbol redirection needed])
1863 dnl Check whether the compiler supports the __thread keyword.
1864 AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
1865 [cat > conftest.c <<\EOF
1866 __thread int a = 42;
1868 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
1869 libc_cv_gcc___thread=yes
1871 libc_cv_gcc___thread=no
1874 if test "$libc_cv_gcc___thread" = no; then
1875 AC_MSG_ERROR([support for the __thread keyword is required])
1878 dnl Check whether the compiler supports the tls_model attribute.
1879 AC_CACHE_CHECK([for tls_model attribute], libc_cv_gcc_tls_model_attr, [dnl
1880 cat > conftest.c <<\EOF
1881 extern __thread int a __attribute__((tls_model ("initial-exec")));
1883 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&AS_MESSAGE_LOG_FD]); then
1884 libc_cv_gcc_tls_model_attr=yes
1886 libc_cv_gcc_tls_model_attr=no
1889 if test "$libc_cv_gcc_tls_model_attr" = no; then
1890 AC_MSG_ERROR([support for the tls_model attribute is required])
1893 dnl Determine how to disable generation of FMA instructions.
1894 AC_CACHE_CHECK([for compiler option to disable generation of FMA instructions],
1895 libc_cv_cc_nofma, [dnl
1897 for opt in -ffp-contract=off -mno-fused-madd; do
1898 LIBC_TRY_CC_OPTION([$opt], [libc_cv_cc_nofma=$opt; break])
1900 AC_SUBST(libc_cv_cc_nofma)
1902 if test -n "$submachine"; then
1903 AC_CACHE_CHECK([for compiler option for CPU variant],
1904 libc_cv_cc_submachine, [dnl
1905 libc_cv_cc_submachine=no
1906 for opt in "-march=$submachine" "-mcpu=$submachine"; do
1907 LIBC_TRY_CC_OPTION([$opt], [
1908 libc_cv_cc_submachine="$opt"
1911 if test "x$libc_cv_cc_submachine" = xno; then
1912 AC_MSG_ERROR([${CC-cc} does not support $submachine])
1915 AC_SUBST(libc_cv_cc_submachine)
1917 AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \
1918 __attribute__ ((__optimize__)), libc_cv_cc_loop_to_function, [dnl
1919 cat > conftest.c <<EOF
1921 __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
1924 libc_cv_cc_loop_to_function=no
1925 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c])
1927 libc_cv_cc_loop_to_function=yes
1930 if test $libc_cv_cc_loop_to_function = yes; then
1931 AC_DEFINE(HAVE_CC_INHIBIT_LOOP_TO_LIBCALL)
1933 AC_SUBST(libc_cv_cc_loop_to_function)
1935 dnl Check whether we have the gd library available.
1936 AC_MSG_CHECKING(for libgd)
1937 if test "$with_gd" != "no"; then
1938 old_CFLAGS="$CFLAGS"
1939 CFLAGS="$CFLAGS $libgd_include"
1940 old_LDFLAGS="$LDFLAGS"
1941 LDFLAGS="$LDFLAGS $libgd_ldflags"
1943 LIBS="$LIBS -lgd -lpng -lz -lm"
1944 AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
1945 CFLAGS="$old_CFLAGS"
1946 LDFLAGS="$old_LDFLAGS"
1951 AC_MSG_RESULT($LIBGD)
1955 if test x$with_selinux = xno ; then
1958 # See if we have the SELinux library
1959 AC_CHECK_LIB(selinux, is_selinux_enabled,
1960 have_selinux=yes, have_selinux=no)
1961 # See if we have the SELinux header with the NSCD permissions in it.
1962 if test x$have_selinux = xyes ; then
1963 AC_MSG_CHECKING([for NSCD Flask permissions in selinux/av_permissions.h])
1964 AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
1965 [#ifdef NSCD__SHMEMHOST
1968 #error NSCD__SHMEMHOST not defined
1970 have_selinux=yes, have_selinux=no)
1971 AC_MSG_RESULT($have_selinux)
1974 if test x$with_selinux = xyes ; then
1975 if test x$have_selinux = xno ; then
1976 AC_MSG_ERROR([SELinux explicitly required, but sufficiently recent SELinux library not found])
1980 # Check if we're building with SELinux support.
1981 if test "x$have_selinux" = xyes; then
1982 AC_DEFINE(HAVE_SELINUX, 1, [SELinux support])
1984 # See if we have the libaudit library
1985 AC_CHECK_LIB(audit, audit_log_user_avc_message,
1986 have_libaudit=yes, have_libaudit=no)
1987 if test "x$have_libaudit" = xyes; then
1988 AC_DEFINE(HAVE_LIBAUDIT, 1, [SELinux libaudit support])
1990 AC_SUBST(have_libaudit)
1992 # See if we have the libcap library
1993 AC_CHECK_LIB(cap, cap_init, have_libcap=yes, have_libcap=no)
1994 if test "x$have_libcap" = xyes; then
1995 AC_DEFINE(HAVE_LIBCAP, 1, [SELinux libcap support])
1997 AC_SUBST(have_libcap)
1999 AC_SUBST(have_selinux)
2001 dnl check for the size of 'long double'.
2002 AC_CHECK_SIZEOF(long double, 0)
2003 sizeof_long_double=$ac_cv_sizeof_long_double
2004 AC_SUBST(sizeof_long_double)
2007 dnl Check for silly hacked compilers predefining _FORTIFY_SOURCE.
2008 dnl Since we are building the implementations of the fortified functions here,
2009 dnl having the macro defined interacts very badly.
2010 AC_CACHE_CHECK([for _FORTIFY_SOURCE predefine], libc_cv_predef_fortify_source,
2011 [AC_TRY_COMPILE([], [
2012 #ifdef _FORTIFY_SOURCE
2015 [libc_cv_predef_fortify_source=no],
2016 [libc_cv_predef_fortify_source=yes])])
2017 if test $libc_cv_predef_fortify_source = yes; then
2018 CPPUNDEFS="${CPPUNDEFS:+$CPPUNDEFS }-U_FORTIFY_SOURCE"
2022 dnl Check for silly hacked compilers inserting -fstack-protector.
2023 dnl This breaks badly for the early startup code we compile, since
2024 dnl the compiled code can refer to a magic machine-dependent location
2025 dnl for the canary value before we have sufficient setup for that to
2026 dnl work. It's also questionable to build all of libc with this flag
2027 dnl even when you're doing that for most applications you build, since
2028 dnl libc's code is so heavily-used and performance-sensitive. If we
2029 dnl ever really want to make that work, it should be enabled explicitly
2030 dnl in the libc build, not inherited from implicit compiler settings.
2031 AC_CACHE_CHECK([whether $CC implicitly enables -fstack-protector],
2032 libc_cv_predef_stack_protector, [
2033 AC_TRY_COMPILE([extern void foobar (char *);],
2034 [char large_array[2048]; foobar (large_array);], [
2035 libc_undefs=`$NM -u conftest.o |
2036 LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
2037 2>&AS_MESSAGE_LOG_FD` || {
2038 AC_MSG_ERROR([confusing output from $NM -u])
2040 echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
2041 # On some architectures, there are architecture-specific undefined
2042 # symbols (resolved by the linker), so filter out unknown symbols.
2043 # This will fail to produce the correct result if the compiler
2044 # defaults to -fstack-protector but this produces an undefined symbol
2045 # other than __stack_chk_fail. However, compilers like that have not
2046 # been encountered in practice.
2047 libc_undefs=`echo "$libc_undefs" | egrep '^(foobar|__stack_chk_fail)$'`
2048 case "$libc_undefs" in
2049 foobar) libc_cv_predef_stack_protector=no ;;
2051 foobar') libc_cv_predef_stack_protector=yes ;;
2052 *) AC_MSG_ERROR([unexpected symbols in test: $libc_undefs]) ;;
2054 [AC_MSG_ERROR([test compilation failed])])
2057 if test $libc_cv_predef_stack_protector = yes; then
2058 libc_extra_cflags=-fno-stack-protector
2060 AC_SUBST(libc_extra_cflags)
2062 ### End of automated tests.
2063 ### Now run sysdeps configure fragments.
2065 # They also can set these variables.
2067 ldd_rewrite_script=no
2068 libc_cv_sysconfdir=$sysconfdir
2069 libc_cv_localstatedir=$localstatedir
2070 libc_cv_gcc_unwind_find_fde=no
2073 # Iterate over all the sysdep directories we will use, running their
2074 # configure fragments.
2075 for dir in $sysnames; do
2078 *) dest=$srcdir/$dir ;;
2080 if test -r $dest/configure; then
2081 AC_MSG_RESULT(running configure fragment for $dir)
2086 if test x$libc_cv_gcc_unwind_find_fde = xyes; then
2087 AC_DEFINE(EXPORT_UNWIND_FIND_FDE)
2089 AC_SUBST(libc_cv_gcc_unwind_find_fde)
2091 # A sysdeps configure fragment can reset this if IFUNC is not actually
2092 # usable even though the assembler knows how to generate the symbol type.
2093 if test x"$libc_cv_ld_gnu_indirect_function" = xyes; then
2094 AC_DEFINE(HAVE_IFUNC)
2097 # This is far from the AC_ARG_ENABLE that sets it so that a sysdeps
2098 # configure fragment can override the value to prevent this AC_DEFINE.
2100 if test "x$use_nscd" != xno; then
2101 AC_DEFINE([USE_NSCD])
2103 if test "x$build_nscd" = xdefault; then
2104 build_nscd=$use_nscd
2107 # Test for old glibc 2.0.x headers so that they can be removed properly
2108 # Search only in includedir.
2109 AC_MSG_CHECKING(for old glibc 2.0.x headers)
2110 if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
2112 old_glibc_headers=yes
2114 old_glibc_headers=no
2116 AC_MSG_RESULT($old_glibc_headers)
2117 if test ${old_glibc_headers} = yes; then
2118 AC_MSG_WARN(*** During \"make install\" old headers from glibc 2.0.x will)
2119 AC_MSG_WARN(*** be removed.)
2121 AC_SUBST(old_glibc_headers)
2123 AC_SUBST(libc_cv_slibdir)
2124 AC_SUBST(libc_cv_rtlddir)
2125 AC_SUBST(libc_cv_localedir)
2126 AC_SUBST(libc_cv_sysconfdir)
2127 AC_SUBST(libc_cv_localstatedir)
2128 AC_SUBST(libc_cv_rootsbindir)
2129 AC_SUBST(libc_cv_forced_unwind)
2131 if test x$use_ldconfig = xyes; then
2132 AC_DEFINE(USE_LDCONFIG)
2134 AC_SUBST(use_ldconfig)
2135 AC_SUBST(ldd_rewrite_script)
2140 AC_CACHE_CHECK([whether -fPIC is default], libc_cv_pic_default,
2141 [libc_cv_pic_default=yes
2142 cat > conftest.c <<EOF
2143 #if defined __PIC__ || defined __pic__ || defined PIC || defined pic
2144 # error PIC is default.
2147 if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
2148 libc_cv_pic_default=no
2151 AC_SUBST(libc_cv_pic_default)
2154 AC_SUBST(static_nss)
2158 dnl See sysdeps/mach/configure.ac for this variable.
2159 AC_SUBST(mach_interface_list)
2161 VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
2162 RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
2166 AC_CONFIG_FILES([config.make Makefile])
2167 AC_CONFIG_COMMANDS([default],[[
2168 case $CONFIG_FILES in *config.make*)
2169 echo "$config_vars" >> config.make;;
2171 test -d bits || mkdir bits]],[[config_vars='$config_vars']])