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