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 AC_SUBST(enable_lock_elision)
188 if test "$enable_lock_elision" = yes ; then
189 AC_DEFINE(ENABLE_LOCK_ELISION)
192 dnl Generic infrastructure for drop-in additions to libc.
193 AC_ARG_ENABLE([add-ons],
194 AC_HELP_STRING([--enable-add-ons@<:@=DIRS...@:>@],
195 [configure and build add-ons in DIR1,DIR2,...
196 search for add-ons if no parameter given]),
197 , [enable_add_ons=yes])
199 AC_ARG_ENABLE([hidden-plt],
200 AC_HELP_STRING([--disable-hidden-plt],
201 [do not hide internal function calls to avoid PLT]),
204 if test "x$hidden" = xno; then
208 AC_ARG_ENABLE([bind-now],
209 AC_HELP_STRING([--enable-bind-now],
210 [disable lazy relocations in DSOs]),
211 [bindnow=$enableval],
215 dnl On some platforms we cannot use dynamic loading. We must provide
216 dnl static NSS modules.
217 AC_ARG_ENABLE([static-nss],
218 AC_HELP_STRING([--enable-static-nss],
219 [build static NSS modules @<:@default=no@:>@]),
220 [static_nss=$enableval],
222 dnl Enable static NSS also if we build no shared objects.
223 if test x"$static_nss" = xyes || test x"$shared" = xno; then
225 AC_DEFINE(DO_STATIC_NSS)
228 AC_ARG_ENABLE([force-install],
229 AC_HELP_STRING([--disable-force-install],
230 [don't force installation of files from this package, even if they are older than the installed files]),
231 [force_install=$enableval],
233 AC_SUBST(force_install)
235 AC_ARG_ENABLE([maintainer-mode],
236 AC_HELP_STRING([--enable-maintainer-mode],
237 [enable make rules and dependencies not useful (and sometimes confusing) to the casual installer]),
238 [maintainer=$enableval],
241 dnl On some platforms we allow dropping compatibility with all kernel
243 AC_ARG_ENABLE([kernel],
244 AC_HELP_STRING([--enable-kernel=VERSION],
245 [compile for compatibility with kernel not older than VERSION]),
246 [minimum_kernel=$enableval],
248 dnl Prevent unreasonable values.
249 if test "$minimum_kernel" = yes || test "$minimum_kernel" = no; then
250 # Better nothing than this.
253 if test "$minimum_kernel" = current; then
254 minimum_kernel=`uname -r 2>/dev/null` || minimum_kernel=
258 dnl For the development we sometimes want gcc to issue even more warnings.
259 dnl This is not the default since many of the extra warnings are not
261 AC_ARG_ENABLE([all-warnings],
262 AC_HELP_STRING([--enable-all-warnings],
263 [enable all useful warnings gcc can issue]),
264 [all_warnings=$enableval],
266 AC_SUBST(all_warnings)
268 AC_ARG_ENABLE([multi-arch],
269 AC_HELP_STRING([--enable-multi-arch],
270 [enable single DSO with optimizations for multiple architectures]),
271 [multi_arch=$enableval],
272 [multi_arch=default])
274 AC_ARG_ENABLE([nss-crypt],
275 AC_HELP_STRING([--enable-nss-crypt],
276 [enable libcrypt to use nss]),
277 [nss_crypt=$enableval],
279 if test x$nss_crypt = xyes; then
280 nss_includes=-I$(nss-config --includedir 2>/dev/null)
281 if test $? -ne 0; then
282 AC_MSG_ERROR([cannot find include directory with nss-config])
285 CFLAGS="$CFLAGS $nss_includes"
286 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
288 #include <nsslowhash.h>
289 void f (void) { NSSLOW_Init (); }])],
290 libc_cv_nss_crypt=yes,
292 cannot find NSS headers with lowlevel hash function interfaces]))
294 LIBS="$LIBS -lfreebl3"
295 AC_LINK_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
297 #include <nsslowhash.h>],
299 libc_cv_nss_crypt=yes,
301 cannot link program using lowlevel NSS hash functions]))
307 AC_SUBST(libc_cv_nss_crypt)
310 AC_ARG_ENABLE([obsolete-rpc],
311 AC_HELP_STRING([--enable-obsolete-rpc],
312 [build and install the obsolete RPC code for link-time usage]),
313 [link_obsolete_rpc=$enableval],
314 [link_obsolete_rpc=no])
315 AC_SUBST(link_obsolete_rpc)
317 if test "$link_obsolete_rpc" = yes; then
318 AC_DEFINE(LINK_OBSOLETE_RPC)
321 AC_ARG_ENABLE([systemtap],
322 [AS_HELP_STRING([--enable-systemtap],
323 [enable systemtap static probe points @<:@default=no@:>@])],
324 [systemtap=$enableval],
326 if test "x$systemtap" != xno; then
327 AC_CACHE_CHECK([for systemtap static probe support], libc_cv_sdt, [dnl
329 CFLAGS="-std=gnu99 $CFLAGS"
330 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <sys/sdt.h>
331 void foo (int i, void *p)
333 asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
334 :: STAP_PROBE_ASM_OPERANDS (2, i, p));
335 }]])], [libc_cv_sdt=yes], [libc_cv_sdt=no])
336 CFLAGS="$old_CFLAGS"])
337 if test $libc_cv_sdt = yes; then
338 AC_DEFINE([USE_STAP_PROBE])
339 elif test "x$systemtap" != xauto; then
340 AC_MSG_FAILURE([systemtap support needs sys/sdt.h with asm support])
344 AC_ARG_ENABLE([build-nscd],
345 [AS_HELP_STRING([--disable-build-nscd],
346 [disable building and installing the nscd daemon])],
347 [build_nscd=$enableval],
348 [build_nscd=default])
351 # Note the use of $use_nscd is near the bottom of the file.
352 AC_ARG_ENABLE([nscd],
353 [AS_HELP_STRING([--disable-nscd],
354 [library functions will not contact the nscd daemon])],
355 [use_nscd=$enableval],
358 AC_ARG_ENABLE([pt_chown],
359 [AS_HELP_STRING([--enable-pt_chown],
360 [Enable building and installing pt_chown])],
361 [build_pt_chown=$enableval],
363 AC_SUBST(build_pt_chown)
364 if test "$build_pt_chown" = yes; then
365 AC_DEFINE(HAVE_PT_CHOWN)
368 # The way shlib-versions is used to generate soversions.mk uses a
369 # fairly simplistic model for name recognition that can't distinguish
370 # i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
371 # of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can
372 # tell. This doesn't get used much beyond that, so it's fairly safe.
377 host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'`
381 # We keep the original values in `$config_*' and never modify them, so we
382 # can write them unchanged into config.make. Everything else uses
383 # $machine, $vendor, and $os, and changes them whenever convenient.
384 config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
386 # Don't allow vendor == "unknown"
387 test "$config_vendor" = unknown && config_vendor=
388 config_os="`echo $config_os | sed 's/^unknown-//'`"
390 # Some configurations imply other options.
393 # The configure fragment of an add-on port can modify these to supplement
394 # or override the table in the case statement below. No fragment should
395 # ever change the config_* variables, however.
396 machine=$config_machine
397 vendor=$config_vendor
401 # config.guess on some IBM machines says `rs6000' instead of `powerpc'.
403 if test "$machine" = rs6000; then
407 # Braindead PowerPC box with absolutely no FPU.
408 case "$machine-$host_os" in
416 AS_HELP_STRING([--with-cpu=CPU], [select code for CPU variant]),
419 yes|'') AC_MSG_ERROR([--with-cpu requires an argument]) ;;
421 *) submachine="$withval" ;;
425 dnl Let sysdeps/*/preconfigure act here, like they can in add-ons.
426 LIBC_PRECONFIGURE([$srcdir], [for sysdeps])
428 # An add-on can set this when it wants to disable the sanity check below.
431 dnl Having this here, though empty, makes sure that if add-ons' fragments
432 dnl do AC_CONFIG_SUBDIRS([some-dir]), which just sets $subdirs, then
433 dnl our AC_OUTPUT will actually use it.
436 case "$enable_add_ons" in
439 add_ons=`cd $srcdir && ls -d 2> /dev/null */configure */sysdeps |
440 sed 's@/[[^/]]*$@@' | sort | uniq`
441 add_ons_automatic=yes
443 *) add_ons=`echo "$enable_add_ons" | sed 's/,/ /g'`
444 add_ons_automatic=no ;;
450 if test x"$add_ons" != x; then
451 for f in $add_ons; do
456 *** It seems that you're using an old \`crypt' add-on. crypt is now
457 *** part of glibc and using the old add-on will not work with this
458 *** release. Start again with fresh sources and without the old
459 *** \`crypt' add-on.])
463 *** It seems that you're using an old \`localedata' add-on. localedata
464 *** is now part of glibc and using the old add-on will not work with
465 *** this release. Start again with fresh sources and without the old
466 *** \`localedata' add-on.])
471 # Now source each add-on's configure fragment.
472 # The fragments can use $srcdir/$libc_add_on to find themselves,
473 # and test $add_ons_automatic to see if they were explicitly requested.
474 # A fragment can clear (or even change) $libc_add_on to affect
475 # whether it goes into the list to be actually used in the build.
477 for libc_add_on in $add_ons; do
478 # Test whether such a directory really exists.
479 # It can be absolute, or relative to $srcdir, or relative to the build dir.
480 case "$libc_add_on" in
482 libc_add_on_srcdir=$libc_add_on
485 test -d "$srcdir/$libc_add_on" || {
486 if test -d "$libc_add_on"; then
487 libc_add_on="`pwd`/$libc_add_on"
489 AC_MSG_ERROR(add-on directory \"$libc_add_on\" does not exist)
492 libc_add_on_srcdir=$srcdir/$libc_add_on
496 libc_add_on_frag=$libc_add_on_srcdir/configure
497 libc_add_on_canonical=
498 libc_add_on_config_subdirs=
499 if test -r "$libc_add_on_frag"; then
500 AC_MSG_NOTICE(running configure fragment for add-on $libc_add_on)
501 libc_add_on_canonical=unknown
503 . "$libc_add_on_frag"
504 test -z "$libc_add_on" || {
505 configured_add_ons="$configured_add_ons $libc_add_on"
506 if test "x$libc_add_on_canonical" = xunknown; then
507 AC_MSG_ERROR(fragment must set \$libc_add_on_canonical)
509 for d in $libc_add_on_subdirs; do
510 case "$libc_add_on" in
511 /*) subdir_srcdir="$libc_add_on" ;;
512 *) subdir_srcdir="\$(..)$libc_add_on" ;;
516 d="${libc_add_on_canonical:-$libc_add_on}"
522 subdir_srcdir="$subdir_srcdir/$d"
525 d=`echo "$d" | sed 's@/*$@@;s@^.*/@@'`
526 add_on_subdirs="$add_on_subdirs $d"
527 test "$subdir_srcdir" = "\$(..)$d" || config_vars="$config_vars
528 $d-srcdir = $subdir_srcdir"
530 for d in $libc_add_on_config_subdirs; do
533 fragment uses absolute path in \$libc_add_on_config_subdirs) ;;
535 if test ! -d "$libc_add_on_srcdir/$d"; then
536 AC_MSG_ERROR(fragment wants to configure missing directory $d)
538 case "$libc_add_on" in
540 relative path required for add-on using \$libc_add_on_config_subdirs) ;;
542 subdirs="$subdirs $libc_add_on/$d"
546 if test -n "$libc_add_on"; then
547 LIBC_PRECONFIGURE([$libc_add_on_srcdir], [add-on $libc_add_on for])
548 use_add_ons="$use_add_ons $libc_add_on"
549 add_ons_pfx="$add_ons_pfx $libc_add_on/"
550 test -z "$libc_add_on_canonical" ||
551 add_ons_sfx="$add_ons_sfx /$libc_add_on_canonical"
554 # Use echo to strip excess whitespace.
555 add_ons="`echo $use_add_ons`"
558 AC_SUBST(add_on_subdirs)
562 ### I put this here to prevent those annoying emails from people who cannot
563 ### read and try to compile glibc on unsupported platforms. --drepper
565 ### By using the undocumented --enable-hacker-mode option for configure
566 ### one can skip this test to make the configuration not fail for unsupported
569 if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then
570 case "$machine-$host_os" in
574 echo "*** The GNU C library is currently not available for this platform."
575 echo "*** So far nobody cared to port it and if there is no volunteer it"
576 echo "*** might never happen. So, if you have interest to see glibc on"
577 echo "*** this platform visit"
578 echo "*** http://www.gnu.org/software/libc/porting.html"
579 echo "*** and join the group of porters"
585 # Set base_machine if not set by a preconfigure fragment.
586 test -n "$base_machine" || base_machine=$machine
587 AC_SUBST(base_machine)
589 if test "$base_machine" = "i386"; then
590 AC_DEFINE(USE_REGPARMS)
593 # For the multi-arch option we need support in the assembler & linker.
594 AC_CACHE_CHECK([for assembler and linker STT_GNU_IFUNC support],
595 libc_cv_ld_gnu_indirect_function, [dnl
596 cat > conftest.S <<EOF
597 .type foo,%gnu_indirect_function
610 libc_cv_ld_gnu_indirect_function=no
611 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
612 -nostartfiles -nostdlib \
613 -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
614 # Do a link to see if the backend supports IFUNC relocs.
615 $READELF -r conftest 1>&AS_MESSAGE_LOG_FD
616 LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || {
617 libc_cv_ld_gnu_indirect_function=yes
622 AC_MSG_CHECKING(whether .text pseudo-op must be used)
623 AC_CACHE_VAL(libc_cv_dot_text, [dnl
624 cat > conftest.s <<EOF
628 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
629 libc_cv_dot_text=.text
632 if test -z "$libc_cv_dot_text"; then
638 if test x"$libc_cv_ld_gnu_indirect_function" != xyes; then
639 if test x"$multi_arch" = xyes; then
640 AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
646 if test x"$multi_arch" != xno; then
647 multi_arch_d=/multiarch
650 # Compute the list of sysdep directories for this configuration.
651 # This can take a while to compute.
652 sysdep_dir=$srcdir/sysdeps
653 AC_MSG_CHECKING(sysdep dirs)
654 dnl We need to use [ and ] for other purposes for a while now.
656 # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
657 os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
659 test "x$base_os" != x || case "$os" in
666 # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
669 while o=`echo $tail | sed 's/\.[^.]*$//'`; test $o != $tail; do
673 o=`echo $tail | sed 's/[0-9]*$//'`
674 if test $o != $tail; then
677 # For linux-gnu, try linux-gnu, then linux.
678 o=`echo $tail | sed 's/-.*$//'`
679 if test $o != $tail; then
683 # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
686 while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$b"; do
692 # For sparc/sparc32, try sparc/sparc32 and then sparc.
694 tail=$machine${submachine:+/$submachine}
695 while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
697 # Prepend the machine's FPU directory unless --without-fp.
698 if test "$with_fp" = yes; then
703 # For each machine term, try it with and then without /multiarch.
704 for try_fpu in $maybe_fpu ''; do
705 for try_multi in $multi_arch_d ''; do
706 mach="$mach /$1$try_fpu$try_multi"
712 dnl We are done with glob and regexp uses of [ and ]; return to autoconf.
715 # Find what sysdep directories exist.
718 for b in $base ''; do
719 for m0 in $mach ''; do
720 for v in /$vendor ''; do
721 test "$v" = / && continue
722 for o in /$ostry ''; do
723 test "$o" = / && continue
724 for m in $mach ''; do
725 for d in $add_ons_pfx ''; do
726 for a in $add_ons_sfx ''; do
727 try_suffix="$m0$b$v$o$m"
728 if test -n "$try_suffix"; then
729 try_srcdir="${srcdir}/"
733 try="${d}sysdeps$try_suffix$a"
734 test -n "$enable_debug_configure" &&
735 echo "$0 [DEBUG]: try $try" >&2
736 if test -d "$try_srcdir$try"; then
737 sysnames="$sysnames $try"
738 { test -n "$o" || test -n "$b"; } && os_used=t
739 { test -n "$m" || test -n "$m0"; } && machine_used=t
741 x*/$submachine) submachine_used=t ;;
743 if test -n "$d"; then
744 case "$sysnames_add_ons" in
746 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
759 # If the assembler supports gnu_indirect_function symbol type and the
760 # architecture supports multi-arch, we enable multi-arch by default.
761 case $sysnames_add_ons$sysnames in
765 test x"$multi_arch" = xdefault && multi_arch=no
768 if test x"$multi_arch" != xno; then
769 AC_DEFINE(USE_MULTIARCH)
773 if test -z "$os_used" && test "$os" != none; then
774 AC_MSG_ERROR(Operating system $os is not supported.)
776 if test -z "$machine_used" && test "$machine" != none; then
777 AC_MSG_ERROR(The $machine is not supported.)
779 if test -z "$submachine_used" && test -n "$submachine"; then
780 AC_MSG_ERROR(The $submachine subspecies of $host_cpu is not supported.)
784 # We have now validated the configuration.
786 # Expand the list of system names into a full list of directories
787 # from each element's parent name and Implies file (if present).
790 while test $# -gt 0; do
794 case " $names " in *" $name "*)
795 # Already in the list.
799 # Report each name as we discover it, so there is no long pause in output.
800 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
802 name_base=`echo $name | sed -e 's@\(.*sysdeps\)/.*@\1@'`
806 *) xsrcdir=$srcdir/ ;;
808 test -n "$enable_debug_configure" &&
809 echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2
811 for implies_file in Implies Implies-before Implies-after; do
812 implies_type=`echo $implies_file | sed s/-/_/`
813 eval ${implies_type}=
814 if test -f $xsrcdir$name/$implies_file; then
815 # Collect more names from the `Implies' file (removing comments).
816 implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/$implies_file`"
817 for x in $implied_candidate; do
819 if test -d $xsrcdir$name_base/$x; then
820 eval "${implies_type}=\"\$${implies_type} \$name_base/\$x\""
823 for d in $add_ons_pfx ''; do
827 *) try_srcdir=$srcdir/ ;;
829 test -n "$enable_debug_configure" &&
830 echo "[DEBUG]: $name $implies_file $x try($d) {$try_srcdir}$try" >&2
831 if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
833 eval "${implies_type}=\"\$${implies_type} \$try\""
835 case "$sysnames_add_ons" in
837 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
841 if test $found = no; then
842 AC_MSG_WARN($name/$implies_file specifies nonexistent $x)
848 # Add NAME to the list of names.
851 # Find the parent of NAME, using the empty string if it has none.
853 parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
856 test -n "$enable_debug_configure" &&
857 echo "[DEBUG]: $name Implies='$Implies' rest='$*' parent='$parent' \
858 Implies_before='$Implies_before' Implies_after='$Implies_after'" >&2
860 # Add the names implied by NAME, and NAME's parent (if it has one), to
861 # the list of names to be processed (the argument list). We prepend the
862 # implied names to the list and append the parent. We want implied
863 # directories to come before further directories inferred from the
864 # configuration components; this ensures that for sysv4, unix/common
865 # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
867 sysnames="`echo $Implies $* $Implies_before $parent $Implies_after`"
868 test -n "$sysnames" && set $sysnames
871 # Add the default directories.
872 default_sysnames="sysdeps/generic"
873 sysnames="$names $default_sysnames"
875 # The other names were emitted during the scan.
876 AC_MSG_RESULT($default_sysnames)
878 # Collect the list of add-ons that supply partial sysdeps trees.
880 for add_on in $add_ons; do
883 *) xsrcdir="$srcdir/" ;;
886 test -d "$xsrcdir$add_on/sysdeps" || {
887 case "$configured_add_ons " in
890 AC_MSG_ERROR(add-on $add_on has no configure fragment or sysdeps tree)
896 sysdeps_add_ons="$sysdeps_add_ons $add_on"
897 case "$sysnames_add_ons" in
900 AC_MSG_WARN(add-on $add_on contributed no sysdeps directories)
905 for d in $sysnames; do
907 $add_on/sysdeps/*) ;;
910 (cd "$xsrcdir$d" && for f in *[[!~]]; do
914 test -d "$ff" || { test -e "$ff" && exit 88; }
918 test -d "$f" || { test -e "$f" && exit 88; }
922 if test $? -eq 88; then
927 if test $found = no; then
928 AC_MSG_WARN(add-on $add_on contributed no useful sysdeps directories)
931 AC_SUBST(sysdeps_add_ons)
937 if test "$INSTALL" = "${srcdir}/scripts/install-sh -c"; then
938 # The makefiles need to use a different form to find it in $srcdir.
939 INSTALL='\$(..)./scripts/install-sh -c'
945 # Accept binutils 2.20 or newer.
946 AC_CHECK_PROG_VER(AS, $AS, --version,
947 [GNU assembler.* \([0-9]*\.[0-9.]*\)],
948 [2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], AS=: critic_missing="$critic_missing as")
949 AC_CHECK_PROG_VER(LD, $LD, --version,
950 [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
951 [2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], LD=: critic_missing="$critic_missing ld")
953 # These programs are version sensitive.
955 AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
956 [version \([egcygnustpi-]*[0-9.]*\)], [4.[4-9].* | 4.[1-9][0-9].* | [5-9].* ],
957 critic_missing="$critic_missing gcc")
958 AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
959 [GNU Make[^0-9]*\([0-9][0-9.]*\)],
960 [3.79* | 3.[89]* | [4-9].* | [1-9][0-9]*], critic_missing="$critic_missing make")
962 AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
963 [GNU gettext.* \([0-9]*\.[0-9.]*\)],
964 [0.10.3[6-9]* | 0.10.[4-9][0-9]* | 0.1[1-9]* | 0.[2-9][0-9]* | [1-9].*],
965 MSGFMT=: aux_missing="$aux_missing msgfmt")
966 AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
967 [GNU texinfo.* \([0-9][0-9.]*\)],
968 [4.[5-9]*|4.[1-9][0-9]*|[5-9].*],
969 MAKEINFO=: aux_missing="$aux_missing makeinfo")
970 AC_CHECK_PROG_VER(SED, sed, --version,
971 [GNU sed[^0-9]* \([0-9]*\.[0-9.]*\)],
972 [3.0[2-9]*|3.[1-9]*|[4-9]*],
973 SED=: aux_missing="$aux_missing sed")
974 AC_CHECK_PROG_VER(AWK, gawk, --version,
975 [GNU Awk[^0-9]*\([0-9][0-9.]*\)],
976 [3.1.[2-9]*|3.[2-9]*|[4-9]*], critic_missing="$critic_missing gawk")
978 AC_CHECK_TOOL(NM, nm, false)
980 if test "x$maintainer" = "xyes"; then
981 AC_CHECK_PROGS(AUTOCONF, autoconf, no)
983 xno|x|x:) AUTOCONF=no ;;
986 whether $AUTOCONF${ACFLAGS:+ }$ACFLAGS works, libc_cv_autoconf_works, [dnl
987 if (cd $srcdir; $AUTOCONF $ACFLAGS configure.ac > /dev/null 2>&1); then
988 libc_cv_autoconf_works=yes
990 libc_cv_autoconf_works=no
992 test $libc_cv_autoconf_works = yes || AUTOCONF=no
995 if test "x$AUTOCONF" = xno; then
996 aux_missing="$aux_missing autoconf"
1002 test -n "$critic_missing" && AC_MSG_ERROR([
1003 *** These critical programs are missing or too old:$critic_missing
1004 *** Check the INSTALL file for required versions.])
1006 test -n "$aux_missing" && AC_MSG_WARN([
1007 *** These auxiliary programs are missing or incompatible versions:$aux_missing
1008 *** some features will be disabled.
1009 *** Check the INSTALL file for required versions.])
1011 # if using special system headers, find out the compiler's sekrit
1012 # header directory and add that to the list. NOTE: Only does the right
1013 # thing on a system that doesn't need fixincludes. (Not presently a problem.)
1014 if test -n "$sysheaders"; then
1015 SYSINCLUDES=-nostdinc
1016 for d in include include-fixed; do
1017 i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
1018 SYSINCLUDES="$SYSINCLUDES -isystem $i"
1020 SYSINCLUDES="$SYSINCLUDES \
1021 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
1022 if test -n "$CXX"; then
1024 for cxxheaders in `$CXX -v -S -x c++ /dev/null -o /dev/null 2>&1 \
1025 | sed -n -e '1,/#include/d' -e 's/^ \(\/.*\/[cg]++\)/\1/p'`; do
1026 test "x$cxxheaders" != x &&
1027 CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders"
1031 AC_SUBST(SYSINCLUDES)
1032 AC_SUBST(CXX_SYSINCLUDES)
1034 # Test if LD_LIBRARY_PATH contains the notation for the current directory
1035 # since this would lead to problems installing/building glibc.
1036 # LD_LIBRARY_PATH contains the current directory if one of the following
1038 # - one of the terminals (":" and ";") is the first or last sign
1039 # - two terminals occur directly after each other
1040 # - the path contains an element with a dot in it
1041 AC_MSG_CHECKING(LD_LIBRARY_PATH variable)
1043 case ${LD_LIBRARY_PATH} in
1044 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
1045 ld_library_path_setting="contains current directory"
1048 ld_library_path_setting="ok"
1052 AC_MSG_RESULT($ld_library_path_setting)
1053 if test "$ld_library_path_setting" != "ok"; then
1055 *** LD_LIBRARY_PATH shouldn't contain the current directory when
1056 *** building glibc. Please change the environment variable
1057 *** and run configure again.])
1060 AC_CACHE_CHECK(whether GCC supports -static-libgcc, libc_cv_gcc_static_libgcc, [dnl
1061 if $CC -v -static-libgcc 2>&1 | grep 'unrecognized option.*static-libgcc' >/dev/null; then
1062 libc_cv_gcc_static_libgcc=
1064 libc_cv_gcc_static_libgcc=-static-libgcc
1066 AC_SUBST(libc_cv_gcc_static_libgcc)
1068 AC_PATH_PROG(BASH_SHELL, bash, no)
1070 AC_PATH_PROG(PERL, perl, no)
1071 if test "$PERL" != no &&
1072 (eval `$PERL -V:apiversion`; test `expr "$apiversion" \< 5` -ne 0); then
1075 AC_PATH_PROG(INSTALL_INFO, install-info, no,
1076 $PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin)
1077 AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin)
1079 AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl
1081 [#define __need_size_t
1082 #define __need_wchar_t
1085 #include <stddef.h>], [size_t size; wchar_t wchar;
1087 #error stddef.h ignored __need_*
1089 if (&size == NULL || &wchar == NULL) abort ();],
1090 libc_cv_friendly_stddef=yes,
1091 libc_cv_friendly_stddef=no)])
1092 if test $libc_cv_friendly_stddef = yes; then
1093 config_vars="$config_vars
1094 override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
1097 AC_CACHE_CHECK(whether we need to use -P to assemble .S files,
1098 libc_cv_need_minus_P, [dnl
1099 cat > conftest.S <<EOF
1100 #include "confdefs.h"
1101 /* Nothing whatsoever. */
1103 if AC_TRY_COMMAND(${CC-cc} $CPPFLAGS $ASFLAGS -c conftest.S 1>&AS_MESSAGE_LOG_FD); then
1104 libc_cv_need_minus_P=no
1106 libc_cv_need_minus_P=yes
1109 if test $libc_cv_need_minus_P = yes; then
1110 config_vars="$config_vars
1111 asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
1114 AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl
1115 cat > conftest.s <<EOF
1118 .set glibc_conftest_frobozz,foo
1119 .globl glibc_conftest_frobozz
1121 # The alpha-dec-osf1 assembler gives only a warning for `.set'
1122 # (but it doesn't work), so we must do a linking check to be sure.
1123 cat > conftest1.c <<\EOF
1124 extern int glibc_conftest_frobozz;
1125 void _start() { glibc_conftest_frobozz = 1; }
1127 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1128 -nostartfiles -nostdlib \
1129 -o conftest conftest.s conftest1.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1130 libc_cv_asm_set_directive=yes
1132 libc_cv_asm_set_directive=no
1135 if test $libc_cv_asm_set_directive = yes; then
1136 AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
1139 AC_CACHE_CHECK(for assembler gnu_unique_object symbol type,
1140 libc_cv_asm_unique_object, [dnl
1141 cat > conftest.s <<EOF
1144 .type _sym, %gnu_unique_object
1146 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1147 libc_cv_asm_unique_object=yes
1149 libc_cv_asm_unique_object=no
1152 if test $libc_cv_asm_unique_object = yes; then
1153 AC_DEFINE(HAVE_ASM_UNIQUE_OBJECT)
1156 AC_CACHE_CHECK(for .previous assembler directive,
1157 libc_cv_asm_previous_directive, [dnl
1158 cat > conftest.s <<EOF
1159 .section foo_section
1162 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1163 libc_cv_asm_previous_directive=yes
1165 libc_cv_asm_previous_directive=no
1168 if test $libc_cv_asm_previous_directive = yes; then
1169 AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
1171 AC_CACHE_CHECK(for .popsection assembler directive,
1172 libc_cv_asm_popsection_directive, [dnl
1173 cat > conftest.s <<EOF
1174 .pushsection foo_section
1177 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1178 libc_cv_asm_popsection_directive=yes
1180 libc_cv_asm_popsection_directive=no
1183 if test $libc_cv_asm_popsection_directive = yes; then
1184 AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
1187 AC_CACHE_CHECK(for .protected and .hidden assembler directive,
1188 libc_cv_asm_protected_directive, [dnl
1189 cat > conftest.s <<EOF
1195 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1196 libc_cv_asm_protected_directive=yes
1198 AC_MSG_ERROR(assembler support for symbol visibility is required)
1202 if test $libc_cv_asm_protected_directive = yes; then
1203 AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
1204 libc_cv_visibility_attribute,
1205 [cat > conftest.c <<EOF
1206 int foo __attribute__ ((visibility ("hidden"))) = 1;
1207 int bar __attribute__ ((visibility ("protected"))) = 1;
1209 libc_cv_visibility_attribute=no
1210 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1211 if grep '\.hidden.*foo' conftest.s >/dev/null; then
1212 if grep '\.protected.*bar' conftest.s >/dev/null; then
1213 libc_cv_visibility_attribute=yes
1217 rm -f conftest.{c,s}
1219 if test $libc_cv_visibility_attribute != yes; then
1220 AC_MSG_ERROR(compiler support for visibility attribute is required)
1224 if test $libc_cv_visibility_attribute = yes; then
1225 AC_CACHE_CHECK(for broken __attribute__((visibility())),
1226 libc_cv_broken_visibility_attribute,
1227 [cat > conftest.c <<EOF
1229 int bar (int x) __asm__ ("foo") __attribute__ ((visibility ("hidden")));
1230 int bar (int x) { return x; }
1232 libc_cv_broken_visibility_attribute=yes
1233 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1235 if grep '\.hidden[ _]foo' conftest.s >/dev/null; then
1237 libc_cv_broken_visibility_attribute=no
1240 rm -f conftest.c conftest.s
1242 if test $libc_cv_broken_visibility_attribute = yes; then
1243 AC_MSG_ERROR(working compiler support for visibility attribute is required)
1247 AC_CACHE_CHECK(for broken __attribute__((alias())),
1248 libc_cv_broken_alias_attribute,
1249 [cat > conftest.c <<EOF
1250 extern int foo (int x) __asm ("xyzzy");
1251 int bar (int x) { return x; }
1252 extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
1254 extern __typeof (dfoo) dfoo __asm ("abccb");
1257 libc_cv_broken_alias_attribute=yes
1258 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1259 if grep 'xyzzy' conftest.s >/dev/null &&
1260 grep 'abccb' conftest.s >/dev/null; then
1261 libc_cv_broken_alias_attribute=no
1264 rm -f conftest.c conftest.s
1266 if test $libc_cv_broken_alias_attribute = yes; then
1267 AC_MSG_ERROR(working alias attribute support required)
1270 if test $libc_cv_visibility_attribute = yes; then
1271 AC_CACHE_CHECK(whether to put _rtld_local into .sdata section,
1272 libc_cv_have_sdata_section,
1273 [echo "int i;" > conftest.c
1274 libc_cv_have_sdata_section=no
1275 if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
1276 | grep '\.sdata' >/dev/null; then
1277 libc_cv_have_sdata_section=yes
1279 rm -f conftest.c conftest.so
1281 if test $libc_cv_have_sdata_section = yes; then
1282 AC_DEFINE(HAVE_SDATA_SECTION)
1286 AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
1287 libc_cv_initfini_array, [dnl
1288 LIBC_TRY_LINK_STATIC([
1289 int foo (void) { return 1; }
1290 int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
1292 [if $READELF -S conftest | fgrep INIT_ARRAY > /dev/null; then
1293 libc_cv_initfini_array=yes
1295 libc_cv_initfini_array=no
1297 [libc_cv_initfini_array=no])
1299 if test $libc_cv_initfini_array != yes; then
1300 AC_MSG_ERROR([Need linker with .init_array/.fini_array support.])
1303 AC_CACHE_CHECK(whether to use .ctors/.dtors header and trailer,
1304 libc_cv_ctors_header, [dnl
1305 libc_cv_ctors_header=yes
1306 LIBC_TRY_LINK_STATIC([
1307 __attribute__ ((constructor)) void ctor (void) { asm (""); }
1308 __attribute__ ((destructor)) void dtor (void) { asm (""); }
1311 AS_IF([$READELF -WS conftest$ac_exeext | $AWK '
1312 { gsub(/\@<:@ */, "@<:@") }
1313 $2 == ".ctors" || $2 == ".dtors" {
1314 size = strtonum("0x" $6)
1315 align = strtonum("0x" $NF)
1317 stub@<:@$2@:>@ = size == align * 2
1320 ctors_ok = !seen@<:@".ctors"@:>@ || stub@<:@".ctors"@:>@
1321 dtors_ok = !seen@<:@".dtors"@:>@ || stub@<:@".dtors"@:>@
1322 exit ((ctors_ok && dtors_ok) ? 0 : 1)
1324 '], [libc_cv_ctors_header=no])
1326 AC_MSG_ERROR([missing __attribute__ ((constructor)) support??])
1329 if test $libc_cv_ctors_header = no; then
1330 AC_DEFINE(NO_CTORS_DTORS_SECTIONS)
1333 AC_CACHE_CHECK(for libunwind-support in compiler,
1334 libc_cv_cc_with_libunwind, [
1335 cat > conftest.c <<EOF
1336 int main (void) { return 0; }
1338 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
1339 conftest.c -v 2>&1 >/dev/null | grep ' -lunwind ' >/dev/null; then
1340 libc_cv_cc_with_libunwind=yes
1342 libc_cv_cc_with_libunwind=no
1345 AC_SUBST(libc_cv_cc_with_libunwind)
1346 if test $libc_cv_cc_with_libunwind = yes; then
1347 AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
1350 LIBC_LINKER_FEATURE([-z nodelete], [-Wl,--enable-new-dtags,-z,nodelete],
1351 [libc_cv_z_nodelete=yes],
1352 [AC_MSG_ERROR(linker with -z nodelete support required)])
1354 LIBC_LINKER_FEATURE([-z nodlopen], [-Wl,--enable-new-dtags,-z,nodlopen],
1355 [libc_cv_z_nodlopen=yes],
1356 [AC_MSG_ERROR(linker with -z nodlopen support required)])
1358 LIBC_LINKER_FEATURE([-z initfirst], [-Wl,--enable-new-dtags,-z,initfirst],
1359 [libc_cv_z_initfirst=yes],
1360 [AC_MSG_ERROR(linker with -z initfirst support required)])
1362 # Add-on fragments can set these for other machines.
1363 libc_commonpagesize=${libc_commonpagesize:-no}
1364 libc_relro_required=${libc_relro_required:-no}
1365 case "$base_machine" in
1366 i[[34567]]86 | x86_64 | powerpc* | s390*)
1367 libc_commonpagesize=0x1000
1368 libc_relro_required=yes
1371 libc_commonpagesize=0x2000
1372 libc_relro_required=yes
1376 if test $libc_commonpagesize != no; then
1377 AC_CACHE_CHECK(for -z relro option,
1378 libc_cv_z_relro, [dnl
1380 AC_LANG_CONFTEST([AC_LANG_SOURCE([[
1381 int _start (void) { return 42; }
1382 extern void _exit (int);
1383 /* Since these pointers are const, they should go in rodata.
1384 Since they refer to functions that have to be resolved by
1385 dynamic linking, they should instead go in RELRO data. */
1386 const void *const relro[] = { &_start, &_exit, 0 };
1387 /* GNU ld fails to produce RELRO data when it's very small and there is no
1388 normal writable data following it, or if only uninitialized (.bss) data
1389 follows it, or only very small writable data. */
1390 int data[0x10000] = { 1, };
1392 cat > conftest.awk <<\EOF
1395 commonpagesize = strtonum(commonpagesize)
1397 { print "LINE:", $0 > "/dev/stderr" }
1399 vaddr = strtonum($3)
1400 memsz = strtonum($6)
1402 printf "vaddr %#x memsz %#x end %#x commonpagesize %#x\n", \
1403 vaddr, memsz, end, commonpagesize > "/dev/stderr"
1404 result = (end % commonpagesize == 0) ? "yes" : "broken"
1406 END { print result }
1408 AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1409 -fPIC -shared -o conftest.so conftest.c
1410 -nostartfiles -nostdlib
1411 -Wl,-z,relro 1>&AS_MESSAGE_LOG_FD]) &&
1412 AC_TRY_COMMAND([$READELF -Wl conftest.so > conftest.ph]) &&
1414 $AWK -v commonpagesize=$libc_commonpagesize -f conftest.awk
1415 conftest.ph > conftest.cps
1417 libc_cv_z_relro=`cat conftest.cps 2>&AS_MESSAGE_LOG_FD`
1419 if { test "x$libc_relro_required" = xyes &&
1420 test "x$libc_cv_z_relro" != xyes
1423 AC_MSG_ERROR(linker with -z relro support required)
1426 AC_MSG_WARN([missing architecture parameter to check for working -z relro])
1429 AC_CACHE_CHECK(for -Bgroup option,
1430 libc_cv_Bgroup, [dnl
1431 cat > conftest.c <<EOF
1432 int _start (void) { return 42; }
1434 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1435 -fPIC -shared -o conftest.so conftest.c
1436 -Wl,-Bgroup -nostdlib 1>&AS_MESSAGE_LOG_FD])
1443 AC_SUBST(libc_cv_Bgroup)
1446 AC_CACHE_CHECK(whether --noexecstack is desirable for .S files,
1447 libc_cv_as_noexecstack, [dnl
1448 cat > conftest.c <<EOF
1451 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS
1452 -S -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD]) \
1453 && grep .note.GNU-stack conftest.s >/dev/null \
1454 && AC_TRY_COMMAND([${CC-cc} $ASFLAGS -Wa,--noexecstack
1455 -c -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD])
1457 libc_cv_as_noexecstack=yes
1459 libc_cv_as_noexecstack=no
1462 if test $libc_cv_as_noexecstack = yes; then
1463 ASFLAGS_config="$ASFLAGS_config -Wa,--noexecstack"
1465 AC_SUBST(ASFLAGS_config)
1467 AC_CACHE_CHECK(for -z combreloc,
1468 libc_cv_z_combreloc, [dnl
1469 cat > conftest.c <<EOF
1470 extern int bar (int);
1472 int foo (void) { return bar (mumble); }
1474 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1475 -fPIC -shared -o conftest.so conftest.c
1476 -nostdlib -nostartfiles
1477 -Wl,-z,combreloc 1>&AS_MESSAGE_LOG_FD])
1479 dnl The following test is a bit weak. We must use a tool which can test
1480 dnl cross-platform since the gcc used can be a cross compiler. Without
1481 dnl introducing new options this is not easily doable. Instead use a tool
1482 dnl which always is cross-platform: readelf. To detect whether -z combreloc
1483 dnl look for a section named .rel.dyn.
1484 if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
1485 libc_cv_z_combreloc=yes
1487 libc_cv_z_combreloc=no
1490 libc_cv_z_combreloc=no
1493 if test "$libc_cv_z_combreloc" = yes; then
1494 AC_DEFINE(HAVE_Z_COMBRELOC)
1496 AC_SUBST(libc_cv_z_combreloc)
1498 LIBC_LINKER_FEATURE([-z execstack], [-Wl,-z,execstack],
1499 [libc_cv_z_execstack=yes], [libc_cv_z_execstack=no])
1500 AC_SUBST(libc_cv_z_execstack)
1502 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
1503 LIBC_TRY_CC_OPTION([-fpie], [libc_cv_fpie=yes], [libc_cv_fpie=no])
1506 AC_SUBST(libc_cv_fpie)
1508 AC_CACHE_CHECK(for --hash-style option,
1509 libc_cv_hashstyle, [dnl
1510 cat > conftest.c <<EOF
1511 int _start (void) { return 42; }
1513 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1514 -fPIC -shared -o conftest.so conftest.c
1515 -Wl,--hash-style=both -nostdlib 1>&AS_MESSAGE_LOG_FD])
1517 libc_cv_hashstyle=yes
1519 libc_cv_hashstyle=no
1522 AC_SUBST(libc_cv_hashstyle)
1524 # The linker's default -shared behavior is good enough if it
1525 # does these things that our custom linker scripts ensure that
1526 # all allocated NOTE sections come first.
1527 if test "$use_default_link" = default; then
1528 AC_CACHE_CHECK([for sufficient default -shared layout],
1529 libc_cv_use_default_link, [dnl
1530 libc_cv_use_default_link=no
1531 cat > conftest.s <<\EOF
1532 .section .note.a,"a",%note
1537 .section .note.b,"a",%note
1543 if AC_TRY_COMMAND([dnl
1544 ${CC-cc} $ASFLAGS -shared -o conftest.so conftest.s 1>&AS_MESSAGE_LOG_FD]) &&
1545 ac_try=`$READELF -S conftest.so | sed -n \
1547 s/^ *\[ *[1-9][0-9]*\] *\([^ ][^ ]*\) *\([^ ][^ ]*\) .*$/\2 \1/
1553 libc_seen_a=no libc_seen_b=no
1555 while test $# -ge 2 -a "$1" = NOTE; do
1557 .note.a) libc_seen_a=yes ;;
1558 .note.b) libc_seen_b=yes ;;
1562 case "$libc_seen_a$libc_seen_b" in
1564 libc_cv_use_default_link=yes
1567 echo >&AS_MESSAGE_LOG_FD "\
1568 $libc_seen_a$libc_seen_b from:
1574 use_default_link=$libc_cv_use_default_link
1577 AC_CACHE_CHECK(linker output format, libc_cv_output_format, [dnl
1578 if libc_cv_output_format=`
1579 ${CC-cc} -nostartfiles -nostdlib -Wl,--print-output-format 2>&AS_MESSAGE_LOG_FD`
1583 libc_cv_output_format=
1585 test -n "$libc_cv_output_format" || libc_cv_output_format=unknown])
1586 AC_SUBST(libc_cv_output_format)
1588 AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl
1589 cat > conftest.c <<EOF
1592 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder -fno-section-anchors
1593 conftest.c 1>&AS_MESSAGE_LOG_FD])
1595 libc_cv_fno_toplevel_reorder=yes
1597 libc_cv_fno_toplevel_reorder=no
1600 if test $libc_cv_fno_toplevel_reorder = yes; then
1601 fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors"
1603 fno_unit_at_a_time=-fno-unit-at-a-time
1605 AC_SUBST(fno_unit_at_a_time)
1607 AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
1608 LIBC_TRY_CC_OPTION([$CFLAGS $CPPFLAGS -Werror -fstack-protector],
1612 AC_SUBST(libc_cv_ssp)
1614 AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
1615 cat > conftest.c <<EOF
1617 #ifdef __GNUC_GNU_INLINE__
1618 main () { return 0;}
1623 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -std=gnu99 -fgnu89-inline
1624 -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD])
1626 libc_cv_gnu89_inline=yes
1628 libc_cv_gnu89_inline=no
1631 if test $libc_cv_gnu89_inline = yes; then
1632 gnu89_inline=-fgnu89-inline
1636 AC_SUBST(gnu89_inline)
1638 AC_CACHE_CHECK(whether cc puts quotes around section names,
1639 libc_cv_have_section_quotes,
1640 [cat > conftest.c <<EOF
1641 static const int foo
1642 __attribute__ ((section ("bar"))) = 1;
1644 if ${CC-cc} -S conftest.c -o conftest.s; then
1645 if grep '\.section.*"bar"' conftest.s >/dev/null; then
1646 libc_cv_have_section_quotes=yes
1648 libc_cv_have_section_quotes=no
1651 libc_cv_have_section_quotes=unknown
1653 rm -f conftest.{c,s}
1655 if test $libc_cv_have_section_quotes = yes; then
1656 AC_DEFINE(HAVE_SECTION_QUOTES)
1659 AC_CACHE_CHECK(for assembler .weak directive, libc_cv_asm_weak_directive,
1661 cat > conftest.s <<EOF
1666 .weak bar; bar = foo
1668 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1669 libc_cv_asm_weak_directive=yes
1671 libc_cv_asm_weak_directive=no
1675 if test $libc_cv_asm_weak_directive = no; then
1676 AC_CACHE_CHECK(for assembler .weakext directive,
1677 libc_cv_asm_weakext_directive,
1679 cat > conftest.s <<EOF
1688 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1689 libc_cv_asm_weakext_directive=yes
1691 libc_cv_asm_weakext_directive=no
1697 if test $libc_cv_asm_weak_directive = yes; then
1698 AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
1699 elif test $libc_cv_asm_weakext_directive = yes; then
1700 AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)
1703 AC_CACHE_CHECK(whether CFI directives are supported, libc_cv_asm_cfi_directives, [dnl
1705 sparc/sparc64*) cfi_offset=2047;;
1708 cat > conftest.s <<EOF
1710 .type func,%function
1714 .cfi_rel_offset 1, $cfi_offset
1717 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
1718 libc_cv_asm_cfi_directives=yes
1720 libc_cv_asm_cfi_directives=no
1723 if test $libc_cv_asm_cfi_directives = yes; then
1724 AC_DEFINE(HAVE_ASM_CFI_DIRECTIVES)
1727 AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
1728 cat > conftest.c <<\EOF
1733 dnl No \ in command here because it ends up inside ''.
1734 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1735 -nostdlib -nostartfiles -Wl,--no-whole-archive
1736 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1737 libc_cv_ld_no_whole_archive=yes
1739 libc_cv_ld_no_whole_archive=no
1742 if test $libc_cv_ld_no_whole_archive = no; then
1743 AC_MSG_ERROR([support for --no-whole-archive is needed])
1746 AC_CACHE_CHECK(for gcc -fexceptions, libc_cv_gcc_exceptions, [dnl
1747 cat > conftest.c <<\EOF
1752 dnl No \ in command here because it ends up inside ''.
1753 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1754 -nostdlib -nostartfiles -fexceptions
1755 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
1756 libc_cv_gcc_exceptions=yes
1758 libc_cv_gcc_exceptions=no
1761 if test $libc_cv_gcc_exceptions = yes; then
1762 exceptions=-fexceptions
1764 AC_SUBST(exceptions)dnl
1766 AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
1767 cat > conftest.c <<\EOF
1770 __builtin_memset (x, 0, 1000);
1774 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null]);
1776 libc_cv_gcc_builtin_memset=no
1778 libc_cv_gcc_builtin_memset=yes
1781 if test "$libc_cv_gcc_builtin_memset" = yes ; then
1782 AC_DEFINE(HAVE_BUILTIN_MEMSET)
1785 AC_CACHE_CHECK(for redirection of built-in functions, libc_cv_gcc_builtin_redirection, [dnl
1786 cat > conftest.c <<\EOF
1787 extern char *strstr (const char *, const char *) __asm ("my_strstr");
1788 char *foo (const char *a, const char *b)
1790 return __builtin_strstr (a, b);
1794 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "my_strstr" > /dev/null]);
1796 libc_cv_gcc_builtin_redirection=yes
1798 libc_cv_gcc_builtin_redirection=no
1801 if test "$libc_cv_gcc_builtin_redirection" = no; then
1802 AC_MSG_ERROR([support for the symbol redirection needed])
1805 dnl Check whether the compiler supports the __thread keyword.
1806 AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
1807 [cat > conftest.c <<\EOF
1808 __thread int a = 42;
1810 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
1811 libc_cv_gcc___thread=yes
1813 libc_cv_gcc___thread=no
1816 if test "$libc_cv_gcc___thread" = no; then
1817 AC_MSG_ERROR([support for the __thread keyword is required])
1820 dnl Check whether the compiler supports the tls_model attribute.
1821 AC_CACHE_CHECK([for tls_model attribute], libc_cv_gcc_tls_model_attr, [dnl
1822 cat > conftest.c <<\EOF
1823 extern __thread int a __attribute__((tls_model ("initial-exec")));
1825 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&AS_MESSAGE_LOG_FD]); then
1826 libc_cv_gcc_tls_model_attr=yes
1828 libc_cv_gcc_tls_model_attr=no
1831 if test "$libc_cv_gcc_tls_model_attr" = no; then
1832 AC_MSG_ERROR([support for the tls_model attribute is required])
1835 dnl Determine how to disable generation of FMA instructions.
1836 AC_CACHE_CHECK([for compiler option to disable generation of FMA instructions],
1837 libc_cv_cc_nofma, [dnl
1839 for opt in -ffp-contract=off -mno-fused-madd; do
1840 LIBC_TRY_CC_OPTION([$opt], [libc_cv_cc_nofma=$opt; break])
1842 AC_SUBST(libc_cv_cc_nofma)
1844 if test -n "$submachine"; then
1845 AC_CACHE_CHECK([for compiler option for CPU variant],
1846 libc_cv_cc_submachine, [dnl
1847 libc_cv_cc_submachine=no
1848 for opt in "-march=$submachine" "-mcpu=$submachine"; do
1849 LIBC_TRY_CC_OPTION([$opt], [
1850 libc_cv_cc_submachine="$opt"
1853 if test "x$libc_cv_cc_submachine" = xno; then
1854 AC_MSG_ERROR([${CC-cc} does not support $submachine])
1857 AC_SUBST(libc_cv_cc_submachine)
1859 AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \
1860 __attribute__ ((__optimize__)), libc_cv_cc_loop_to_function, [dnl
1861 cat > conftest.c <<EOF
1863 __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
1866 libc_cv_cc_loop_to_function=no
1867 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c])
1869 libc_cv_cc_loop_to_function=yes
1872 if test $libc_cv_cc_loop_to_function = yes; then
1873 AC_DEFINE(HAVE_CC_INHIBIT_LOOP_TO_LIBCALL)
1875 AC_SUBST(libc_cv_cc_loop_to_function)
1877 dnl Check whether we have the gd library available.
1878 AC_MSG_CHECKING(for libgd)
1879 if test "$with_gd" != "no"; then
1880 old_CFLAGS="$CFLAGS"
1881 CFLAGS="$CFLAGS $libgd_include"
1882 old_LDFLAGS="$LDFLAGS"
1883 LDFLAGS="$LDFLAGS $libgd_ldflags"
1885 LIBS="$LIBS -lgd -lpng -lz -lm"
1886 AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
1887 CFLAGS="$old_CFLAGS"
1888 LDFLAGS="$old_LDFLAGS"
1893 AC_MSG_RESULT($LIBGD)
1897 if test x$with_selinux = xno ; then
1900 # See if we have the SELinux library
1901 AC_CHECK_LIB(selinux, is_selinux_enabled,
1902 have_selinux=yes, have_selinux=no)
1903 if test x$with_selinux = xyes ; then
1904 if test x$have_selinux = xno ; then
1905 AC_MSG_ERROR([SELinux explicitly required, but SELinux library not found])
1909 # Check if we're building with SELinux support.
1910 if test "x$have_selinux" = xyes; then
1911 AC_DEFINE(HAVE_SELINUX, 1, [SELinux support])
1913 # See if we have the libaudit library
1914 AC_CHECK_LIB(audit, audit_log_user_avc_message,
1915 have_libaudit=yes, have_libaudit=no)
1916 if test "x$have_libaudit" = xyes; then
1917 AC_DEFINE(HAVE_LIBAUDIT, 1, [SELinux libaudit support])
1919 AC_SUBST(have_libaudit)
1921 # See if we have the libcap library
1922 AC_CHECK_LIB(cap, cap_init, have_libcap=yes, have_libcap=no)
1923 if test "x$have_libcap" = xyes; then
1924 AC_DEFINE(HAVE_LIBCAP, 1, [SELinux libcap support])
1926 AC_SUBST(have_libcap)
1928 AC_SUBST(have_selinux)
1930 dnl check for the size of 'long double'.
1931 AC_CHECK_SIZEOF(long double, 0)
1932 sizeof_long_double=$ac_cv_sizeof_long_double
1933 AC_SUBST(sizeof_long_double)
1936 dnl Check for silly hacked compilers predefining _FORTIFY_SOURCE.
1937 dnl Since we are building the implementations of the fortified functions here,
1938 dnl having the macro defined interacts very badly.
1939 AC_CACHE_CHECK([for _FORTIFY_SOURCE predefine], libc_cv_predef_fortify_source,
1940 [AC_TRY_COMPILE([], [
1941 #ifdef _FORTIFY_SOURCE
1944 [libc_cv_predef_fortify_source=no],
1945 [libc_cv_predef_fortify_source=yes])])
1946 if test $libc_cv_predef_fortify_source = yes; then
1947 CPPUNDEFS="${CPPUNDEFS:+$CPPUNDEFS }-U_FORTIFY_SOURCE"
1951 dnl Check for silly hacked compilers inserting -fstack-protector.
1952 dnl This breaks badly for the early startup code we compile, since
1953 dnl the compiled code can refer to a magic machine-dependent location
1954 dnl for the canary value before we have sufficient setup for that to
1955 dnl work. It's also questionable to build all of libc with this flag
1956 dnl even when you're doing that for most applications you build, since
1957 dnl libc's code is so heavily-used and performance-sensitive. If we
1958 dnl ever really want to make that work, it should be enabled explicitly
1959 dnl in the libc build, not inherited from implicit compiler settings.
1960 AC_CACHE_CHECK([whether $CC implicitly enables -fstack-protector],
1961 libc_cv_predef_stack_protector, [
1962 AC_TRY_COMPILE([extern void foobar (char *);],
1963 [char large_array[2048]; foobar (large_array);], [
1964 libc_undefs=`$NM -u conftest.o |
1965 LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
1966 2>&AS_MESSAGE_LOG_FD` || {
1967 AC_MSG_ERROR([confusing output from $NM -u])
1969 echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
1970 # On some architectures, there are architecture-specific undefined
1971 # symbols (resolved by the linker), so filter out unknown symbols.
1972 # This will fail to produce the correct result if the compiler
1973 # defaults to -fstack-protector but this produces an undefined symbol
1974 # other than __stack_chk_fail. However, compilers like that have not
1975 # been encountered in practice.
1976 libc_undefs=`echo "$libc_undefs" | egrep '^(foobar|__stack_chk_fail)$'`
1977 case "$libc_undefs" in
1978 foobar) libc_cv_predef_stack_protector=no ;;
1980 foobar') libc_cv_predef_stack_protector=yes ;;
1981 *) AC_MSG_ERROR([unexpected symbols in test: $libc_undefs]) ;;
1983 [AC_MSG_ERROR([test compilation failed])])
1986 if test $libc_cv_predef_stack_protector = yes; then
1987 libc_extra_cflags="$libc_extra_cflags -fno-stack-protector"
1989 libc_extra_cppflags=
1991 AC_CACHE_CHECK([whether the linker provides __ehdr_start],
1992 libc_cv_ehdr_start, [
1993 old_CFLAGS="$CFLAGS"
1994 old_LDFLAGS="$LDFLAGS"
1996 CFLAGS="$CFLAGS -fPIC"
1997 LDFLAGS="$LDFLAGS -nostdlib -nostartfiles -shared"
1999 AC_LINK_IFELSE([AC_LANG_SOURCE([
2000 extern const char __ehdr_start __attribute__ ((visibility ("hidden")));
2001 const char *ehdr (void) { return &__ehdr_start; }
2003 [libc_cv_ehdr_start=yes], [libc_cv_ehdr_start=no])
2004 CFLAGS="$old_CFLAGS"
2005 LDFLAGS="$old_LDFLAGS"
2008 if test $libc_cv_ehdr_start = yes; then
2009 AC_DEFINE([HAVE_EHDR_START])
2012 ### End of automated tests.
2013 ### Now run sysdeps configure fragments.
2015 # They also can set these variables.
2017 ldd_rewrite_script=no
2018 libc_cv_sysconfdir=$sysconfdir
2019 libc_cv_localstatedir=$localstatedir
2020 libc_cv_gcc_unwind_find_fde=no
2023 # Iterate over all the sysdep directories we will use, running their
2024 # configure fragments.
2025 for dir in $sysnames; do
2028 *) dest=$srcdir/$dir ;;
2030 if test -r $dest/configure; then
2031 AC_MSG_RESULT(running configure fragment for $dir)
2036 AC_SUBST(libc_extra_cflags)
2037 AC_SUBST(libc_extra_cppflags)
2039 if test x$libc_cv_gcc_unwind_find_fde = xyes; then
2040 AC_DEFINE(EXPORT_UNWIND_FIND_FDE)
2042 AC_SUBST(libc_cv_gcc_unwind_find_fde)
2044 # A sysdeps configure fragment can reset this if IFUNC is not actually
2045 # usable even though the assembler knows how to generate the symbol type.
2046 if test x"$libc_cv_ld_gnu_indirect_function" = xyes; then
2047 AC_DEFINE(HAVE_IFUNC)
2050 # This is far from the AC_ARG_ENABLE that sets it so that a sysdeps
2051 # configure fragment can override the value to prevent this AC_DEFINE.
2053 if test "x$use_nscd" != xno; then
2054 AC_DEFINE([USE_NSCD])
2056 if test "x$build_nscd" = xdefault; then
2057 build_nscd=$use_nscd
2060 # Test for old glibc 2.0.x headers so that they can be removed properly
2061 # Search only in includedir.
2062 AC_MSG_CHECKING(for old glibc 2.0.x headers)
2063 if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
2065 old_glibc_headers=yes
2067 old_glibc_headers=no
2069 AC_MSG_RESULT($old_glibc_headers)
2070 if test ${old_glibc_headers} = yes; then
2071 AC_MSG_WARN(*** During \"make install\" old headers from glibc 2.0.x will)
2072 AC_MSG_WARN(*** be removed.)
2074 AC_SUBST(old_glibc_headers)
2076 AC_SUBST(libc_cv_slibdir)
2077 AC_SUBST(libc_cv_rtlddir)
2078 AC_SUBST(libc_cv_localedir)
2079 AC_SUBST(libc_cv_sysconfdir)
2080 AC_SUBST(libc_cv_localstatedir)
2081 AC_SUBST(libc_cv_rootsbindir)
2082 AC_SUBST(libc_cv_forced_unwind)
2084 if test x$use_ldconfig = xyes; then
2085 AC_DEFINE(USE_LDCONFIG)
2087 AC_SUBST(use_ldconfig)
2088 AC_SUBST(ldd_rewrite_script)
2093 AC_CACHE_CHECK([whether -fPIC is default], libc_cv_pic_default,
2094 [libc_cv_pic_default=yes
2095 cat > conftest.c <<EOF
2096 #if defined __PIC__ || defined __pic__ || defined PIC || defined pic
2097 # error PIC is default.
2100 if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
2101 libc_cv_pic_default=no
2104 AC_SUBST(libc_cv_pic_default)
2107 AC_SUBST(static_nss)
2111 dnl See sysdeps/mach/configure.ac for this variable.
2112 AC_SUBST(mach_interface_list)
2114 VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
2115 RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
2119 AC_CONFIG_FILES([config.make Makefile])
2120 AC_CONFIG_COMMANDS([default],[[
2121 case $CONFIG_FILES in *config.make*)
2122 echo "$config_vars" >> config.make;;
2124 test -d bits || mkdir bits]],[[config_vars='$config_vars']])