]>
Commit | Line | Data |
---|---|---|
f4017d20 | 1 | dnl Process this file with autoconf to produce a configure script. |
ff3d7ed3 | 2 | AC_REVISION([$CVSid$]) |
8a523922 | 3 | AC_PREREQ(2.11)dnl dnl Minimum Autoconf version required. |
5107cf1d | 4 | AC_INIT(include/features.h) |
28f540f4 RM |
5 | AC_CONFIG_HEADER(config.h) |
6 | ||
7 | # This will get text that should go into config.make. | |
8 | config_vars= | |
9 | ||
10 | # Check for a --with-gmp argument and set gmp-srcdir in config.make. | |
11 | AC_ARG_WITH(gmp, dnl | |
12 | --with-gmp=DIRECTORY find GMP source code in DIRECTORY (not needed), | |
13 | [dnl | |
14 | case "$with_gmp" in | |
15 | yes) AC_MSG_ERROR(--with-gmp requires an argument; use --with-gmp=DIRECTORY) ;; | |
16 | ''|no) ;; | |
17 | *) config_vars="$config_vars | |
18 | gmp-srcdir = $withval" ;; | |
19 | esac | |
20 | ]) | |
75914335 RM |
21 | # Check for a --with-gettext argument and set gettext-srcdir in config.make. |
22 | AC_ARG_WITH(gettext, dnl | |
23 | --with-gettext=DIR find GNU gettext source code in DIR (not needed), | |
24 | [dnl | |
25 | case "$with_gettext" in | |
26 | yes) | |
27 | AC_MSG_ERROR(--with-gettext requires an argument; use --with-gettext=DIR) ;; | |
28 | ''|no) ;; | |
29 | *) | |
30 | config_vars="$config_vars | |
31 | gettext-srcdir = $withval" ;; | |
32 | esac | |
33 | ]) | |
28f540f4 | 34 | |
ff3d7ed3 | 35 | dnl Arguments to specify presence of other packages/features. |
335aa320 | 36 | AC_ARG_WITH(fp, dnl |
a18f587d | 37 | [ --with-fp if using floating-point hardware [default=yes]], |
335aa320 | 38 | with_fp=$withval, with_fp=yes) |
650425ce | 39 | AC_ARG_WITH(binutils, dnl |
a5a0310d | 40 | --with-binutils=PATH specify location of binutils (as and ld), |
650425ce | 41 | path_binutils=$withval, path_binutils='') |
28f540f4 RM |
42 | AC_ARG_WITH(elf, dnl |
43 | --with-elf if using the ELF object format, | |
335aa320 | 44 | elf=$withval, elf=no) |
28f540f4 | 45 | |
deab9dea RM |
46 | AC_ARG_ENABLE(libio, dnl |
47 | [ --enable-libio build in GNU libio instead of GNU stdio], | |
f4482045 RM |
48 | [if test $enableval = yes; then |
49 | stdio=libio | |
50 | else | |
51 | stdio=stdio | |
52 | fi], | |
53 | stdio=default) | |
deab9dea | 54 | |
a18f587d UD |
55 | AC_ARG_ENABLE(sanity-checks, dnl |
56 | [ --disable-sanity-checks really do not use threads (should not be used | |
57 | except in special situations) [default=yes]], | |
58 | enable_sanity=$enableval, enable_sanity=yes) | |
59 | ||
650425ce UD |
60 | dnl Arguments to enable or disable building the static, shared, profiled, |
61 | dnl and -fomit-frame-pointer libraries. | |
62 | AC_ARG_ENABLE(static, dnl | |
63 | [ --enable-static build static library [default=yes]], | |
64 | static=$enableval, static=yes) | |
ff3d7ed3 RM |
65 | AC_ARG_ENABLE(shared, dnl |
66 | [ --enable-shared build shared library [default=yes if GNU ld & ELF]], | |
6b3a2224 | 67 | shared=$enableval, shared=default) |
ff3d7ed3 RM |
68 | AC_ARG_ENABLE(profile, dnl |
69 | [ --enable-profile build profiled library [default=yes]], | |
6b3a2224 | 70 | profile=$enableval, profile=yes) |
ff3d7ed3 | 71 | AC_ARG_ENABLE(omitfp, dnl |
6b3a2224 RM |
72 | [ --enable-omitfp build undebuggable optimized library [default=no]], |
73 | omitfp=$enableval, omitfp=no) | |
5a97622d UD |
74 | AC_ARG_ENABLE(bounded, dnl |
75 | [ --enable-bounded build with runtime bounds checking [default=no]], | |
76 | bounded=$enableval, bounded=no) | |
650425ce UD |
77 | AC_ARG_ENABLE(versioning, dnl |
78 | [ --disable-versioning do not include versioning information in the | |
79 | library objects [default=yes if supported]], | |
80 | enable_versioning=$enableval, enable_versioning=yes) | |
6b3a2224 RM |
81 | |
82 | dnl Generic infrastructure for drop-in additions to libc. | |
83 | AC_ARG_ENABLE(add-ons, dnl | |
f4017d20 | 84 | [ --enable-add-ons=DIR1,DIR2... configure and build named extra directories], |
61952351 UD |
85 | [case "$enableval" in |
86 | yes) add_ons=`echo $srcdir/*/configure | \ | |
87 | sed -e "s!$srcdir/!!g" -e 's!/configure!!g'`;; | |
88 | *) add_ons=`echo "$enableval" | sed 's/,/ /g'`;; | |
89 | esac], | |
90 | [add_ons=]) | |
91 | ||
6b3a2224 | 92 | AC_CONFIG_SUBDIRS($add_ons) |
57ba7bb4 | 93 | add_ons_pfx= |
da74e902 | 94 | if test x"$add_ons" != x; then |
57ba7bb4 | 95 | for f in $add_ons; do |
af6f3906 UD |
96 | # Test whether such a subdir really exists. |
97 | if test -d $srcdir/$f; then | |
98 | add_ons_pfx="$add_ons_pfx $f/" | |
99 | else | |
100 | AC_MSG_ERROR(add-on directory \"$f\" does not exist) | |
101 | fi | |
57ba7bb4 UD |
102 | done |
103 | fi | |
ff3d7ed3 | 104 | |
5107cf1d UD |
105 | dnl On some platforms we cannot use dynamic loading. We must provide |
106 | dnl static NSS modules. | |
107 | AC_ARG_ENABLE(static-nss, dnl | |
108 | [ --enable-static-nss build static NSS modules [default=no]], | |
109 | static_nss=$enableval, static_nss=no) | |
110 | if test x"$static_nss" = xyes; then | |
111 | AC_DEFINE(DO_STATIC_NSS) | |
112 | fi | |
113 | ||
28f540f4 | 114 | AC_CANONICAL_HOST |
8a523922 UD |
115 | |
116 | # The way shlib-versions is used to generate soversions.mk uses a | |
117 | # fairly simplistic model for name recognition that can't distinguish | |
118 | # i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os | |
119 | # of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can | |
120 | # tell. This doesn't get used much beyond that, so it's fairly safe. | |
121 | case "$host_os" in | |
122 | linux*) | |
123 | ;; | |
124 | gnu*) | |
125 | host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'` | |
126 | ;; | |
127 | esac | |
128 | ||
61eb22d3 UD |
129 | ### |
130 | ### I put this here to prevent those annoying emails from people who cannot | |
131 | ### read and try to compile glibc on unsupported platforms. --drepper | |
132 | ### | |
650425ce UD |
133 | ### By using the undocumented --enable-hacker-mode option for configure |
134 | ### one can skip this test to make the configuration not fail for unsupported | |
135 | ### platforms. | |
136 | ### | |
137 | if test -z "$enable_hacker_mode"; then | |
138 | case "$host_os" in | |
139 | linux* | gnu*) | |
140 | ;; | |
141 | *) | |
142 | echo "*** The GNU C library is currently not available for this platform." | |
143 | echo "*** So far nobody cared to port it and if there is no volunteer it" | |
144 | echo "*** might never happen. So, if you have interest to see glibc on" | |
145 | echo "*** this platform visit" | |
146 | echo "*** http://www.gnu.ai.mit.edu/software/libc/porting.html" | |
147 | echo "*** and join the group of porters" | |
148 | exit 1 | |
149 | ;; | |
150 | esac | |
151 | fi | |
61eb22d3 | 152 | |
28f540f4 RM |
153 | # We keep the original values in `$config_*' and never modify them, so we |
154 | # can write them unchanged into config.make. Everything else uses | |
155 | # $machine, $vendor, and $os, and changes them whenever convenient. | |
156 | config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os | |
157 | ||
a2fe9c76 RM |
158 | # Some configurations imply other options. |
159 | case "$host_os" in | |
160 | gnu* | linux* | bsd4.4* | netbsd* | freebsd*) | |
161 | # These systems always use GNU tools. | |
c8cf0b14 | 162 | gnu_ld=yes gnu_as=yes ;; |
a2fe9c76 RM |
163 | esac |
164 | case "$host_os" in | |
7799b7b3 UD |
165 | # i586-linuxaout is mangled into i586-pc-linux-gnuaout |
166 | linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*) | |
3776d592 | 167 | ;; |
a2fe9c76 | 168 | gnu* | linux* | sysv4* | solaris2*) |
3776d592 RM |
169 | # These systems (almost) always use the ELF format. |
170 | elf=yes | |
84724245 | 171 | ;; |
a2fe9c76 RM |
172 | esac |
173 | ||
28f540f4 RM |
174 | machine=$config_machine |
175 | vendor=$config_vendor | |
176 | os=$config_os | |
177 | ||
178 | dnl We need to use [ and ] for other purposes for a while now. | |
179 | changequote(,)dnl | |
180 | # Expand the configuration machine name into a subdirectory by architecture | |
181 | # type and particular chip. | |
182 | case "$machine" in | |
f0523145 RM |
183 | a29k | am29000) base_machine=a29k machine=a29k ;; |
184 | alpha*) base_machine=alpha machine=alpha/$machine ;; | |
7799b7b3 | 185 | arm*) base_machine=arm machine=arm/$machine ;; |
60c96635 UD |
186 | c3[012]) base_machine=cx0 machine=cx0/c30 ;; |
187 | c4[04]) base_machine=cx0 machine=cx0/c40 ;; | |
f0523145 | 188 | hppa*) base_machine=hppa machine=hppa/$machine ;; |
a8922de8 | 189 | i[3456]86) base_machine=i386 machine=i386/$machine ;; |
f0523145 RM |
190 | m680?0) base_machine=m68k machine=m68k/$machine ;; |
191 | m68k) base_machine=m68k machine=m68k/m68020 ;; | |
192 | m88???) base_machine=m88k machine=m88k/$machine ;; | |
193 | m88k) base_machine=m88k machine=m88k/m88100 ;; | |
f0523145 | 194 | mips64*) base_machine=mips64 machine=mips/mips64/$machine ;; |
f21acc89 | 195 | mips*) base_machine=mips machine=mips/$machine ;; |
ca34d7a7 UD |
196 | sparc | sparcv[67]) |
197 | base_machine=sparc machine=sparc/sparc32 ;; | |
198 | sparcv8 | supersparc | hypersparc) | |
199 | base_machine=sparc machine=sparc/sparc32/sparcv8 ;; | |
200 | sparc64 | ultrasparc) | |
201 | base_machine=sparc machine=sparc/sparc64 ;; | |
28f540f4 | 202 | esac |
f0523145 RM |
203 | changequote([,])dnl |
204 | AC_SUBST(base_machine) | |
28f540f4 | 205 | |
dfd2257a UD |
206 | if test "$base_machine" = "i386"; then |
207 | AC_DEFINE(USE_REGPARMS) | |
208 | fi | |
209 | ||
f0523145 | 210 | # Compute the list of sysdep directories for this configuration. |
f332db02 | 211 | # This can take a while to compute. |
f0523145 | 212 | sysdep_dir=$srcdir/sysdeps |
f332db02 | 213 | AC_MSG_CHECKING(sysdep dirs) |
f0523145 RM |
214 | dnl We need to use [ and ] for other purposes for a while now. |
215 | changequote(,)dnl | |
28f540f4 RM |
216 | # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1. |
217 | os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`" | |
218 | ||
219 | case "$os" in | |
220 | gnu*) | |
221 | base_os=mach/hurd ;; | |
883bc19b | 222 | netbsd* | 386bsd* | freebsd* | bsdi*) |
28f540f4 | 223 | base_os=unix/bsd/bsd4.4 ;; |
222c4e71 | 224 | osf* | sunos* | ultrix* | newsos* | dynix* | *bsd*) |
28f540f4 | 225 | base_os=unix/bsd ;; |
d586354e | 226 | sysv* | isc* | esix* | sco* | minix* | irix4* | linux*) |
28f540f4 | 227 | base_os=unix/sysv ;; |
d586354e | 228 | solaris[2-9]*) |
28f540f4 RM |
229 | base_os=unix/sysv/sysv4 ;; |
230 | none) | |
231 | base_os=standalone ;; | |
232 | *) | |
233 | base_os='' ;; | |
234 | esac | |
235 | ||
236 | # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos. | |
237 | tail=$os | |
238 | ostry=$os | |
239 | while o=`echo $tail | sed 's/\.[^.]*$//'`; test $o != $tail; do | |
240 | ostry="$ostry /$o" | |
241 | tail=$o | |
75914335 | 242 | done |
28f540f4 RM |
243 | o=`echo $tail | sed 's/[0-9]*$//'` |
244 | if test $o != $tail; then | |
245 | ostry="$ostry /$o" | |
246 | fi | |
ec4b0518 UD |
247 | # For linux-gnu, try linux-gnu, then linux. |
248 | o=`echo $tail | sed 's/-.*$//'` | |
249 | if test $o != $tail; then | |
250 | ostry="$ostry /$o" | |
251 | fi | |
28f540f4 RM |
252 | |
253 | # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix. | |
254 | base= | |
255 | tail=$base_os | |
256 | while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$b"; do | |
257 | set $b | |
258 | base="$base /$1" | |
259 | tail="$2" | |
260 | done | |
261 | ||
262 | # For sparc/sparc9, try sparc/sparc9 and then sparc. | |
263 | mach= | |
264 | tail=$machine | |
265 | while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do | |
266 | set $m | |
10ceac89 RM |
267 | # Prepend the machine's FPU directory unless --without-fp. |
268 | if test "$with_fp" = yes; then | |
269 | mach="$mach /$1/fpu" | |
82d00cab | 270 | fi |
28f540f4 RM |
271 | mach="$mach /$1" |
272 | tail="$2" | |
273 | done | |
274 | ||
275 | dnl We are done with glob and regexp uses of [ and ]; return to autoconf. | |
276 | changequote([,])dnl | |
277 | ||
278 | # Find what sysdep directories exist. | |
279 | sysnames= | |
57ba7bb4 UD |
280 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" |
281 | for d in $add_ons_pfx ''; do | |
282 | for b in $base ''; do | |
283 | for m0 in $mach ''; do | |
284 | for v in /$vendor ''; do | |
285 | for o in /$ostry ''; do | |
286 | for m in $mach ''; do | |
287 | if test "$m0$b$v$o$m"; then | |
288 | try="${d}sysdeps$m0$b$v$o$m" | |
289 | test -n "$enable_debug_configure" && | |
290 | echo "$0 [DEBUG]: try $try" >&2 | |
291 | case $try in | |
292 | /*) dest=$try ;; | |
293 | *) dest=$srcdir/$try ;; | |
294 | esac | |
295 | if test -d $dest; then | |
296 | sysnames="$sysnames $try" | |
297 | { test -n "$o" || test -n "$b"; } && os_used=t | |
298 | { test -n "$m" || test -n "$m0"; } && machine_used=t | |
299 | fi | |
300 | fi | |
301 | done | |
28f540f4 RM |
302 | done |
303 | done | |
304 | done | |
305 | done | |
306 | done | |
57ba7bb4 | 307 | IFS="$ac_save_ifs" |
28f540f4 RM |
308 | |
309 | if test -z "$os_used" && test "$os" != none; then | |
310 | AC_MSG_ERROR(Operating system $os is not supported.) | |
311 | fi | |
312 | if test -z "$machine_used" && test "$machine" != none; then | |
313 | AC_MSG_ERROR(The $machine is not supported.) | |
314 | fi | |
315 | ||
316 | # We have now validated the configuration. | |
317 | ||
335aa320 | 318 | |
10ceac89 RM |
319 | # If using ELF, look for an `elf' subdirectory of each machine directory. |
320 | # We prepend these rather than inserting them whereever the machine appears | |
321 | # because things specified by the machine's ELF ABI should override | |
322 | # OS-specific things, and should always be the same for any OS on the | |
323 | # machine (otherwise what's the point of an ABI?). | |
324 | if test "$elf" = yes; then | |
325 | elf_dirs= | |
57ba7bb4 UD |
326 | for d in $add_ons_pfx ''; do |
327 | case $d in | |
328 | /*) xsrcdir= ;; | |
329 | *) xsrcdir=$srcdir/ ;; | |
330 | esac | |
331 | for m in $mach; do | |
332 | if test -d $xsrcdir${d}sysdeps$m/elf; then | |
c2bb8cab | 333 | elf_dirs="$elf_dirs ${d}sysdeps$m/elf" |
57ba7bb4 UD |
334 | fi |
335 | done | |
28f540f4 | 336 | done |
57ba7bb4 | 337 | sysnames="`echo $elf_dirs | sed -e 's,//,/,g'` $sysnames" |
28f540f4 RM |
338 | fi |
339 | ||
335aa320 | 340 | |
28f540f4 RM |
341 | # Expand the list of system names into a full list of directories |
342 | # from each element's parent name and Implies file (if present). | |
343 | set $sysnames | |
e50ec9f9 | 344 | names= |
28f540f4 RM |
345 | while test $# -gt 0; do |
346 | name=$1 | |
347 | shift | |
348 | ||
e50ec9f9 | 349 | case " $names " in *" $name "*) |
f332db02 RM |
350 | # Already in the list. |
351 | continue | |
e50ec9f9 | 352 | esac |
f332db02 RM |
353 | |
354 | # Report each name as we discover it, so there is no long pause in output. | |
355 | echo $ac_n "$name $ac_c" >&AC_FD_MSG | |
356 | ||
57ba7bb4 UD |
357 | name_base=`echo $name | sed -e 's@\(.*sysdeps\)/.*@\1@'` |
358 | ||
359 | case $name in | |
360 | /*) xsrcdir= ;; | |
361 | *) xsrcdir=$srcdir/ ;; | |
362 | esac | |
363 | test -n "$enable_debug_configure" && | |
364 | echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2 | |
365 | ||
366 | if test -f $xsrcdir$name/Implies; then | |
28f540f4 | 367 | # Collect more names from the `Implies' file (removing comments). |
57ba7bb4 UD |
368 | implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`" |
369 | implied= | |
370 | for x in $implied_candidate; do | |
371 | if test -d $xsrcdir$name_base/$x; then | |
372 | implied="$implied $name_base/$x"; | |
373 | else | |
374 | AC_MSG_WARN($name/Implies specifies nonexistent $x) | |
375 | fi | |
28f540f4 RM |
376 | done |
377 | else | |
378 | implied= | |
379 | fi | |
380 | ||
381 | # Add NAME to the list of names. | |
382 | names="$names $name" | |
383 | ||
384 | # Find the parent of NAME, using the empty string if it has none. | |
385 | changequote(,)dnl | |
57ba7bb4 | 386 | parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`" |
28f540f4 RM |
387 | changequote([,])dnl |
388 | ||
389 | # Add the names implied by NAME, and NAME's parent (if it has one), to | |
390 | # the list of names to be processed (the argument list). We prepend the | |
391 | # implied names to the list and append the parent. We want implied | |
392 | # directories to come before further directories inferred from the | |
393 | # configuration components; this ensures that for sysv4, unix/common | |
394 | # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*) | |
395 | # after sysv4). | |
396 | sysnames="`echo $implied $* $parent`" | |
397 | test -n "$sysnames" && set $sysnames | |
398 | done | |
399 | ||
400 | # Add the default directories. | |
f2ea0f5b | 401 | sysnames="$names sysdeps/generic" |
f332db02 RM |
402 | AC_SUBST(sysnames) |
403 | # The other names were emitted during the scan. | |
f2ea0f5b | 404 | AC_MSG_RESULT(sysdeps/generic) |
28f540f4 | 405 | |
f332db02 RM |
406 | |
407 | ### Locate tools. | |
28f540f4 | 408 | |
28f540f4 | 409 | AC_PROG_INSTALL |
26761c28 | 410 | if test "$INSTALL" = "${srcdir}/install-sh -c"; then |
28f540f4 | 411 | # The makefiles need to use a different form to find it in $srcdir. |
f41c8091 | 412 | INSTALL='\$(..)./install-sh -c' |
28f540f4 | 413 | fi |
0e3426bb | 414 | AC_PROG_LN_S |
c17097f1 | 415 | AC_CHECK_PROGS(MSGFMT, msgfmt gmsgfmt, :) |
04be94a8 UD |
416 | AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo) |
417 | if test "$MAKEINFO"; then | |
418 | changequote(,)dnl Need [] for regexps. | |
419 | if $MAKEINFO --version | grep 'texinfo 3\.[1-9][1-9]' >/dev/null 2>&1 | |
420 | changequote([,])dnl | |
421 | then : # Makeinfo 3.11 or greater, works. | |
422 | else | |
423 | AC_MSG_WARN([ | |
424 | *** makeinfo is too old (need version 3.11 or better). | |
425 | *** You should install the needed version and re-configure since otherwise | |
426 | *** you won't get the info pages installed.]) | |
427 | MAKEINFO= | |
428 | fi | |
429 | fi | |
28f540f4 | 430 | |
ebbad4cc | 431 | AC_PROG_CC_LOCAL |
22d57dd3 | 432 | AC_CANONICAL_BUILD |
072ebcef | 433 | if test $host != $build; then |
22d57dd3 | 434 | AC_CHECK_PROGS(BUILD_CC, gcc cc) |
072ebcef | 435 | fi |
779ae82e | 436 | AC_SUBST(cross_compiling) |
7c713e28 | 437 | AC_PROG_CPP |
650425ce | 438 | LIBC_PROG_BINUTILS |
ff3d7ed3 RM |
439 | AC_CHECK_TOOL(AR, ar) |
440 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
28f540f4 | 441 | |
84384f5b | 442 | AC_PATH_PROG(BASH, bash, no) |
a18f587d | 443 | if test "$BASH" != no && |
f43ce637 | 444 | $BASH -c 'test "$BASH_VERSINFO" \ |
6973fc01 | 445 | && test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then |
84384f5b UD |
446 | libc_cv_have_bash2=yes |
447 | else | |
448 | libc_cv_have_bash2=no | |
449 | fi | |
450 | AC_SUBST(libc_cv_have_bash2) | |
451 | ||
5290baf0 UD |
452 | dnl We need a ksh compatible shell for tzselect. |
453 | if test "$BASH" = no; then | |
454 | AC_PATH_PROG(KSH, ksh, no) | |
455 | if test "$KSH" = no; then | |
456 | libc_cv_have_ksh=no | |
457 | else | |
458 | libc_cv_have_ksh=yes | |
459 | fi | |
460 | else | |
461 | KSH="$BASH" | |
462 | AC_SUBST(KSH) | |
463 | libc_cv_have_ksh=yes | |
464 | fi | |
465 | AC_SUBST(libc_cv_have_ksh) | |
466 | ||
a2b08ee5 UD |
467 | AC_PATH_PROGS(PERL, perl, no) |
468 | AC_SUBST(PERL) | |
469 | ||
b8dc6a10 | 470 | AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl |
28f540f4 RM |
471 | echo '#include <stddef.h> |
472 | FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c | |
473 | if eval "$ac_cpp conftest.c 2>/dev/null" \ | |
474 | | grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null; then | |
475 | libc_cv_signed_size_t=no | |
476 | else | |
477 | libc_cv_signed_size_t=yes | |
478 | fi | |
479 | rm -f conftest*]) | |
28f540f4 RM |
480 | if test $libc_cv_signed_size_t = yes; then |
481 | dnl Do this by hand instead of AC_DEFINE so can add #undef to avoid warnings. | |
482 | cat >> confdefs.h <<\EOF | |
483 | #undef __SIZE_TYPE__ | |
484 | #define __SIZE_TYPE__ unsigned | |
485 | EOF | |
486 | fi | |
487 | ||
b8dc6a10 | 488 | AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl |
28f540f4 RM |
489 | AC_TRY_COMPILE(dnl |
490 | [#define __need_size_t | |
491 | #define __need_wchar_t | |
492 | #include <stddef.h> | |
493 | #define __need_NULL | |
494 | #include <stddef.h>], [size_t size; wchar_t wchar; | |
495 | #ifdef offsetof | |
496 | #error stddef.h ignored __need_* | |
497 | #endif | |
498 | if (&size == NULL || &wchar == NULL) abort ();], | |
499 | libc_cv_friendly_stddef=yes, | |
500 | libc_cv_friendly_stddef=no)]) | |
28f540f4 RM |
501 | if test $libc_cv_friendly_stddef = yes; then |
502 | config_vars="$config_vars | |
503 | override stddef.h = # The installed <stddef.h> seems to be libc-friendly." | |
504 | fi | |
505 | ||
b8dc6a10 RM |
506 | AC_CACHE_CHECK(whether we need to use -P to assemble .S files, |
507 | libc_cv_need_minus_P, [dnl | |
28f540f4 RM |
508 | cat > conftest.S <<EOF |
509 | #include "confdefs.h" | |
510 | /* Nothing whatsoever. */ | |
511 | EOF | |
512 | if ${CC-cc} $CFLAGS -c conftest.S 2>/dev/null; then | |
513 | libc_cv_need_minus_P=no | |
514 | else | |
515 | libc_cv_need_minus_P=yes | |
516 | fi | |
517 | rm -f conftest*]) | |
28f540f4 RM |
518 | if test $libc_cv_need_minus_P = yes; then |
519 | config_vars="$config_vars | |
520 | asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives." | |
521 | fi | |
522 | ||
1618c590 UD |
523 | # gcc 2.7.x has a bug where if -pipe is set, the assembler will always |
524 | # be told to read stdin. This causes the compiler to hang when fed an | |
525 | # .s file. | |
526 | if test $ac_cv_prog_gcc = yes; then | |
527 | case `${CC-cc} -v 2>&1` in | |
528 | *2.7*) | |
529 | # We must check this even if -pipe is not given here, because the user | |
530 | # might do `make CFLAGS=-pipe'. | |
531 | AC_CACHE_CHECK(for gcc 2.7.x -pipe bug, libc_cv_gcc_pipe_bug, [dnl | |
86187531 UD |
532 | cp /dev/null conftest.s |
533 | cat >conftest1.s <<EOF | |
534 | .nosuchdirective | |
1618c590 | 535 | EOF |
86187531 | 536 | if ${CC-cc} -pipe -c conftest.s <conftest1.s 2>/dev/null; then |
1618c590 UD |
537 | libc_cv_gcc_pipe_bug=no |
538 | else | |
539 | libc_cv_gcc_pipe_bug=yes | |
540 | fi | |
541 | rm -f conftest*]) | |
542 | if test $libc_cv_gcc_pipe_bug = yes; then | |
543 | makeCC="${CC-cc} -B\$(common-objpfx)" | |
544 | makeCFLAGS=$CFLAGS | |
545 | CFLAGS=`echo $CFLAGS |sed 's/-pipe//'` | |
546 | fi;; | |
547 | *) libc_cv_gcc_pipe_bug=no;; | |
548 | esac | |
549 | else | |
550 | libc_cv_gcc_pipe_bug=no | |
551 | fi | |
552 | ||
b8dc6a10 RM |
553 | AC_CACHE_CHECK(for assembler global-symbol directive, |
554 | libc_cv_asm_global_directive, [dnl | |
9a70fcab UD |
555 | libc_cv_asm_global_directive=UNKNOWN |
556 | for ac_globl in .globl .global; do | |
557 | cat > conftest.s <<EOF | |
558 | .text | |
559 | ${ac_globl} foo | |
ae1025be | 560 | foo: |
9a70fcab UD |
561 | EOF |
562 | if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then | |
563 | libc_cv_asm_global_directive=${ac_globl} | |
564 | fi | |
565 | rm -f conftest* | |
566 | test $libc_cv_asm_global_directive != UNKNOWN && break | |
567 | done]) | |
9a70fcab UD |
568 | if test $libc_cv_asm_global_directive = UNKNOWN; then |
569 | AC_MSG_ERROR(cannot determine asm global directive) | |
570 | else | |
571 | AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${libc_cv_asm_global_directive}) | |
572 | fi | |
573 | ||
b8dc6a10 | 574 | AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl |
9a70fcab | 575 | cat > conftest.s <<EOF |
e215c478 | 576 | .text |
ae1025be | 577 | foo: |
df2a0c93 | 578 | .set glibc_conftest_frobozz,foo |
9a70fcab | 579 | $libc_cv_asm_global_directive glibc_conftest_frobozz |
e215c478 | 580 | EOF |
df2a0c93 RM |
581 | # The alpha-dec-osf1 assembler gives only a warning for `.set' |
582 | # (but it doesn't work), so we must do a linking check to be sure. | |
583 | cat > conftest1.c <<\EOF | |
584 | extern int glibc_conftest_frobozz; | |
585 | main () { printf ("%d\n", glibc_conftest_frobozz); } | |
586 | EOF | |
587 | if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ | |
cb2f05ed | 588 | -o conftest conftest.s conftest1.c 1>&AC_FD_CC 2>&AC_FD_CC; then |
e215c478 RM |
589 | libc_cv_asm_set_directive=yes |
590 | else | |
591 | libc_cv_asm_set_directive=no | |
592 | fi | |
65b3cbcb | 593 | rm -f conftest*]) |
e215c478 RM |
594 | if test $libc_cv_asm_set_directive = yes; then |
595 | AC_DEFINE(HAVE_ASM_SET_DIRECTIVE) | |
596 | fi | |
597 | ||
377a515b UD |
598 | AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive, |
599 | [cat > conftest.s <<EOF | |
600 | .text | |
4cca6b86 | 601 | _sym: |
377a515b UD |
602 | .symver _sym,sym@VERS |
603 | EOF | |
604 | if ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.s 1>&AC_FD_CC 2>&AC_FD_CC; then | |
605 | libc_cv_asm_symver_directive=yes | |
606 | else | |
607 | libc_cv_asm_symver_directive=no | |
608 | fi | |
609 | rm -f conftest*]) | |
610 | AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl | |
611 | if test $libc_cv_asm_symver_directive = yes; then | |
612 | cat > conftest.s <<EOF | |
613 | .text | |
4cca6b86 | 614 | _sym: |
377a515b UD |
615 | .symver _sym,sym@VERS |
616 | EOF | |
617 | cat > conftest.map <<EOF | |
f43ce637 | 618 | VERS_1 { |
377a515b UD |
619 | global: sym; |
620 | }; | |
f43ce637 UD |
621 | |
622 | VERS_2 { | |
623 | global: sym; | |
624 | } VERS_1; | |
377a515b UD |
625 | EOF |
626 | if ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.s 1>&AC_FD_CC 2>&AC_FD_CC; then | |
5ae3e846 UD |
627 | if AC_TRY_COMMAND([${CC-cc} $CFLAGS -shared -o conftest.so conftest.o |
628 | -nostartfiles -nostdlib | |
ae1025be UD |
629 | -Wl,--version-script,conftest.map |
630 | 1>&AC_FD_CC]); | |
377a515b UD |
631 | then |
632 | libc_cv_ld_version_script_option=yes | |
633 | else | |
634 | libc_cv_ld_version_script_option=no | |
635 | fi | |
636 | else | |
637 | libc_cv_ld_version_script_option=no | |
638 | fi | |
639 | else | |
640 | libc_cv_ld_version_script_option=no | |
641 | fi | |
642 | rm -f conftest*]) | |
643 | if test $libc_cv_asm_symver_directive = yes && | |
650425ce UD |
644 | test $libc_cv_ld_version_script_option = yes && |
645 | test $enable_versioning = yes; then | |
377a515b UD |
646 | VERSIONING=yes |
647 | AC_DEFINE(DO_VERSIONING) | |
648 | else | |
649 | VERSIONING=no | |
650 | fi | |
651 | AC_SUBST(VERSIONING) | |
652 | ||
f43ce637 UD |
653 | if test $VERSIONING = no; then |
654 | echo "\ | |
f4017d20 | 655 | *** WARNING: You should not compile GNU libc without versioning. Not using |
f43ce637 UD |
656 | *** versioning will introduce incompatibilities so that old binaries |
657 | *** will not run anymore. | |
658 | *** For versioning you need recent binutils (binutils-2.8.1.0.17 or newer)." | |
659 | fi | |
fd26970f UD |
660 | if test $elf = yes; then |
661 | AC_CACHE_CHECK(for .previous assembler directive, | |
662 | libc_cv_asm_previous_directive, [dnl | |
663 | cat > conftest.s <<EOF | |
664 | .section foo_section | |
665 | .previous | |
666 | EOF | |
667 | if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then | |
668 | libc_cv_asm_previous_directive=yes | |
669 | else | |
670 | libc_cv_asm_previous_directive=no | |
671 | fi | |
672 | rm -f conftest*]) | |
673 | if test $libc_cv_asm_previous_directive = yes; then | |
674 | AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE) | |
675 | else | |
676 | AC_CACHE_CHECK(for .popsection assembler directive, | |
677 | libc_cv_asm_popsection_directive, [dnl | |
678 | cat > conftest.s <<EOF | |
679 | .pushsection foo_section | |
680 | .popsection | |
681 | EOF | |
682 | if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then | |
683 | libc_cv_asm_popsection_directive=yes | |
684 | else | |
685 | libc_cv_asm_popsection_directive=no | |
686 | fi | |
687 | rm -f conftest*]) | |
688 | if test $libc_cv_asm_popsection_directive = yes; then | |
689 | AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE) | |
690 | fi | |
691 | fi | |
692 | fi | |
693 | ||
b8dc6a10 RM |
694 | if test $elf != yes; then |
695 | AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini, | |
696 | [AC_TRY_COMPILE(, [asm (".section .init"); | |
84724245 RM |
697 | asm (".section .fini"); |
698 | asm (".text");], | |
b8dc6a10 RM |
699 | libc_cv_have_initfini=yes, |
700 | libc_cv_have_initfini=no)]) | |
701 | AC_SUBST(libc_cv_have_initfini)dnl | |
702 | if test $libc_cv_have_initfini = yes; then | |
703 | AC_DEFINE(HAVE_INITFINI) | |
704 | fi | |
705 | fi | |
e215c478 | 706 | |
9a0a462c UD |
707 | dnl AC_CHECK_ASM_UNDERSCORE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) |
708 | AC_DEFUN(AC_CHECK_ASM_UNDERSCORE, | |
709 | [cat > conftest.$ac_ext <<EOF | |
710 | dnl This sometimes fails to find confdefs.h, for some reason. | |
711 | dnl [#]line __oline__ "[$]0" | |
712 | [#]line __oline__ "configure" | |
713 | #include "confdefs.h" | |
714 | void underscore_test(void) { | |
715 | return; } | |
716 | EOF | |
717 | if AC_TRY_EVAL(ac_compile); then | |
718 | if grep _underscore_test conftest* >/dev/null; then | |
719 | ifelse([$1], , :, [rm -f conftest* | |
720 | $1]) | |
721 | else | |
722 | ifelse([$2], , , [rm -f conftest* | |
723 | $2]) | |
724 | fi | |
725 | else | |
726 | echo "configure: failed program was:" >&AC_FD_CC | |
727 | cat conftest.$ac_ext >&AC_FD_CC | |
728 | ifelse([$2], , , [rm -f conftest* | |
729 | $2]) | |
730 | fi | |
731 | rm -f conftest*]) | |
732 | ||
c224a18a RM |
733 | if test $elf = yes; then |
734 | libc_cv_asm_underscores=no | |
735 | else | |
9a0a462c UD |
736 | if test $ac_cv_prog_cc_works = yes; then |
737 | AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores, | |
738 | [AC_TRY_LINK([asm ("_glibc_foobar:");], [glibc_foobar ();], | |
739 | libc_cv_asm_underscores=yes, | |
740 | libc_cv_asm_underscores=no)]) | |
741 | else | |
742 | AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores, | |
743 | [AC_CHECK_ASM_UNDERSCORE(libc_cv_asm_underscores=yes, | |
744 | libc_cv_asm_underscores=no)]) | |
745 | fi | |
c224a18a RM |
746 | fi |
747 | if test $libc_cv_asm_underscores = no; then | |
748 | AC_DEFINE(NO_UNDERSCORES) | |
749 | fi | |
750 | ||
751 | if test $elf = yes; then | |
752 | libc_cv_weak_symbols=yes | |
753 | libc_cv_asm_weak_directive=yes | |
754 | libc_cv_asm_weakext_directive=no | |
755 | else | |
756 | AC_CACHE_CHECK(for assembler .weak directive, libc_cv_asm_weak_directive, | |
757 | [dnl | |
758 | cat > conftest.s <<EOF | |
759 | .text | |
760 | ${libc_cv_asm_global_directive} foo | |
ae1025be | 761 | foo: |
c224a18a RM |
762 | .weak foo |
763 | .weak bar; bar = foo | |
764 | EOF | |
765 | if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then | |
766 | libc_cv_asm_weak_directive=yes | |
767 | else | |
768 | libc_cv_asm_weak_directive=no | |
769 | fi | |
770 | rm -f conftest*]) | |
771 | ||
c8cf0b14 | 772 | if test $libc_cv_asm_weak_directive = no; then |
c224a18a RM |
773 | AC_CACHE_CHECK(for assembler .weakext directive, |
774 | libc_cv_asm_weakext_directive, | |
775 | [dnl | |
776 | cat > conftest.s <<EOF | |
777 | .text | |
778 | ${libc_cv_asm_global_directive} foo | |
ae1025be | 779 | foo: |
c224a18a | 780 | .weakext foo |
a1470b6f | 781 | .weakext foo, bar |
c224a18a RM |
782 | EOF |
783 | if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then | |
784 | libc_cv_asm_weakext_directive=yes | |
785 | else | |
786 | libc_cv_asm_weakext_directive=no | |
787 | fi | |
788 | rm -f conftest*]) | |
789 | ||
790 | fi # no .weak | |
791 | fi # not ELF | |
792 | ||
ffcf9634 | 793 | if test $libc_cv_asm_weak_directive = yes; then |
c224a18a | 794 | AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE) |
ffcf9634 | 795 | elif test $libc_cv_asm_weakext_directive = yes; then |
c224a18a RM |
796 | AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE) |
797 | fi | |
798 | ||
a641835a RM |
799 | AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl |
800 | cat > conftest.c <<\EOF | |
5f0e6fc7 | 801 | _start () {} |
dcf0671d UD |
802 | int __eh_pc; |
803 | __throw () {} | |
a641835a | 804 | EOF |
dcea62dd RM |
805 | dnl No \ in command here because it ends up inside ''. |
806 | if AC_TRY_COMMAND([${CC-cc} $CFLAGS | |
807 | -nostdlib -nostartfiles -Wl,--no-whole-archive | |
ae1025be | 808 | -o conftest conftest.c 1>&AC_FD_CC]); then |
a641835a RM |
809 | libc_cv_ld_no_whole_archive=yes |
810 | else | |
811 | libc_cv_ld_no_whole_archive=no | |
812 | fi | |
813 | rm -f conftest*]) | |
814 | AC_SUBST(libc_cv_ld_no_whole_archive)dnl | |
815 | ||
b236e99d UD |
816 | AC_CACHE_CHECK(for gcc -fno-exceptions, libc_cv_gcc_no_exceptions, [dnl |
817 | cat > conftest.c <<\EOF | |
818 | _start () {} | |
819 | int __eh_pc; | |
820 | __throw () {} | |
821 | EOF | |
822 | dnl No \ in command here because it ends up inside ''. | |
823 | if AC_TRY_COMMAND([${CC-cc} $CFLAGS | |
824 | -nostdlib -nostartfiles -fno-exceptions | |
ae1025be | 825 | -o conftest conftest.c 1>&AC_FD_CC]); then |
b236e99d UD |
826 | libc_cv_gcc_no_exceptions=yes |
827 | else | |
828 | libc_cv_gcc_no_exceptions=no | |
829 | fi | |
830 | rm -f conftest*]) | |
831 | AC_SUBST(libc_cv_gcc_no_exceptions)dnl | |
832 | ||
650425ce UD |
833 | AC_CACHE_CHECK(for DWARF2 unwind info support, libc_cv_gcc_dwarf2_unwind_info, |
834 | [cat > conftest.c <<EOF | |
835 | #line __oline__ "configure" | |
836 | static char __EH_FRAME_BEGIN__[]; | |
837 | _start () | |
838 | { | |
839 | __register_frame (__EH_FRAME_BEGIN__); | |
840 | __deregister_frame (__EH_FRAME_BEGIN__); | |
841 | } | |
842 | int __eh_pc; | |
843 | __throw () {} | |
844 | /* FIXME: this is fragile. */ | |
845 | malloc () {} | |
846 | strcmp () {} | |
847 | strlen () {} | |
848 | memcpy () {} | |
849 | memset () {} | |
850 | free () {} | |
851 | abort () {} | |
dfd2257a | 852 | __bzero () {} |
650425ce UD |
853 | EOF |
854 | dnl No \ in command here because it ends up inside ''. | |
855 | if AC_TRY_COMMAND([${CC-cc} $CFLAGS | |
856 | -nostdlib -nostartfiles | |
857 | -o conftest conftest.c -lgcc >&AC_FD_CC]); then | |
858 | libc_cv_gcc_dwarf2_unwind_info=yes | |
859 | else | |
860 | libc_cv_gcc_dwarf2_unwind_info=no | |
861 | fi | |
862 | rm -f conftest*]) | |
863 | if test $libc_cv_gcc_dwarf2_unwind_info = yes; then | |
864 | AC_DEFINE(HAVE_DWARF2_UNWIND_INFO) | |
865 | fi | |
866 | ||
c224a18a RM |
867 | ### End of automated tests. |
868 | ### Now run sysdeps configure fragments. | |
869 | ||
28f540f4 RM |
870 | # sysdeps configure fragments may set these with files to be linked below. |
871 | libc_link_dests= | |
872 | libc_link_sources= | |
873 | ||
874 | # Iterate over all the sysdep directories we will use, running their | |
875 | # configure fragments, and looking for a uname implementation. | |
876 | uname= | |
877 | for dir in $sysnames; do | |
57ba7bb4 UD |
878 | case $dir in |
879 | /*) dest=$dir ;; | |
880 | *) dest=$srcdir/$dir ;; | |
881 | esac | |
882 | if test -r $dest/configure; then | |
883 | AC_MSG_RESULT(running configure fragment for $dest) | |
884 | . $dest/configure | |
28f540f4 | 885 | fi |
4ca84cff | 886 | [ |
28f540f4 | 887 | if test -z "$uname"; then |
e7f1f046 UD |
888 | if test -r $dest/uname.c || |
889 | test -r $dest/uname.S || | |
890 | { test -r $dest/syscalls.list && | |
891 | grep '^uname[ ]' $dest/syscalls.list >/dev/null; }; then | |
b86199fb | 892 | uname=$dir |
4ca84cff | 893 | fi |
28f540f4 | 894 | fi |
4ca84cff | 895 | ]dnl |
28f540f4 RM |
896 | done |
897 | ||
898 | AC_LINK_FILES(`echo $libc_link_sources`, `echo $libc_link_dests`) | |
899 | ||
900 | # If we will use the generic uname implementation, we must figure out what | |
901 | # it will say by examining the system, and write the results in config-name.h. | |
e7f1f046 | 902 | if test "$uname" = "sysdeps/generic"; then |
28f540f4 RM |
903 | |
904 | changequote(,)dnl | |
905 | uname_sysname=`echo $config_os | sed 's/[0-9.]*$//'` | |
906 | changequote([,])dnl | |
907 | if test $uname_sysname != $config_os; then | |
908 | config_release=`echo $config_os | sed s/$uname_sysname//` | |
909 | fi | |
910 | dnl | |
911 | AC_DEFUN(LIBC_KERNEL_ID, [dnl | |
912 | if test -r /vmunix; then | |
913 | kernel_id=`strings /vmunix | grep UNIX` | |
914 | elif test -r /dynix; then | |
915 | kernel_id=`strings /dynix | grep DYNIX` | |
916 | else | |
917 | kernel_id= | |
918 | fi | |
919 | ])dnl | |
920 | ||
b8dc6a10 | 921 | AC_CACHE_CHECK(OS release for uname, libc_cv_uname_release, [dnl |
28f540f4 RM |
922 | AC_REQUIRE([LIBC_KERNEL_ID])dnl |
923 | changequote(,)dnl | |
924 | kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'` | |
925 | changequote([,])dnl | |
926 | if test x`echo "$config_release" | sed "s/^$kernel_release//"` \ | |
927 | != x$config_release; then | |
928 | # The configuration release is a substring of the kernel release. | |
929 | libc_cv_uname_release=$kernel_release | |
930 | elif test x$config_release != x; then | |
931 | libc_cv_uname_release=$config_release | |
932 | elif test x$kernel_release != x; then | |
933 | libc_cv_uname_release=$kernel_release | |
934 | else | |
935 | libc_cv_uname_release=unknown | |
936 | fi]) | |
28f540f4 RM |
937 | uname_release="$libc_cv_uname_release" |
938 | ||
b8dc6a10 | 939 | AC_CACHE_CHECK(OS version for uname, libc_cv_uname_version, [dnl |
28f540f4 RM |
940 | AC_REQUIRE([LIBC_KERNEL_ID])dnl |
941 | changequote(,)dnl | |
942 | kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'` | |
943 | changequote([,])dnl | |
944 | if test -n "$kernel_version"; then | |
945 | libc_cv_uname_version="$kernel_version" | |
946 | else | |
947 | libc_cv_uname_version=unknown | |
948 | fi]) | |
28f540f4 RM |
949 | uname_version="$libc_cv_uname_version" |
950 | ||
951 | AC_SUBST(uname_sysname) AC_SUBST(uname_release) AC_SUBST(uname_version)dnl | |
952 | config_uname=config-name.h:config-name.in | |
953 | else | |
954 | # For non-generic uname, we don't need to create config-name.h at all. | |
955 | config_uname= | |
956 | fi | |
957 | ||
96aa2d94 RM |
958 | AC_MSG_CHECKING(stdio selection) |
959 | AC_SUBST(stdio) | |
960 | case $stdio in | |
961 | libio) AC_DEFINE(USE_IN_LIBIO) ;; | |
962 | default) stdio=stdio ;; | |
963 | esac | |
964 | AC_MSG_RESULT($stdio) | |
965 | ||
26b4d766 UD |
966 | AC_MSG_CHECKING(ldap selection) |
967 | AC_SUBST(LDAP) | |
968 | case $add_ons in | |
969 | *ldap*) | |
970 | ldap=yes | |
971 | LDAP=ldap ;; | |
972 | *) ldap=no | |
973 | LDAP= ;; | |
974 | esac | |
975 | AC_MSG_RESULT($ldap) | |
976 | ||
84384f5b UD |
977 | AC_SUBST(libc_cv_slibdir) |
978 | AC_SUBST(libc_cv_sysconfdir) | |
1ef32c3d UD |
979 | AC_SUBST(libc_cv_rootsbindir) |
980 | ||
981 | AC_SUBST(has_ldconfig) | |
84384f5b | 982 | |
c224a18a | 983 | AC_SUBST(gnu_ld) AC_SUBST(gnu_as) AC_SUBST(elf) |
28f540f4 RM |
984 | if test $gnu_ld = yes; then |
985 | AC_DEFINE(HAVE_GNU_LD) | |
986 | fi | |
987 | if test $gnu_as = yes; then | |
988 | AC_DEFINE(HAVE_GNU_AS) | |
989 | fi | |
990 | if test $elf = yes; then | |
991 | AC_DEFINE(HAVE_ELF) | |
992 | fi | |
28f540f4 | 993 | |
650425ce | 994 | AC_SUBST(static) |
ff3d7ed3 RM |
995 | AC_SUBST(shared) |
996 | if test $shared = default; then | |
997 | if test $gnu_ld = yes; then | |
998 | shared=$elf | |
f65fd747 UD |
999 | else |
1000 | # For now we do not assume shared libs are available. In future more | |
1001 | # tests might become available. | |
1002 | shared=no | |
ff3d7ed3 RM |
1003 | fi |
1004 | fi | |
cc3fa755 UD |
1005 | |
1006 | AC_CACHE_CHECK([whether -fPIC is default], pic_default, | |
1007 | [pic_default=yes | |
1008 | cat > conftest.c <<EOF | |
1009 | #if defined(__PIC__) || defined(__pic__) || defined(PIC) || defined(pic) | |
1010 | # error PIC is default. | |
1011 | #endif | |
1012 | EOF | |
1013 | if eval "${CC-cc} -S conftest.c 2>&AC_FD_CC 1>&AC_FD_CC"; then | |
1014 | pic_default=no | |
1015 | fi | |
1016 | rm -f conftest.*]) | |
1017 | AC_SUBST(pic_default) | |
1018 | ||
ff3d7ed3 RM |
1019 | AC_SUBST(profile) |
1020 | AC_SUBST(omitfp) | |
5a97622d | 1021 | AC_SUBST(bounded) |
5107cf1d | 1022 | AC_SUBST(static_nss) |
5ae3e846 | 1023 | AC_SUBST(nopic_initfini) |
ff3d7ed3 | 1024 | |
edf5b2d7 UD |
1025 | AC_SUBST(DEFINES) |
1026 | ||
28f540f4 RM |
1027 | if test "`(cd $srcdir; pwd)`" = "`pwd`"; then |
1028 | config_makefile= | |
1029 | else | |
1030 | config_makefile=Makefile | |
1031 | fi | |
1032 | ||
df4ef2ab UD |
1033 | VERSION=`sed -e 's/^#define VERSION "\([^"]*\)"/\1/p' -e d < $srcdir/version.h` |
1034 | AC_SUBST(VERSION) | |
1035 | ||
1618c590 UD |
1036 | if test $libc_cv_gcc_pipe_bug = yes; then |
1037 | realCC=$CC | |
1038 | CC=$makeCC | |
1039 | CFLAGS=$makeCFLAGS | |
1040 | fi | |
1041 | AC_OUTPUT_COMMANDS([ | |
1042 | if test "$realCC"; then | |
1043 | sed -e 's/%{pipe:-}/%|/g' `$realCC -print-file-name=specs` >specsT | |
1044 | mv specsT specs | |
1045 | fi], [realCC=$realCC]) | |
1046 | ||
ae1025be | 1047 | AC_OUTPUT(config.make glibcbug ${config_makefile} ${config_uname}, , |
5107cf1d | 1048 | [echo '$config_vars' >> config.make; test -d bits || mkdir bits]) |