Bug fixes for ____longjmp_chk on sparc.
[glibc.git] / configure.in
blob65ace27b76a18bd78c65b39084db45c56cc125fb
1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION([$CVSid$])
3 AC_PREREQ(2.53)dnl              dnl Minimum Autoconf version required.
4 AC_INIT([GNU C Library], [(see version.h)], [glibc])
5 AC_CONFIG_SRCDIR([include/features.h])
6 AC_CONFIG_HEADERS([config.h])
7 AC_CONFIG_AUX_DIR([scripts])
9 dnl This is here so we can set $subdirs directly based on configure fragments.
10 AC_CONFIG_SUBDIRS()
12 AC_CANONICAL_HOST
14 AC_PROG_CC
15 if test $host != $build; then
16   AC_CHECK_PROGS(BUILD_CC, gcc cc)
18 AC_SUBST(cross_compiling)
19 AC_PROG_CPP
20 # We need the C++ compiler only for testing.
21 AC_PROG_CXX
23 if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
24   AC_MSG_ERROR([you must configure in a separate build directory])
27 # This will get text that should go into config.make.
28 config_vars=
30 # Check for a --with-gd argument and set libgd-LDFLAGS in config.make.
31 AC_ARG_WITH([gd],
32             AC_HELP_STRING([--with-gd=DIR],
33                            [find libgd include dir and library with prefix DIR]),
34             [dnl
35 case "$with_gd" in
36 yes|''|no) ;;
37 *) libgd_include="-I$withval/include"
38    libgd_ldflags="-L$withval/lib" ;;
39 esac
41 AC_ARG_WITH([gd-include],
42             AC_HELP_STRING([--with-gd-include=DIR],
43                            [find libgd include files in DIR]),
44             [dnl
45 case "$with_gd_include" in
46 ''|no) ;;
47 *) libgd_include="-I$withval" ;;
48 esac
50 AC_ARG_WITH([gd-lib],
51             AC_HELP_STRING([--with-gd-lib=DIR],
52                            [find libgd library files in DIR]),
53             [dnl
54 case "$with_gd_lib" in
55 ''|no) ;;
56 *) libgd_ldflags="-L$withval" ;;
57 esac
60 if test -n "$libgd_include"; then
61   config_vars="$config_vars
62 CFLAGS-memusagestat.c = $libgd_include"
64 if test -n "$libgd_ldflags"; then
65   config_vars="$config_vars
66 libgd-LDFLAGS = $libgd_ldflags"
69 dnl Arguments to specify presence of other packages/features.
70 AC_ARG_WITH([fp],
71             AC_HELP_STRING([--with-fp],
72                            [if using floating-point hardware @<:@default=yes@:>@]),
73             [with_fp=$withval],
74             [with_fp=yes])
75 AC_SUBST(with_fp)
76 AC_ARG_WITH([binutils],
77             AC_HELP_STRING([--with-binutils=PATH],
78                            [specify location of binutils (as and ld)]),
79             [path_binutils=$withval],
80             [path_binutils=''])
81 AC_ARG_WITH([elf],
82             AC_HELP_STRING([--with-elf],
83                            [if using the ELF object format]),
84             [elf=$withval],
85             [elf=no])
86 AC_ARG_WITH([selinux],
87             AC_HELP_STRING([--with-selinux],
88                            [if building with SELinux support]),
89             [with_selinux=$withval],
90             [with_selinux=auto])
91 AC_ARG_WITH([xcoff],
92             AC_HELP_STRING([--with-xcoff],
93                            [if using the XCOFF object format]),
94             [xcoff=$withval],
95             [xcoff=no])
96 AC_ARG_WITH([cvs],
97             AC_HELP_STRING([--without-cvs],
98                            [if CVS should not be used]),
99             [with_cvs=$withval],
100             [with_cvs=yes])
101 if test "$with_cvs" = yes; then
102   if test -d $srcdir/CVS && grep :pserver: $srcdir/CVS/Root > /dev/null
103   then
104     with_cvs=no
105   fi
107 AC_SUBST(with_cvs)
109 AC_ARG_WITH([headers],
110             AC_HELP_STRING([--with-headers=PATH],
111                            [location of system headers to use
112                             (for example /usr/src/linux/include)
113                             @<:@default=compiler default@:>@]),
114             [sysheaders=$withval],
115             [sysheaders=''])
117 AC_SUBST(use_default_link)
118 AC_ARG_WITH([default-link],
119             AC_HELP_STRING([--with-default-link],
120                            [do not use explicit linker scripts]),
121             [use_default_link=$withval],
122             [use_default_link=default])
124 AC_ARG_ENABLE([sanity-checks],
125               AC_HELP_STRING([--disable-sanity-checks],
126                              [really do not use threads (should not be used except in special situations) @<:@default=yes@:>@]),
127               [enable_sanity=$enableval],
128               [enable_sanity=yes])
130 AC_SUBST(enable_check_abi)
131 AC_ARG_ENABLE([check-abi],
132               AC_HELP_STRING([--enable-check-abi],
133                              [do "make check-abi" in "make check" (no/warn/yes)
134                               @<:@default=no@:>@]),
135               [enable_check_abi=$enableval],
136               [enable_check_abi=no])
138 dnl Arguments to enable or disable building the static, shared, profiled,
139 dnl and -fomit-frame-pointer libraries.
140 dnl I've disabled this for now since we cannot build glibc without static
141 dnl libraries built in the moment.
142 dnl AC_ARG_ENABLE([static],
143 dnl               AC_HELP_STRING([--enable-static],
144 dnl                              [build static library @<:@default=yes@:>@]),
145 dnl               [static=$enableval],
146 dnl               [static=yes])
147 static=yes
148 AC_ARG_ENABLE([shared],
149               AC_HELP_STRING([--enable-shared],
150                              [build shared library @<:@default=yes if GNU ld & ELF@:>@]),
151               [shared=$enableval],
152               [shared=default])
153 AC_ARG_ENABLE([profile],
154               AC_HELP_STRING([--enable-profile],
155                              [build profiled library @<:@default=no@:>@]),
156               [profile=$enableval],
157               [profile=no])
158 AC_ARG_ENABLE([omitfp],
159               AC_HELP_STRING([--enable-omitfp],
160                              [build undebuggable optimized library @<:@default=no@:>@]),
161               [omitfp=$enableval],
162               [omitfp=no])
163 AC_ARG_ENABLE([bounded],
164               AC_HELP_STRING([--enable-bounded],
165                              [build with runtime bounds checking @<:@default=no@:>@]),
166               [bounded=$enableval],
167               [bounded=no])
168 AC_ARG_ENABLE([versioning],
169               AC_HELP_STRING([--disable-versioning],
170                              [do not include versioning information in the library objects @<:@default=yes if supported@:>@]),
171               [enable_versioning=$enableval],
172               [enable_versioning=yes])
174 AC_ARG_ENABLE([oldest-abi],
175               AC_HELP_STRING([--enable-oldest-abi=ABI],
176                              [configure the oldest ABI supported @<:@e.g. 2.2@:>@ @<:@default=glibc default@:>@]),
177               [oldest_abi=$enableval],
178               [oldest_abi=no])
179 if test "$oldest_abi" = yes || test "$oldest_abi" = no; then
180   oldest_abi=default
181 else
182   AC_DEFINE_UNQUOTED(GLIBC_OLDEST_ABI, "$oldest_abi")
184 AC_SUBST(oldest_abi)
186 AC_ARG_ENABLE([stackguard-randomization],
187               AC_HELP_STRING([--enable-stackguard-randomization],
188                              [initialize __stack_chk_guard canary with a random number at program start]),
189               [enable_stackguard_randomize=$enableval],
190               [enable_stackguard_randomize=no])
191 if test "$enable_stackguard_randomize" = yes; then
192   AC_DEFINE(ENABLE_STACKGUARD_RANDOMIZE)
195 dnl Generic infrastructure for drop-in additions to libc.
196 AC_ARG_ENABLE([add-ons],
197               AC_HELP_STRING([--enable-add-ons@<:@=DIRS...@:>@],
198                              [configure and build add-ons in DIR1,DIR2,...
199                               search for add-ons if no parameter given]),
200                              , [enable_add_ons=yes])
202 dnl Let the user avoid using TLS.  Don't know why but...
203 AC_ARG_WITH([tls],
204             AC_HELP_STRING([--with-tls],
205                            [enable support for TLS]),
206             [usetls=$withval],
207             [usetls=yes])
209 AC_ARG_WITH([__thread],
210             AC_HELP_STRING([--without-__thread],
211                            [do not use TLS features even when supporting them]),
212             [use__thread=$withval],
213             [use__thread=yes])
215 AC_ARG_ENABLE([hidden-plt],
216               AC_HELP_STRING([--disable-hidden-plt],
217                              [do not hide internal function calls to avoid PLT]),
218               [hidden=$enableval],
219               [hidden=yes])
220 if test "x$hidden" = xno; then
221   AC_DEFINE(NO_HIDDEN)
224 AC_ARG_ENABLE([bind-now],
225               AC_HELP_STRING([--enable-bind-now],
226                              [disable lazy relocations in DSOs]),
227               [bindnow=$enableval],
228               [bindnow=no])
229 AC_SUBST(bindnow)
231 dnl On some platforms we cannot use dynamic loading.  We must provide
232 dnl static NSS modules.
233 AC_ARG_ENABLE([static-nss],
234               AC_HELP_STRING([--enable-static-nss],
235                              [build static NSS modules @<:@default=no@:>@]),
236               [static_nss=$enableval],
237               [static_nss=no])
238 dnl Enable static NSS also if we build no shared objects.
239 if test x"$static_nss" = xyes || test x"$shared" = xno; then
240   static_nss=yes
241   AC_DEFINE(DO_STATIC_NSS)
244 AC_ARG_ENABLE([force-install],
245               AC_HELP_STRING([--disable-force-install],
246                              [don't force installation of files from this package, even if they are older than the installed files]),
247               [force_install=$enableval],
248               [force_install=yes])
249 AC_SUBST(force_install)
251 dnl On some platforms we allow dropping compatibility with all kernel
252 dnl versions.
253 AC_ARG_ENABLE([kernel],
254               AC_HELP_STRING([--enable-kernel=VERSION],
255                              [compile for compatibility with kernel not older than VERSION]),
256               [minimum_kernel=$enableval],
257               [])
258 dnl Prevent unreasonable values.
259 if test "$minimum_kernel" = yes || test "$minimum_kernel" = no; then
260   # Better nothing than this.
261   minimum_kernel=""
262 else
263   if test "$minimum_kernel" = current; then
264     minimum_kernel=`uname -r 2>/dev/null` || minimum_kernel=
265   fi
268 dnl For the development we sometimes want gcc to issue even more warnings.
269 dnl This is not the default since many of the extra warnings are not
270 dnl appropriate.
271 AC_ARG_ENABLE([all-warnings],
272               AC_HELP_STRING([--enable-all-warnings],
273                              [enable all useful warnings gcc can issue]),
274               [all_warnings=$enableval],
275               [])
276 AC_SUBST(all_warnings)
278 AC_ARG_ENABLE([multi-arch],
279               AC_HELP_STRING([--enable-multi-arch],
280                              [enable single DSO with optimizations for multiple architectures]),
281               [multi_arch=$enableval],
282               [multi_arch=default])
284 AC_ARG_ENABLE([nss-crypt],
285               AC_HELP_STRING([--enable-nss-crypt],
286                              [enable libcrypt to use nss]),
287               [nss_crypt=$enableval],
288               [nss_crypt=no])
289 if test x$nss_crypt = xyes; then
290   nss_includes=-I$(nss-config --includedir 2>/dev/null)
291   if test $? -ne 0; then
292     AC_MSG_ERROR([cannot find include directory with nss-config])
293   fi
294   old_CFLAGS="$CFLAGS"
295   CFLAGS="$CFLAGS $nss_includes"
296   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
297 #include <hasht.h>
298 #include <nsslowhash.h>
299 void f (void) { NSSLOW_Init (); }])],
300              libc_cv_nss_crypt=yes,
301              AC_MSG_ERROR([
302 cannot find NSS headers with lowlevel hash function interfaces]))
303   old_LIBS="$LIBS"
304   LIBS="$LIBS -lfreebl3"
305   AC_LINK_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
306 #include <hasht.h>
307 #include <nsslowhash.h>],
308                                   [NSSLOW_Init();])],
309                  libc_cv_nss_crypt=yes,
310                  AC_MSG_ERROR([
311 cannot link program using lowlevel NSS hash functions]))
312   CFLAGS="$old_CFLAGS"
313   LIBS="$old_LIBS"
314 else
315   libc_cv_nss_crypt=no
317 AC_SUBST(libc_cv_nss_crypt)
319 # The way shlib-versions is used to generate soversions.mk uses a
320 # fairly simplistic model for name recognition that can't distinguish
321 # i486-pc-linux-gnu fully from i486-pc-gnu.  So we mutate a $host_os
322 # of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can
323 # tell.  This doesn't get used much beyond that, so it's fairly safe.
324 case "$host_os" in
325 linux*)
326   ;;
327 gnu*)
328   host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'`
329   ;;
330 esac
332 # We keep the original values in `$config_*' and never modify them, so we
333 # can write them unchanged into config.make.  Everything else uses
334 # $machine, $vendor, and $os, and changes them whenever convenient.
335 config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
337 # Don't allow vendor == "unknown"
338 test "$config_vendor" = unknown && config_vendor=
339 config_os="`echo $config_os | sed 's/^unknown-//'`"
341 # Some configurations imply other options.
342 case "$host_os" in
343 # i586-linuxaout is mangled into i586-pc-linux-gnuaout
344 linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*)
345   ;;
346 gnu* | linux* | freebsd* | netbsd* | sysv4* | solaris2* | irix6*)
347   # These systems (almost) always use the ELF format.
348   elf=yes
349   ;;
350 aix*)
351   # These systems are always xcoff
352   xcoff=yes
353   elf=no
354   ;;
355 esac
357 # The configure fragment of an add-on port can modify these to supplement
358 # or override the table in the case statement below.  No fragment should
359 # ever change the config_* variables, however.
360 machine=$config_machine
361 vendor=$config_vendor
362 os=$config_os
363 base_os=''
365 # config.guess on some IBM machines says `rs6000' instead of `powerpc'.
366 # Unify this here.
367 if test "$machine" = rs6000; then
368   machine="powerpc"
371 # Braindead PowerPC box with absolutely no FPU.
372 case "$machine-$host_os" in
373   powerpc*-*soft)
374     with_fp=no
375     ;;
376 esac
378 submachine=
379 AC_ARG_WITH([cpu],
380             AS_HELP_STRING([--with-cpu=CPU], [select code for CPU variant]),
381             [dnl
382   case "$withval" in
383   yes|'') AC_MSG_ERROR([--with-cpu requires an argument]) ;;
384   no) ;;
385   *) submachine="$withval" ;;
386   esac
389 # An add-on can set this when it wants to disable the sanity check below.
390 libc_config_ok=no
392 dnl Having this here, though empty, makes sure that if add-ons' fragments
393 dnl do AC_CONFIG_SUBDIRS([some-dir]), which just sets $subdirs, then
394 dnl our AC_OUTPUT will actually use it.
395 AC_CONFIG_SUBDIRS()
397 case "$enable_add_ons" in
398 ''|no) add_ons= ;;
399 yes|'*')
400  add_ons=`cd $srcdir && ls -d 2> /dev/null */configure */sysdeps |
401           sed 's@/[[^/]]*$@@' | sort | uniq`
402          add_ons_automatic=yes
403          ;;
404 *) add_ons=`echo "$enable_add_ons" | sed 's/,/ /g'`
405        add_ons_automatic=no ;;
406 esac
408 configured_add_ons=
409 add_ons_sfx=
410 add_ons_pfx=
411 if test x"$add_ons" != x; then
412   for f in $add_ons; do
413     # Some sanity checks
414     case "$f" in
415     crypt)
416       AC_MSG_ERROR([
417 *** It seems that you're using an old \`crypt' add-on.  crypt is now
418 *** part of glibc and using the old add-on will not work with this
419 *** release.  Start again with fresh sources and without the old
420 *** \`crypt' add-on.])
421     ;;
422     localedata)
423       AC_MSG_ERROR([
424 *** It seems that you're using an old \`localedata' add-on.  localedata
425 *** is now part of glibc and using the old add-on will not work with
426 *** this release.  Start again with fresh sources and without the old
427 *** \`localedata' add-on.])
428     ;;
429     esac
430   done
432   # Now source each add-on's configure fragment.
433   # The fragments can use $srcdir/$libc_add_on to find themselves,
434   # and test $add_ons_automatic to see if they were explicitly requested.
435   # A fragment can clear (or even change) $libc_add_on to affect
436   # whether it goes into the list to be actually used in the build.
437   use_add_ons=
438   for libc_add_on in $add_ons; do
439     # Test whether such a directory really exists.
440     # It can be absolute, or relative to $srcdir, or relative to the build dir.
441     case "$libc_add_on" in
442     /*)
443       libc_add_on_srcdir=$libc_add_on
444       ;;
445     *)
446       test -d "$srcdir/$libc_add_on" || {
447         if test -d "$libc_add_on"; then
448           libc_add_on="`pwd`/$libc_add_on"
449         else
450           AC_MSG_ERROR(add-on directory \"$libc_add_on\" does not exist)
451         fi
452       }
453       libc_add_on_srcdir=$srcdir/$libc_add_on
454       ;;
455     esac
457     libc_add_on_frag=$libc_add_on_srcdir/configure
458     libc_add_on_canonical=
459     libc_add_on_config_subdirs=
460     if test -r "$libc_add_on_frag"; then
461       AC_MSG_NOTICE(running configure fragment for add-on $libc_add_on)
462       libc_add_on_canonical=unknown
463       libc_add_on_subdirs=
464       . "$libc_add_on_frag"
465       test -z "$libc_add_on" || {
466         configured_add_ons="$configured_add_ons $libc_add_on"
467         if test "x$libc_add_on_canonical" = xunknown; then
468           AC_MSG_ERROR(fragment must set \$libc_add_on_canonical)
469         fi
470         for d in $libc_add_on_subdirs; do
471           case "$libc_add_on" in
472           /*) subdir_srcdir="$libc_add_on" ;;
473           *) subdir_srcdir="\$(..)$libc_add_on" ;;
474           esac
475           case "$d" in
476           .)
477             d="${libc_add_on_canonical:-$libc_add_on}"
478             ;;
479           /*)
480             subdir_srcdir="$d"
481             ;;
482           *)
483             subdir_srcdir="$subdir_srcdir/$d"
484             ;;
485           esac
486           d=`echo "$d" | sed 's@/*$@@;s@^.*/@@'`
487           add_on_subdirs="$add_on_subdirs $d"
488           test "$subdir_srcdir" = "\$(..)$d" || config_vars="$config_vars
489 $d-srcdir = $subdir_srcdir"
490         done
491         for d in $libc_add_on_config_subdirs; do
492           case "$d" in
493           /*) AC_MSG_ERROR(dnl
494 fragment uses absolute path in \$libc_add_on_config_subdirs) ;;
495           esac
496           if test ! -d "$libc_add_on_srcdir/$d"; then
497             AC_MSG_ERROR(fragment wants to configure missing directory $d)
498           fi
499           case "$libc_add_on" in
500           /*) AC_MSG_ERROR(dnl
501 relative path required for add-on using \$libc_add_on_config_subdirs) ;;
502           esac
503           subdirs="$subdirs $libc_add_on/$d"
504         done
505       }
506     fi
507     if test -n "$libc_add_on"; then
508       if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2> /dev/null`
509       then
510         AC_MSG_CHECKING(add-on $libc_add_on for preconfigure fragments)
511         for frag in $frags; do
512           name=`echo "$frag" | sed 's@/[[^/]]*$@@;s@^.*/@@'`
513           echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
514           . "$frag"
515         done
516         AC_MSG_RESULT()
517       fi
518       use_add_ons="$use_add_ons $libc_add_on"
519       add_ons_pfx="$add_ons_pfx $libc_add_on/"
520       test -z "$libc_add_on_canonical" ||
521       add_ons_sfx="$add_ons_sfx /$libc_add_on_canonical"
522     fi
523   done
524   # Use echo to strip excess whitespace.
525   add_ons="`echo $use_add_ons`"
527 AC_SUBST(add_ons)
528 AC_SUBST(add_on_subdirs)
532 ### I put this here to prevent those annoying emails from people who cannot
533 ### read and try to compile glibc on unsupported platforms.  --drepper
535 ### By using the undocumented --enable-hacker-mode option for configure
536 ### one can skip this test to make the configuration not fail for unsupported
537 ### platforms.
539 if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then
540   case "$machine-$host_os" in
541   *-linux* | *-gnu* | arm*-none* | powerpc-aix4.3.*)
542     ;;
543   *)
544     echo "*** The GNU C library is currently not available for this platform."
545     echo "*** So far nobody cared to port it and if there is no volunteer it"
546     echo "*** might never happen.  So, if you have interest to see glibc on"
547     echo "*** this platform visit"
548     echo "***   http://www.gnu.org/software/libc/porting.html"
549     echo "*** and join the group of porters"
550     exit 1
551     ;;
552   esac
555 dnl We need to use [ and ] for other purposes for a while now.
556 changequote(,)dnl
557 # Expand the configuration machine name into a subdirectory by architecture
558 # type and particular chip.  If an add-on configure fragment already set
559 # base_machine, we don't change it.
560 test -n "$base_machine" || case "$machine" in
561 a29k | am29000) base_machine=a29k machine=a29k ;;
562 c3[012])        base_machine=cx0 machine=cx0/c30 ;;
563 c4[04])         base_machine=cx0 machine=cx0/c40 ;;
564 i[34567]86)     base_machine=i386 machine=i386/$machine ;;
565 ia64)           base_machine=ia64 machine=ia64 ;;
566 m88???)         base_machine=m88k machine=m88k/$machine ;;
567 m88k)           base_machine=m88k machine=m88k/m88100 ;;
568 powerpc)        base_machine=powerpc machine=powerpc/powerpc32 ;;
569 powerpc64)      base_machine=powerpc machine=powerpc/powerpc64 ;;
570 s390)           base_machine=s390 machine=s390/s390-32 ;;
571 s390x)          base_machine=s390 machine=s390/s390-64 ;;
572 sh3*)           base_machine=sh machine=sh/sh3 ;;
573 sh4*)           base_machine=sh machine=sh/sh4 ;;
574 sparc | sparcv[67])
575                 base_machine=sparc machine=sparc/sparc32 ;;
576 sparcv8 | supersparc | hypersparc)
577                 base_machine=sparc machine=sparc/sparc32/sparcv8 ;;
578 sparcv8plus | sparcv8plusa | sparcv9)
579                 base_machine=sparc machine=sparc/sparc32/sparcv9 ;;
580 sparcv8plusb | sparcv9b)
581                 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;;
582 sparcv9v)
583                 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v ;;
584 sparcv9v2)
585                 base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v2 ;;
586 sparc64)
587                 base_machine=sparc machine=sparc/sparc64 ;;
588 sparc64b)
589                 base_machine=sparc machine=sparc/sparc64/sparcv9b ;;
590 sparc64v)
591                 base_machine=sparc machine=sparc/sparc64/sparcv9v ;;
592 sparc64v2)
593                 base_machine=sparc machine=sparc/sparc64/sparcv9v2 ;;
594 *)              base_machine=$machine ;;
595 esac
596 changequote([,])dnl
597 AC_SUBST(base_machine)
599 if test "$base_machine" = "i386"; then
600   AC_DEFINE(USE_REGPARMS)
603 # For the multi-arch option we need support in the assembler.
604 AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support],
605                libc_cv_asm_gnu_indirect_function, [dnl
606 cat > conftest.s <<EOF
607 .type foo,%gnu_indirect_function
609 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
610 then
611   libc_cv_asm_gnu_indirect_function=yes
612 else
613   libc_cv_asm_gnu_indirect_function=no
615 rm -f conftest*])
617 AC_MSG_CHECKING(whether .text pseudo-op must be used)
618 AC_CACHE_VAL(libc_cv_dot_text, [dnl
619 cat > conftest.s <<EOF
620 .text
622 libc_cv_dot_text=
623 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
624   libc_cv_dot_text=.text
626 rm -f conftest*])
627 if test -z "$libc_cv_dot_text"; then
628   AC_MSG_RESULT(no)
629 else
630   AC_MSG_RESULT(yes)
633 AC_CACHE_CHECK(for assembler global-symbol directive,
634                libc_cv_asm_global_directive, [dnl
635 libc_cv_asm_global_directive=UNKNOWN
636 for ac_globl in .globl .global .EXPORT; do
637   cat > conftest.s <<EOF
638         ${libc_cv_dot_text}
639         ${ac_globl} foo
640 foo:
642   if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
643     libc_cv_asm_global_directive=${ac_globl}
644   fi
645   rm -f conftest*
646   test $libc_cv_asm_global_directive != UNKNOWN && break
647 done])
648 if test $libc_cv_asm_global_directive = UNKNOWN; then
649   AC_MSG_ERROR(cannot determine asm global directive)
650 else
651   AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${libc_cv_asm_global_directive})
654 AC_CACHE_CHECK(for assembler .type directive prefix,
655                libc_cv_asm_type_prefix, [dnl
656 libc_cv_asm_type_prefix=no
657 for ac_try_prefix in '@' '%' '#'; do
658   cat > conftest.s <<EOF
659         ${libc_cv_dot_text}
660         ${libc_cv_asm_global_directive} foo
661         .type foo, ${ac_try_prefix}object
662         .size foo, 1
663 foo:
664         .byte 1
666   if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
667     libc_cv_asm_type_prefix=${ac_try_prefix}
668   fi
669   rm -f conftest*
670   test "x$libc_cv_asm_type_prefix" != xno && break
671 done])
672 if test "x$libc_cv_asm_type_prefix" != xno; then
673   AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix})
676 if test x"$libc_cv_asm_gnu_indirect_function" != xyes -a x"$libc_cv_asm_type_prefix" = xno; then
677   if test x"$multi_arch" = xyes; then
678     AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
679   else
680     multi_arch=no
681   fi
683 if test x"$multi_arch" != xno; then
684   multi_arch_d=/multiarch
687 # Compute the list of sysdep directories for this configuration.
688 # This can take a while to compute.
689 sysdep_dir=$srcdir/sysdeps
690 AC_MSG_CHECKING(sysdep dirs)
691 dnl We need to use [ and ] for other purposes for a while now.
692 changequote(,)dnl
693 # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
694 os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
696 test "x$base_os" != x || case "$os" in
697 gnu*)
698   base_os=mach/hurd ;;
699 netbsd* | 386bsd* | freebsd* | bsdi*)
700   base_os=unix/bsd/bsd4.4 ;;
701 osf* | sunos* | ultrix* | newsos* | dynix* | *bsd*)
702   base_os=unix/bsd ;;
703 sysv* | isc* | esix* | sco* | minix* | irix4* | linux*)
704   base_os=unix/sysv ;;
705 irix6*)
706   base_os=unix/sysv/irix6/$os ;;
707 solaris[2-9]*)
708   base_os=unix/sysv/sysv4 ;;
709 hpux*)
710   base_os=unix/sysv/hpux/$os ;;
711 aix4.3*)
712   base_os=unix/sysv/aix/aix4.3 ;;
713 none)
714   base_os=standalone ;;
715 esac
717 # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
718 tail=$os
719 ostry=$os
720 while o=`echo $tail | sed 's/\.[^.]*$//'`; test $o != $tail; do
721   ostry="$ostry /$o"
722   tail=$o
723 done
724 o=`echo $tail | sed 's/[0-9]*$//'`
725 if test $o != $tail; then
726   ostry="$ostry /$o"
728 # For linux-gnu, try linux-gnu, then linux.
729 o=`echo $tail | sed 's/-.*$//'`
730 if test $o != $tail; then
731   ostry="$ostry /$o"
734 # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
735 base=
736 tail=$base_os
737 while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$b"; do
738   set $b
739   base="$base /$1"
740   tail="$2"
741 done
743 # For sparc/sparc32, try sparc/sparc32 and then sparc.
744 mach=
745 tail=$machine${submachine:+/$submachine}
746 while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
747   set $m
748   # Prepend the machine's FPU directory unless --without-fp.
749   if test "$with_fp" = yes; then
750     mach="$mach /$1/fpu"
751   else
752     mach="$mach /$1/nofpu"
753   fi
754   mach="$mach /$1"
755   tail="$2"
756 done
758 dnl We are done with glob and regexp uses of [ and ]; return to autoconf.
759 changequote([,])dnl
761 # Find what sysdep directories exist.
762 sysnames_add_ons=
763 sysnames=
764 for b in $base ''; do
765   for m0 in $mach ''; do
766     for v in /$vendor ''; do
767       test "$v" = / && continue
768       for o in /$ostry ''; do
769         test "$o" = / && continue
770         for m in $multi_arch_d $mach ''; do
771           for d in $add_ons_pfx ''; do
772             for a in $add_ons_sfx ''; do
773               if test -n "$m0$m0sub$b$v$o$m$msub"; then
774                 try_srcdir="${srcdir}/"
775                 case "$d" in
776                 /*) try_srcdir= ;;
777                 esac
778                 try="${d}sysdeps$m0$m0sub$b$v$o$m$msub$a"
779                 test -n "$enable_debug_configure" &&
780                 echo "$0 [DEBUG]: try $try" >&2
781                 if test -d "$try_srcdir$try"; then
782                   sysnames="$sysnames $try"
783                   { test -n "$o" || test -n "$b"; } && os_used=t
784                   { test -n "$m" || test -n "$m0"; } && machine_used=t
785                   case x${m0:-$m} in
786                   x*/$submachine) submachine_used=t ;;
787                   esac
788                   if test -n "$d"; then
789                     case "$sysnames_add_ons" in
790                     *" $d "*) ;;
791                     *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
792                     esac
793                   fi
794                 fi
795               fi
796             done
797           done
798         done
799       done
800     done
801   done
802 done
804 # If the assembler supports gnu_indirect_function symbol type and the
805 # architecture supports multi-arch, we enable multi-arch by default.
806 case $sysnames_add_ons$sysnames in
807 *"$multi_arch_d"*)
808   ;;
810   test x"$multi_arch" = xdefault && multi_arch=no
811   ;;
812 esac
813 if test x"$multi_arch" != xno; then
814   AC_DEFINE(USE_MULTIARCH)
816 AC_SUBST(multi_arch)
818 if test -z "$os_used" && test "$os" != none; then
819   AC_MSG_ERROR(Operating system $os is not supported.)
821 if test -z "$machine_used" && test "$machine" != none; then
822   AC_MSG_ERROR(The $machine is not supported.)
824 if test -z "$submachine_used" && test -n "$submachine"; then
825   AC_MSG_ERROR(The $submachine subspecies of $host_cpu is not supported.)
827 AC_SUBST(submachine)
829 # We have now validated the configuration.
832 # If using ELF, look for an `elf' subdirectory of each machine directory.
833 # We prepend these rather than inserting them whereever the machine appears
834 # because things specified by the machine's ELF ABI should override
835 # OS-specific things, and should always be the same for any OS on the
836 # machine (otherwise what's the point of an ABI?).
837 if test "$elf" = yes; then
838   elf_dirs=
839   for d in $add_ons_pfx ''; do
840     for m in $mach; do
841       if test -d $srcdir/${d}sysdeps$m/elf; then
842         elf_dirs="$elf_dirs ${d}sysdeps$m/elf"
843       fi
844     done
845   done
846   sysnames="`echo $elf_dirs | sed -e 's,//,/,g'` $sysnames"
850 # Expand the list of system names into a full list of directories
851 # from each element's parent name and Implies file (if present).
852 set $sysnames
853 names=
854 while test $# -gt 0; do
855   name=$1
856   shift
858   case " $names " in *" $name "*)
859     # Already in the list.
860     continue
861   esac
863   # Report each name as we discover it, so there is no long pause in output.
864   echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
866   name_base=`echo $name | sed -e 's@\(.*sysdeps\)/.*@\1@'`
868   case $name in
869     /*) xsrcdir= ;;
870     *)  xsrcdir=$srcdir/ ;;
871   esac
872   test -n "$enable_debug_configure" &&
873   echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2
875   if test -f $xsrcdir$name/Implies; then
876     # Collect more names from the `Implies' file (removing comments).
877     implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`"
878     implied=
879     for x in $implied_candidate; do
880       found=no
881       if test -d $xsrcdir$name_base/$x; then
882         implied="$implied $name_base/$x";
883         found=yes
884       fi
885       for d in $add_ons_pfx ''; do
886         try="${d}sysdeps/$x"
887         case $d in
888          /*) try_srcdir= ;;
889          *) try_srcdir=$srcdir/ ;;
890         esac
891         test -n "$enable_debug_configure" &&
892          echo "[DEBUG]: $name implied $x try($d) {$try_srcdir}$try" >&2
893         if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
894         then
895           implied="$implied $try"
896           found=yes
897           case "$sysnames_add_ons" in
898           *" $d "*) ;;
899           *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
900           esac
901         fi
902       done
903       if test $found = no; then
904         AC_MSG_WARN($name/Implies specifies nonexistent $x)
905       fi
906     done
907   else
908     implied=
909   fi
911   # Add NAME to the list of names.
912   names="$names $name"
914   # Find the parent of NAME, using the empty string if it has none.
915 changequote(,)dnl
916   parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
917 changequote([,])dnl
919   # Add the names implied by NAME, and NAME's parent (if it has one), to
920   # the list of names to be processed (the argument list).  We prepend the
921   # implied names to the list and append the parent.  We want implied
922   # directories to come before further directories inferred from the
923   # configuration components; this ensures that for sysv4, unix/common
924   # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
925   # after sysv4).
926   sysnames="`echo $implied $* $parent`"
927   test -n "$sysnames" && set $sysnames
928 done
930 # Add the default directories.
931 default_sysnames=sysdeps/generic
932 if test "$elf" = yes; then
933   default_sysnames="sysdeps/generic/elf $default_sysnames"
935 sysnames="$names $default_sysnames"
936 AC_SUBST(sysnames)
937 # The other names were emitted during the scan.
938 AC_MSG_RESULT($default_sysnames)
940 # Collect the list of add-ons that supply partial sysdeps trees.
941 sysdeps_add_ons=
942 for add_on in $add_ons; do
943   case "$add_on" in
944   /*) xsrcdir= ;;
945   *) xsrcdir="$srcdir/" ;;
946   esac
948   test -d "$xsrcdir$add_on/sysdeps" || {
949     case "$configured_add_ons " in
950     *" $add_on "*) ;;
951     *|'')
952       AC_MSG_ERROR(add-on $add_on has no configure fragment or sysdeps tree)
953       ;;
954     esac
955     continue
956   }
958   sysdeps_add_ons="$sysdeps_add_ons $add_on"
959   case "$sysnames_add_ons" in
960   *" $add_on/ "*) ;;
961   *|'')
962     AC_MSG_WARN(add-on $add_on contributed no sysdeps directories)
963     continue ;;
964   esac
966   found=no
967   for d in $sysnames; do
968     case "$d" in
969     $add_on/sysdeps/*) ;;
970     *) continue ;;
971     esac
972     (cd "$xsrcdir$d" && for f in *[[!~]]; do
973        case "$f" in
974        sys|bits)
975          for ff in $f/*.h; do
976            test -d "$ff" || { test -e "$ff" && exit 88; }
977          done
978          ;;
979        *)
980          test -d "$f" || { test -e "$f" && exit 88; }
981          ;;
982        esac
983      done)
984     if test $? -eq 88; then
985       found=yes
986       break
987     fi
988   done
989   if test $found = no; then
990     AC_MSG_WARN(add-on $add_on contributed no useful sysdeps directories)
991   fi
992 done
993 AC_SUBST(sysdeps_add_ons)
996 ### Locate tools.
998 AC_PROG_INSTALL
999 if test "$INSTALL" = "${srcdir}/scripts/install-sh -c"; then
1000   # The makefiles need to use a different form to find it in $srcdir.
1001   INSTALL='\$(..)./scripts/install-sh -c'
1003 AC_PROG_LN_S
1005 LIBC_PROG_BINUTILS
1006 AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
1008 # Accept binutils 2.13 or newer.
1009 AC_CHECK_PROG_VER(AS, $AS, --version,
1010                   [GNU assembler.* \([0-9]*\.[0-9.]*\)],
1011                   [2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], AS=: critic_missing="$critic_missing as")
1012 AC_CHECK_PROG_VER(LD, $LD, --version,
1013                   [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
1014                   [2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], LD=: critic_missing="$critic_missing ld")
1016 # We need the physical current working directory.  We cannot use the
1017 # "pwd -P" shell builtin since that's not portable.  Instead we try to
1018 # find a pwd binary.  Note that assigning to the PWD environment
1019 # variable might have some interesting side effects, so we don't do
1020 # that.
1021 AC_PATH_PROG(PWD_P, pwd, no)
1022 if test "$PWD_P" = no; then
1023   AC_MSG_ERROR(*** A pwd binary could not be found.)
1026 # These programs are version sensitive.
1027 AC_CHECK_TOOL_PREFIX
1028 AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
1029   [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* ],
1030   critic_missing="$critic_missing gcc")
1031 AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
1032   [GNU Make[^0-9]*\([0-9][0-9.]*\)],
1033   [3.79* | 3.[89]*], critic_missing="$critic_missing make")
1035 AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
1036   [GNU gettext.* \([0-9]*\.[0-9.]*\)],
1037   [0.10.3[6-9]* | 0.10.[4-9][0-9]* | 0.1[1-9]* | 0.[2-9][0-9]* | [1-9].*],
1038   MSGFMT=: aux_missing="$aux_missing msgfmt")
1039 AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
1040   [GNU texinfo.* \([0-9][0-9.]*\)],
1041   [4.*],
1042   MAKEINFO=: aux_missing="$aux_missing makeinfo")
1043 AC_CHECK_PROG_VER(SED, sed, --version,
1044   [GNU sed version \([0-9]*\.[0-9.]*\)],
1045   [3.0[2-9]*|3.[1-9]*|[4-9]*],
1046   SED=: aux_missing="$aux_missing sed")
1048 AC_CHECK_TOOL(READELF, readelf, false)
1050 AC_CHECK_PROGS(AUTOCONF, autoconf, no)
1051 case "x$AUTOCONF" in
1052 xno|x|x:) AUTOCONF=no ;;
1054   AC_CACHE_CHECK(dnl
1055 whether $AUTOCONF${ACFLAGS:+ }$ACFLAGS works, libc_cv_autoconf_works, [dnl
1056   if (cd $srcdir; $AUTOCONF $ACFLAGS configure.in > /dev/null 2>&1); then
1057     libc_cv_autoconf_works=yes
1058   else
1059     libc_cv_autoconf_works=no
1060   fi])
1061   test $libc_cv_autoconf_works = yes || AUTOCONF=no
1062   ;;
1063 esac
1064 if test "x$with_cvs" = xyes && test "x$AUTOCONF" = xno; then
1065   # If --without-cvs they probably won't change configure.in, so no complaints.
1066   aux_missing="$aux_missing autoconf"
1069 test -n "$critic_missing" && AC_MSG_ERROR([
1070 *** These critical programs are missing or too old:$critic_missing
1071 *** Check the INSTALL file for required versions.])
1073 test -n "$aux_missing" && AC_MSG_WARN([
1074 *** These auxiliary programs are missing or incompatible versions:$aux_missing
1075 *** some features will be disabled.
1076 *** Check the INSTALL file for required versions.])
1078 # if using special system headers, find out the compiler's sekrit
1079 # header directory and add that to the list.  NOTE: Only does the right
1080 # thing on a system that doesn't need fixincludes.  (Not presently a problem.)
1081 if test -n "$sysheaders"; then
1082   SYSINCLUDES=-nostdinc
1083   for d in include include-fixed; do
1084     i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
1085     SYSINCLUDES="$SYSINCLUDES -isystem $i"
1086   done
1087   SYSINCLUDES="$SYSINCLUDES \
1088 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
1089   if test -n "$CXX"; then
1090     cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
1091     cxxmachine=`$CXX -dumpmachine 2>&AS_MESSAGE_LOG_FD` &&
1092     cxxheaders=`$CXX -print-file-name=../../../../include/c++/`"$cxxversion" &&
1093     CXX_SYSINCLUDES="-isystem $cxxheaders \
1094 -isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
1095   fi
1097 AC_SUBST(SYSINCLUDES)
1098 AC_SUBST(CXX_SYSINCLUDES)
1100 # ranlib is never necessary on Linux and Hurd systems
1101 RANLIB=:
1103 # Test if LD_LIBRARY_PATH contains the notation for the current directory
1104 # since this would lead to problems installing/building glibc.
1105 # LD_LIBRARY_PATH contains the current directory if one of the following
1106 # is true:
1107 # - one of the terminals (":" and ";") is the first or last sign
1108 # - two terminals occur directly after each other
1109 # - the path contains an element with a dot in it
1110 AC_MSG_CHECKING(LD_LIBRARY_PATH variable)
1111 changequote(,)dnl
1112 case ${LD_LIBRARY_PATH} in
1113   [:\;]* | *[:\;] | *[:\;][:\;]* |  *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
1114     ld_library_path_setting="contains current directory"
1115     ;;
1116   *)
1117     ld_library_path_setting="ok"
1118     ;;
1119 esac
1120 changequote([,])dnl
1121 AC_MSG_RESULT($ld_library_path_setting)
1122 if test "$ld_library_path_setting" != "ok"; then
1123 AC_MSG_ERROR([
1124 *** LD_LIBRARY_PATH shouldn't contain the current directory when
1125 *** building glibc. Please change the environment variable
1126 *** and run configure again.])
1129 AC_CACHE_CHECK(whether GCC supports -static-libgcc, libc_cv_gcc_static_libgcc, [dnl
1130 if $CC -v -static-libgcc 2>&1 | grep -q 'unrecognized option.*static-libgcc'; then
1131   libc_cv_gcc_static_libgcc=
1132 else
1133   libc_cv_gcc_static_libgcc=-static-libgcc
1134 fi])
1135 AC_SUBST(libc_cv_gcc_static_libgcc)
1137 AC_PATH_PROG(BASH_SHELL, bash, no)
1138 if test "$BASH_SHELL" != no &&
1139    $BASH_SHELL -c 'test "$BASH_VERSINFO" \
1140              && test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then
1141   libc_cv_have_bash2=yes
1142 else
1143   libc_cv_have_bash2=no
1145 AC_SUBST(libc_cv_have_bash2)
1147 dnl We need a ksh compatible shell for tzselect.
1148 if test "$BASH_SHELL" = no; then
1149   AC_PATH_PROG(KSH, ksh, no)
1150   if test "$KSH" = no; then
1151     libc_cv_have_ksh=no
1152   else
1153     libc_cv_have_ksh=yes
1154   fi
1155 else
1156   KSH="$BASH_SHELL"
1157   AC_SUBST(KSH)
1158   libc_cv_have_ksh=yes
1160 AC_SUBST(libc_cv_have_ksh)
1162 AC_PROG_AWK
1163 AC_PATH_PROG(PERL, perl, no)
1164 if test "$PERL" != no &&
1165    (eval `$PERL -V:apiversion`; test `expr "$apiversion" \< 5` -ne 0); then
1166   PERL=no
1168 AC_PATH_PROG(INSTALL_INFO, install-info, no,
1169              $PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin)
1170 AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin)
1172 AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl
1173 echo '#include <stddef.h>
1174 FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
1175 if eval "$ac_cpp conftest.c 2>/dev/null" \
1176 | grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null; then
1177   libc_cv_signed_size_t=no
1178 else
1179   libc_cv_signed_size_t=yes
1181 rm -f conftest*])
1182 if test $libc_cv_signed_size_t = yes; then
1183   dnl Do this by hand instead of AC_DEFINE so can add #undef to avoid warnings.
1184   cat >> confdefs.h <<\EOF
1185 #undef __SIZE_TYPE__
1186 #define __SIZE_TYPE__ unsigned
1190 AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl
1191 AC_TRY_COMPILE(dnl
1192 [#define __need_size_t
1193 #define __need_wchar_t
1194 #include <stddef.h>
1195 #define __need_NULL
1196 #include <stddef.h>], [size_t size; wchar_t wchar;
1197 #ifdef offsetof
1198 #error stddef.h ignored __need_*
1199 #endif
1200 if (&size == NULL || &wchar == NULL) abort ();],
1201                libc_cv_friendly_stddef=yes,
1202                libc_cv_friendly_stddef=no)])
1203 if test $libc_cv_friendly_stddef = yes; then
1204   config_vars="$config_vars
1205 override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
1208 AC_CACHE_CHECK(whether we need to use -P to assemble .S files,
1209                libc_cv_need_minus_P, [dnl
1210 cat > conftest.S <<EOF
1211 #include "confdefs.h"
1212 /* Nothing whatsoever.  */
1214 if AC_TRY_COMMAND(${CC-cc} $CPPFLAGS $ASFLAGS -c conftest.S 1>&AS_MESSAGE_LOG_FD); then
1215   libc_cv_need_minus_P=no
1216 else
1217   libc_cv_need_minus_P=yes
1219 rm -f conftest*])
1220 if test $libc_cv_need_minus_P = yes; then
1221   config_vars="$config_vars
1222 asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
1225 AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl
1226 cat > conftest.s <<EOF
1227 ${libc_cv_dot_text}
1228 foo:
1229 .set glibc_conftest_frobozz,foo
1230 $libc_cv_asm_global_directive glibc_conftest_frobozz
1232 # The alpha-dec-osf1 assembler gives only a warning for `.set'
1233 # (but it doesn't work), so we must do a linking check to be sure.
1234 cat > conftest1.c <<\EOF
1235 extern int glibc_conftest_frobozz;
1236 void _start() { glibc_conftest_frobozz = 1; }
1238 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1239             -nostartfiles -nostdlib \
1240             -o conftest conftest.s conftest1.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1241   libc_cv_asm_set_directive=yes
1242 else
1243   libc_cv_asm_set_directive=no
1245 rm -f conftest*])
1246 if test $libc_cv_asm_set_directive = yes; then
1247   AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
1250 AC_CACHE_CHECK(for assembler gnu_unique_object symbol type,
1251                libc_cv_asm_unique_object, [dnl
1252 cat > conftest.s <<EOF
1253 ${libc_cv_dot_text}
1254 _sym:
1255 .type _sym, ${libc_cv_asm_type_prefix}gnu_unique_object
1257 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1258   libc_cv_asm_unique_object=yes
1259 else
1260   libc_cv_asm_unique_object=no
1262 rm -f conftest*])
1263 if test $libc_cv_asm_unique_object = yes; then
1264   AC_DEFINE(HAVE_ASM_UNIQUE_OBJECT)
1267 AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
1268 [cat > conftest.s <<EOF
1269 ${libc_cv_dot_text}
1270 _sym:
1271 .symver _sym,sym@VERS
1273 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1274   libc_cv_asm_symver_directive=yes
1275 else
1276   libc_cv_asm_symver_directive=no
1278 rm -f conftest*])
1279 AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl
1280 if test $libc_cv_asm_symver_directive = yes; then
1281   cat > conftest.s <<EOF
1282 ${libc_cv_dot_text}
1283 _sym:
1284 .symver _sym,sym@VERS
1286   cat > conftest.map <<EOF
1287 VERS_1 {
1288         global: sym;
1291 VERS_2 {
1292         global: sym;
1293 } VERS_1;
1295   if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1296     if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
1297                                 -o conftest.so conftest.o
1298                                 -nostartfiles -nostdlib
1299                                 -Wl,--version-script,conftest.map
1300                        1>&AS_MESSAGE_LOG_FD]);
1301     then
1302       libc_cv_ld_version_script_option=yes
1303     else
1304       libc_cv_ld_version_script_option=no
1305     fi
1306   else
1307     libc_cv_ld_version_script_option=no
1308   fi
1309 else
1310   libc_cv_ld_version_script_option=no
1312 rm -f conftest*])
1313 if test $shared != no &&
1314    test $libc_cv_asm_symver_directive = yes &&
1315    test $libc_cv_ld_version_script_option = yes &&
1316    test $enable_versioning = yes; then
1317   VERSIONING=yes
1318   AC_DEFINE(DO_VERSIONING)
1319 else
1320   VERSIONING=no
1322 AC_SUBST(VERSIONING)
1324 if test $elf = yes && test $shared != no && test $VERSIONING = no; then
1325   echo "\
1326 *** WARNING: You should not compile GNU libc without versioning. Not using
1327 *** versioning will introduce incompatibilities so that old binaries
1328 *** will not run anymore.
1329 *** For versioning you need recent binutils (binutils-2.8.1.0.23 or newer)."
1331 if test $elf = yes; then
1332   AC_CACHE_CHECK(for .previous assembler directive,
1333                  libc_cv_asm_previous_directive, [dnl
1334   cat > conftest.s <<EOF
1335 .section foo_section
1336 .previous
1338   if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1339     libc_cv_asm_previous_directive=yes
1340   else
1341     libc_cv_asm_previous_directive=no
1342   fi
1343   rm -f conftest*])
1344   if test $libc_cv_asm_previous_directive = yes; then
1345     AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
1346   else
1347     AC_CACHE_CHECK(for .popsection assembler directive,
1348                    libc_cv_asm_popsection_directive, [dnl
1349     cat > conftest.s <<EOF
1350 .pushsection foo_section
1351 .popsection
1353     if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1354       libc_cv_asm_popsection_directive=yes
1355     else
1356       libc_cv_asm_popsection_directive=no
1357     fi
1358     rm -f conftest*])
1359     if test $libc_cv_asm_popsection_directive = yes; then
1360       AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
1361     fi
1362   fi
1363   AC_CACHE_CHECK(for .protected and .hidden assembler directive,
1364                  libc_cv_asm_protected_directive, [dnl
1365   cat > conftest.s <<EOF
1366 .protected foo
1367 foo:
1368 .hidden bar
1369 bar:
1371   if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1372     libc_cv_asm_protected_directive=yes
1373   else
1374     AC_MSG_ERROR(assembler support for symbol visibility is required)
1375   fi
1376   rm -f conftest*])
1378   if test $libc_cv_asm_protected_directive = yes; then
1379     AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
1380                  libc_cv_visibility_attribute,
1381                  [cat > conftest.c <<EOF
1382                   int foo __attribute__ ((visibility ("hidden"))) = 1;
1383                   int bar __attribute__ ((visibility ("protected"))) = 1;
1385                   libc_cv_visibility_attribute=no
1386                   if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1387                     if grep '\.hidden.*foo' conftest.s >/dev/null; then
1388                       if grep '\.protected.*bar' conftest.s >/dev/null; then
1389                         libc_cv_visibility_attribute=yes
1390                       fi
1391                     fi
1392                   fi
1393                   rm -f conftest.{c,s}
1394                  ])
1395     if test $libc_cv_visibility_attribute != yes; then
1396       AC_MSG_ERROR(compiler support for visibility attribute is required)
1397     fi
1398   fi
1400   if test $libc_cv_visibility_attribute = yes; then
1401     AC_CACHE_CHECK(for broken __attribute__((visibility())),
1402                  libc_cv_broken_visibility_attribute,
1403                  [cat > conftest.c <<EOF
1404                   int foo (int x);
1405                   int bar (int x) __asm__ ("foo") __attribute__ ((visibility ("hidden")));
1406                   int bar (int x) { return x; }
1408                   libc_cv_broken_visibility_attribute=yes
1409                   if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1410 changequote(,)dnl
1411                     if grep '\.hidden[  _]foo' conftest.s >/dev/null; then
1412 changequote([,])dnl
1413                       libc_cv_broken_visibility_attribute=no
1414                     fi
1415                   fi
1416                   rm -f conftest.c conftest.s
1417                  ])
1418     if test $libc_cv_broken_visibility_attribute = yes; then
1419       AC_MSG_ERROR(working compiler support for visibility attribute is required)
1420     fi
1421   fi
1423   AC_CACHE_CHECK(for broken __attribute__((alias())),
1424                  libc_cv_broken_alias_attribute,
1425                  [cat > conftest.c <<EOF
1426                   extern int foo (int x) __asm ("xyzzy");
1427                   int bar (int x) { return x; }
1428                   extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
1429                   extern int dfoo;
1430                   extern __typeof (dfoo) dfoo __asm ("abccb");
1431                   int dfoo = 1;
1433                   libc_cv_broken_alias_attribute=yes
1434                   if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1435                     if grep 'xyzzy' conftest.s >/dev/null &&
1436                        grep 'abccb' conftest.s >/dev/null; then
1437                       libc_cv_broken_alias_attribute=no
1438                     fi
1439                   fi
1440                   rm -f conftest.c conftest.s
1441                  ])
1442   if test $libc_cv_broken_alias_attribute = yes; then
1443     AC_MSG_ERROR(working alias attribute support required)
1444   fi
1446   if test $libc_cv_visibility_attribute = yes; then
1447     AC_CACHE_CHECK(whether to put _rtld_local into .sdata section,
1448                  libc_cv_have_sdata_section,
1449                  [echo "int i;" > conftest.c
1450                   libc_cv_have_sdata_section=no
1451                   if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
1452                      | grep '\.sdata' >/dev/null; then
1453                     libc_cv_have_sdata_section=yes
1454                   fi
1455                   rm -f conftest.c conftest.so
1456                  ])
1457     if test $libc_cv_have_sdata_section = yes; then
1458       AC_DEFINE(HAVE_SDATA_SECTION)
1459     fi
1460   fi
1462   AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
1463                  libc_cv_initfini_array, [dnl
1464   cat > conftest.c <<EOF
1465 int _start (void) { return 0; }
1466 int __start (void) { return 0; }
1467 int foo (void) { return 1; }
1468 int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
1470   if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c
1471                      -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
1472   then
1473     if $READELF -S conftest | fgrep INIT_ARRAY > /dev/null; then
1474       libc_cv_initfini_array=yes
1475     else
1476       libc_cv_initfini_array=no
1477     fi
1478   else
1479     libc_cv_initfini_array=no
1480   fi
1481   rm -f conftest*])
1482   if test $libc_cv_initfini_array != yes; then
1483     AC_MSG_ERROR([Need linker with .init_array/.fini_array support.])
1484   fi
1486   AC_CACHE_CHECK(whether to use .ctors/.dtors header and trailer,
1487                  libc_cv_ctors_header, [dnl
1488     libc_cv_ctors_header=yes
1489     AC_TRY_LINK([], [
1490 __attribute__ ((constructor)) void ctor (void) { puts("ctor"); }
1491 __attribute__ ((destructor))  void dtor (void) { puts("dtor"); }
1493                 [dnl
1494       AS_IF([$READELF -WS conftest$ac_exeext | $AWK '
1495         { gsub(/\@<:@ */, "@<:@") }
1496         $2 == ".ctors" || $2 == ".dtors" {
1497           size = strtonum("0x" $6)
1498           align = strtonum("0x" $NF)
1499           seen@<:@$2@:>@ = 1
1500           stub@<:@$2@:>@ = size == align * 2
1501         }
1502         END {
1503           ctors_ok = !seen@<:@".ctors"@:>@ || stub@<:@".ctors"@:>@
1504           dtors_ok = !seen@<:@".dtors"@:>@ || stub@<:@".dtors"@:>@
1505           exit ((ctors_ok && dtors_ok) ? 0 : 1)
1506         }
1507       '], [libc_cv_ctors_header=no])
1508     ], [dnl
1509       AC_MSG_ERROR([missing __attribute__ ((constructor)) support??])
1510     ])
1511   ])
1512   if test $libc_cv_ctors_header = no; then
1513     AC_DEFINE(NO_CTORS_DTORS_SECTIONS)
1514   fi
1516   AC_CACHE_CHECK(for libunwind-support in compiler,
1517                  libc_cv_cc_with_libunwind, [
1518     cat > conftest.c <<EOF
1519 int main (void) { return 0; }
1521     if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
1522        conftest.c -v 2>&1 >/dev/null | grep -q " -lunwind "; then
1523       libc_cv_cc_with_libunwind=yes
1524     else
1525       libc_cv_cc_with_libunwind=no
1526     fi
1527     rm -f conftest*])
1528   AC_SUBST(libc_cv_cc_with_libunwind)
1529   if test $libc_cv_cc_with_libunwind = yes; then
1530     AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
1531   fi
1533   AC_CACHE_CHECK(for -z nodelete option,
1534                  libc_cv_z_nodelete, [dnl
1535   cat > conftest.c <<EOF
1536 int _start (void) { return 42; }
1538   if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1539                      -fPIC -shared -o conftest.so conftest.c
1540                      -nostartfiles -nostdlib
1541                      -Wl,--enable-new-dtags,-z,nodelete 1>&AS_MESSAGE_LOG_FD])
1542   then
1543     libc_cv_z_nodelete=yes
1544   else
1545     AC_MSG_ERROR(linker with -z nodelete support required)
1546   fi
1547   rm -f conftest*])
1549   AC_CACHE_CHECK(for -z nodlopen option,
1550                  libc_cv_z_nodlopen, [dnl
1551   cat > conftest.c <<EOF
1552 int _start (void) { return 42; }
1554   if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1555                         -fPIC -shared -o conftest.so conftest.c
1556                         -nostartfiles -nostdlib
1557                         -Wl,--enable-new-dtags,-z,nodlopen 1>&AS_MESSAGE_LOG_FD])
1558   then
1559     libc_cv_z_nodlopen=yes
1560   else
1561     AC_MSG_ERROR(linker with -z nodlopen support required)
1562   fi
1563   rm -f conftest*])
1565   AC_CACHE_CHECK(for -z initfirst option,
1566                  libc_cv_z_initfirst, [dnl
1567   cat > conftest.c <<EOF
1568 int _start (void) { return 42; }
1570   if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1571                         -fPIC -shared -o conftest.so conftest.c
1572                         -nostartfiles -nostdlib
1573                         -Wl,--enable-new-dtags,-z,initfirst 1>&AS_MESSAGE_LOG_FD])
1574   then
1575     libc_cv_z_initfirst=yes
1576   else
1577     AC_MSG_ERROR(linker with -z initfirst support required)
1578   fi
1579   rm -f conftest*])
1581   # Add-on fragments can set these for other machines.
1582   libc_commonpagesize=${libc_commonpagesize:-no}
1583   libc_relro_required=${libc_relro_required:-no}
1584   case "$base_machine" in
1585     i[[34567]]86 | x86_64 | powerpc* | s390*)
1586       libc_commonpagesize=0x1000
1587       libc_relro_required=yes
1588       ;;
1589     sparc*)
1590       libc_commonpagesize=0x2000
1591       libc_relro_required=yes
1592       ;;
1593     ia64*)
1594       libc_commonpagesize=0x4000
1595       ;;
1596     alpha*)
1597       libc_commonpagesize=0x10000
1598       libc_relro_required=yes
1599       ;;
1600   esac
1602   if test $libc_commonpagesize != no; then
1603     AC_CACHE_CHECK(for -z relro option,
1604                    libc_cv_z_relro, [dnl
1605     libc_cv_z_relro=no
1606     AC_LANG_CONFTEST([AC_LANG_SOURCE([[
1607 int _start (void) { return 42; }
1608 extern void _exit (int);
1609 /* Since these pointers are const, they should go in rodata.
1610    Since they refer to functions that have to be resolved by
1611    dynamic linking, they should instead go in RELRO data.  */
1612 const void *const relro[] = { &_start, &_exit, 0 };
1613 /* GNU ld fails to produce RELRO data when it's very small and there is no
1614    normal writable data following it, or if only uninitialized (.bss) data
1615    follows it, or only very small writable data.  */
1616 int data[0x10000] = { 1, };
1617 ]])])
1618     cat > conftest.awk <<\EOF
1619 BEGIN {
1620   result = "no"
1621   commonpagesize = strtonum(commonpagesize)
1623 { print "LINE:", $0 > "/dev/stderr" }
1624 $1 == "GNU_RELRO" {
1625   vaddr = strtonum($3)
1626   memsz = strtonum($6)
1627   end = vaddr + memsz
1628   printf "vaddr %#x memsz %#x end %#x commonpagesize %#x\n", \
1629     vaddr, memsz, end, commonpagesize > "/dev/stderr"
1630   result = (end % commonpagesize == 0) ? "yes" : "broken"
1632 END { print result }
1634     AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1635                     -fPIC -shared -o conftest.so conftest.c
1636                     -nostartfiles -nostdlib
1637                     -Wl,-z,relro 1>&AS_MESSAGE_LOG_FD]) &&
1638     AC_TRY_COMMAND([$READELF -Wl conftest.so > conftest.ph]) &&
1639     AC_TRY_COMMAND([
1640       $AWK -v commonpagesize=$libc_commonpagesize -f conftest.awk
1641            conftest.ph > conftest.cps
1642     ]) &&
1643     libc_cv_z_relro=`cat conftest.cps 2>&AS_MESSAGE_LOG_FD`
1644     rm -f conftest*])
1645     if { test "x$libc_relro_required" = xyes &&
1646          test "x$libc_cv_z_relro" != xyes
1647        }
1648     then
1649       AC_MSG_ERROR(linker with -z relro support required)
1650     fi
1651   else
1652     AC_MSG_WARN([missing architecture parameter to check for working -z relro])
1653   fi
1655   AC_CACHE_CHECK(for -Bgroup option,
1656                  libc_cv_Bgroup, [dnl
1657   cat > conftest.c <<EOF
1658 int _start (void) { return 42; }
1660   if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1661                               -fPIC -shared -o conftest.so conftest.c
1662                               -Wl,-Bgroup -nostdlib 1>&AS_MESSAGE_LOG_FD])
1663   then
1664     libc_cv_Bgroup=yes
1665   else
1666     libc_cv_Bgroup=no
1667   fi
1668   rm -f conftest*])
1669   AC_SUBST(libc_cv_Bgroup)
1671   AC_CACHE_CHECK(for libgcc_s suffix,
1672                  libc_cv_libgcc_s_suffix, [dnl
1673   cat > conftest.c <<EOF
1674 int main (void) { return 0; }
1676 changequote(,)dnl
1677   libc_cv_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
1678                            -fPIC -shared -shared-libgcc -o conftest.so \
1679                            conftest.c -v 2>&1 >/dev/null \
1680                            | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
1681 changequote([,])dnl
1682   rm -f conftest*])
1683   AC_SUBST(libc_cv_libgcc_s_suffix)
1685   AC_CACHE_CHECK(for --as-needed option,
1686                  libc_cv_as_needed, [dnl
1687   cat > conftest.c <<EOF
1688 int main (void) { return 0; }
1690   if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1691                               -fPIC -shared -o conftest.so conftest.c
1692                               -lgcc_s$libc_cv_libgcc_s_suffix -Wl,--as-needed
1693                               -nostdlib 1>&AS_MESSAGE_LOG_FD])
1694   then
1695     libc_cv_as_needed=yes
1696   else
1697     libc_cv_as_needed=no
1698   fi
1699   rm -f conftest*])
1700   AC_SUBST(libc_cv_as_needed)
1702   ASFLAGS_config=
1703   AC_CACHE_CHECK(whether --noexecstack is desirable for .S files,
1704                  libc_cv_as_noexecstack, [dnl
1705   cat > conftest.c <<EOF
1706 void foo (void) { }
1708   if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS
1709                      -S -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD]) \
1710      && grep -q .note.GNU-stack conftest.s \
1711      && AC_TRY_COMMAND([${CC-cc} $ASFLAGS -Wa,--noexecstack
1712                        -c -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD])
1713   then
1714     libc_cv_as_noexecstack=yes
1715   else
1716     libc_cv_as_noexecstack=no
1717   fi
1718   rm -f conftest*])
1719   if test $libc_cv_as_noexecstack = yes; then
1720     ASFLAGS_config="$ASFLAGS_config -Wa,--noexecstack"
1721   fi
1722   AC_SUBST(ASFLAGS_config)
1724   AC_CACHE_CHECK(for -z combreloc,
1725                  libc_cv_z_combreloc, [dnl
1726   cat > conftest.c <<EOF
1727 extern int bar (int);
1728 extern int mumble;
1729 int foo (void) { return bar (mumble); }
1731   if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1732                         -fPIC -shared -o conftest.so conftest.c
1733                         -nostdlib -nostartfiles
1734                         -Wl,-z,combreloc 1>&AS_MESSAGE_LOG_FD])
1735   then
1736 dnl The following test is a bit weak.  We must use a tool which can test
1737 dnl cross-platform since the gcc used can be a cross compiler.  Without
1738 dnl introducing new options this is not easily doable.  Instead use a tool
1739 dnl which always is cross-platform: readelf.  To detect whether -z combreloc
1740 dnl look for a section named .rel.dyn.
1741     if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
1742       libc_cv_z_combreloc=yes
1743     else
1744       libc_cv_z_combreloc=no
1745     fi
1746   else
1747     libc_cv_z_combreloc=no
1748   fi
1749   rm -f conftest*])
1750   if test "$libc_cv_z_combreloc" = yes; then
1751     AC_DEFINE(HAVE_Z_COMBRELOC)
1752   fi
1753   AC_SUBST(libc_cv_z_combreloc)
1755   AC_CACHE_CHECK(for -z execstack,
1756                  libc_cv_z_execstack, [dnl
1757   cat > conftest.c <<EOF
1758 int _start (void) { return 42; }
1760   if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1761                               -fPIC -shared -o conftest.so conftest.c
1762                               -Wl,-z,execstack -nostdlib
1763                               1>&AS_MESSAGE_LOG_FD])
1764   then
1765     libc_cv_z_execstack=yes
1766   else
1767     libc_cv_z_execstack=no
1768   fi
1769   rm -f conftest*])
1770   AC_SUBST(libc_cv_z_execstack)
1772   AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
1773   cat > conftest.c <<EOF
1774 int foo;
1775 main () { return 0;}
1777   if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
1778                               -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
1779   then
1780     libc_cv_fpie=yes
1781   else
1782     libc_cv_fpie=no
1783   fi
1784   rm -f conftest*])
1786   AC_SUBST(libc_cv_fpie)
1788   AC_CACHE_CHECK(for --hash-style option,
1789                  libc_cv_hashstyle, [dnl
1790   cat > conftest.c <<EOF
1791 int _start (void) { return 42; }
1793   if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1794                               -fPIC -shared -o conftest.so conftest.c
1795                               -Wl,--hash-style=both -nostdlib 1>&AS_MESSAGE_LOG_FD])
1796   then
1797     libc_cv_hashstyle=yes
1798   else
1799     libc_cv_hashstyle=no
1800   fi
1801   rm -f conftest*])
1802   AC_SUBST(libc_cv_hashstyle)
1804   # The linker's default -shared behavior is good enough if it
1805   # does these things that our custom linker scripts ensure that
1806   # all allocated NOTE sections come first.
1807   if test "$use_default_link" = default; then
1808     AC_CACHE_CHECK([for sufficient default -shared layout],
1809                    libc_cv_use_default_link, [dnl
1810     libc_cv_use_default_link=no
1811     cat > conftest.s <<\EOF
1812           .section .note.a,"a",%note
1813           .balign 4
1814           .long 4,4,9
1815           .string "GNU"
1816           .string "foo"
1817           .section .note.b,"a",%note
1818           .balign 4
1819           .long 4,4,9
1820           .string "GNU"
1821           .string "bar"
1823     if AC_TRY_COMMAND([dnl
1824   ${CC-cc} $ASFLAGS -shared -o conftest.so conftest.s 1>&AS_MESSAGE_LOG_FD]) &&
1825        ac_try=`$READELF -S conftest.so | sed -n \
1826          ['${x;p;}
1827           s/^ *\[ *[1-9][0-9]*\]  *\([^ ][^ ]*\)  *\([^ ][^ ]*\) .*$/\2 \1/
1828           t a
1829           b
1830           : a
1831           H']`
1832     then
1833       libc_seen_a=no libc_seen_b=no
1834       set -- $ac_try
1835       while test $# -ge 2 -a "$1" = NOTE; do
1836         case "$2" in
1837         .note.a) libc_seen_a=yes ;;
1838         .note.b) libc_seen_b=yes ;;
1839         esac
1840         shift 2
1841       done
1842       case "$libc_seen_a$libc_seen_b" in
1843       yesyes)
1844         libc_cv_use_default_link=yes
1845         ;;
1846       *)
1847         echo >&AS_MESSAGE_LOG_FD "\
1848 $libc_seen_a$libc_seen_b from:
1849 $ac_try"
1850         ;;
1851       esac
1852     fi
1853     rm -f conftest*])
1854     use_default_link=$libc_cv_use_default_link
1855   fi
1858 AC_CACHE_CHECK(linker output format, libc_cv_output_format, [dnl
1859 if libc_cv_output_format=`
1860 ${CC-cc} -nostartfiles -nostdlib -Wl,--print-output-format 2>&AS_MESSAGE_LOG_FD`
1861 then
1862   :
1863 else
1864   libc_cv_output_format=
1866 test -n "$libc_cv_output_format" || libc_cv_output_format=unknown])
1867 AC_SUBST(libc_cv_output_format)
1869 AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl
1870 cat > conftest.c <<EOF
1871 int foo;
1873 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder -fno-section-anchors
1874                             conftest.c 1>&AS_MESSAGE_LOG_FD])
1875 then
1876   libc_cv_fno_toplevel_reorder=yes
1877 else
1878   libc_cv_fno_toplevel_reorder=no
1880 rm -f conftest*])
1881 if test $libc_cv_fno_toplevel_reorder = yes; then
1882   fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors"
1883 else
1884   fno_unit_at_a_time=-fno-unit-at-a-time
1886 AC_SUBST(fno_unit_at_a_time)
1888 AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
1889 cat > conftest.c <<EOF
1890 int foo;
1891 main () { return 0;}
1893 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -Werror -fstack-protector
1894                             -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
1895 then
1896   libc_cv_ssp=yes
1897 else
1898   libc_cv_ssp=no
1900 rm -f conftest*])
1901 AC_SUBST(libc_cv_ssp)
1903 AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
1904 cat > conftest.c <<EOF
1905 int foo;
1906 #ifdef __GNUC_GNU_INLINE__
1907 main () { return 0;}
1908 #else
1909 #error
1910 #endif
1912 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -std=gnu99 -fgnu89-inline
1913                             -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD])
1914 then
1915   libc_cv_gnu89_inline=yes
1916 else
1917   libc_cv_gnu89_inline=no
1919 rm -f conftest*])
1920 if test $libc_cv_gnu89_inline = yes; then
1921   gnu89_inline=-fgnu89-inline
1922 else
1923   gnu89_inline=
1925 AC_SUBST(gnu89_inline)
1927 if test $elf != yes; then
1928   AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
1929                  [AC_TRY_COMPILE(, [asm (".section .init");
1930                                     asm (".section .fini");
1931                                     asm ("${libc_cv_dot_text}");],
1932                                  libc_cv_have_initfini=yes,
1933                                  libc_cv_have_initfini=no)])
1934   AC_SUBST(libc_cv_have_initfini)dnl
1935   if test $libc_cv_have_initfini = yes; then
1936     AC_DEFINE(HAVE_INITFINI)
1937   fi
1940 if test $elf = yes; then
1941   AC_CACHE_CHECK(whether cc puts quotes around section names,
1942                  libc_cv_have_section_quotes,
1943                  [cat > conftest.c <<EOF
1944                   static const int foo
1945                   __attribute__ ((section ("bar"))) = 1;
1947                   if ${CC-cc} -S conftest.c -o conftest.s; then
1948                     if grep '\.section.*"bar"' conftest.s >/dev/null; then
1949                       libc_cv_have_section_quotes=yes
1950                     else
1951                       libc_cv_have_section_quotes=no
1952                     fi
1953                   else
1954                     libc_cv_have_section_quotes=unknown
1955                   fi
1956                   rm -f conftest.{c,s}
1957                  ])
1958   if test $libc_cv_have_section_quotes = yes; then
1959     AC_DEFINE(HAVE_SECTION_QUOTES)
1960   fi
1963 dnl AC_CHECK_ASM_UNDERSCORE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1964 AC_DEFUN(AC_CHECK_ASM_UNDERSCORE,
1965 [cat > conftest.$ac_ext <<EOF
1966 dnl This sometimes fails to find confdefs.h, for some reason.
1967 dnl [#]line $LINENO "[$]0"
1968 [#]line $LINENO "configure"
1969 #include "confdefs.h"
1970 void underscore_test(void) {
1971 return; }
1973 if AC_TRY_EVAL(ac_compile); then
1974   if grep _underscore_test conftest* >/dev/null; then
1975     ifelse([$1], , :, [rm -f conftest*
1976     $1])
1977   else
1978     ifelse([$2], , , [rm -f conftest*
1979     $2])
1980   fi
1981 else
1982   echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
1983   cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
1984   ifelse([$2], , , [rm -f conftest*
1985   $2])
1987 rm -f conftest*])
1989 if test $elf = yes; then
1990   libc_cv_asm_underscores=no
1991 else
1992   if test $ac_cv_prog_cc_works = yes; then
1993     AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1994                    [AC_TRY_LINK([asm ("_glibc_foobar:");], [glibc_foobar ();],
1995                                 libc_cv_asm_underscores=yes,
1996                                 libc_cv_asm_underscores=no)])
1997   else
1998     AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1999                    [AC_CHECK_ASM_UNDERSCORE(libc_cv_asm_underscores=yes,
2000                                             libc_cv_asm_underscores=no)])
2001   fi
2003 if test $libc_cv_asm_underscores = no; then
2004   AC_DEFINE(NO_UNDERSCORES)
2007 if test $elf = yes; then
2008   libc_cv_weak_symbols=yes
2011 AC_CACHE_CHECK(for assembler .weak directive, libc_cv_asm_weak_directive,
2012                [dnl
2013 cat > conftest.s <<EOF
2014 ${libc_cv_dot_text}
2015 ${libc_cv_asm_global_directive} foo
2016 foo:
2017 .weak foo
2018 .weak bar; bar = foo
2020 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
2021   libc_cv_asm_weak_directive=yes
2022 else
2023   libc_cv_asm_weak_directive=no
2025 rm -f conftest*])
2027 if test $libc_cv_asm_weak_directive = no; then
2028   AC_CACHE_CHECK(for assembler .weakext directive,
2029                  libc_cv_asm_weakext_directive,
2030                  [dnl
2031 cat > conftest.s <<EOF
2032 ${libc_cv_dot_text}
2033 ${libc_cv_asm_global_directive} foo
2034 foo:
2035 .weakext bar foo
2036 .weakext baz
2037 ${libc_cv_asm_global_directive} baz
2038 baz:
2040   if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
2041     libc_cv_asm_weakext_directive=yes
2042   else
2043     libc_cv_asm_weakext_directive=no
2044   fi
2045   rm -f conftest*])
2047 fi # no .weak
2049 if test $libc_cv_asm_weak_directive = yes; then
2050   AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
2051 elif test $libc_cv_asm_weakext_directive = yes; then
2052   AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)
2055 AC_CACHE_CHECK(whether CFI directives are supported, libc_cv_asm_cfi_directives, [dnl
2056 case $machine in
2057   sparc/sparc64*) cfi_offset=2047;;
2058   *) cfi_offset=0;;
2059 esac
2060 cat > conftest.s <<EOF
2061         .text
2062         .type   func,%function
2063 func:
2064         .cfi_startproc
2065         .cfi_remember_state
2066         .cfi_rel_offset 1, $cfi_offset
2067         .cfi_endproc
2069 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
2070   libc_cv_asm_cfi_directives=yes
2071 else
2072   libc_cv_asm_cfi_directives=no
2074 rm -f conftest*])
2075 if test $libc_cv_asm_cfi_directives = yes; then
2076   AC_DEFINE(HAVE_ASM_CFI_DIRECTIVES)
2079 AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
2080 cat > conftest.c <<\EOF
2081 _start () {}
2082 int __eh_pc;
2083 __throw () {}
2085 dnl No \ in command here because it ends up inside ''.
2086 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
2087                             -nostdlib -nostartfiles -Wl,--no-whole-archive
2088                             -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
2089   libc_cv_ld_no_whole_archive=yes
2090 else
2091   libc_cv_ld_no_whole_archive=no
2093 rm -f conftest*])
2094 if test $libc_cv_ld_no_whole_archive = yes; then
2095   no_whole_archive=-Wl,--no-whole-archive
2097 AC_SUBST(no_whole_archive)dnl
2099 AC_CACHE_CHECK(for gcc -fexceptions, libc_cv_gcc_exceptions, [dnl
2100 cat > conftest.c <<\EOF
2101 _start () {}
2102 int __eh_pc;
2103 __throw () {}
2105 dnl No \ in command here because it ends up inside ''.
2106 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
2107                             -nostdlib -nostartfiles -fexceptions
2108                             -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
2109   libc_cv_gcc_exceptions=yes
2110 else
2111   libc_cv_gcc_exceptions=no
2113 rm -f conftest*])
2114 if test $libc_cv_gcc_exceptions = yes; then
2115   exceptions=-fexceptions
2117 AC_SUBST(exceptions)dnl
2119 if test "$host_cpu" = powerpc ; then
2120 # Check for a bug present in at least versions 2.8.x of GCC
2121 # and versions 1.0.x of EGCS.
2122 AC_CACHE_CHECK(whether clobbering cr0 causes problems,libc_cv_c_asmcr0_bug,[dnl
2123 AC_TRY_COMPILE([int tester(int x) { asm ("" : : : "cc"); return x & 123; }],,
2124                libc_cv_c_asmcr0_bug='no',
2125                libc_cv_c_asmcr0_bug='yes')])
2126 if test "$libc_cv_c_asmcr0_bug" != 'no'; then
2127   AC_DEFINE(BROKEN_PPC_ASM_CR0)
2131 dnl Check whether compiler understands __builtin_expect.
2132 AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
2133 [cat > conftest.c <<EOF
2134 #line $LINENO "configure"
2135 int foo (int a)
2137   a = __builtin_expect (a, 10);
2138   return a == 10 ? 0 : 1;
2141 dnl No \ in command here because it ends up inside ''.
2142 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles
2143                             -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
2144   libc_cv_gcc_builtin_expect=yes
2145 else
2146   libc_cv_gcc_builtin_expect=no
2148 rm -f conftest*])
2149 if test "$libc_cv_gcc_builtin_expect" = yes; then
2150   AC_DEFINE(HAVE_BUILTIN_EXPECT)
2153 AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
2154 cat > conftest.c <<\EOF
2155 void zero (void *x)
2157   __builtin_memset (x, 0, 1000);
2161 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null]);
2162 then
2163   libc_cv_gcc_builtin_memset=no
2164 else
2165   libc_cv_gcc_builtin_memset=yes
2167 rm -f conftest* ])
2168 if test "$libc_cv_gcc_builtin_memset" = yes ; then
2169   AC_DEFINE(HAVE_BUILTIN_MEMSET)
2172 AC_CACHE_CHECK(for redirection of built-in functions, libc_cv_gcc_builtin_redirection, [dnl
2173 cat > conftest.c <<\EOF
2174 extern char *strstr (const char *, const char *) __asm ("my_strstr");
2175 char *foo (const char *a, const char *b)
2177   return __builtin_strstr (a, b);
2181 if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "my_strstr" > /dev/null]);
2182 then
2183   libc_cv_gcc_builtin_redirection=yes
2184 else
2185   libc_cv_gcc_builtin_redirection=no
2187 rm -f conftest* ])
2188 if test "$libc_cv_gcc_builtin_redirection" = yes ; then
2189   AC_DEFINE(HAVE_BUILTIN_REDIRECTION)
2192 dnl Check whether the compiler supports the __thread keyword.
2193 if test "x$use__thread" != xno; then
2194   AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
2195   [cat > conftest.c <<\EOF
2196 __thread int a = 42;
2198   if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
2199     libc_cv_gcc___thread=yes
2200   else
2201     libc_cv_gcc___thread=no
2202   fi
2203   rm -f conftest*])
2204   if test "$libc_cv_gcc___thread" = yes; then
2205     AC_DEFINE(HAVE___THREAD)
2206   fi
2207 else
2208   libc_cv_gcc___thread=no
2211 if test "$libc_cv_gcc___thread" = yes; then
2212   dnl Check whether the compiler supports the tls_model attribute.
2213   AC_CACHE_CHECK([for tls_model attribute], libc_cv_gcc_tls_model_attr, [dnl
2214   cat > conftest.c <<\EOF
2215 extern __thread int a __attribute__((tls_model ("initial-exec")));
2217   if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&AS_MESSAGE_LOG_FD]); then
2218     libc_cv_gcc_tls_model_attr=yes
2219   else
2220     libc_cv_gcc_tls_model_attr=no
2221   fi
2222   rm -f conftest*])
2223   if test "$libc_cv_gcc_tls_model_attr" = yes; then
2224     AC_DEFINE(HAVE_TLS_MODEL_ATTRIBUTE)
2225   fi
2228 if test -n "$submachine"; then
2229   AC_CACHE_CHECK([for compiler option for CPU variant],
2230                  libc_cv_cc_submachine, [dnl
2231   libc_cv_cc_submachine=no
2232   for opt in "-march=$submachine" "-mcpu=$submachine"; do
2233     if AC_TRY_COMMAND([${CC-cc} $opt -xc /dev/null -S -o /dev/null]); then
2234       libc_cv_cc_submachine="$opt"
2235       break
2236     fi
2237   done])
2238   if test "x$libc_cv_cc_submachine" = xno; then
2239     AC_MSG_ERROR([${CC-cc} does not support $submachine])
2240   fi
2242 AC_SUBST(libc_cv_cc_submachine)
2244 dnl Check whether we have the gd library available.
2245 AC_MSG_CHECKING(for libgd)
2246 if test "$with_gd" != "no"; then
2247   old_CFLAGS="$CFLAGS"
2248   CFLAGS="$CFLAGS $libgd_include"
2249   old_LDFLAGS="$LDFLAGS"
2250   LDFLAGS="$LDFLAGS $libgd_ldflags"
2251   old_LIBS="$LIBS"
2252   LIBS="$LIBS -lgd -lpng -lz -lm"
2253   AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
2254   CFLAGS="$old_CFLAGS"
2255   LDFLAGS="$old_LDFLAGS"
2256   LIBS="$old_LIBS"
2257 else
2258   LIBGD=no
2260 AC_MSG_RESULT($LIBGD)
2261 AC_SUBST(LIBGD)
2263 # SELinux detection
2264 if test x$with_selinux = xno ; then
2265   have_selinux=no;
2266 else
2267   # See if we have the SELinux library
2268   AC_CHECK_LIB(selinux, is_selinux_enabled,
2269                have_selinux=yes, have_selinux=no)
2270   # See if we have the SELinux header with the NSCD permissions in it.
2271   if test x$have_selinux = xyes ; then
2272     AC_MSG_CHECKING([for NSCD Flask permissions in selinux/av_permissions.h])
2273     AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
2274                     [#ifdef NSCD__SHMEMHOST
2275                      return 0;
2276                      #else
2277                      #error NSCD__SHMEMHOST not defined
2278                      #endif],
2279                     have_selinux=yes, have_selinux=no)
2280     AC_MSG_RESULT($have_selinux)
2281   fi
2283   if test x$with_selinux = xyes ; then
2284     if test x$have_selinux = xno ; then
2285       AC_MSG_ERROR([SELinux explicitly required, but sufficiently recent SELinux library not found])
2286     fi
2287   fi
2289 # Check if we're building with SELinux support.
2290 if test "x$have_selinux" = xyes; then
2291   AC_DEFINE(HAVE_SELINUX, 1, [SELinux support])
2293   # See if we have the libaudit library
2294   AC_CHECK_LIB(audit, audit_log_user_avc_message,
2295                have_libaudit=yes, have_libaudit=no)
2296   if test "x$have_libaudit" = xyes; then
2297     AC_DEFINE(HAVE_LIBAUDIT, 1, [SELinux libaudit support])
2298   fi
2299   AC_SUBST(have_libaudit)
2301   # See if we have the libcap library
2302   AC_CHECK_LIB(cap, cap_init, have_libcap=yes, have_libcap=no)
2303   if test "x$have_libcap" = xyes; then
2304     AC_DEFINE(HAVE_LIBCAP, 1, [SELinux libcap support])
2305   fi
2306   AC_SUBST(have_libcap)
2308 AC_SUBST(have_selinux)
2310 dnl check for the size of 'long double'.
2311 AC_CHECK_SIZEOF(long double, 0)
2312 sizeof_long_double=$ac_cv_sizeof_long_double
2313 AC_SUBST(sizeof_long_double)
2315 ### End of automated tests.
2316 ### Now run sysdeps configure fragments.
2318 # They also can set these variables.
2319 use_ldconfig=no
2320 ldd_rewrite_script=no
2321 libc_cv_sysconfdir=$sysconfdir
2322 libc_cv_gcc_unwind_find_fde=no
2323 libc_cv_idn=no
2325 # Iterate over all the sysdep directories we will use, running their
2326 # configure fragments.
2327 for dir in $sysnames; do
2328   case $dir in
2329     /*) dest=$dir ;;
2330     *)  dest=$srcdir/$dir ;;
2331   esac
2332   if test -r $dest/configure; then
2333     AC_MSG_RESULT(running configure fragment for $dir)
2334     . $dest/configure
2335   fi
2336 done
2338 if test x$libc_cv_gcc_unwind_find_fde = xyes; then
2339   AC_DEFINE(EXPORT_UNWIND_FIND_FDE)
2341 AC_SUBST(libc_cv_gcc_unwind_find_fde)
2343 dnl This is tested by existing code and it's simpler to avoid changing it.
2344 AC_DEFINE(USE_IN_LIBIO)
2346 # Test for old glibc 2.0.x headers so that they can be removed properly
2347 # Search only in includedir.
2348 AC_MSG_CHECKING(for old glibc 2.0.x headers)
2349 if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
2350 then
2351   old_glibc_headers=yes
2352 else
2353   old_glibc_headers=no
2355 AC_MSG_RESULT($old_glibc_headers)
2356 if test ${old_glibc_headers} = yes; then
2357   AC_MSG_WARN(*** During \"make install\" old headers from glibc 2.0.x will)
2358   AC_MSG_WARN(*** be removed.)
2360 AC_SUBST(old_glibc_headers)
2362 AC_SUBST(libc_cv_slibdir)
2363 AC_SUBST(libc_cv_localedir)
2364 AC_SUBST(libc_cv_sysconfdir)
2365 AC_SUBST(libc_cv_rootsbindir)
2366 AC_SUBST(libc_cv_forced_unwind)
2368 dnl sysdeps/CPU/configure.in checks set this via arch-specific asm tests
2369 AC_SUBST(libc_cv_cpp_asm_debuginfo)
2370 AC_SUBST(libc_cv_cc_sse4)
2371 AC_SUBST(libc_cv_cc_avx)
2372 AC_SUBST(libc_cv_cc_novzeroupper)
2373 AC_SUBST(libc_cv_as_i686)
2375 AC_SUBST(use_ldconfig)
2376 AC_SUBST(ldd_rewrite_script)
2378 AC_SUBST(elf) AC_SUBST(xcoff)
2379 if test $elf = yes; then
2380   AC_DEFINE(HAVE_ELF)
2382 if test $xcoff = yes; then
2383   AC_DEFINE(HAVE_XCOFF)
2386 AC_SUBST(static)
2387 AC_SUBST(shared)
2388 if test $shared = default; then
2389   shared=$elf
2392 AC_CACHE_CHECK([whether -fPIC is default], libc_cv_pic_default,
2393 [libc_cv_pic_default=yes
2394 cat > conftest.c <<EOF
2395 #if defined __PIC__ || defined __pic__ || defined PIC || defined pic
2396 # error PIC is default.
2397 #endif
2399 if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
2400   libc_cv_pic_default=no
2402 rm -f conftest.*])
2403 AC_SUBST(libc_cv_pic_default)
2405 AC_SUBST(profile)
2406 AC_SUBST(omitfp)
2407 AC_SUBST(bounded)
2408 AC_SUBST(static_nss)
2409 AC_SUBST(nopic_initfini)
2411 AC_SUBST(DEFINES)
2413 dnl See sysdeps/mach/configure.in for this variable.
2414 AC_SUBST(mach_interface_list)
2416 if test "`(cd $srcdir; pwd)`" = "`pwd`"; then
2417   config_makefile=
2418 else
2419   config_makefile=Makefile
2422 VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
2423 RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
2424 AC_SUBST(VERSION)
2425 AC_SUBST(RELEASE)
2427 AC_CONFIG_FILES([config.make ${config_makefile}])
2428 AC_CONFIG_COMMANDS([default],[[
2429 case $CONFIG_FILES in *config.make*)
2430 echo "$config_vars" >> config.make;;
2431 esac
2432 test -d bits || mkdir bits]],[[config_vars='$config_vars']])
2433 AC_OUTPUT