]>
Commit | Line | Data |
---|---|---|
f4017d20 | 1 | dnl Process this file with autoconf to produce a configure script. |
ff3d7ed3 | 2 | AC_REVISION([$CVSid$]) |
3a12e572 | 3 | AC_PREREQ(2.53)dnl dnl Minimum Autoconf version required. |
5d77b1da RM |
4 | AC_INIT([GNU C Library], [(see version.h)], [glibc]) |
5 | AC_CONFIG_SRCDIR([include/features.h]) | |
28f540f4 | 6 | AC_CONFIG_HEADER(config.h) |
5bc2f642 | 7 | AC_CONFIG_AUX_DIR(scripts) |
28f540f4 RM |
8 | |
9 | # This will get text that should go into config.make. | |
10 | config_vars= | |
11 | ||
12 | # Check for a --with-gmp argument and set gmp-srcdir in config.make. | |
13 | AC_ARG_WITH(gmp, dnl | |
14 | --with-gmp=DIRECTORY find GMP source code in DIRECTORY (not needed), | |
15 | [dnl | |
16 | case "$with_gmp" in | |
17 | yes) AC_MSG_ERROR(--with-gmp requires an argument; use --with-gmp=DIRECTORY) ;; | |
18 | ''|no) ;; | |
19 | *) config_vars="$config_vars | |
20 | gmp-srcdir = $withval" ;; | |
21 | esac | |
22 | ]) | |
c8f3e6db UD |
23 | # Check for a --with-gd argument and set libgd-LDFLAGS in config.make. |
24 | AC_ARG_WITH(gd, dnl | |
25 | --with-gd=DIR find libgd include dir and library with prefix DIR, | |
26 | [dnl | |
27 | case "$with_gd" in | |
f5f7239f UD |
28 | yes|''|no) ;; |
29 | *) libgd_include="-I$withval/include" | |
c8f3e6db UD |
30 | libgd_ldflags="-L$withval/lib" ;; |
31 | esac | |
32 | ]) | |
f5f7239f UD |
33 | AC_ARG_WITH(gd-include, dnl |
34 | --with-gd-include=DIR find libgd include files in DIR, | |
35 | [dnl | |
36 | case "$with_gd_include" in | |
37 | ''|no) ;; | |
38 | *) libgd_include="-I$withval" ;; | |
39 | esac | |
40 | ]) | |
41 | AC_ARG_WITH(gd-lib, dnl | |
42 | --with-gd-lib=DIR find libgd library files in DIR, | |
43 | [dnl | |
44 | case "$with_gd_lib" in | |
45 | ''|no) ;; | |
46 | *) libgd_ldflags="-L$withval" ;; | |
47 | esac | |
48 | ]) | |
49 | ||
50 | if test -n "$libgd_include"; then | |
51 | config_vars="$config_vars | |
cf90163d | 52 | CFLAGS-memusagestat.c = $libgd_include" |
f5f7239f UD |
53 | fi |
54 | if test -n "$libgd_ldflags"; then | |
55 | config_vars="$config_vars | |
56 | libgd-LDFLAGS = $libgd_ldflags" | |
57 | fi | |
28f540f4 | 58 | |
ff3d7ed3 | 59 | dnl Arguments to specify presence of other packages/features. |
335aa320 | 60 | AC_ARG_WITH(fp, dnl |
a18f587d | 61 | [ --with-fp if using floating-point hardware [default=yes]], |
335aa320 | 62 | with_fp=$withval, with_fp=yes) |
675322a5 | 63 | AC_SUBST(with_fp) |
650425ce | 64 | AC_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 |
67 | AC_ARG_WITH(elf, dnl |
68 | --with-elf if using the ELF object format, | |
335aa320 | 69 | elf=$withval, elf=no) |
5af3245a UD |
70 | AC_ARG_WITH(xcoff, dnl |
71 | --with-xcoff if using the XCOFF object format, | |
72 | xcoff=$withval, xcoff=no) | |
4d06461a | 73 | AC_ARG_WITH(cvs, dnl |
4442d7e8 | 74 | [ --without-cvs if CVS should not be used], |
4d06461a | 75 | with_cvs=$withval, with_cvs=yes) |
6b3f2b3d UD |
76 | if 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 | 81 | fi |
4d06461a | 82 | AC_SUBST(with_cvs) |
28f540f4 | 83 | |
dbe7a0f5 UD |
84 | AC_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 |
90 | AC_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 |
95 | dnl Arguments to enable or disable building the static, shared, profiled, |
96 | dnl and -fomit-frame-pointer libraries. | |
b38bb8ca UD |
97 | dnl I've disabled this for now since we cannot build glibc without static |
98 | dnl libraries built in the moment. | |
99 | dnl AC_ARG_ENABLE(static, dnl | |
100 | dnl [ --enable-static build static library [default=yes]], | |
101 | dnl static=$enableval, static=yes) | |
5c2a0669 | 102 | static=yes |
ff3d7ed3 RM |
103 | AC_ARG_ENABLE(shared, dnl |
104 | [ --enable-shared build shared library [default=yes if GNU ld & ELF]], | |
6b3a2224 | 105 | shared=$enableval, shared=default) |
ff3d7ed3 RM |
106 | AC_ARG_ENABLE(profile, dnl |
107 | [ --enable-profile build profiled library [default=yes]], | |
6b3a2224 | 108 | profile=$enableval, profile=yes) |
ff3d7ed3 | 109 | AC_ARG_ENABLE(omitfp, dnl |
6b3a2224 RM |
110 | [ --enable-omitfp build undebuggable optimized library [default=no]], |
111 | omitfp=$enableval, omitfp=no) | |
5a97622d UD |
112 | AC_ARG_ENABLE(bounded, dnl |
113 | [ --enable-bounded build with runtime bounds checking [default=no]], | |
114 | bounded=$enableval, bounded=no) | |
650425ce UD |
115 | AC_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 |
120 | AC_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) | |
124 | if test "$oldest_abi" = yes || test "$oldest_abi" = no; then | |
125 | oldest_abi=default | |
126 | else | |
127 | AC_DEFINE_UNQUOTED(GLIBC_OLDEST_ABI, "$oldest_abi") | |
128 | fi | |
129 | AC_SUBST(oldest_abi) | |
130 | ||
6b3a2224 RM |
131 | dnl Generic infrastructure for drop-in additions to libc. |
132 | AC_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 | 143 | dnl Let the user avoid using TLS. Don't know why but... |
9cce206e | 144 | dnl XXX For now we disable support by default. |
8d4b5a8a | 145 | AC_ARG_WITH(tls, dnl |
9cce206e UD |
146 | [ --with-tls enable support for TLS], |
147 | usetls=$withval, usetls=no) | |
8d4b5a8a | 148 | |
5b8f26b4 RM |
149 | AC_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 |
153 | AC_ARG_ENABLE(hidden-plt, dnl |
154 | [ --disable-hidden-plt do not hide internal function calls to avoid PLT], | |
155 | hidden=$enableval, hidden=yes) | |
156 | if test "x$hidden" = xno; then | |
157 | AC_DEFINE(NO_HIDDEN) | |
158 | fi | |
159 | ||
6b3a2224 | 160 | AC_CONFIG_SUBDIRS($add_ons) |
57ba7bb4 | 161 | add_ons_pfx= |
da74e902 | 162 | if 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 |
186 | fi | |
ff3d7ed3 | 187 | |
5107cf1d UD |
188 | dnl On some platforms we cannot use dynamic loading. We must provide |
189 | dnl static NSS modules. | |
190 | AC_ARG_ENABLE(static-nss, dnl | |
191 | [ --enable-static-nss build static NSS modules [default=no]], | |
192 | static_nss=$enableval, static_nss=no) | |
834cef7c UD |
193 | dnl Enable static NSS also if we build no shared objects. |
194 | if test x"$static_nss" = xyes || test x"$shared" = xno; then | |
3172f58f | 195 | static_nss=yes |
5107cf1d UD |
196 | AC_DEFINE(DO_STATIC_NSS) |
197 | fi | |
198 | ||
73237de3 | 199 | AC_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) | |
203 | AC_SUBST(force_install) | |
204 | ||
958f238f UD |
205 | dnl On some platforms we allow dropping compatibility with all kernel |
206 | dnl versions. | |
207 | AC_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 |
211 | dnl Prevent unreasonable values. |
212 | if test "$minimum_kernel" = yes || test "$minimum_kernel" = no; then | |
213 | # Better nothing than this. | |
214 | minimum_kernel="" | |
269e369f UD |
215 | else |
216 | if test "$minimum_kernel" = current; then | |
217 | minimum_kernel=`uname -r 2>/dev/null` || minimum_kernel= | |
218 | fi | |
86cfe82d | 219 | fi |
958f238f | 220 | |
6cc7d725 UD |
221 | dnl For the development we sometimes want gcc to issue even more warnings. |
222 | dnl This is not the default since many of the extra warnings are not | |
223 | dnl appropriate. | |
224 | AC_ARG_ENABLE(all-warnings, | |
225 | [ --enable-all-warnings enable all useful warnings gcc can issue], | |
226 | all_warnings=$enableval) | |
227 | AC_SUBST(all_warnings) | |
228 | ||
28f540f4 | 229 | AC_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. | |
236 | case "$host_os" in | |
237 | linux*) | |
238 | ;; | |
239 | gnu*) | |
240 | host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'` | |
241 | ;; | |
242 | esac | |
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. | |
247 | config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os | |
248 | ||
2f64b655 UD |
249 | # Don't allow vendor == "unknown" |
250 | test "$config_vendor" = unknown && config_vendor= | |
251 | config_os="`echo $config_os | sed 's/^unknown-//'`" | |
252 | ||
a2fe9c76 RM |
253 | # Some configurations imply other options. |
254 | case "$host_os" in | |
255 | gnu* | linux* | bsd4.4* | netbsd* | freebsd*) | |
256 | # These systems always use GNU tools. | |
c8cf0b14 | 257 | gnu_ld=yes gnu_as=yes ;; |
a2fe9c76 RM |
258 | esac |
259 | case "$host_os" in | |
7799b7b3 UD |
260 | # i586-linuxaout is mangled into i586-pc-linux-gnuaout |
261 | linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*) | |
3776d592 | 262 | ;; |
ffa8d2a0 | 263 | gnu* | linux* | freebsd* | netbsd* | sysv4* | solaris2* | irix6*) |
3776d592 RM |
264 | # These systems (almost) always use the ELF format. |
265 | elf=yes | |
84724245 | 266 | ;; |
5af3245a UD |
267 | aix*) |
268 | # These systems are always xcoff | |
269 | xcoff=yes | |
a711b01d | 270 | elf=no |
5af3245a | 271 | ;; |
a2fe9c76 RM |
272 | esac |
273 | ||
28f540f4 RM |
274 | machine=$config_machine |
275 | vendor=$config_vendor | |
276 | os=$config_os | |
277 | ||
a808d541 UD |
278 | # config.guess on some IBM machines says `rs6000' instead of `powerpc'. |
279 | # Unify this here. | |
280 | if test "$machine" = rs6000; then | |
281 | machine="powerpc" | |
282 | fi | |
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 | ### | |
292 | if 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 | |
306 | fi | |
307 | ||
1a8aaf91 | 308 | # Brain dead PowerPC box with absolutely no FPU. |
1a8aaf91 UD |
309 | case "$machine-$host_os" in |
310 | powerpc*-*soft) | |
311 | with_fp=no | |
312 | completely_soft=yes | |
313 | AC_SUBST(completely_soft) | |
314 | ;; | |
315 | esac | |
316 | ||
28f540f4 RM |
317 | dnl We need to use [ and ] for other purposes for a while now. |
318 | changequote(,)dnl | |
319 | # Expand the configuration machine name into a subdirectory by architecture | |
320 | # type and particular chip. | |
321 | case "$machine" in | |
f0523145 RM |
322 | a29k | am29000) base_machine=a29k machine=a29k ;; |
323 | alpha*) base_machine=alpha machine=alpha/$machine ;; | |
0c8b61e6 | 324 | arm*) base_machine=arm machine=arm/arm32/$machine ;; |
60c96635 UD |
325 | c3[012]) base_machine=cx0 machine=cx0/c30 ;; |
326 | c4[04]) base_machine=cx0 machine=cx0/c40 ;; | |
b15cb495 UD |
327 | hppa*64*) base_machine=hppa machine=hppa/hppa64 ;; |
328 | hppa*) base_machine=hppa machine=hppa/hppa1.1 ;; | |
a8922de8 | 329 | i[3456]86) base_machine=i386 machine=i386/$machine ;; |
d64e704c | 330 | ia64) base_machine=ia64 machine=ia64 ;; |
f0523145 RM |
331 | m680?0) base_machine=m68k machine=m68k/$machine ;; |
332 | m68k) base_machine=m68k machine=m68k/m68020 ;; | |
333 | m88???) base_machine=m88k machine=m88k/$machine ;; | |
334 | m88k) base_machine=m88k machine=m88k/m88100 ;; | |
f0523145 | 335 | mips64*) base_machine=mips64 machine=mips/mips64/$machine ;; |
2b904739 | 336 | mips*) base_machine=mips machine=mips/$machine ;; |
92b27c74 UD |
337 | powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;; |
338 | powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;; | |
136d4332 UD |
339 | s390) base_machine=s390 machine=s390/s390-32 ;; |
340 | s390x) base_machine=s390 machine=s390/s390-64 ;; | |
88615235 UD |
341 | sh3*) base_machine=sh machine=sh/sh3 ;; |
342 | sh4*) base_machine=sh machine=sh/sh4 ;; | |
ca34d7a7 UD |
343 | sparc | sparcv[67]) |
344 | base_machine=sparc machine=sparc/sparc32 ;; | |
345 | sparcv8 | supersparc | hypersparc) | |
346 | base_machine=sparc machine=sparc/sparc32/sparcv8 ;; | |
ae6b8730 RH |
347 | sparcv8plus | sparcv8plusa | sparcv9) |
348 | base_machine=sparc machine=sparc/sparc32/sparcv9 ;; | |
bb769ab6 UD |
349 | sparcv8plusb | sparcv9b) |
350 | base_machine=sparc machine=sparc/sparc32/sparcv9b ;; | |
ca34d7a7 UD |
351 | sparc64 | ultrasparc) |
352 | base_machine=sparc machine=sparc/sparc64 ;; | |
bb769ab6 UD |
353 | sparc64b | ultrasparc3) |
354 | base_machine=sparc machine=sparc/sparc64/sparcv9b ;; | |
0c8b61e6 | 355 | thumb*) base_machine=thumb machine=arm/thumb/$machine ;; |
3a2832a0 | 356 | *) base_machine=$machine ;; |
28f540f4 | 357 | esac |
f0523145 RM |
358 | changequote([,])dnl |
359 | AC_SUBST(base_machine) | |
28f540f4 | 360 | |
dfd2257a UD |
361 | if test "$base_machine" = "i386"; then |
362 | AC_DEFINE(USE_REGPARMS) | |
363 | fi | |
364 | ||
f0523145 | 365 | # Compute the list of sysdep directories for this configuration. |
f332db02 | 366 | # This can take a while to compute. |
f0523145 | 367 | sysdep_dir=$srcdir/sysdeps |
f332db02 | 368 | AC_MSG_CHECKING(sysdep dirs) |
f0523145 RM |
369 | dnl We need to use [ and ] for other purposes for a while now. |
370 | changequote(,)dnl | |
28f540f4 RM |
371 | # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1. |
372 | os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`" | |
373 | ||
374 | case "$os" in | |
375 | gnu*) | |
376 | base_os=mach/hurd ;; | |
883bc19b | 377 | netbsd* | 386bsd* | freebsd* | bsdi*) |
28f540f4 | 378 | base_os=unix/bsd/bsd4.4 ;; |
222c4e71 | 379 | osf* | sunos* | ultrix* | newsos* | dynix* | *bsd*) |
28f540f4 | 380 | base_os=unix/bsd ;; |
d586354e | 381 | sysv* | isc* | esix* | sco* | minix* | irix4* | linux*) |
28f540f4 | 382 | base_os=unix/sysv ;; |
f802accb UD |
383 | irix6*) |
384 | base_os=unix/sysv/irix6/$os ;; | |
d586354e | 385 | solaris[2-9]*) |
28f540f4 | 386 | base_os=unix/sysv/sysv4 ;; |
908c3d5b UD |
387 | hpux*) |
388 | base_os=unix/sysv/hpux/$os ;; | |
75d86c1f UD |
389 | aix4.3*) |
390 | base_os=unix/sysv/aix/aix4.3 ;; | |
28f540f4 RM |
391 | none) |
392 | base_os=standalone ;; | |
393 | *) | |
394 | base_os='' ;; | |
395 | esac | |
396 | ||
397 | # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos. | |
398 | tail=$os | |
399 | ostry=$os | |
400 | while o=`echo $tail | sed 's/\.[^.]*$//'`; test $o != $tail; do | |
401 | ostry="$ostry /$o" | |
402 | tail=$o | |
75914335 | 403 | done |
28f540f4 RM |
404 | o=`echo $tail | sed 's/[0-9]*$//'` |
405 | if test $o != $tail; then | |
406 | ostry="$ostry /$o" | |
407 | fi | |
ec4b0518 UD |
408 | # For linux-gnu, try linux-gnu, then linux. |
409 | o=`echo $tail | sed 's/-.*$//'` | |
410 | if test $o != $tail; then | |
411 | ostry="$ostry /$o" | |
412 | fi | |
28f540f4 RM |
413 | |
414 | # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix. | |
415 | base= | |
416 | tail=$base_os | |
417 | while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$b"; do | |
418 | set $b | |
419 | base="$base /$1" | |
420 | tail="$2" | |
421 | done | |
422 | ||
ae6b8730 | 423 | # For sparc/sparc32, try sparc/sparc32 and then sparc. |
28f540f4 RM |
424 | mach= |
425 | tail=$machine | |
426 | while 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" | |
434 | done | |
435 | ||
436 | dnl We are done with glob and regexp uses of [ and ]; return to autoconf. | |
437 | changequote([,])dnl | |
438 | ||
439 | # Find what sysdep directories exist. | |
440 | sysnames= | |
57ba7bb4 UD |
441 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" |
442 | for 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 | |
465 | done | |
57ba7bb4 | 466 | IFS="$ac_save_ifs" |
28f540f4 RM |
467 | |
468 | if test -z "$os_used" && test "$os" != none; then | |
469 | AC_MSG_ERROR(Operating system $os is not supported.) | |
470 | fi | |
471 | if test -z "$machine_used" && test "$machine" != none; then | |
472 | AC_MSG_ERROR(The $machine is not supported.) | |
473 | fi | |
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?). | |
483 | if 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 |
493 | fi |
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). | |
498 | set $sysnames | |
e50ec9f9 | 499 | names= |
28f540f4 RM |
500 | while 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. | |
557 | changequote(,)dnl | |
57ba7bb4 | 558 | parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`" |
28f540f4 RM |
559 | changequote([,])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 | |
570 | done | |
571 | ||
572 | # Add the default directories. | |
ecdc196c | 573 | default_sysnames=sysdeps/generic |
2de7874e | 574 | if test "$elf" = yes; then |
ecdc196c | 575 | default_sysnames="sysdeps/generic/elf $default_sysnames" |
2de7874e | 576 | fi |
ecdc196c | 577 | sysnames="$names $default_sysnames" |
f332db02 RM |
578 | AC_SUBST(sysnames) |
579 | # The other names were emitted during the scan. | |
ecdc196c | 580 | AC_MSG_RESULT($default_sysnames) |
28f540f4 | 581 | |
f332db02 RM |
582 | |
583 | ### Locate tools. | |
28f540f4 | 584 | |
28f540f4 | 585 | AC_PROG_INSTALL |
2b80a372 | 586 | if 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 | 589 | fi |
0e3426bb | 590 | AC_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. | |
597 | AC_PATH_PROG(PWD_P, pwd, no) | |
598 | if test "$PWD_P" = no; then | |
599 | AC_MSG_ERROR(*** A pwd binary could not be found.) | |
600 | fi | |
601 | ||
63bda0c1 | 602 | # These programs are version sensitive. |
3a12e572 | 603 | AC_CHECK_TOOL_PREFIX |
4bca4c17 | 604 | AC_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 | 607 | AC_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 | |
612 | if test -n "$critic_missing"; then | |
613 | AC_MSG_ERROR([ | |
aefdff34 | 614 | *** These critical programs are missing or too old:$critic_missing |
03616749 AJ |
615 | *** Check the INSTALL file for required versions.]) |
616 | fi | |
617 | ||
618 | ||
22e65f8f | 619 | AC_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 | 623 | AC_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 | 627 | AC_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 |
632 | AC_CHECK_PROGS(AUTOCONF, autoconf, no) |
633 | case "x$AUTOCONF" in | |
634 | xno|x|x:) AUTOCONF=no ;; | |
635 | *) | |
636 | AC_CACHE_CHECK(dnl | |
637 | whether $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 | ;; | |
645 | esac | |
646 | test "x$AUTOCONF" != xno || aux_missing="$aux_missing autoconf" | |
647 | ||
3a12e572 | 648 | AC_PROG_CC |
ea9f119b AJ |
649 | if test $host != $build; then |
650 | AC_CHECK_PROGS(BUILD_CC, gcc cc) | |
651 | fi | |
652 | AC_SUBST(cross_compiling) | |
653 | AC_PROG_CPP | |
654 | LIBC_PROG_BINUTILS | |
2d37ce0f | 655 | AC_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 | 664 | test -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. |
670 | CCVERSION=`$CC -v 2>&1 | sed -n 's/gcc version //p'` | |
671 | AC_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.) | |
676 | if test -n "$sysheaders"; then | |
677 | ccheaders=`$CC -print-file-name=include` | |
678 | SYSINCLUDES="-nostdinc -isystem $ccheaders -isystem $sysheaders" | |
679 | fi | |
680 | AC_SUBST(SYSINCLUDES) | |
681 | ||
97a47867 UD |
682 | # check if ranlib is necessary |
683 | AC_CACHE_CHECK(whether ranlib is necessary, libc_cv_ranlib_necessary, [dnl | |
684 | cat > conftest.c <<EOF | |
685 | int a; | |
686 | char b; | |
687 | void c(void) {} | |
688 | EOF | |
689 | $CC $CFLAGS -c conftest.c | |
72d4c33d | 690 | $AR cr conftest.a conftest.o |
97a47867 UD |
691 | cp conftest.a conftest2.a |
692 | $RANLIB conftest.a | |
693 | if cmp -s conftest.a conftest2.a; then | |
694 | libc_cv_ranlib_necessary=no | |
f38931a9 | 695 | else |
97a47867 UD |
696 | libc_cv_ranlib_necessary=yes |
697 | fi | |
698 | rm -rf conftest*]) | |
699 | if test "$libc_cv_ranlib_necessary" = no; then | |
700 | RANLIB=: | |
f38931a9 | 701 | fi |
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 | |
710 | AC_MSG_CHECKING(LD_LIBRARY_PATH variable) | |
711 | changequote(,)dnl | |
712 | case ${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 | ;; | |
719 | esac | |
720 | changequote([,])dnl | |
721 | AC_MSG_RESULT($ld_library_path_setting) | |
722 | if test "$ld_library_path_setting" != "ok"; then | |
63bda0c1 UD |
723 | AC_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 | 727 | fi |
8e31cf7e | 728 | |
74bd2300 UD |
729 | AC_CACHE_CHECK(whether GCC supports -static-libgcc, libc_cv_gcc_static_libgcc, [dnl |
730 | if $CC -v -static-libgcc 2>&1 | grep -q 'unrecognized option.*static-libgcc'; then | |
731 | libc_cv_gcc_static_libgcc= | |
732 | else | |
733 | libc_cv_gcc_static_libgcc=-static-libgcc | |
734 | fi]) | |
735 | AC_SUBST(libc_cv_gcc_static_libgcc) | |
736 | ||
84384f5b | 737 | AC_PATH_PROG(BASH, bash, no) |
a18f587d | 738 | if 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 |
742 | else | |
743 | libc_cv_have_bash2=no | |
744 | fi | |
745 | AC_SUBST(libc_cv_have_bash2) | |
746 | ||
5290baf0 UD |
747 | dnl We need a ksh compatible shell for tzselect. |
748 | if 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 | |
755 | else | |
756 | KSH="$BASH" | |
757 | AC_SUBST(KSH) | |
758 | libc_cv_have_ksh=yes | |
759 | fi | |
760 | AC_SUBST(libc_cv_have_ksh) | |
761 | ||
5aa8ff62 | 762 | AC_PROG_AWK |
c0016081 | 763 | AC_PATH_PROG(PERL, perl, no) |
2fd5d029 RM |
764 | if test "$PERL" != no && |
765 | (eval `$PERL -V:apiversion`; test `expr "$apiversion" \< 5` -ne 0); then | |
766 | PERL=no | |
ecb06196 | 767 | fi |
2f512715 AS |
768 | AC_PATH_PROG(INSTALL_INFO, install-info, no, |
769 | $PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin) | |
c0016081 UD |
770 | if test "$INSTALL_INFO" != "no"; then |
771 | AC_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]) | |
790 | if test -n "$testfailed" | |
791 | then AC_MSG_WARN([install-info errored out, check config.log]) | |
792 | fi | |
793 | OLD_DEBIAN_INSTALL_INFO=$libc_cv_old_debian_install_info | |
794 | fi | |
795 | AC_SUBST(OLD_DEBIAN_INSTALL_INFO) | |
a2b08ee5 | 796 | |
2de00372 UD |
797 | AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin) |
798 | ||
b8dc6a10 | 799 | AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl |
28f540f4 RM |
800 | echo '#include <stddef.h> |
801 | FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c | |
802 | if eval "$ac_cpp conftest.c 2>/dev/null" \ | |
803 | | grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null; then | |
804 | libc_cv_signed_size_t=no | |
805 | else | |
806 | libc_cv_signed_size_t=yes | |
807 | fi | |
808 | rm -f conftest*]) | |
28f540f4 RM |
809 | if 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 | |
814 | EOF | |
815 | fi | |
816 | ||
b8dc6a10 | 817 | AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl |
28f540f4 RM |
818 | AC_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 | |
827 | if (&size == NULL || &wchar == NULL) abort ();], | |
828 | libc_cv_friendly_stddef=yes, | |
829 | libc_cv_friendly_stddef=no)]) | |
28f540f4 RM |
830 | if test $libc_cv_friendly_stddef = yes; then |
831 | config_vars="$config_vars | |
832 | override stddef.h = # The installed <stddef.h> seems to be libc-friendly." | |
833 | fi | |
834 | ||
b8dc6a10 RM |
835 | AC_CACHE_CHECK(whether we need to use -P to assemble .S files, |
836 | libc_cv_need_minus_P, [dnl | |
28f540f4 RM |
837 | cat > conftest.S <<EOF |
838 | #include "confdefs.h" | |
839 | /* Nothing whatsoever. */ | |
840 | EOF | |
841 | if ${CC-cc} $CFLAGS -c conftest.S 2>/dev/null; then | |
842 | libc_cv_need_minus_P=no | |
843 | else | |
844 | libc_cv_need_minus_P=yes | |
845 | fi | |
846 | rm -f conftest*]) | |
28f540f4 RM |
847 | if test $libc_cv_need_minus_P = yes; then |
848 | config_vars="$config_vars | |
849 | asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives." | |
850 | fi | |
851 | ||
2293395f UD |
852 | AC_MSG_CHECKING(whether .text pseudo-op must be used) |
853 | AC_CACHE_VAL(libc_cv_dot_text, [dnl | |
854 | cat > conftest.s <<EOF | |
855 | .text | |
856 | EOF | |
857 | libc_cv_dot_text= | |
858 | if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then | |
859 | libc_cv_dot_text=.text | |
860 | fi | |
861 | rm -f conftest*]) | |
862 | if test -z "$libc_cv_dot_text"; then | |
863 | AC_MSG_RESULT(no) | |
864 | else | |
865 | AC_MSG_RESULT(yes) | |
866 | fi | |
867 | ||
b8dc6a10 RM |
868 | AC_CACHE_CHECK(for assembler global-symbol directive, |
869 | libc_cv_asm_global_directive, [dnl | |
9a70fcab | 870 | libc_cv_asm_global_directive=UNKNOWN |
908c3d5b | 871 | for 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 | 875 | foo: |
9a70fcab UD |
876 | EOF |
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 | |
882 | done]) | |
9a70fcab UD |
883 | if test $libc_cv_asm_global_directive = UNKNOWN; then |
884 | AC_MSG_ERROR(cannot determine asm global directive) | |
885 | else | |
886 | AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${libc_cv_asm_global_directive}) | |
887 | fi | |
888 | ||
b8dc6a10 | 889 | AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl |
9a70fcab | 890 | cat > conftest.s <<EOF |
2293395f | 891 | ${libc_cv_dot_text} |
ae1025be | 892 | foo: |
df2a0c93 | 893 | .set glibc_conftest_frobozz,foo |
9a70fcab | 894 | $libc_cv_asm_global_directive glibc_conftest_frobozz |
e215c478 | 895 | EOF |
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. | |
898 | cat > conftest1.c <<\EOF | |
899 | extern int glibc_conftest_frobozz; | |
900 | main () { printf ("%d\n", glibc_conftest_frobozz); } | |
901 | EOF | |
902 | if ${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 |
905 | else | |
906 | libc_cv_asm_set_directive=no | |
907 | fi | |
65b3cbcb | 908 | rm -f conftest*]) |
e215c478 RM |
909 | if test $libc_cv_asm_set_directive = yes; then |
910 | AC_DEFINE(HAVE_ASM_SET_DIRECTIVE) | |
911 | fi | |
912 | ||
b88ac073 RM |
913 | AC_CACHE_CHECK(for assembler .type directive prefix, |
914 | libc_cv_asm_type_prefix, [dnl | |
915 | libc_cv_asm_type_prefix=no | |
916 | for 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 | |
922 | foo: | |
923 | .byte 1 | |
924 | EOF | |
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 | |
930 | done]) | |
931 | if test "x$libc_cv_asm_type_prefix" != xno; then | |
932 | AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix}) | |
933 | fi | |
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. |
937 | case "${os}${machine}" in | |
938 | aix4.3* | linux*powerpc/powerpc64*) | |
2aa15430 UD |
939 | AC_DEFINE(HAVE_ASM_GLOBAL_DOT_NAME) |
940 | esac | |
941 | ||
377a515b UD |
942 | AC_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 |
947 | EOF | |
c2f55635 | 948 | if ${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 |
950 | else | |
951 | libc_cv_asm_symver_directive=no | |
952 | fi | |
953 | rm -f conftest*]) | |
954 | AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl | |
955 | if 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 |
960 | EOF | |
961 | cat > conftest.map <<EOF | |
f43ce637 | 962 | VERS_1 { |
377a515b UD |
963 | global: sym; |
964 | }; | |
f43ce637 UD |
965 | |
966 | VERS_2 { | |
967 | global: sym; | |
968 | } VERS_1; | |
377a515b | 969 | EOF |
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 | |
983 | else | |
984 | libc_cv_ld_version_script_option=no | |
985 | fi | |
986 | rm -f conftest*]) | |
7499a22a RM |
987 | if 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) | |
993 | else | |
994 | VERSIONING=no | |
995 | fi | |
996 | AC_SUBST(VERSIONING) | |
997 | ||
102a3e8f | 998 | if 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 | 1004 | fi |
fd26970f UD |
1005 | if 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 | |
1011 | EOF | |
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 | |
1026 | EOF | |
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 | |
1041 | foo: | |
1042 | .hidden bar | |
1043 | bar: | |
1044 | EOF | |
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; | |
1061 | EOF | |
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; } | |
1084 | EOF | |
1085 | libc_cv_broken_visibility_attribute=yes | |
1086 | if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then | |
1087 | changequote(,)dnl | |
1088 | if grep '\.hidden[ _]foo' conftest.s >/dev/null; then | |
1089 | changequote([,])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 |
1109 | EOF |
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 | |
1142 | int _start (void) { return 0; } | |
1143 | int __start (void) { return 0; } | |
1144 | int foo (void) { return 1; } | |
2c617417 | 1145 | int (*fp) (void) __attribute__ ((section (".init_array"))) = foo; |
5241882c UD |
1146 | EOF |
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 | |
1167 | int _start (void) { return 42; } | |
1168 | EOF | |
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 | |
1183 | int _start (void) { return 42; } | |
1184 | EOF | |
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 | |
1199 | int _start (void) { return 42; } | |
1200 | EOF | |
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 | |
1215 | int _start (void) { return 42; } | |
1216 | EOF | |
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 |
1229 | extern int bar (int); |
1230 | extern int mumble; | |
1231 | int foo (void) { return bar (mumble); } | |
a711b01d | 1232 | EOF |
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 |
1237 | dnl The following test is a bit weak. We must use a tool which can test | |
1238 | dnl cross-platform since the gcc used can be a cross compiler. Without | |
1239 | dnl introducing new options this is not easily doable. Instead use a tool | |
1240 | dnl which always is cross-platform: readelf. To detect whether -z combreloc | |
1241 | dnl 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 | 1254 | fi |
f13df7c7 | 1255 | AC_SUBST(libc_cv_z_combreloc) |
fd26970f | 1256 | |
b8dc6a10 RM |
1257 | if 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 | |
1268 | fi | |
e215c478 | 1269 | |
e26dd47f UD |
1270 | if 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; | |
1276 | EOF | |
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 | |
1291 | fi | |
1292 | ||
9a0a462c UD |
1293 | dnl AC_CHECK_ASM_UNDERSCORE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) |
1294 | AC_DEFUN(AC_CHECK_ASM_UNDERSCORE, | |
1295 | [cat > conftest.$ac_ext <<EOF | |
1296 | dnl This sometimes fails to find confdefs.h, for some reason. | |
1297 | dnl [#]line __oline__ "[$]0" | |
1298 | [#]line __oline__ "configure" | |
1299 | #include "confdefs.h" | |
1300 | void underscore_test(void) { | |
1301 | return; } | |
1302 | EOF | |
1303 | if 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 | |
1311 | else | |
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]) | |
1316 | fi | |
1317 | rm -f conftest*]) | |
1318 | ||
c224a18a RM |
1319 | if test $elf = yes; then |
1320 | libc_cv_asm_underscores=no | |
1321 | else | |
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 |
1332 | fi |
1333 | if test $libc_cv_asm_underscores = no; then | |
1334 | AC_DEFINE(NO_UNDERSCORES) | |
1335 | fi | |
1336 | ||
1337 | if test $elf = yes; then | |
1338 | libc_cv_weak_symbols=yes | |
9a97d1f7 UD |
1339 | fi |
1340 | ||
1341 | AC_CACHE_CHECK(for assembler .weak directive, libc_cv_asm_weak_directive, | |
75d86c1f | 1342 | [dnl |
c224a18a | 1343 | cat > conftest.s <<EOF |
2293395f | 1344 | ${libc_cv_dot_text} |
c224a18a | 1345 | ${libc_cv_asm_global_directive} foo |
ae1025be | 1346 | foo: |
c224a18a RM |
1347 | .weak foo |
1348 | .weak bar; bar = foo | |
1349 | EOF | |
9a97d1f7 UD |
1350 | if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then |
1351 | libc_cv_asm_weak_directive=yes | |
1352 | else | |
1353 | libc_cv_asm_weak_directive=no | |
1354 | fi | |
1355 | rm -f conftest*]) | |
c224a18a | 1356 | |
c8cf0b14 | 1357 | if 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 | |
1361 | cat > conftest.s <<EOF | |
2293395f | 1362 | ${libc_cv_dot_text} |
c224a18a | 1363 | ${libc_cv_asm_global_directive} foo |
ae1025be | 1364 | foo: |
f802accb UD |
1365 | .weakext bar foo |
1366 | .weakext baz | |
1367 | ${libc_cv_asm_global_directive} baz | |
9a97d1f7 | 1368 | baz: |
c224a18a RM |
1369 | EOF |
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 | 1377 | fi # no .weak |
c224a18a | 1378 | |
ffcf9634 | 1379 | if test $libc_cv_asm_weak_directive = yes; then |
c224a18a | 1380 | AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE) |
ffcf9634 | 1381 | elif test $libc_cv_asm_weakext_directive = yes; then |
c224a18a RM |
1382 | AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE) |
1383 | fi | |
1384 | ||
b15cb495 | 1385 | dnl The standard hppa assembler uses `;' to start comments and `!' |
eacde9d0 UD |
1386 | dnl as a line separator. CRIS uses `;' to start comments and `@' for |
1387 | dnl line separator. | |
b15cb495 | 1388 | case "${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 | |
1398 | EOF | |
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 | ;; | |
1412 | esac | |
1413 | ||
a641835a RM |
1414 | AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl |
1415 | cat > conftest.c <<\EOF | |
5f0e6fc7 | 1416 | _start () {} |
dcf0671d UD |
1417 | int __eh_pc; |
1418 | __throw () {} | |
a641835a | 1419 | EOF |
dcea62dd RM |
1420 | dnl No \ in command here because it ends up inside ''. |
1421 | if 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 |
1425 | else | |
1426 | libc_cv_ld_no_whole_archive=no | |
1427 | fi | |
1428 | rm -f conftest*]) | |
b17277cf UD |
1429 | if test $libc_cv_ld_no_whole_archive = yes; then |
1430 | no_whole_archive=-Wl,--no-whole-archive | |
1431 | fi | |
1432 | AC_SUBST(no_whole_archive)dnl | |
a641835a | 1433 | |
dff14448 | 1434 | AC_CACHE_CHECK(for gcc -fexceptions, libc_cv_gcc_exceptions, [dnl |
b236e99d UD |
1435 | cat > conftest.c <<\EOF |
1436 | _start () {} | |
1437 | int __eh_pc; | |
1438 | __throw () {} | |
1439 | EOF | |
1440 | dnl No \ in command here because it ends up inside ''. | |
1441 | if 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 | 1445 | else |
dff14448 | 1446 | libc_cv_gcc_exceptions=no |
b236e99d UD |
1447 | fi |
1448 | rm -f conftest*]) | |
dff14448 UD |
1449 | if test $libc_cv_gcc_exceptions = yes; then |
1450 | exceptions=-fexceptions | |
b17277cf | 1451 | fi |
dff14448 | 1452 | AC_SUBST(exceptions)dnl |
b236e99d | 1453 | |
d71b808a UD |
1454 | if test "$base_machine" = alpha ; then |
1455 | AC_CACHE_CHECK(for function ..ng prefix, libc_cv_gcc_alpha_ng_prefix, [dnl | |
1456 | cat > conftest.c <<\EOF | |
1457 | foo () { } | |
1458 | EOF | |
1459 | dnl | |
9756dfe1 | 1460 | if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "\$foo..ng" > /dev/null]); |
d71b808a UD |
1461 | then |
1462 | libc_cv_gcc_alpha_ng_prefix=yes | |
1463 | else | |
1464 | libc_cv_gcc_alpha_ng_prefix=no | |
1465 | fi | |
1466 | rm -f conftest* ]) | |
1467 | if test $libc_cv_gcc_alpha_ng_prefix = yes ; then | |
1468 | AC_DEFINE(ASM_ALPHA_NG_SYMBOL_PREFIX, "$") | |
1469 | else | |
1470 | AC_DEFINE(ASM_ALPHA_NG_SYMBOL_PREFIX, "") | |
1471 | fi | |
1472 | fi | |
1473 | ||
66000494 UD |
1474 | if 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. | |
1477 | AC_CACHE_CHECK(whether clobbering cr0 causes problems,libc_cv_c_asmcr0_bug,[dnl | |
1478 | AC_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')]) | |
1481 | if test "$libc_cv_c_asmcr0_bug" != 'no'; then | |
1482 | AC_DEFINE(BROKEN_PPC_ASM_CR0) | |
1483 | fi | |
1484 | fi | |
1485 | ||
650425ce UD |
1486 | AC_CACHE_CHECK(for DWARF2 unwind info support, libc_cv_gcc_dwarf2_unwind_info, |
1487 | [cat > conftest.c <<EOF | |
1488 | #line __oline__ "configure" | |
2b904739 | 1489 | static 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 | } |
1501 | int __eh_pc; | |
1502 | __throw () {} | |
1503 | /* FIXME: this is fragile. */ | |
1504 | malloc () {} | |
1505 | strcmp () {} | |
1506 | strlen () {} | |
1507 | memcpy () {} | |
1508 | memset () {} | |
1509 | free () {} | |
1510 | abort () {} | |
dfd2257a | 1511 | __bzero () {} |
df17727a | 1512 | dl_iterate_phdr () {} |
650425ce UD |
1513 | EOF |
1514 | dnl No \ in command here because it ends up inside ''. | |
9756dfe1 | 1515 | if 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 |
1519 | else |
1520 | libc_cv_gcc_dwarf2_unwind_info=no | |
1521 | fi | |
2b904739 AJ |
1522 | if 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 | |
1532 | else | |
1533 | libc_cv_gcc_dwarf2_unwind_info=no | |
1534 | fi | |
9756dfe1 UD |
1535 | if 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 | |
1543 | fi | |
650425ce | 1544 | rm -f conftest*]) |
9756dfe1 UD |
1545 | case $libc_cv_gcc_dwarf2_unwind_info in |
1546 | yes) | |
650425ce | 1547 | AC_DEFINE(HAVE_DWARF2_UNWIND_INFO) |
9756dfe1 UD |
1548 | ;; |
1549 | static) | |
1550 | AC_DEFINE(HAVE_DWARF2_UNWIND_INFO) | |
1551 | AC_DEFINE(HAVE_DWARF2_UNWIND_INFO_STATIC) | |
1552 | ;; | |
1553 | esac | |
650425ce | 1554 | |
a8eab8b1 UD |
1555 | dnl Check whether compiler understands __builtin_expect. |
1556 | AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect, | |
1557 | [cat > conftest.c <<EOF | |
1558 | #line __oline__ "configure" | |
1559 | int foo (int a) | |
1560 | { | |
1561 | a = __builtin_expect (a, 10); | |
1562 | return a == 10 ? 0 : 1; | |
1563 | } | |
1564 | EOF | |
1565 | dnl No \ in command here because it ends up inside ''. | |
1566 | if 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 |
1569 | else | |
1570 | libc_cv_gcc_builtin_expect=no | |
1571 | fi | |
1572 | rm -f conftest*]) | |
1573 | if test "$libc_cv_gcc_builtin_expect" = yes; then | |
1574 | AC_DEFINE(HAVE_BUILTIN_EXPECT) | |
1575 | fi | |
1576 | ||
d555194c UD |
1577 | AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl |
1578 | cat > conftest.c <<\EOF | |
1579 | void zero (void *x) | |
1580 | { | |
a52d1562 | 1581 | __builtin_memset (x, 0, 1000); |
d555194c UD |
1582 | } |
1583 | EOF | |
1584 | dnl | |
1585 | if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null]); | |
1586 | then | |
1587 | libc_cv_gcc_builtin_memset=no | |
1588 | else | |
1589 | libc_cv_gcc_builtin_memset=yes | |
1590 | fi | |
1591 | rm -f conftest* ]) | |
1592 | if test "$libc_cv_gcc_builtin_memset" = yes ; then | |
1593 | AC_DEFINE(HAVE_BUILTIN_MEMSET) | |
1594 | fi | |
1595 | ||
3d558f4e UD |
1596 | dnl Check whether the compiler supports subtraction of local labels. |
1597 | AC_CACHE_CHECK(for local label subtraction, libc_cv_gcc_subtract_local_labels, | |
1598 | [cat > conftest.c <<EOF | |
1599 | changequote(,)dnl | |
1600 | #line __oline__ "configure" | |
1601 | int 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 | } | |
1611 | changequote([,])dnl | |
1612 | EOF | |
1613 | dnl No \ in command here because it ends up inside ''. | |
1614 | if 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 |
1617 | else | |
1618 | libc_cv_gcc_subtract_local_labels=no | |
1619 | fi | |
1620 | rm -f conftest*]) | |
1621 | if test "$libc_cv_gcc_subtract_local_labels" = yes; then | |
1622 | AC_DEFINE(HAVE_SUBTRACT_LOCAL_LABELS) | |
1623 | fi | |
1624 | ||
739d440d | 1625 | dnl Check whether the compiler supports the __thread keyword. |
5b8f26b4 RM |
1626 | if 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; |
1630 | EOF | |
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 |
1640 | else |
1641 | libc_cv_gcc___thread=no | |
1642 | fi | |
739d440d | 1643 | |
9b21e6bc RM |
1644 | if 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 | |
1648 | extern __thread int a __attribute__((tls_model ("initial-exec"))); | |
1649 | EOF | |
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 | |
1659 | fi | |
739d440d | 1660 | |
c8f3e6db UD |
1661 | dnl Check whether we have the gd library available. |
1662 | AC_MSG_CHECKING(for libgd) | |
6dab8688 UD |
1663 | if 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" | |
1674 | else | |
1675 | LIBGD=no | |
1676 | fi | |
c8f3e6db UD |
1677 | AC_MSG_RESULT($LIBGD) |
1678 | AC_SUBST(LIBGD) | |
3d558f4e | 1679 | |
8ed1e7d5 GK |
1680 | dnl check for the size of 'long double'. |
1681 | AC_CHECK_SIZEOF(long double, 0) | |
1682 | sizeof_long_double=$ac_cv_sizeof_long_double | |
1683 | AC_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 | 1689 | use_ldconfig=no |
cb343854 | 1690 | ldd_rewrite_script=no |
77259608 | 1691 | libc_cv_sysconfdir=$sysconfdir |
74bd2300 | 1692 | libc_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. | |
1696 | uname= | |
1697 | for 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 |
1716 | done |
1717 | ||
74bd2300 UD |
1718 | if test x$libc_cv_gcc_unwind_find_fde = xyes; then |
1719 | AC_DEFINE(EXPORT_UNWIND_FIND_FDE) | |
1720 | fi | |
1721 | AC_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 | 1725 | if test "$uname" = "sysdeps/generic"; then |
28f540f4 RM |
1726 | |
1727 | changequote(,)dnl | |
1728 | uname_sysname=`echo $config_os | sed 's/[0-9.]*$//'` | |
1729 | changequote([,])dnl | |
1730 | if test $uname_sysname != $config_os; then | |
1731 | config_release=`echo $config_os | sed s/$uname_sysname//` | |
1732 | fi | |
1733 | dnl | |
1734 | AC_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 | 1745 | LIBC_KERNEL_ID |
28f540f4 RM |
1746 | changequote(,)dnl |
1747 | kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'` | |
1748 | changequote([,])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 | 1763 | LIBC_KERNEL_ID |
28f540f4 RM |
1764 | changequote(,)dnl |
1765 | kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'` | |
1766 | changequote([,])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 | ||
1774 | AC_SUBST(uname_sysname) AC_SUBST(uname_release) AC_SUBST(uname_version)dnl | |
1775 | config_uname=config-name.h:config-name.in | |
1776 | else | |
1777 | # For non-generic uname, we don't need to create config-name.h at all. | |
1778 | config_uname= | |
1779 | fi | |
1780 | ||
a8c01776 RM |
1781 | dnl This is tested by existing code and it's simpler to avoid changing it. |
1782 | AC_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. | |
1786 | AC_MSG_CHECKING(for old glibc 2.0.x headers) | |
350eb336 | 1787 | if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h" |
a53bad16 UD |
1788 | then |
1789 | old_glibc_headers=yes | |
1790 | else | |
1791 | old_glibc_headers=no | |
1792 | fi | |
1793 | AC_MSG_RESULT($old_glibc_headers) | |
1794 | if 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.) | |
1797 | fi | |
b195f6bc | 1798 | AC_SUBST(old_glibc_headers) |
26b4d766 | 1799 | |
84384f5b | 1800 | AC_SUBST(libc_cv_slibdir) |
a1d84548 | 1801 | AC_SUBST(libc_cv_localedir) |
77259608 | 1802 | AC_SUBST(libc_cv_sysconfdir) |
1ef32c3d UD |
1803 | AC_SUBST(libc_cv_rootsbindir) |
1804 | ||
591e1ffb | 1805 | AC_SUBST(use_ldconfig) |
cb343854 | 1806 | AC_SUBST(ldd_rewrite_script) |
84384f5b | 1807 | |
5af3245a | 1808 | AC_SUBST(gnu_ld) AC_SUBST(gnu_as) AC_SUBST(elf) AC_SUBST(xcoff) |
28f540f4 RM |
1809 | if test $gnu_ld = yes; then |
1810 | AC_DEFINE(HAVE_GNU_LD) | |
1811 | fi | |
1812 | if test $gnu_as = yes; then | |
1813 | AC_DEFINE(HAVE_GNU_AS) | |
1814 | fi | |
1815 | if test $elf = yes; then | |
1816 | AC_DEFINE(HAVE_ELF) | |
1817 | fi | |
5af3245a UD |
1818 | if test $xcoff = yes; then |
1819 | AC_DEFINE(HAVE_XCOFF) | |
1820 | fi | |
28f540f4 | 1821 | |
650425ce | 1822 | AC_SUBST(static) |
ff3d7ed3 RM |
1823 | AC_SUBST(shared) |
1824 | if 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 |
1832 | fi | |
cc3fa755 UD |
1833 | |
1834 | AC_CACHE_CHECK([whether -fPIC is default], pic_default, | |
1835 | [pic_default=yes | |
1836 | cat > conftest.c <<EOF | |
9756dfe1 | 1837 | #if defined __PIC__ || defined __pic__ || defined PIC || defined pic |
cc3fa755 UD |
1838 | # error PIC is default. |
1839 | #endif | |
1840 | EOF | |
c2f55635 | 1841 | if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AC_FD_CC"; then |
cc3fa755 UD |
1842 | pic_default=no |
1843 | fi | |
1844 | rm -f conftest.*]) | |
1845 | AC_SUBST(pic_default) | |
1846 | ||
ff3d7ed3 RM |
1847 | AC_SUBST(profile) |
1848 | AC_SUBST(omitfp) | |
5a97622d | 1849 | AC_SUBST(bounded) |
5107cf1d | 1850 | AC_SUBST(static_nss) |
5ae3e846 | 1851 | AC_SUBST(nopic_initfini) |
ff3d7ed3 | 1852 | |
edf5b2d7 UD |
1853 | AC_SUBST(DEFINES) |
1854 | ||
7cabd57c UD |
1855 | case "$add_ons" in |
1856 | *door*) linux_doors=yes ;; | |
1857 | *) linux_doors=no ;; | |
1858 | esac | |
1859 | AC_SUBST(linux_doors) | |
1860 | ||
61c83c3f RM |
1861 | dnl See sysdeps/mach/configure.in for this variable. |
1862 | AC_SUBST(mach_interface_list) | |
1863 | ||
28f540f4 RM |
1864 | if test "`(cd $srcdir; pwd)`" = "`pwd`"; then |
1865 | config_makefile= | |
1866 | else | |
1867 | config_makefile=Makefile | |
1868 | fi | |
1869 | ||
ee74a442 UD |
1870 | VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h` |
1871 | RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h` | |
df4ef2ab | 1872 | AC_SUBST(VERSION) |
ee74a442 | 1873 | AC_SUBST(RELEASE) |
df4ef2ab | 1874 | |
c118d634 RM |
1875 | AC_CONFIG_FILES([config.make glibcbug ${config_makefile} ${config_uname}]) |
1876 | AC_CONFIG_COMMANDS([default],[[ | |
737547be UD |
1877 | case $CONFIG_FILES in *config.make*) |
1878 | echo "$config_vars" >> config.make;; | |
1879 | esac | |
c118d634 RM |
1880 | test -d bits || mkdir bits]],[[config_vars='$config_vars']]) |
1881 | AC_OUTPUT |