]> git.ipfire.org Git - thirdparty/glibc.git/blame - configure.in
* sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela): Fix
[thirdparty/glibc.git] / configure.in
CommitLineData
f4017d20 1dnl Process this file with autoconf to produce a configure script.
ff3d7ed3 2AC_REVISION([$CVSid$])
3a12e572 3AC_PREREQ(2.53)dnl dnl Minimum Autoconf version required.
5d77b1da
RM
4AC_INIT([GNU C Library], [(see version.h)], [glibc])
5AC_CONFIG_SRCDIR([include/features.h])
28f540f4 6AC_CONFIG_HEADER(config.h)
5bc2f642 7AC_CONFIG_AUX_DIR(scripts)
28f540f4
RM
8
9# This will get text that should go into config.make.
10config_vars=
11
12# Check for a --with-gmp argument and set gmp-srcdir in config.make.
13AC_ARG_WITH(gmp, dnl
14 --with-gmp=DIRECTORY find GMP source code in DIRECTORY (not needed),
15 [dnl
16case "$with_gmp" in
17yes) AC_MSG_ERROR(--with-gmp requires an argument; use --with-gmp=DIRECTORY) ;;
18''|no) ;;
19*) config_vars="$config_vars
20gmp-srcdir = $withval" ;;
21esac
22])
c8f3e6db
UD
23# Check for a --with-gd argument and set libgd-LDFLAGS in config.make.
24AC_ARG_WITH(gd, dnl
25 --with-gd=DIR find libgd include dir and library with prefix DIR,
26 [dnl
27case "$with_gd" in
f5f7239f
UD
28yes|''|no) ;;
29*) libgd_include="-I$withval/include"
c8f3e6db
UD
30 libgd_ldflags="-L$withval/lib" ;;
31esac
32])
f5f7239f
UD
33AC_ARG_WITH(gd-include, dnl
34 --with-gd-include=DIR find libgd include files in DIR,
35 [dnl
36case "$with_gd_include" in
37''|no) ;;
38*) libgd_include="-I$withval" ;;
39esac
40])
41AC_ARG_WITH(gd-lib, dnl
42 --with-gd-lib=DIR find libgd library files in DIR,
43 [dnl
44case "$with_gd_lib" in
45''|no) ;;
46*) libgd_ldflags="-L$withval" ;;
47esac
48])
49
50if test -n "$libgd_include"; then
51 config_vars="$config_vars
cf90163d 52CFLAGS-memusagestat.c = $libgd_include"
f5f7239f
UD
53fi
54if test -n "$libgd_ldflags"; then
55 config_vars="$config_vars
56libgd-LDFLAGS = $libgd_ldflags"
57fi
28f540f4 58
ff3d7ed3 59dnl Arguments to specify presence of other packages/features.
335aa320 60AC_ARG_WITH(fp, dnl
a18f587d 61[ --with-fp if using floating-point hardware [default=yes]],
335aa320 62 with_fp=$withval, with_fp=yes)
675322a5 63AC_SUBST(with_fp)
650425ce 64AC_ARG_WITH(binutils, dnl
a5a0310d 65 --with-binutils=PATH specify location of binutils (as and ld),
650425ce 66 path_binutils=$withval, path_binutils='')
28f540f4
RM
67AC_ARG_WITH(elf, dnl
68 --with-elf if using the ELF object format,
335aa320 69 elf=$withval, elf=no)
5af3245a
UD
70AC_ARG_WITH(xcoff, dnl
71 --with-xcoff if using the XCOFF object format,
72 xcoff=$withval, xcoff=no)
4d06461a 73AC_ARG_WITH(cvs, dnl
4442d7e8 74[ --without-cvs if CVS should not be used],
4d06461a 75 with_cvs=$withval, with_cvs=yes)
6b3f2b3d
UD
76if test "$with_cvs" = yes; then
77 if test -d $srcdir/CVS && grep :pserver: $srcdir/CVS/Root > /dev/null
78 then
79 with_cvs=no
80 fi
4442d7e8 81fi
4d06461a 82AC_SUBST(with_cvs)
28f540f4 83
dbe7a0f5
UD
84AC_ARG_WITH(headers, dnl
85[ --with-headers=PATH location of system headers to use
86 [e.g. /usr/src/linux/include]
87 [default=compiler default]],
88 sysheaders=$withval, sysheaders='')
89
a18f587d
UD
90AC_ARG_ENABLE(sanity-checks, dnl
91[ --disable-sanity-checks really do not use threads (should not be used
92 except in special situations) [default=yes]],
93 enable_sanity=$enableval, enable_sanity=yes)
94
650425ce
UD
95dnl Arguments to enable or disable building the static, shared, profiled,
96dnl and -fomit-frame-pointer libraries.
b38bb8ca
UD
97dnl I've disabled this for now since we cannot build glibc without static
98dnl libraries built in the moment.
99dnl AC_ARG_ENABLE(static, dnl
100dnl [ --enable-static build static library [default=yes]],
101dnl static=$enableval, static=yes)
5c2a0669 102static=yes
ff3d7ed3
RM
103AC_ARG_ENABLE(shared, dnl
104[ --enable-shared build shared library [default=yes if GNU ld & ELF]],
6b3a2224 105 shared=$enableval, shared=default)
ff3d7ed3
RM
106AC_ARG_ENABLE(profile, dnl
107[ --enable-profile build profiled library [default=yes]],
6b3a2224 108 profile=$enableval, profile=yes)
ff3d7ed3 109AC_ARG_ENABLE(omitfp, dnl
6b3a2224
RM
110[ --enable-omitfp build undebuggable optimized library [default=no]],
111 omitfp=$enableval, omitfp=no)
5a97622d
UD
112AC_ARG_ENABLE(bounded, dnl
113[ --enable-bounded build with runtime bounds checking [default=no]],
114 bounded=$enableval, bounded=no)
650425ce
UD
115AC_ARG_ENABLE(versioning, dnl
116[ --disable-versioning do not include versioning information in the
117 library objects [default=yes if supported]],
118 enable_versioning=$enableval, enable_versioning=yes)
6b3a2224 119
62ab42d6
UD
120AC_ARG_ENABLE(oldest-abi, dnl
121[ --enable-oldest-abi=ABI configure the oldest ABI supported [e.g. 2.2]
122 [default=glibc default]],
123 oldest_abi=$enableval, oldest_abi=no)
124if test "$oldest_abi" = yes || test "$oldest_abi" = no; then
125 oldest_abi=default
126else
127 AC_DEFINE_UNQUOTED(GLIBC_OLDEST_ABI, "$oldest_abi")
128fi
129AC_SUBST(oldest_abi)
130
6b3a2224
RM
131dnl Generic infrastructure for drop-in additions to libc.
132AC_ARG_ENABLE(add-ons, dnl
73237de3
UD
133[ --enable-add-ons[=DIR1,DIR2]...
134 configure and build add-ons in DIR1,DIR2,...
135 search for add-ons if no parameter given],
61952351 136 [case "$enableval" in
9c4c0024
UD
137 yes) add_ons=`cd $srcdir && echo */configure | sed -e 's!/configure!!g'`
138 test "$add_ons" = "*" && add_ons= ;;
61952351
UD
139 *) add_ons=`echo "$enableval" | sed 's/,/ /g'`;;
140 esac],
141 [add_ons=])
142
8d4b5a8a 143dnl Let the user avoid using TLS. Don't know why but...
9cce206e 144dnl XXX For now we disable support by default.
8d4b5a8a 145AC_ARG_WITH(tls, dnl
9cce206e
UD
146[ --with-tls enable support for TLS],
147 usetls=$withval, usetls=no)
8d4b5a8a 148
5b8f26b4
RM
149AC_ARG_WITH(__thread, dnl
150[ --without-__thread do not use TLS features even when supporting them],
151 use__thread=$withval, use__thread=yes)
152
749a9a4f
RM
153AC_ARG_ENABLE(hidden-plt, dnl
154[ --disable-hidden-plt do not hide internal function calls to avoid PLT],
155 hidden=$enableval, hidden=yes)
156if test "x$hidden" = xno; then
157 AC_DEFINE(NO_HIDDEN)
158fi
159
6b3a2224 160AC_CONFIG_SUBDIRS($add_ons)
57ba7bb4 161add_ons_pfx=
da74e902 162if test x"$add_ons" != x; then
57ba7bb4 163 for f in $add_ons; do
aa44a9de
AJ
164 # Some sanity checks
165 if test "$f" = "crypt"; then
166 AC_MSG_ERROR([
167*** It seems that you're using an old \`crypt' add-on. crypt is now
168*** part of glibc and using the old add-on will not work with this
169*** release. Start again with fresh sources and without the old
170*** \`crypt' add-on.])
171 fi
172 if test "$f" = "localedata"; then
173 AC_MSG_ERROR([
174*** It seems that you're using an old \`localedata' add-on. localedata
175*** is now part of glibc and using the old add-on will not work with
176*** this release. Start again with fresh sources and without the old
177*** \`localedata' add-on.])
178 fi
af6f3906
UD
179 # Test whether such a subdir really exists.
180 if test -d $srcdir/$f; then
181 add_ons_pfx="$add_ons_pfx $f/"
182 else
183 AC_MSG_ERROR(add-on directory \"$f\" does not exist)
184 fi
57ba7bb4
UD
185 done
186fi
ff3d7ed3 187
5107cf1d
UD
188dnl On some platforms we cannot use dynamic loading. We must provide
189dnl static NSS modules.
190AC_ARG_ENABLE(static-nss, dnl
191[ --enable-static-nss build static NSS modules [default=no]],
192 static_nss=$enableval, static_nss=no)
834cef7c
UD
193dnl Enable static NSS also if we build no shared objects.
194if test x"$static_nss" = xyes || test x"$shared" = xno; then
3172f58f 195 static_nss=yes
5107cf1d
UD
196 AC_DEFINE(DO_STATIC_NSS)
197fi
198
73237de3 199AC_ARG_ENABLE(force-install,
310b3460 200[ --disable-force-install don't force installation of files from this package,
73237de3
UD
201 even if they are older than the installed files],
202 force_install=$enableval, force_install=yes)
203AC_SUBST(force_install)
204
958f238f
UD
205dnl On some platforms we allow dropping compatibility with all kernel
206dnl versions.
207AC_ARG_ENABLE(kernel,
b5b53bdb 208[ --enable-kernel=VERSION compile for compatibility with kernel not older
958f238f
UD
209 than VERSION],
210 minimum_kernel=$enableval)
86cfe82d
UD
211dnl Prevent unreasonable values.
212if test "$minimum_kernel" = yes || test "$minimum_kernel" = no; then
213 # Better nothing than this.
214 minimum_kernel=""
269e369f
UD
215else
216 if test "$minimum_kernel" = current; then
217 minimum_kernel=`uname -r 2>/dev/null` || minimum_kernel=
218 fi
86cfe82d 219fi
958f238f 220
6cc7d725
UD
221dnl For the development we sometimes want gcc to issue even more warnings.
222dnl This is not the default since many of the extra warnings are not
223dnl appropriate.
224AC_ARG_ENABLE(all-warnings,
225[ --enable-all-warnings enable all useful warnings gcc can issue],
226 all_warnings=$enableval)
227AC_SUBST(all_warnings)
228
28f540f4 229AC_CANONICAL_HOST
8a523922
UD
230
231# The way shlib-versions is used to generate soversions.mk uses a
232# fairly simplistic model for name recognition that can't distinguish
233# i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
234# of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can
235# tell. This doesn't get used much beyond that, so it's fairly safe.
236case "$host_os" in
237linux*)
238 ;;
239gnu*)
240 host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'`
241 ;;
242esac
243
28f540f4
RM
244# We keep the original values in `$config_*' and never modify them, so we
245# can write them unchanged into config.make. Everything else uses
246# $machine, $vendor, and $os, and changes them whenever convenient.
247config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
248
2f64b655
UD
249# Don't allow vendor == "unknown"
250test "$config_vendor" = unknown && config_vendor=
251config_os="`echo $config_os | sed 's/^unknown-//'`"
252
a2fe9c76
RM
253# Some configurations imply other options.
254case "$host_os" in
255gnu* | linux* | bsd4.4* | netbsd* | freebsd*)
256 # These systems always use GNU tools.
c8cf0b14 257 gnu_ld=yes gnu_as=yes ;;
a2fe9c76
RM
258esac
259case "$host_os" in
7799b7b3
UD
260# i586-linuxaout is mangled into i586-pc-linux-gnuaout
261linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*)
3776d592 262 ;;
ffa8d2a0 263gnu* | linux* | freebsd* | netbsd* | sysv4* | solaris2* | irix6*)
3776d592
RM
264 # These systems (almost) always use the ELF format.
265 elf=yes
84724245 266 ;;
5af3245a
UD
267aix*)
268 # These systems are always xcoff
269 xcoff=yes
a711b01d 270 elf=no
5af3245a 271 ;;
a2fe9c76
RM
272esac
273
28f540f4
RM
274machine=$config_machine
275vendor=$config_vendor
276os=$config_os
277
a808d541
UD
278# config.guess on some IBM machines says `rs6000' instead of `powerpc'.
279# Unify this here.
280if test "$machine" = rs6000; then
281 machine="powerpc"
282fi
283
bdc8eb03
UD
284###
285### I put this here to prevent those annoying emails from people who cannot
286### read and try to compile glibc on unsupported platforms. --drepper
287###
288### By using the undocumented --enable-hacker-mode option for configure
289### one can skip this test to make the configuration not fail for unsupported
290### platforms.
291###
292if test -z "$enable_hacker_mode"; then
293 case "$machine-$host_os" in
75d86c1f 294 *-linux* | *-gnu* | arm*-none* | powerpc-aix4.3.*)
bdc8eb03
UD
295 ;;
296 *)
297 echo "*** The GNU C library is currently not available for this platform."
298 echo "*** So far nobody cared to port it and if there is no volunteer it"
299 echo "*** might never happen. So, if you have interest to see glibc on"
300 echo "*** this platform visit"
301 echo "*** http://www.gnu.org/software/libc/porting.html"
302 echo "*** and join the group of porters"
303 exit 1
304 ;;
305 esac
306fi
307
1a8aaf91 308# Brain dead PowerPC box with absolutely no FPU.
1a8aaf91
UD
309case "$machine-$host_os" in
310 powerpc*-*soft)
311 with_fp=no
312 completely_soft=yes
313 AC_SUBST(completely_soft)
314 ;;
315esac
316
28f540f4
RM
317dnl We need to use [ and ] for other purposes for a while now.
318changequote(,)dnl
319# Expand the configuration machine name into a subdirectory by architecture
320# type and particular chip.
321case "$machine" in
f0523145
RM
322a29k | am29000) base_machine=a29k machine=a29k ;;
323alpha*) base_machine=alpha machine=alpha/$machine ;;
0c8b61e6 324arm*) base_machine=arm machine=arm/arm32/$machine ;;
60c96635
UD
325c3[012]) base_machine=cx0 machine=cx0/c30 ;;
326c4[04]) base_machine=cx0 machine=cx0/c40 ;;
b15cb495
UD
327hppa*64*) base_machine=hppa machine=hppa/hppa64 ;;
328hppa*) base_machine=hppa machine=hppa/hppa1.1 ;;
a8922de8 329i[3456]86) base_machine=i386 machine=i386/$machine ;;
d64e704c 330ia64) base_machine=ia64 machine=ia64 ;;
f0523145
RM
331m680?0) base_machine=m68k machine=m68k/$machine ;;
332m68k) base_machine=m68k machine=m68k/m68020 ;;
333m88???) base_machine=m88k machine=m88k/$machine ;;
334m88k) base_machine=m88k machine=m88k/m88100 ;;
f0523145 335mips64*) base_machine=mips64 machine=mips/mips64/$machine ;;
2b904739 336mips*) base_machine=mips machine=mips/$machine ;;
92b27c74
UD
337powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;;
338powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;;
136d4332
UD
339s390) base_machine=s390 machine=s390/s390-32 ;;
340s390x) base_machine=s390 machine=s390/s390-64 ;;
88615235
UD
341sh3*) base_machine=sh machine=sh/sh3 ;;
342sh4*) base_machine=sh machine=sh/sh4 ;;
ca34d7a7
UD
343sparc | sparcv[67])
344 base_machine=sparc machine=sparc/sparc32 ;;
345sparcv8 | supersparc | hypersparc)
346 base_machine=sparc machine=sparc/sparc32/sparcv8 ;;
ae6b8730
RH
347sparcv8plus | sparcv8plusa | sparcv9)
348 base_machine=sparc machine=sparc/sparc32/sparcv9 ;;
bb769ab6
UD
349sparcv8plusb | sparcv9b)
350 base_machine=sparc machine=sparc/sparc32/sparcv9b ;;
ca34d7a7
UD
351sparc64 | ultrasparc)
352 base_machine=sparc machine=sparc/sparc64 ;;
bb769ab6
UD
353sparc64b | ultrasparc3)
354 base_machine=sparc machine=sparc/sparc64/sparcv9b ;;
0c8b61e6 355thumb*) base_machine=thumb machine=arm/thumb/$machine ;;
3a2832a0 356*) base_machine=$machine ;;
28f540f4 357esac
f0523145
RM
358changequote([,])dnl
359AC_SUBST(base_machine)
28f540f4 360
dfd2257a
UD
361if test "$base_machine" = "i386"; then
362 AC_DEFINE(USE_REGPARMS)
363fi
364
f0523145 365# Compute the list of sysdep directories for this configuration.
f332db02 366# This can take a while to compute.
f0523145 367sysdep_dir=$srcdir/sysdeps
f332db02 368AC_MSG_CHECKING(sysdep dirs)
f0523145
RM
369dnl We need to use [ and ] for other purposes for a while now.
370changequote(,)dnl
28f540f4
RM
371# Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
372os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
373
374case "$os" in
375gnu*)
376 base_os=mach/hurd ;;
883bc19b 377netbsd* | 386bsd* | freebsd* | bsdi*)
28f540f4 378 base_os=unix/bsd/bsd4.4 ;;
222c4e71 379osf* | sunos* | ultrix* | newsos* | dynix* | *bsd*)
28f540f4 380 base_os=unix/bsd ;;
d586354e 381sysv* | isc* | esix* | sco* | minix* | irix4* | linux*)
28f540f4 382 base_os=unix/sysv ;;
f802accb
UD
383irix6*)
384 base_os=unix/sysv/irix6/$os ;;
d586354e 385solaris[2-9]*)
28f540f4 386 base_os=unix/sysv/sysv4 ;;
908c3d5b
UD
387hpux*)
388 base_os=unix/sysv/hpux/$os ;;
75d86c1f
UD
389aix4.3*)
390 base_os=unix/sysv/aix/aix4.3 ;;
28f540f4
RM
391none)
392 base_os=standalone ;;
393*)
394 base_os='' ;;
395esac
396
397# For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
398tail=$os
399ostry=$os
400while o=`echo $tail | sed 's/\.[^.]*$//'`; test $o != $tail; do
401 ostry="$ostry /$o"
402 tail=$o
75914335 403done
28f540f4
RM
404o=`echo $tail | sed 's/[0-9]*$//'`
405if test $o != $tail; then
406 ostry="$ostry /$o"
407fi
ec4b0518
UD
408# For linux-gnu, try linux-gnu, then linux.
409o=`echo $tail | sed 's/-.*$//'`
410if test $o != $tail; then
411 ostry="$ostry /$o"
412fi
28f540f4
RM
413
414# For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
415base=
416tail=$base_os
417while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$b"; do
418 set $b
419 base="$base /$1"
420 tail="$2"
421done
422
ae6b8730 423# For sparc/sparc32, try sparc/sparc32 and then sparc.
28f540f4
RM
424mach=
425tail=$machine
426while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
427 set $m
10ceac89
RM
428 # Prepend the machine's FPU directory unless --without-fp.
429 if test "$with_fp" = yes; then
430 mach="$mach /$1/fpu"
82d00cab 431 fi
28f540f4
RM
432 mach="$mach /$1"
433 tail="$2"
434done
435
436dnl We are done with glob and regexp uses of [ and ]; return to autoconf.
437changequote([,])dnl
438
439# Find what sysdep directories exist.
440sysnames=
57ba7bb4
UD
441IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
442for d in $add_ons_pfx ''; do
443 for b in $base ''; do
444 for m0 in $mach ''; do
445 for v in /$vendor ''; do
ae828bc6 446 test "$v" = / && continue
57ba7bb4 447 for o in /$ostry ''; do
ae828bc6 448 test "$o" = / && continue
57ba7bb4
UD
449 for m in $mach ''; do
450 if test "$m0$b$v$o$m"; then
451 try="${d}sysdeps$m0$b$v$o$m"
452 test -n "$enable_debug_configure" &&
453 echo "$0 [DEBUG]: try $try" >&2
9c4c0024 454 if test -d $srcdir/$try; then
57ba7bb4
UD
455 sysnames="$sysnames $try"
456 { test -n "$o" || test -n "$b"; } && os_used=t
457 { test -n "$m" || test -n "$m0"; } && machine_used=t
458 fi
459 fi
460 done
28f540f4
RM
461 done
462 done
463 done
464 done
465done
57ba7bb4 466IFS="$ac_save_ifs"
28f540f4
RM
467
468if test -z "$os_used" && test "$os" != none; then
469 AC_MSG_ERROR(Operating system $os is not supported.)
470fi
471if test -z "$machine_used" && test "$machine" != none; then
472 AC_MSG_ERROR(The $machine is not supported.)
473fi
474
475# We have now validated the configuration.
476
335aa320 477
10ceac89
RM
478# If using ELF, look for an `elf' subdirectory of each machine directory.
479# We prepend these rather than inserting them whereever the machine appears
480# because things specified by the machine's ELF ABI should override
481# OS-specific things, and should always be the same for any OS on the
482# machine (otherwise what's the point of an ABI?).
483if test "$elf" = yes; then
484 elf_dirs=
57ba7bb4 485 for d in $add_ons_pfx ''; do
57ba7bb4 486 for m in $mach; do
9c4c0024 487 if test -d $srcdir/${d}sysdeps$m/elf; then
c2bb8cab 488 elf_dirs="$elf_dirs ${d}sysdeps$m/elf"
57ba7bb4
UD
489 fi
490 done
28f540f4 491 done
57ba7bb4 492 sysnames="`echo $elf_dirs | sed -e 's,//,/,g'` $sysnames"
28f540f4
RM
493fi
494
335aa320 495
28f540f4
RM
496# Expand the list of system names into a full list of directories
497# from each element's parent name and Implies file (if present).
498set $sysnames
e50ec9f9 499names=
28f540f4
RM
500while test $# -gt 0; do
501 name=$1
502 shift
503
e50ec9f9 504 case " $names " in *" $name "*)
f332db02
RM
505 # Already in the list.
506 continue
e50ec9f9 507 esac
f332db02
RM
508
509 # Report each name as we discover it, so there is no long pause in output.
3a12e572 510 echo $ECHO_N "$name $ECHO_C" >&AC_FD_MSG
f332db02 511
57ba7bb4
UD
512 name_base=`echo $name | sed -e 's@\(.*sysdeps\)/.*@\1@'`
513
514 case $name in
515 /*) xsrcdir= ;;
516 *) xsrcdir=$srcdir/ ;;
517 esac
518 test -n "$enable_debug_configure" &&
519 echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2
520
521 if test -f $xsrcdir$name/Implies; then
28f540f4 522 # Collect more names from the `Implies' file (removing comments).
57ba7bb4
UD
523 implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`"
524 implied=
525 for x in $implied_candidate; do
636ccfc8 526 found=no
57ba7bb4
UD
527 if test -d $xsrcdir$name_base/$x; then
528 implied="$implied $name_base/$x";
636ccfc8
UD
529 found=yes
530 fi
531 for d in $add_ons_pfx ''; do
532 try="${d}sysdeps/$x"
533 case $d in
534 /*) try_srcdir= ;;
535 *) try_srcdir=$srcdir/ ;;
536 esac
537 test -n "$enable_debug_configure" &&
538 echo "[DEBUG]: $name implied $x try($d) {$try_srcdir}$try" >&2
539 if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
540 then
541 implied="$implied $try"
542 found=yes
543 fi
544 done
545 if test $found = no; then
57ba7bb4
UD
546 AC_MSG_WARN($name/Implies specifies nonexistent $x)
547 fi
28f540f4
RM
548 done
549 else
550 implied=
551 fi
552
553 # Add NAME to the list of names.
554 names="$names $name"
555
556 # Find the parent of NAME, using the empty string if it has none.
557changequote(,)dnl
57ba7bb4 558 parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
28f540f4
RM
559changequote([,])dnl
560
561 # Add the names implied by NAME, and NAME's parent (if it has one), to
562 # the list of names to be processed (the argument list). We prepend the
563 # implied names to the list and append the parent. We want implied
564 # directories to come before further directories inferred from the
565 # configuration components; this ensures that for sysv4, unix/common
566 # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
567 # after sysv4).
568 sysnames="`echo $implied $* $parent`"
569 test -n "$sysnames" && set $sysnames
570done
571
572# Add the default directories.
ecdc196c 573default_sysnames=sysdeps/generic
2de7874e 574if test "$elf" = yes; then
ecdc196c 575 default_sysnames="sysdeps/generic/elf $default_sysnames"
2de7874e 576fi
ecdc196c 577sysnames="$names $default_sysnames"
f332db02
RM
578AC_SUBST(sysnames)
579# The other names were emitted during the scan.
ecdc196c 580AC_MSG_RESULT($default_sysnames)
28f540f4 581
f332db02
RM
582
583### Locate tools.
28f540f4 584
28f540f4 585AC_PROG_INSTALL
2b80a372 586if test "$INSTALL" = "${srcdir}/scripts/install-sh -c"; then
28f540f4 587 # The makefiles need to use a different form to find it in $srcdir.
2b80a372 588 INSTALL='\$(..)./scripts/install-sh -c'
28f540f4 589fi
0e3426bb 590AC_PROG_LN_S
ae828bc6 591
a4301d41
UD
592# We need the physical current working directory. We cannot use the
593# "pwd -P" shell builtin since that's not portable. Instead we try to
594# find a pwd binary. Note that assigning to the PWD environment
595# variable might have some interesting side effects, so we don't do
596# that.
597AC_PATH_PROG(PWD_P, pwd, no)
598if test "$PWD_P" = no; then
599 AC_MSG_ERROR(*** A pwd binary could not be found.)
600fi
601
63bda0c1 602# These programs are version sensitive.
3a12e572 603AC_CHECK_TOOL_PREFIX
4bca4c17 604AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
90d1d40b
RM
605 [version \([egcygnustpi-]*[0-9.]*\)], [3.[2-9]*],
606 critic_missing="$critic_missing gcc")
22e65f8f 607AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
8fc1e2ca 608 [GNU Make[^0-9]*\([0-9][0-9.]*\)],
6b4e880f 609 [3.79* | 3.[89]*], critic_missing="$critic_missing make")
63bda0c1 610
03616749
AJ
611
612if test -n "$critic_missing"; then
613AC_MSG_ERROR([
aefdff34 614*** These critical programs are missing or too old:$critic_missing
03616749
AJ
615*** Check the INSTALL file for required versions.])
616fi
617
618
22e65f8f 619AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
bdd421cc 620 [GNU gettext.* \([0-9]*\.[0-9.]*\)],
aefdff34
RM
621 [0.10.3[6-9]* | 0.10.[4-9][0-9]* | 0.1[1-9]* | 0.[2-9][0-9]* | [1-9].*],
622 MSGFMT=: aux_missing="$aux_missing msgfmt")
63bda0c1 623AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
8b7fb588 624 [GNU texinfo.* \([0-9][0-9.]*\)],
aefdff34
RM
625 [4.*],
626 MAKEINFO=: aux_missing="$aux_missing makeinfo")
d6a97a28 627AC_CHECK_PROG_VER(SED, sed, --version,
aec103d3 628 [GNU sed version \([0-9]*\.[0-9.]*\)],
aefdff34
RM
629 [3.0[2-9]*|3.[1-9]*|[4-9]*],
630 SED=: aux_missing="$aux_missing sed")
63bda0c1 631
1400de2e
RM
632AC_CHECK_PROGS(AUTOCONF, autoconf, no)
633case "x$AUTOCONF" in
634xno|x|x:) AUTOCONF=no ;;
635*)
636 AC_CACHE_CHECK(dnl
637whether $AUTOCONF${ACFLAGS:+ }$ACFLAGS works, libc_cv_autoconf_works, [dnl
638 if (cd $srcdir; $AUTOCONF $ACFLAGS configure.in > /dev/null 2>&1); then
639 libc_cv_autoconf_works=yes
640 else
641 libc_cv_autoconf_works=no
642 fi])
643 test $libc_cv_autoconf_works = yes || AUTOCONF=no
644 ;;
645esac
646test "x$AUTOCONF" != xno || aux_missing="$aux_missing autoconf"
647
3a12e572 648AC_PROG_CC
ea9f119b
AJ
649if test $host != $build; then
650 AC_CHECK_PROGS(BUILD_CC, gcc cc)
651fi
652AC_SUBST(cross_compiling)
653AC_PROG_CPP
654LIBC_PROG_BINUTILS
2d37ce0f 655AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
ea9f119b
AJ
656
657# Accept binutils 2.10.1 or newer (and also any ia64 2.9 version)
45ef592d
UD
658# XXX Commented out because it filters out too many good versions.
659# XXX --drepper
660# AC_CHECK_PROG_VER(AS, $AS, --version,
661# [GNU assembler.* \([0-9]*\.[0-9.]*\(-ia64-[0-9]*\)*\)],
662# [2.10.[1-9]* | 2.1[1-9]* | 2.9-ia64-*], AS=: critic_missing=t)
ea9f119b 663
4bca4c17 664test -n "$aux_missing" && AC_MSG_WARN([
9c6fffc0 665*** These auxiliary programs are missing or incompatible versions:$aux_missing
63bda0c1
UD
666*** some features will be disabled.
667*** Check the INSTALL file for required versions.])
28f540f4 668
d01d6319
UD
669# glibcbug.in wants to know the compiler version.
670CCVERSION=`$CC -v 2>&1 | sed -n 's/gcc version //p'`
671AC_SUBST(CCVERSION)
672
dbe7a0f5
UD
673# if using special system headers, find out the compiler's sekrit
674# header directory and add that to the list. NOTE: Only does the right
675# thing on a system that doesn't need fixincludes. (Not presently a problem.)
676if test -n "$sysheaders"; then
677 ccheaders=`$CC -print-file-name=include`
678 SYSINCLUDES="-nostdinc -isystem $ccheaders -isystem $sysheaders"
679fi
680AC_SUBST(SYSINCLUDES)
681
97a47867
UD
682# check if ranlib is necessary
683AC_CACHE_CHECK(whether ranlib is necessary, libc_cv_ranlib_necessary, [dnl
684cat > conftest.c <<EOF
685int a;
686char b;
687void c(void) {}
688EOF
689$CC $CFLAGS -c conftest.c
72d4c33d 690$AR cr conftest.a conftest.o
97a47867
UD
691cp conftest.a conftest2.a
692$RANLIB conftest.a
693if cmp -s conftest.a conftest2.a; then
694 libc_cv_ranlib_necessary=no
f38931a9 695else
97a47867
UD
696 libc_cv_ranlib_necessary=yes
697fi
698rm -rf conftest*])
699if test "$libc_cv_ranlib_necessary" = no; then
700 RANLIB=:
f38931a9 701fi
f38931a9 702
3911660e
UD
703# Test if LD_LIBRARY_PATH contains the notation for the current directory
704# since this would lead to problems installing/building glibc.
705# LD_LIBRARY_PATH contains the current directory if one of the following
706# is true:
707# - one of the terminals (":" and ";") is the first or last sign
708# - two terminals occur directly after each other
709# - the path contains an element with a dot in it
710AC_MSG_CHECKING(LD_LIBRARY_PATH variable)
711changequote(,)dnl
712case ${LD_LIBRARY_PATH} in
713 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
b3a86ae1 714 ld_library_path_setting="contains current directory"
3911660e
UD
715 ;;
716 *)
717 ld_library_path_setting="ok"
718 ;;
719esac
720changequote([,])dnl
721AC_MSG_RESULT($ld_library_path_setting)
722if test "$ld_library_path_setting" != "ok"; then
63bda0c1
UD
723AC_MSG_ERROR([
724*** LD_LIBRARY_PATH shouldn't contain the current directory when
725*** building glibc. Please change the environment variable
726*** and run configure again.])
3911660e 727fi
8e31cf7e 728
74bd2300
UD
729AC_CACHE_CHECK(whether GCC supports -static-libgcc, libc_cv_gcc_static_libgcc, [dnl
730if $CC -v -static-libgcc 2>&1 | grep -q 'unrecognized option.*static-libgcc'; then
731 libc_cv_gcc_static_libgcc=
732else
733 libc_cv_gcc_static_libgcc=-static-libgcc
734fi])
735AC_SUBST(libc_cv_gcc_static_libgcc)
736
84384f5b 737AC_PATH_PROG(BASH, bash, no)
a18f587d 738if test "$BASH" != no &&
f43ce637 739 $BASH -c 'test "$BASH_VERSINFO" \
6973fc01 740 && test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then
84384f5b
UD
741 libc_cv_have_bash2=yes
742else
743 libc_cv_have_bash2=no
744fi
745AC_SUBST(libc_cv_have_bash2)
746
5290baf0
UD
747dnl We need a ksh compatible shell for tzselect.
748if test "$BASH" = no; then
749 AC_PATH_PROG(KSH, ksh, no)
750 if test "$KSH" = no; then
751 libc_cv_have_ksh=no
752 else
753 libc_cv_have_ksh=yes
754 fi
755else
756 KSH="$BASH"
757 AC_SUBST(KSH)
758 libc_cv_have_ksh=yes
759fi
760AC_SUBST(libc_cv_have_ksh)
761
5aa8ff62 762AC_PROG_AWK
c0016081 763AC_PATH_PROG(PERL, perl, no)
2fd5d029
RM
764if test "$PERL" != no &&
765 (eval `$PERL -V:apiversion`; test `expr "$apiversion" \< 5` -ne 0); then
766 PERL=no
ecb06196 767fi
2f512715
AS
768AC_PATH_PROG(INSTALL_INFO, install-info, no,
769 $PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin)
c0016081
UD
770if test "$INSTALL_INFO" != "no"; then
771AC_CACHE_CHECK(for old Debian install-info, libc_cv_old_debian_install_info,
772 [mkdir conftest.d
773 # There is a hard ^_ on the next line. I am open to better ideas.
774 (echo '\1f'
775 echo 'File: dir Node: Top This is the top of the INFO tree'
776 echo '* Menu:') >conftest.d/dir
777 (echo 'INFO-DIR-SECTION i-d-s works'
778 echo 'START-INFO-DIR-ENTRY'
779 echo '* Prog: (prog). Program.'
780 echo 'END-INFO-DIR-ENTRY') >conftest.d/prog.info
c2f55635 781 if $INSTALL_INFO --info-dir=conftest.d conftest.d/prog.info >&AS_MESSAGE_LOG_FD 2>&1
d8cceb4f 782 then
c0016081
UD
783 if grep -s 'i-d-s works' conftest.d/dir >/dev/null
784 then libc_cv_old_debian_install_info=no
785 else libc_cv_old_debian_install_info=yes
786 fi
787 else libc_cv_old_debian_install_info=no testfailed=t
788 fi
789 rm -fr conftest.d])
790if test -n "$testfailed"
791then AC_MSG_WARN([install-info errored out, check config.log])
792fi
793OLD_DEBIAN_INSTALL_INFO=$libc_cv_old_debian_install_info
794fi
795AC_SUBST(OLD_DEBIAN_INSTALL_INFO)
a2b08ee5 796
2de00372
UD
797AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin)
798
b8dc6a10 799AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl
28f540f4
RM
800echo '#include <stddef.h>
801FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
802if eval "$ac_cpp conftest.c 2>/dev/null" \
803| grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null; then
804 libc_cv_signed_size_t=no
805else
806 libc_cv_signed_size_t=yes
807fi
808rm -f conftest*])
28f540f4
RM
809if test $libc_cv_signed_size_t = yes; then
810 dnl Do this by hand instead of AC_DEFINE so can add #undef to avoid warnings.
811 cat >> confdefs.h <<\EOF
812#undef __SIZE_TYPE__
813#define __SIZE_TYPE__ unsigned
814EOF
815fi
816
b8dc6a10 817AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl
28f540f4
RM
818AC_TRY_COMPILE(dnl
819[#define __need_size_t
820#define __need_wchar_t
821#include <stddef.h>
822#define __need_NULL
823#include <stddef.h>], [size_t size; wchar_t wchar;
824#ifdef offsetof
825#error stddef.h ignored __need_*
826#endif
827if (&size == NULL || &wchar == NULL) abort ();],
828 libc_cv_friendly_stddef=yes,
829 libc_cv_friendly_stddef=no)])
28f540f4
RM
830if test $libc_cv_friendly_stddef = yes; then
831 config_vars="$config_vars
832override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
833fi
834
b8dc6a10
RM
835AC_CACHE_CHECK(whether we need to use -P to assemble .S files,
836 libc_cv_need_minus_P, [dnl
28f540f4
RM
837cat > conftest.S <<EOF
838#include "confdefs.h"
839/* Nothing whatsoever. */
840EOF
841if ${CC-cc} $CFLAGS -c conftest.S 2>/dev/null; then
842 libc_cv_need_minus_P=no
843else
844 libc_cv_need_minus_P=yes
845fi
846rm -f conftest*])
28f540f4
RM
847if test $libc_cv_need_minus_P = yes; then
848 config_vars="$config_vars
849asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
850fi
851
2293395f
UD
852AC_MSG_CHECKING(whether .text pseudo-op must be used)
853AC_CACHE_VAL(libc_cv_dot_text, [dnl
854cat > conftest.s <<EOF
855.text
856EOF
857libc_cv_dot_text=
858if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
859 libc_cv_dot_text=.text
860fi
861rm -f conftest*])
862if test -z "$libc_cv_dot_text"; then
863 AC_MSG_RESULT(no)
864else
865 AC_MSG_RESULT(yes)
866fi
867
b8dc6a10
RM
868AC_CACHE_CHECK(for assembler global-symbol directive,
869 libc_cv_asm_global_directive, [dnl
9a70fcab 870libc_cv_asm_global_directive=UNKNOWN
908c3d5b 871for ac_globl in .globl .global .EXPORT; do
9a70fcab 872 cat > conftest.s <<EOF
2293395f 873 ${libc_cv_dot_text}
908c3d5b 874 ${ac_globl} foo
ae1025be 875foo:
9a70fcab
UD
876EOF
877 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
878 libc_cv_asm_global_directive=${ac_globl}
879 fi
880 rm -f conftest*
881 test $libc_cv_asm_global_directive != UNKNOWN && break
882done])
9a70fcab
UD
883if test $libc_cv_asm_global_directive = UNKNOWN; then
884 AC_MSG_ERROR(cannot determine asm global directive)
885else
886 AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${libc_cv_asm_global_directive})
887fi
888
b8dc6a10 889AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl
9a70fcab 890cat > conftest.s <<EOF
2293395f 891${libc_cv_dot_text}
ae1025be 892foo:
df2a0c93 893.set glibc_conftest_frobozz,foo
9a70fcab 894$libc_cv_asm_global_directive glibc_conftest_frobozz
e215c478 895EOF
df2a0c93
RM
896# The alpha-dec-osf1 assembler gives only a warning for `.set'
897# (but it doesn't work), so we must do a linking check to be sure.
898cat > conftest1.c <<\EOF
899extern int glibc_conftest_frobozz;
900main () { printf ("%d\n", glibc_conftest_frobozz); }
901EOF
902if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
c2f55635 903 -o conftest conftest.s conftest1.c 1>&AS_MESSAGE_LOG_FD 2>&AC_FD_CC; then
e215c478
RM
904 libc_cv_asm_set_directive=yes
905else
906 libc_cv_asm_set_directive=no
907fi
65b3cbcb 908rm -f conftest*])
e215c478
RM
909if test $libc_cv_asm_set_directive = yes; then
910 AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
911fi
912
b88ac073
RM
913AC_CACHE_CHECK(for assembler .type directive prefix,
914 libc_cv_asm_type_prefix, [dnl
915libc_cv_asm_type_prefix=no
916for ac_try_prefix in '@' '%' '#'; do
917 cat > conftest.s <<EOF
918 ${libc_cv_dot_text}
919 ${libc_cv_asm_global_directive} foo
920 .type foo, ${ac_try_prefix}object
921 .size foo, 1
922foo:
923 .byte 1
924EOF
925 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
926 libc_cv_asm_type_prefix=${ac_try_prefix}
927 fi
928 rm -f conftest*
929 test "x$libc_cv_asm_type_prefix" != xno && break
930done])
931if test "x$libc_cv_asm_type_prefix" != xno; then
932 AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix})
933fi
934
2aa15430 935# The Aix ld uses global .symbol_names instead of symbol_names.
92b27c74
UD
936# Unfortunately also used in the PPC64 ELF ABI.
937case "${os}${machine}" in
938aix4.3* | linux*powerpc/powerpc64*)
2aa15430
UD
939 AC_DEFINE(HAVE_ASM_GLOBAL_DOT_NAME)
940esac
941
377a515b
UD
942AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
943[cat > conftest.s <<EOF
2293395f 944${libc_cv_dot_text}
4cca6b86 945_sym:
377a515b
UD
946.symver _sym,sym@VERS
947EOF
c2f55635 948if ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AC_FD_CC; then
377a515b
UD
949 libc_cv_asm_symver_directive=yes
950else
951 libc_cv_asm_symver_directive=no
952fi
953rm -f conftest*])
954AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl
955if test $libc_cv_asm_symver_directive = yes; then
956 cat > conftest.s <<EOF
2293395f 957${libc_cv_dot_text}
4cca6b86 958_sym:
377a515b
UD
959.symver _sym,sym@VERS
960EOF
961 cat > conftest.map <<EOF
f43ce637 962VERS_1 {
377a515b
UD
963 global: sym;
964};
f43ce637
UD
965
966VERS_2 {
967 global: sym;
968} VERS_1;
377a515b 969EOF
c2f55635 970 if ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AC_FD_CC; then
5ae3e846
UD
971 if AC_TRY_COMMAND([${CC-cc} $CFLAGS -shared -o conftest.so conftest.o
972 -nostartfiles -nostdlib
ae1025be 973 -Wl,--version-script,conftest.map
c2f55635 974 1>&AS_MESSAGE_LOG_FD]);
377a515b
UD
975 then
976 libc_cv_ld_version_script_option=yes
977 else
978 libc_cv_ld_version_script_option=no
979 fi
980 else
981 libc_cv_ld_version_script_option=no
982 fi
983else
984 libc_cv_ld_version_script_option=no
985fi
986rm -f conftest*])
7499a22a
RM
987if test $shared != no &&
988 test $libc_cv_asm_symver_directive = yes &&
650425ce
UD
989 test $libc_cv_ld_version_script_option = yes &&
990 test $enable_versioning = yes; then
377a515b
UD
991 VERSIONING=yes
992 AC_DEFINE(DO_VERSIONING)
993else
994 VERSIONING=no
995fi
996AC_SUBST(VERSIONING)
997
102a3e8f 998if test $elf = yes && test $shared != no && test $VERSIONING = no; then
f43ce637 999 echo "\
f4017d20 1000*** WARNING: You should not compile GNU libc without versioning. Not using
f43ce637
UD
1001*** versioning will introduce incompatibilities so that old binaries
1002*** will not run anymore.
50304ef0 1003*** For versioning you need recent binutils (binutils-2.8.1.0.23 or newer)."
f43ce637 1004fi
fd26970f
UD
1005if test $elf = yes; then
1006 AC_CACHE_CHECK(for .previous assembler directive,
1007 libc_cv_asm_previous_directive, [dnl
1008 cat > conftest.s <<EOF
1009.section foo_section
1010.previous
1011EOF
c2f55635 1012 if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
fd26970f
UD
1013 libc_cv_asm_previous_directive=yes
1014 else
1015 libc_cv_asm_previous_directive=no
1016 fi
1017 rm -f conftest*])
1018 if test $libc_cv_asm_previous_directive = yes; then
1019 AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
1020 else
1021 AC_CACHE_CHECK(for .popsection assembler directive,
1022 libc_cv_asm_popsection_directive, [dnl
1023 cat > conftest.s <<EOF
1024.pushsection foo_section
1025.popsection
1026EOF
c2f55635 1027 if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
fd26970f
UD
1028 libc_cv_asm_popsection_directive=yes
1029 else
1030 libc_cv_asm_popsection_directive=no
1031 fi
1032 rm -f conftest*])
1033 if test $libc_cv_asm_popsection_directive = yes; then
1034 AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
1035 fi
1036 fi
2d499f55
UD
1037 AC_CACHE_CHECK(for .protected and .hidden assembler directive,
1038 libc_cv_asm_protected_directive, [dnl
1039 cat > conftest.s <<EOF
1040.protected foo
1041foo:
1042.hidden bar
1043bar:
1044EOF
c2f55635 1045 if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
2d499f55
UD
1046 libc_cv_asm_protected_directive=yes
1047 else
1048 libc_cv_asm_protected_directive=no
1049 fi
1050 rm -f conftest*])
1051 AC_SUBST(libc_cv_asm_protected_directive)
5688da55 1052 AC_DEFINE(HAVE_PROTECTED)
9bd64602 1053 AC_DEFINE(HAVE_HIDDEN)
0fb7851f 1054
0d01dace
UD
1055 if test $libc_cv_asm_protected_directive = yes; then
1056 AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
1057 libc_cv_visibility_attribute,
1058 [cat > conftest.c <<EOF
1059 int foo __attribute__ ((visibility ("hidden"))) = 1;
1060 int bar __attribute__ ((visibility ("protected"))) = 1;
1061EOF
1062 libc_cv_visibility_attribute=no
1063 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
1064 if grep '\.hidden.*foo' conftest.s >/dev/null; then
1065 if grep '\.protected.*bar' conftest.s >/dev/null; then
1066 libc_cv_visibility_attribute=yes
1067 fi
1068 fi
1069 fi
1070 rm -f conftest.[cs]
1071 ])
1072 if test $libc_cv_visibility_attribute = yes; then
1073 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
1074 fi
1075 fi
1076
37ba7d66
UD
1077 if test $libc_cv_visibility_attribute = yes; then
1078 AC_CACHE_CHECK(for broken __attribute__((visibility())),
1079 libc_cv_broken_visibility_attribute,
1080 [cat > conftest.c <<EOF
1081 int foo (int x);
1082 int bar (int x) __asm__ ("foo") __attribute__ ((visibility ("hidden")));
1083 int bar (int x) { return x; }
1084EOF
1085 libc_cv_broken_visibility_attribute=yes
1086 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
1087changequote(,)dnl
1088 if grep '\.hidden[ _]foo' conftest.s >/dev/null; then
1089changequote([,])dnl
1090 libc_cv_broken_visibility_attribute=no
1091 fi
1092 fi
1093 rm -f conftest.c conftest.s
1094 ])
1095 if test $libc_cv_broken_visibility_attribute = yes; then
1096 AC_DEFINE(HAVE_BROKEN_VISIBILITY_ATTRIBUTE)
1097 fi
1098 fi
1099
1100 AC_CACHE_CHECK(for broken __attribute__((alias())),
1101 libc_cv_broken_alias_attribute,
1102 [cat > conftest.c <<EOF
1103 extern int foo (int x) __asm ("xyzzy");
1104 int bar (int x) { return x; }
48b8e846
UD
1105 extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
1106 extern int dfoo;
1107 extern __typeof (dfoo) dfoo __asm ("abccb");
1108 int dfoo = 1;
37ba7d66
UD
1109EOF
1110 libc_cv_broken_alias_attribute=yes
1111 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
48b8e846
UD
1112 if grep 'xyzzy' conftest.s >/dev/null &&
1113 grep 'abccb' conftest.s >/dev/null; then
37ba7d66
UD
1114 libc_cv_broken_alias_attribute=no
1115 fi
1116 fi
1117 rm -f conftest.c conftest.s
1118 ])
1119 if test $libc_cv_broken_alias_attribute = yes; then
1120 AC_DEFINE(HAVE_BROKEN_ALIAS_ATTRIBUTE)
1121 fi
1122
0d01dace
UD
1123 if test $libc_cv_visibility_attribute = yes -a $gnu_ld = yes; then
1124 AC_CACHE_CHECK(whether to put _rtld_local into .sdata section,
1125 libc_cv_have_sdata_section,
1126 [echo "int i;" > conftest.c
1127 libc_cv_have_sdata_section=no
1128 if ${CC-cc} -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
1129 | grep '\.sdata' >/dev/null; then
1130 libc_cv_have_sdata_section=yes
1131 fi
1132 rm -f conftest.c conftest.so
1133 ])
1134 if test $libc_cv_have_sdata_section = yes; then
1135 AC_DEFINE(HAVE_SDATA_SECTION)
1136 fi
1137 fi
1138
5241882c
UD
1139 AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
1140 libc_cv_initfinit_array, [dnl
1141 cat > conftest.c <<EOF
1142int _start (void) { return 0; }
1143int __start (void) { return 0; }
1144int foo (void) { return 1; }
2c617417 1145int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
5241882c
UD
1146EOF
1147 if AC_TRY_COMMAND([${CC-cc} -o conftest conftest.c
c2f55635 1148 -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
5241882c
UD
1149 then
1150 if readelf -S conftest | fgrep INIT_ARRAY > /dev/null; then
1151 libc_cv_initfinit_array=yes
1152 else
1153 libc_cv_initfinit_array=no
1154 fi
1155 else
1156 libc_cv_initfinit_array=no
1157 fi
1158 rm -f conftest*])
1159 AC_SUBST(libc_cv_initfinit_array)
1160 if test $libc_cv_initfinit_array = yes; then
1161 AC_DEFINE(HAVE_INITFINI_ARRAY)
1162 fi
1163
0fb7851f
UD
1164 AC_CACHE_CHECK(for -z nodelete option,
1165 libc_cv_z_nodelete, [dnl
1166 cat > conftest.c <<EOF
1167int _start (void) { return 42; }
1168EOF
35cd3c97
AJ
1169 if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c
1170 -nostartfiles -nostdlib
c2f55635 1171 -Wl,--enable-new-dtags,-z,nodelete 1>&AS_MESSAGE_LOG_FD])
0fb7851f
UD
1172 then
1173 libc_cv_z_nodelete=yes
1174 else
1175 libc_cv_z_nodelete=no
1176 fi
1177 rm -f conftest*])
1178 AC_SUBST(libc_cv_z_nodelete)
2f54c82d
UD
1179
1180 AC_CACHE_CHECK(for -z nodlopen option,
1181 libc_cv_z_nodlopen, [dnl
1182 cat > conftest.c <<EOF
1183int _start (void) { return 42; }
1184EOF
35cd3c97
AJ
1185 if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c
1186 -nostartfiles -nostdlib
c2f55635 1187 -Wl,--enable-new-dtags,-z,nodlopen 1>&AS_MESSAGE_LOG_FD])
2f54c82d
UD
1188 then
1189 libc_cv_z_nodlopen=yes
1190 else
1191 libc_cv_z_nodlopen=no
1192 fi
1193 rm -f conftest*])
1194 AC_SUBST(libc_cv_z_nodlopen)
5d916713
UD
1195
1196 AC_CACHE_CHECK(for -z initfirst option,
1197 libc_cv_z_initfirst, [dnl
1198 cat > conftest.c <<EOF
1199int _start (void) { return 42; }
1200EOF
35cd3c97
AJ
1201 if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c
1202 -nostartfiles -nostdlib
c2f55635 1203 -Wl,--enable-new-dtags,-z,initfirst 1>&AS_MESSAGE_LOG_FD])
5d916713
UD
1204 then
1205 libc_cv_z_initfirst=yes
1206 else
1207 libc_cv_z_initfirst=no
1208 fi
1209 rm -f conftest*])
1210 AC_SUBST(libc_cv_z_initfirst)
639c3248
UD
1211
1212 AC_CACHE_CHECK(for -Bgroup option,
1213 libc_cv_Bgroup, [dnl
1214 cat > conftest.c <<EOF
1215int _start (void) { return 42; }
1216EOF
c2f55635 1217 if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c -Wl,-Bgroup -nostdlib 1>&AS_MESSAGE_LOG_FD])
639c3248
UD
1218 then
1219 libc_cv_Bgroup=yes
1220 else
1221 libc_cv_Bgroup=no
1222 fi
1223 rm -f conftest*])
1224 AC_SUBST(libc_cv_Bgroup)
a711b01d
UD
1225
1226 AC_CACHE_CHECK(for -z combreloc,
1227 libc_cv_z_combreloc, [dnl
1228 cat > conftest.c <<EOF
d555194c
UD
1229extern int bar (int);
1230extern int mumble;
1231int foo (void) { return bar (mumble); }
a711b01d 1232EOF
35cd3c97
AJ
1233 if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c
1234 -nostdlib -nostartfiles
c2f55635 1235 -Wl,-z,combreloc 1>&AS_MESSAGE_LOG_FD])
a711b01d
UD
1236 then
1237dnl The following test is a bit weak. We must use a tool which can test
1238dnl cross-platform since the gcc used can be a cross compiler. Without
1239dnl introducing new options this is not easily doable. Instead use a tool
1240dnl which always is cross-platform: readelf. To detect whether -z combreloc
1241dnl look for a section named .rel.dyn.
fdde8349
UD
1242 if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
1243 libc_cv_z_combreloc=yes
1244 else
1245 libc_cv_z_combreloc=no
a711b01d 1246 fi
fdde8349
UD
1247 else
1248 libc_cv_z_combreloc=no
a711b01d
UD
1249 fi
1250 rm -f conftest*])
fdde8349
UD
1251 if test "$libc_cv_z_combreloc" = yes; then
1252 AC_DEFINE(HAVE_Z_COMBRELOC)
1253 fi
fd26970f 1254fi
f13df7c7 1255AC_SUBST(libc_cv_z_combreloc)
fd26970f 1256
b8dc6a10
RM
1257if test $elf != yes; then
1258 AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
1259 [AC_TRY_COMPILE(, [asm (".section .init");
84724245 1260 asm (".section .fini");
2293395f 1261 asm ("${libc_cv_dot_text}");],
b8dc6a10
RM
1262 libc_cv_have_initfini=yes,
1263 libc_cv_have_initfini=no)])
1264 AC_SUBST(libc_cv_have_initfini)dnl
1265 if test $libc_cv_have_initfini = yes; then
1266 AC_DEFINE(HAVE_INITFINI)
1267 fi
1268fi
e215c478 1269
e26dd47f
UD
1270if test $elf = yes -a $gnu_ld = yes; then
1271 AC_CACHE_CHECK(whether cc puts quotes around section names,
1272 libc_cv_have_section_quotes,
1273 [cat > conftest.c <<EOF
1274 static const int foo
1275 __attribute__ ((section ("bar"))) = 1;
1276EOF
1277 if ${CC-cc} -S conftest.c -o conftest.s; then
1278 if grep '\.section.*"bar"' conftest.s >/dev/null; then
1279 libc_cv_have_section_quotes=yes
1280 else
1281 libc_cv_have_section_quotes=no
1282 fi
1283 else
1284 libc_cv_have_section_quotes=unknown
1285 fi
1286 rm -f conftest.[cs]
1287 ])
1288 if test $libc_cv_have_section_quotes = yes; then
1289 AC_DEFINE(HAVE_SECTION_QUOTES)
1290 fi
1291fi
1292
9a0a462c
UD
1293dnl AC_CHECK_ASM_UNDERSCORE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1294AC_DEFUN(AC_CHECK_ASM_UNDERSCORE,
1295[cat > conftest.$ac_ext <<EOF
1296dnl This sometimes fails to find confdefs.h, for some reason.
1297dnl [#]line __oline__ "[$]0"
1298[#]line __oline__ "configure"
1299#include "confdefs.h"
1300void underscore_test(void) {
1301return; }
1302EOF
1303if AC_TRY_EVAL(ac_compile); then
1304 if grep _underscore_test conftest* >/dev/null; then
1305 ifelse([$1], , :, [rm -f conftest*
1306 $1])
1307 else
1308 ifelse([$2], , , [rm -f conftest*
1309 $2])
1310 fi
1311else
c2f55635
RM
1312 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
1313 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
9a0a462c
UD
1314 ifelse([$2], , , [rm -f conftest*
1315 $2])
1316fi
1317rm -f conftest*])
1318
c224a18a
RM
1319if test $elf = yes; then
1320 libc_cv_asm_underscores=no
1321else
9a0a462c
UD
1322 if test $ac_cv_prog_cc_works = yes; then
1323 AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1324 [AC_TRY_LINK([asm ("_glibc_foobar:");], [glibc_foobar ();],
1325 libc_cv_asm_underscores=yes,
1326 libc_cv_asm_underscores=no)])
1327 else
1328 AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
1329 [AC_CHECK_ASM_UNDERSCORE(libc_cv_asm_underscores=yes,
1330 libc_cv_asm_underscores=no)])
1331 fi
c224a18a
RM
1332fi
1333if test $libc_cv_asm_underscores = no; then
1334 AC_DEFINE(NO_UNDERSCORES)
1335fi
1336
1337if test $elf = yes; then
1338 libc_cv_weak_symbols=yes
9a97d1f7
UD
1339fi
1340
1341AC_CACHE_CHECK(for assembler .weak directive, libc_cv_asm_weak_directive,
75d86c1f 1342 [dnl
c224a18a 1343cat > conftest.s <<EOF
2293395f 1344${libc_cv_dot_text}
c224a18a 1345${libc_cv_asm_global_directive} foo
ae1025be 1346foo:
c224a18a
RM
1347.weak foo
1348.weak bar; bar = foo
1349EOF
9a97d1f7
UD
1350if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
1351 libc_cv_asm_weak_directive=yes
1352else
1353 libc_cv_asm_weak_directive=no
1354fi
1355rm -f conftest*])
c224a18a 1356
c8cf0b14 1357if test $libc_cv_asm_weak_directive = no; then
c224a18a
RM
1358 AC_CACHE_CHECK(for assembler .weakext directive,
1359 libc_cv_asm_weakext_directive,
1360 [dnl
1361cat > conftest.s <<EOF
2293395f 1362${libc_cv_dot_text}
c224a18a 1363${libc_cv_asm_global_directive} foo
ae1025be 1364foo:
f802accb
UD
1365.weakext bar foo
1366.weakext baz
1367${libc_cv_asm_global_directive} baz
9a97d1f7 1368baz:
c224a18a
RM
1369EOF
1370 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
1371 libc_cv_asm_weakext_directive=yes
1372 else
1373 libc_cv_asm_weakext_directive=no
1374 fi
1375 rm -f conftest*])
1376
9a97d1f7 1377fi # no .weak
c224a18a 1378
ffcf9634 1379if test $libc_cv_asm_weak_directive = yes; then
c224a18a 1380 AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
ffcf9634 1381elif test $libc_cv_asm_weakext_directive = yes; then
c224a18a
RM
1382 AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)
1383fi
1384
b15cb495 1385dnl The standard hppa assembler uses `;' to start comments and `!'
eacde9d0
UD
1386dnl as a line separator. CRIS uses `;' to start comments and `@' for
1387dnl line separator.
b15cb495 1388case "${host_cpu}-${host_os}" in
eacde9d0
UD
1389 cris*)
1390 libc_cv_asm_line_sep='@'
1391 AC_DEFINE_UNQUOTED(ASM_LINE_SEP, $libc_cv_asm_line_sep)
1392 ;;
b15cb495
UD
1393 hppa*linux*)
1394 AC_CACHE_CHECK(for assembler line separator,
1395 libc_cv_asm_line_sep, [dnl
1396 cat > conftest.s <<EOF
1397 nop ; is_old_puffin
1398EOF
c2f55635 1399 if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
b15cb495
UD
1400 libc_cv_asm_line_sep='!'
1401 else
1402 if test -z "$enable_hacker_mode"; then
1403 echo "*** You need a newer assembler to compile glibc"
1404 rm -f conftest*
1405 exit 1
1406 fi
1407 libc_cv_asm_line_sep=';'
1408 fi
1409 rm -f conftest*])
1410 AC_DEFINE_UNQUOTED(ASM_LINE_SEP, $libc_cv_asm_line_sep)
1411 ;;
1412esac
1413
a641835a
RM
1414AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
1415cat > conftest.c <<\EOF
5f0e6fc7 1416_start () {}
dcf0671d
UD
1417int __eh_pc;
1418__throw () {}
a641835a 1419EOF
dcea62dd
RM
1420dnl No \ in command here because it ends up inside ''.
1421if AC_TRY_COMMAND([${CC-cc} $CFLAGS
1422 -nostdlib -nostartfiles -Wl,--no-whole-archive
c2f55635 1423 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
a641835a
RM
1424 libc_cv_ld_no_whole_archive=yes
1425else
1426 libc_cv_ld_no_whole_archive=no
1427fi
1428rm -f conftest*])
b17277cf
UD
1429if test $libc_cv_ld_no_whole_archive = yes; then
1430 no_whole_archive=-Wl,--no-whole-archive
1431fi
1432AC_SUBST(no_whole_archive)dnl
a641835a 1433
dff14448 1434AC_CACHE_CHECK(for gcc -fexceptions, libc_cv_gcc_exceptions, [dnl
b236e99d
UD
1435cat > conftest.c <<\EOF
1436_start () {}
1437int __eh_pc;
1438__throw () {}
1439EOF
1440dnl No \ in command here because it ends up inside ''.
1441if AC_TRY_COMMAND([${CC-cc} $CFLAGS
dff14448 1442 -nostdlib -nostartfiles -fexceptions
c2f55635 1443 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
dff14448 1444 libc_cv_gcc_exceptions=yes
b236e99d 1445else
dff14448 1446 libc_cv_gcc_exceptions=no
b236e99d
UD
1447fi
1448rm -f conftest*])
dff14448
UD
1449if test $libc_cv_gcc_exceptions = yes; then
1450 exceptions=-fexceptions
b17277cf 1451fi
dff14448 1452AC_SUBST(exceptions)dnl
b236e99d 1453
d71b808a
UD
1454if test "$base_machine" = alpha ; then
1455AC_CACHE_CHECK(for function ..ng prefix, libc_cv_gcc_alpha_ng_prefix, [dnl
1456cat > conftest.c <<\EOF
1457foo () { }
1458EOF
1459dnl
9756dfe1 1460if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "\$foo..ng" > /dev/null]);
d71b808a
UD
1461then
1462 libc_cv_gcc_alpha_ng_prefix=yes
1463else
1464 libc_cv_gcc_alpha_ng_prefix=no
1465fi
1466rm -f conftest* ])
1467if test $libc_cv_gcc_alpha_ng_prefix = yes ; then
1468 AC_DEFINE(ASM_ALPHA_NG_SYMBOL_PREFIX, "$")
1469else
1470 AC_DEFINE(ASM_ALPHA_NG_SYMBOL_PREFIX, "")
1471fi
1472fi
1473
66000494
UD
1474if test "$host_cpu" = powerpc ; then
1475# Check for a bug present in at least versions 2.8.x of GCC
1476# and versions 1.0.x of EGCS.
1477AC_CACHE_CHECK(whether clobbering cr0 causes problems,libc_cv_c_asmcr0_bug,[dnl
1478AC_TRY_COMPILE([int tester(int x) { asm ("" : : : "cc"); return x & 123; }],,
1479 libc_cv_c_asmcr0_bug='no',
1480 libc_cv_c_asmcr0_bug='yes')])
1481if test "$libc_cv_c_asmcr0_bug" != 'no'; then
1482 AC_DEFINE(BROKEN_PPC_ASM_CR0)
1483fi
1484fi
1485
650425ce
UD
1486AC_CACHE_CHECK(for DWARF2 unwind info support, libc_cv_gcc_dwarf2_unwind_info,
1487[cat > conftest.c <<EOF
1488#line __oline__ "configure"
2b904739 1489static char *__EH_FRAME_BEGIN__;
650425ce
UD
1490_start ()
1491{
9756dfe1 1492#ifdef CHECK__register_frame
650425ce
UD
1493 __register_frame (__EH_FRAME_BEGIN__);
1494 __deregister_frame (__EH_FRAME_BEGIN__);
9756dfe1
UD
1495#endif
1496#ifdef CHECK__register_frame_info
1497 __register_frame_info (__EH_FRAME_BEGIN__);
1498 __deregister_frame_info (__EH_FRAME_BEGIN__);
1499#endif
650425ce
UD
1500}
1501int __eh_pc;
1502__throw () {}
1503/* FIXME: this is fragile. */
1504malloc () {}
1505strcmp () {}
1506strlen () {}
1507memcpy () {}
1508memset () {}
1509free () {}
1510abort () {}
dfd2257a 1511__bzero () {}
df17727a 1512dl_iterate_phdr () {}
650425ce
UD
1513EOF
1514dnl No \ in command here because it ends up inside ''.
9756dfe1 1515if AC_TRY_COMMAND([${CC-cc} $CFLAGS -DCHECK__register_frame_info
650425ce 1516 -nostdlib -nostartfiles
c2f55635 1517 -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
9756dfe1 1518 libc_cv_gcc_dwarf2_unwind_info=static
650425ce
UD
1519else
1520 libc_cv_gcc_dwarf2_unwind_info=no
1521fi
2b904739
AJ
1522if AC_TRY_COMMAND([${CC-cc} $CFLAGS -DCHECK__register_frame_info
1523 -nostdlib -nostartfiles
c2f55635 1524 -o conftest conftest.c -lgcc -lgcc_eh >&AS_MESSAGE_LOG_FD]); then
2b904739
AJ
1525 if ${CC-cc} $CFLAGS -DCHECK__register_frame_info -nostdlib -nostartfiles \
1526 -o conftest conftest.c -lgcc -lgcc_eh -v 2>&1 >/dev/null \
1527 | grep -q -- --eh-frame-hdr; then
1528 libc_cv_gcc_dwarf2_unwind_info=no_registry_needed
1529 else
1530 libc_cv_gcc_dwarf2_unwind_info=static
1531 fi
1532else
1533 libc_cv_gcc_dwarf2_unwind_info=no
1534fi
9756dfe1
UD
1535if test $libc_cv_gcc_dwarf2_unwind_info = no; then
1536 if AC_TRY_COMMAND([${CC-cc} $CFLAGS -DCHECK__register_frame
1537 -nostdlib -nostartfiles
c2f55635 1538 -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
9756dfe1
UD
1539 libc_cv_gcc_dwarf2_unwind_info=yes
1540 else
1541 libc_cv_gcc_dwarf2_unwind_info=no
1542 fi
1543fi
650425ce 1544rm -f conftest*])
9756dfe1
UD
1545case $libc_cv_gcc_dwarf2_unwind_info in
1546yes)
650425ce 1547 AC_DEFINE(HAVE_DWARF2_UNWIND_INFO)
9756dfe1
UD
1548 ;;
1549static)
1550 AC_DEFINE(HAVE_DWARF2_UNWIND_INFO)
1551 AC_DEFINE(HAVE_DWARF2_UNWIND_INFO_STATIC)
1552 ;;
1553esac
650425ce 1554
a8eab8b1
UD
1555dnl Check whether compiler understands __builtin_expect.
1556AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
1557[cat > conftest.c <<EOF
1558#line __oline__ "configure"
1559int foo (int a)
1560{
1561 a = __builtin_expect (a, 10);
1562 return a == 10 ? 0 : 1;
1563}
1564EOF
1565dnl No \ in command here because it ends up inside ''.
1566if AC_TRY_COMMAND([${CC-cc} $CFLAGS -nostdlib -nostartfiles
c2f55635 1567 -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
a8eab8b1
UD
1568 libc_cv_gcc_builtin_expect=yes
1569else
1570 libc_cv_gcc_builtin_expect=no
1571fi
1572rm -f conftest*])
1573if test "$libc_cv_gcc_builtin_expect" = yes; then
1574 AC_DEFINE(HAVE_BUILTIN_EXPECT)
1575fi
1576
d555194c
UD
1577AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
1578cat > conftest.c <<\EOF
1579void zero (void *x)
1580{
a52d1562 1581 __builtin_memset (x, 0, 1000);
d555194c
UD
1582}
1583EOF
1584dnl
1585if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null]);
1586then
1587 libc_cv_gcc_builtin_memset=no
1588else
1589 libc_cv_gcc_builtin_memset=yes
1590fi
1591rm -f conftest* ])
1592if test "$libc_cv_gcc_builtin_memset" = yes ; then
1593 AC_DEFINE(HAVE_BUILTIN_MEMSET)
1594fi
1595
3d558f4e
UD
1596dnl Check whether the compiler supports subtraction of local labels.
1597AC_CACHE_CHECK(for local label subtraction, libc_cv_gcc_subtract_local_labels,
1598[cat > conftest.c <<EOF
1599changequote(,)dnl
1600#line __oline__ "configure"
1601int foo (int a)
1602{
1603 static const int ar[] = { &&l1 - &&l1, &&l2 - &&l1 };
1604 void *p = &&l1 + ar[a];
1605 goto *p;
1606 l1:
1607 return 1;
1608 l2:
1609 return 2;
1610}
1611changequote([,])dnl
1612EOF
1613dnl No \ in command here because it ends up inside ''.
1614if AC_TRY_COMMAND([${CC-cc} $CFLAGS -nostdlib -nostartfiles
c2f55635 1615 -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
3d558f4e
UD
1616 libc_cv_gcc_subtract_local_labels=yes
1617else
1618 libc_cv_gcc_subtract_local_labels=no
1619fi
1620rm -f conftest*])
1621if test "$libc_cv_gcc_subtract_local_labels" = yes; then
1622 AC_DEFINE(HAVE_SUBTRACT_LOCAL_LABELS)
1623fi
1624
739d440d 1625dnl Check whether the compiler supports the __thread keyword.
5b8f26b4
RM
1626if test "x$use__thread" != xno; then
1627 AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
1628 [cat > conftest.c <<\EOF
fbb18522
RM
1629__thread int a = 42;
1630EOF
c2f55635 1631 if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
5b8f26b4
RM
1632 libc_cv_gcc___thread=yes
1633 else
1634 libc_cv_gcc___thread=no
1635 fi
1636 rm -f conftest*])
1637 if test "$libc_cv_gcc___thread" = yes; then
1638 AC_DEFINE(HAVE___THREAD)
1639 fi
739d440d
UD
1640else
1641 libc_cv_gcc___thread=no
1642fi
739d440d 1643
9b21e6bc
RM
1644if test "$libc_cv_gcc___thread" = yes; then
1645 dnl Check whether the compiler supports the tls_model attribute.
1646 AC_CACHE_CHECK([for tls_model attribute], libc_cv_gcc_tls_model_attr, [dnl
1647 cat > conftest.c <<\EOF
1648extern __thread int a __attribute__((tls_model ("initial-exec")));
1649EOF
c2f55635 1650 if AC_TRY_COMMAND([${CC-cc} $CFLAGS -S -Werror conftest.c >&AS_MESSAGE_LOG_FD]); then
9b21e6bc
RM
1651 libc_cv_gcc_tls_model_attr=yes
1652 else
1653 libc_cv_gcc_tls_model_attr=no
1654 fi
1655 rm -f conftest*])
1656 if test "$libc_cv_gcc_tls_model_attr" = yes; then
1657 AC_DEFINE(HAVE_TLS_MODEL_ATTRIBUTE)
1658 fi
1659fi
739d440d 1660
c8f3e6db
UD
1661dnl Check whether we have the gd library available.
1662AC_MSG_CHECKING(for libgd)
6dab8688
UD
1663if test "$with_gd" != "no"; then
1664 old_CFLAGS="$CFLAGS"
1665 CFLAGS="$CFLAGS $libgd_include"
1666 old_LDFLAGS="$LDFLAGS"
1667 LDFLAGS="$LDFLAGS $libgd_ldflags"
1668 old_LIBS="$LIBS"
1669 LIBS="$LIBS -lgd -lpng -lz -lm"
1670 AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
1671 CFLAGS="$old_CFLAGS"
1672 LDFLAGS="$old_LDFLAGS"
1673 LIBS="$old_LIBS"
1674else
1675 LIBGD=no
1676fi
c8f3e6db
UD
1677AC_MSG_RESULT($LIBGD)
1678AC_SUBST(LIBGD)
3d558f4e 1679
8ed1e7d5
GK
1680dnl check for the size of 'long double'.
1681AC_CHECK_SIZEOF(long double, 0)
1682sizeof_long_double=$ac_cv_sizeof_long_double
1683AC_SUBST(sizeof_long_double)
1684
c224a18a
RM
1685### End of automated tests.
1686### Now run sysdeps configure fragments.
1687
cb343854 1688# They also can set these variables.
591e1ffb 1689use_ldconfig=no
cb343854 1690ldd_rewrite_script=no
77259608 1691libc_cv_sysconfdir=$sysconfdir
74bd2300 1692libc_cv_gcc_unwind_find_fde=no
cb343854 1693
28f540f4
RM
1694# Iterate over all the sysdep directories we will use, running their
1695# configure fragments, and looking for a uname implementation.
1696uname=
1697for dir in $sysnames; do
57ba7bb4
UD
1698 case $dir in
1699 /*) dest=$dir ;;
1700 *) dest=$srcdir/$dir ;;
1701 esac
1702 if test -r $dest/configure; then
1703 AC_MSG_RESULT(running configure fragment for $dest)
1704 . $dest/configure
28f540f4 1705 fi
4ca84cff 1706[
28f540f4 1707 if test -z "$uname"; then
e7f1f046
UD
1708 if test -r $dest/uname.c ||
1709 test -r $dest/uname.S ||
1710 { test -r $dest/syscalls.list &&
1711 grep '^uname[ ]' $dest/syscalls.list >/dev/null; }; then
b86199fb 1712 uname=$dir
4ca84cff 1713 fi
28f540f4 1714 fi
4ca84cff 1715]dnl
28f540f4
RM
1716done
1717
74bd2300
UD
1718if test x$libc_cv_gcc_unwind_find_fde = xyes; then
1719 AC_DEFINE(EXPORT_UNWIND_FIND_FDE)
1720fi
1721AC_SUBST(libc_cv_gcc_unwind_find_fde)
1722
28f540f4
RM
1723# If we will use the generic uname implementation, we must figure out what
1724# it will say by examining the system, and write the results in config-name.h.
e7f1f046 1725if test "$uname" = "sysdeps/generic"; then
28f540f4
RM
1726
1727changequote(,)dnl
1728 uname_sysname=`echo $config_os | sed 's/[0-9.]*$//'`
1729changequote([,])dnl
1730 if test $uname_sysname != $config_os; then
1731 config_release=`echo $config_os | sed s/$uname_sysname//`
1732 fi
1733dnl
1734AC_DEFUN(LIBC_KERNEL_ID, [dnl
1735 if test -r /vmunix; then
1736 kernel_id=`strings /vmunix | grep UNIX`
1737 elif test -r /dynix; then
1738 kernel_id=`strings /dynix | grep DYNIX`
1739 else
1740 kernel_id=
1741 fi
1742])dnl
1743
b8dc6a10 1744 AC_CACHE_CHECK(OS release for uname, libc_cv_uname_release, [dnl
3a12e572 1745LIBC_KERNEL_ID
28f540f4
RM
1746changequote(,)dnl
1747 kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'`
1748changequote([,])dnl
1749 if test x`echo "$config_release" | sed "s/^$kernel_release//"` \
1750 != x$config_release; then
1751 # The configuration release is a substring of the kernel release.
1752 libc_cv_uname_release=$kernel_release
1753 elif test x$config_release != x; then
1754 libc_cv_uname_release=$config_release
1755 elif test x$kernel_release != x; then
1756 libc_cv_uname_release=$kernel_release
1757 else
1758 libc_cv_uname_release=unknown
1759 fi])
28f540f4
RM
1760 uname_release="$libc_cv_uname_release"
1761
b8dc6a10 1762 AC_CACHE_CHECK(OS version for uname, libc_cv_uname_version, [dnl
3a12e572 1763LIBC_KERNEL_ID
28f540f4
RM
1764changequote(,)dnl
1765 kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'`
1766changequote([,])dnl
1767 if test -n "$kernel_version"; then
1768 libc_cv_uname_version="$kernel_version"
1769 else
1770 libc_cv_uname_version=unknown
1771 fi])
28f540f4
RM
1772 uname_version="$libc_cv_uname_version"
1773
1774AC_SUBST(uname_sysname) AC_SUBST(uname_release) AC_SUBST(uname_version)dnl
1775 config_uname=config-name.h:config-name.in
1776else
1777 # For non-generic uname, we don't need to create config-name.h at all.
1778 config_uname=
1779fi
1780
a8c01776
RM
1781dnl This is tested by existing code and it's simpler to avoid changing it.
1782AC_DEFINE(USE_IN_LIBIO)
96aa2d94 1783
a53bad16
UD
1784# Test for old glibc 2.0.x headers so that they can be removed properly
1785# Search only in includedir.
1786AC_MSG_CHECKING(for old glibc 2.0.x headers)
350eb336 1787if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
a53bad16
UD
1788then
1789 old_glibc_headers=yes
1790else
1791 old_glibc_headers=no
1792fi
1793AC_MSG_RESULT($old_glibc_headers)
1794if test ${old_glibc_headers} = yes; then
1795 AC_MSG_WARN(*** During \"make install\" old headers from glibc 2.0.x will)
1796 AC_MSG_WARN(*** be removed.)
1797fi
b195f6bc 1798AC_SUBST(old_glibc_headers)
26b4d766 1799
84384f5b 1800AC_SUBST(libc_cv_slibdir)
a1d84548 1801AC_SUBST(libc_cv_localedir)
77259608 1802AC_SUBST(libc_cv_sysconfdir)
1ef32c3d
UD
1803AC_SUBST(libc_cv_rootsbindir)
1804
591e1ffb 1805AC_SUBST(use_ldconfig)
cb343854 1806AC_SUBST(ldd_rewrite_script)
84384f5b 1807
5af3245a 1808AC_SUBST(gnu_ld) AC_SUBST(gnu_as) AC_SUBST(elf) AC_SUBST(xcoff)
28f540f4
RM
1809if test $gnu_ld = yes; then
1810 AC_DEFINE(HAVE_GNU_LD)
1811fi
1812if test $gnu_as = yes; then
1813 AC_DEFINE(HAVE_GNU_AS)
1814fi
1815if test $elf = yes; then
1816 AC_DEFINE(HAVE_ELF)
1817fi
5af3245a
UD
1818if test $xcoff = yes; then
1819 AC_DEFINE(HAVE_XCOFF)
1820fi
28f540f4 1821
650425ce 1822AC_SUBST(static)
ff3d7ed3
RM
1823AC_SUBST(shared)
1824if test $shared = default; then
1825 if test $gnu_ld = yes; then
1826 shared=$elf
f65fd747
UD
1827 else
1828 # For now we do not assume shared libs are available. In future more
1829 # tests might become available.
1830 shared=no
ff3d7ed3
RM
1831 fi
1832fi
cc3fa755
UD
1833
1834AC_CACHE_CHECK([whether -fPIC is default], pic_default,
1835[pic_default=yes
1836cat > conftest.c <<EOF
9756dfe1 1837#if defined __PIC__ || defined __pic__ || defined PIC || defined pic
cc3fa755
UD
1838# error PIC is default.
1839#endif
1840EOF
c2f55635 1841if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AC_FD_CC"; then
cc3fa755
UD
1842 pic_default=no
1843fi
1844rm -f conftest.*])
1845AC_SUBST(pic_default)
1846
ff3d7ed3
RM
1847AC_SUBST(profile)
1848AC_SUBST(omitfp)
5a97622d 1849AC_SUBST(bounded)
5107cf1d 1850AC_SUBST(static_nss)
5ae3e846 1851AC_SUBST(nopic_initfini)
ff3d7ed3 1852
edf5b2d7
UD
1853AC_SUBST(DEFINES)
1854
7cabd57c
UD
1855case "$add_ons" in
1856 *door*) linux_doors=yes ;;
1857 *) linux_doors=no ;;
1858esac
1859AC_SUBST(linux_doors)
1860
61c83c3f
RM
1861dnl See sysdeps/mach/configure.in for this variable.
1862AC_SUBST(mach_interface_list)
1863
28f540f4
RM
1864if test "`(cd $srcdir; pwd)`" = "`pwd`"; then
1865 config_makefile=
1866else
1867 config_makefile=Makefile
1868fi
1869
ee74a442
UD
1870VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
1871RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
df4ef2ab 1872AC_SUBST(VERSION)
ee74a442 1873AC_SUBST(RELEASE)
df4ef2ab 1874
c118d634
RM
1875AC_CONFIG_FILES([config.make glibcbug ${config_makefile} ${config_uname}])
1876AC_CONFIG_COMMANDS([default],[[
737547be
UD
1877case $CONFIG_FILES in *config.make*)
1878echo "$config_vars" >> config.make;;
1879esac
c118d634
RM
1880test -d bits || mkdir bits]],[[config_vars='$config_vars']])
1881AC_OUTPUT