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