]> git.ipfire.org Git - thirdparty/glibc.git/blame - configure.ac
Remove configuration name patterns from shlib-versions.
[thirdparty/glibc.git] / configure.ac
CommitLineData
f4017d20 1dnl Process this file with autoconf to produce a configure script.
f7934be8 2dnl Note we do not use AC_PREREQ here! See aclocal.m4 for what we use instead.
f318beb8 3AC_INIT([GNU C Library], [(see version.h)], [http://sourceware.org/bugzilla/], [glibc])
5d77b1da 4AC_CONFIG_SRCDIR([include/features.h])
6b7f6183
RM
5AC_CONFIG_HEADERS([config.h])
6AC_CONFIG_AUX_DIR([scripts])
28f540f4 7
8b748aed
JM
8ACX_PKGVERSION([GNU libc])
9ACX_BUGURL([http://www.gnu.org/software/libc/bugs.html])
10AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"],
11 [Package description])
12AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"],
13 [Bug reporting address])
14
918b5606
L
15# Glibc should not depend on any header files
16AC_DEFUN([_AC_INCLUDES_DEFAULT_REQUIREMENTS],
17 [m4_divert_text([DEFAULTS],
18 [ac_includes_default='/* none */'])])
19
bb931195
TS
20# We require GCC, and by default use its preprocessor. Override AC_PROG_CPP
21# here to work around the Autoconf issue discussed in
22# <http://sourceware.org/ml/libc-alpha/2013-01/msg00721.html>.
23AC_DEFUN([AC_PROG_CPP],
24[AC_REQUIRE([AC_PROG_CC])dnl
25AC_ARG_VAR([CPP], [C preprocessor])dnl
26_AC_ARG_VAR_CPPFLAGS()dnl
27# On Suns, sometimes $CPP names a directory.
28if test -n "$CPP" && test -d "$CPP"; then
29 CPP=
30fi
31if test -z "$CPP"; then
32 CPP="$CC -E"
33fi
34AC_SUBST(CPP)dnl
35])# AC_PROG_CPP
36
b5a5da23
TS
37# We require GCC. Override _AC_PROG_CC_C89 here to work around the Autoconf
38# issue discussed in
39# <http://sourceware.org/ml/libc-alpha/2013-01/msg00757.html>.
40AC_DEFUN([_AC_PROG_CC_C89], [[$1]])
41
7967983f
RM
42dnl This is here so we can set $subdirs directly based on configure fragments.
43AC_CONFIG_SUBDIRS()
44
c16a054d
AS
45AC_CANONICAL_HOST
46
c0bac8b0
UD
47AC_PROG_CC
48if test $host != $build; then
49 AC_CHECK_PROGS(BUILD_CC, gcc cc)
50fi
51AC_SUBST(cross_compiling)
52AC_PROG_CPP
53# We need the C++ compiler only for testing.
54AC_PROG_CXX
0cae3f4b 55AC_CHECK_TOOL(READELF, readelf, false)
c0bac8b0 56
c72637d4
RM
57if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
58 AC_MSG_ERROR([you must configure in a separate build directory])
59fi
60
28f540f4
RM
61# This will get text that should go into config.make.
62config_vars=
63
c8f3e6db 64# Check for a --with-gd argument and set libgd-LDFLAGS in config.make.
6b7f6183 65AC_ARG_WITH([gd],
77e8bddf
AS
66 AC_HELP_STRING([--with-gd=DIR],
67 [find libgd include dir and library with prefix DIR]),
c8f3e6db
UD
68 [dnl
69case "$with_gd" in
f5f7239f
UD
70yes|''|no) ;;
71*) libgd_include="-I$withval/include"
c8f3e6db
UD
72 libgd_ldflags="-L$withval/lib" ;;
73esac
74])
6b7f6183 75AC_ARG_WITH([gd-include],
77e8bddf
AS
76 AC_HELP_STRING([--with-gd-include=DIR],
77 [find libgd include files in DIR]),
78 [dnl
f5f7239f
UD
79case "$with_gd_include" in
80''|no) ;;
81*) libgd_include="-I$withval" ;;
82esac
83])
6b7f6183 84AC_ARG_WITH([gd-lib],
77e8bddf
AS
85 AC_HELP_STRING([--with-gd-lib=DIR],
86 [find libgd library files in DIR]),
87 [dnl
f5f7239f
UD
88case "$with_gd_lib" in
89''|no) ;;
90*) libgd_ldflags="-L$withval" ;;
91esac
92])
93
94if test -n "$libgd_include"; then
95 config_vars="$config_vars
cf90163d 96CFLAGS-memusagestat.c = $libgd_include"
f5f7239f
UD
97fi
98if test -n "$libgd_ldflags"; then
99 config_vars="$config_vars
100libgd-LDFLAGS = $libgd_ldflags"
101fi
28f540f4 102
ff3d7ed3 103dnl Arguments to specify presence of other packages/features.
6b7f6183 104AC_ARG_WITH([fp],
77e8bddf
AS
105 AC_HELP_STRING([--with-fp],
106 [if using floating-point hardware @<:@default=yes@:>@]),
6b7f6183
RM
107 [with_fp=$withval],
108 [with_fp=yes])
675322a5 109AC_SUBST(with_fp)
6b7f6183 110AC_ARG_WITH([binutils],
77e8bddf
AS
111 AC_HELP_STRING([--with-binutils=PATH],
112 [specify location of binutils (as and ld)]),
6b7f6183
RM
113 [path_binutils=$withval],
114 [path_binutils=''])
2fff3d93 115AC_ARG_WITH([selinux],
77e8bddf
AS
116 AC_HELP_STRING([--with-selinux],
117 [if building with SELinux support]),
2fff3d93
UD
118 [with_selinux=$withval],
119 [with_selinux=auto])
28f540f4 120
6b7f6183 121AC_ARG_WITH([headers],
77e8bddf
AS
122 AC_HELP_STRING([--with-headers=PATH],
123 [location of system headers to use
6b7f6183
RM
124 (for example /usr/src/linux/include)
125 @<:@default=compiler default@:>@]),
126 [sysheaders=$withval],
127 [sysheaders=''])
c91c505f 128AC_SUBST(sysheaders)
dbe7a0f5 129
f781ef40
RM
130AC_SUBST(use_default_link)
131AC_ARG_WITH([default-link],
132 AC_HELP_STRING([--with-default-link],
fd5e21c7 133 [do not use explicit linker scripts]),
f781ef40 134 [use_default_link=$withval],
fd5e21c7 135 [use_default_link=default])
f781ef40 136
6b7f6183 137AC_ARG_ENABLE([sanity-checks],
77e8bddf
AS
138 AC_HELP_STRING([--disable-sanity-checks],
139 [really do not use threads (should not be used except in special situations) @<:@default=yes@:>@]),
6b7f6183
RM
140 [enable_sanity=$enableval],
141 [enable_sanity=yes])
a18f587d 142
6b7f6183 143AC_ARG_ENABLE([shared],
77e8bddf 144 AC_HELP_STRING([--enable-shared],
a0da5fe1 145 [build shared library @<:@default=yes if GNU ld@:>@]),
6b7f6183 146 [shared=$enableval],
a0da5fe1 147 [shared=yes])
6b7f6183 148AC_ARG_ENABLE([profile],
77e8bddf
AS
149 AC_HELP_STRING([--enable-profile],
150 [build profiled library @<:@default=no@:>@]),
6b7f6183 151 [profile=$enableval],
11bf311e 152 [profile=no])
6b7f6183
RM
153
154AC_ARG_ENABLE([oldest-abi],
77e8bddf
AS
155 AC_HELP_STRING([--enable-oldest-abi=ABI],
156 [configure the oldest ABI supported @<:@e.g. 2.2@:>@ @<:@default=glibc default@:>@]),
6b7f6183
RM
157 [oldest_abi=$enableval],
158 [oldest_abi=no])
62ab42d6
UD
159if test "$oldest_abi" = yes || test "$oldest_abi" = no; then
160 oldest_abi=default
161else
162 AC_DEFINE_UNQUOTED(GLIBC_OLDEST_ABI, "$oldest_abi")
163fi
164AC_SUBST(oldest_abi)
165
740b3dbe
L
166AC_ARG_ENABLE([hardcoded-path-in-tests],
167 AC_HELP_STRING([--enable-hardcoded-path-in-tests],
168 [hardcode newly built glibc path in tests @<:@default=no@:>@]),
169 [hardcoded_path_in_tests=$enableval],
170 [hardcoded_path_in_tests=no])
171AC_SUBST(hardcoded_path_in_tests)
172
35f1e827
UD
173AC_ARG_ENABLE([stackguard-randomization],
174 AC_HELP_STRING([--enable-stackguard-randomization],
175 [initialize __stack_chk_guard canary with a random number at program start]),
176 [enable_stackguard_randomize=$enableval],
177 [enable_stackguard_randomize=no])
178if test "$enable_stackguard_randomize" = yes; then
179 AC_DEFINE(ENABLE_STACKGUARD_RANDOMIZE)
180fi
181
1717da59
AK
182AC_ARG_ENABLE([lock-elision],
183 AC_HELP_STRING([--enable-lock-elision[=yes/no]],
52dfbe13 184 [Enable lock elision for pthread mutexes by default]),
1717da59
AK
185 [enable_lock_elision=$enableval],
186 [enable_lock_elision=no])
5a414ff7 187AC_SUBST(enable_lock_elision)
1717da59
AK
188if test "$enable_lock_elision" = yes ; then
189 AC_DEFINE(ENABLE_LOCK_ELISION)
190fi
191
6b3a2224 192dnl Generic infrastructure for drop-in additions to libc.
6b7f6183 193AC_ARG_ENABLE([add-ons],
77e8bddf
AS
194 AC_HELP_STRING([--enable-add-ons@<:@=DIRS...@:>@],
195 [configure and build add-ons in DIR1,DIR2,...
196 search for add-ons if no parameter given]),
e0a3ed4f 197 , [enable_add_ons=yes])
61952351 198
6b7f6183 199AC_ARG_ENABLE([hidden-plt],
77e8bddf
AS
200 AC_HELP_STRING([--disable-hidden-plt],
201 [do not hide internal function calls to avoid PLT]),
6b7f6183
RM
202 [hidden=$enableval],
203 [hidden=yes])
749a9a4f
RM
204if test "x$hidden" = xno; then
205 AC_DEFINE(NO_HIDDEN)
206fi
207
4df8c11d
UD
208AC_ARG_ENABLE([bind-now],
209 AC_HELP_STRING([--enable-bind-now],
210 [disable lazy relocations in DSOs]),
211 [bindnow=$enableval],
212 [bindnow=no])
213AC_SUBST(bindnow)
214
5107cf1d
UD
215dnl On some platforms we cannot use dynamic loading. We must provide
216dnl static NSS modules.
6b7f6183 217AC_ARG_ENABLE([static-nss],
77e8bddf
AS
218 AC_HELP_STRING([--enable-static-nss],
219 [build static NSS modules @<:@default=no@:>@]),
6b7f6183
RM
220 [static_nss=$enableval],
221 [static_nss=no])
834cef7c
UD
222dnl Enable static NSS also if we build no shared objects.
223if test x"$static_nss" = xyes || test x"$shared" = xno; then
3172f58f 224 static_nss=yes
5107cf1d
UD
225 AC_DEFINE(DO_STATIC_NSS)
226fi
227
6b7f6183 228AC_ARG_ENABLE([force-install],
77e8bddf
AS
229 AC_HELP_STRING([--disable-force-install],
230 [don't force installation of files from this package, even if they are older than the installed files]),
6b7f6183
RM
231 [force_install=$enableval],
232 [force_install=yes])
73237de3
UD
233AC_SUBST(force_install)
234
8894bad3
AM
235AC_ARG_ENABLE([maintainer-mode],
236 AC_HELP_STRING([--enable-maintainer-mode],
237 [enable make rules and dependencies not useful (and sometimes confusing) to the casual installer]),
238 [maintainer=$enableval],
239 [maintainer=no])
240
958f238f
UD
241dnl On some platforms we allow dropping compatibility with all kernel
242dnl versions.
6b7f6183 243AC_ARG_ENABLE([kernel],
77e8bddf
AS
244 AC_HELP_STRING([--enable-kernel=VERSION],
245 [compile for compatibility with kernel not older than VERSION]),
6b7f6183
RM
246 [minimum_kernel=$enableval],
247 [])
86cfe82d
UD
248dnl Prevent unreasonable values.
249if test "$minimum_kernel" = yes || test "$minimum_kernel" = no; then
250 # Better nothing than this.
251 minimum_kernel=""
269e369f
UD
252else
253 if test "$minimum_kernel" = current; then
254 minimum_kernel=`uname -r 2>/dev/null` || minimum_kernel=
255 fi
86cfe82d 256fi
958f238f 257
6cc7d725
UD
258dnl For the development we sometimes want gcc to issue even more warnings.
259dnl This is not the default since many of the extra warnings are not
260dnl appropriate.
6b7f6183
RM
261AC_ARG_ENABLE([all-warnings],
262 AC_HELP_STRING([--enable-all-warnings],
77e8bddf 263 [enable all useful warnings gcc can issue]),
6b7f6183
RM
264 [all_warnings=$enableval],
265 [])
6cc7d725
UD
266AC_SUBST(all_warnings)
267
425ce2ed
UD
268AC_ARG_ENABLE([multi-arch],
269 AC_HELP_STRING([--enable-multi-arch],
270 [enable single DSO with optimizations for multiple architectures]),
271 [multi_arch=$enableval],
6f89d2f3 272 [multi_arch=default])
425ce2ed 273
ff886b82
UD
274AC_ARG_ENABLE([nss-crypt],
275 AC_HELP_STRING([--enable-nss-crypt],
276 [enable libcrypt to use nss]),
277 [nss_crypt=$enableval],
278 [nss_crypt=no])
279if test x$nss_crypt = xyes; then
280 nss_includes=-I$(nss-config --includedir 2>/dev/null)
281 if test $? -ne 0; then
282 AC_MSG_ERROR([cannot find include directory with nss-config])
283 fi
284 old_CFLAGS="$CFLAGS"
285 CFLAGS="$CFLAGS $nss_includes"
b68e08db 286 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
ff886b82
UD
287#include <hasht.h>
288#include <nsslowhash.h>
b68e08db 289void f (void) { NSSLOW_Init (); }])],
ff886b82
UD
290 libc_cv_nss_crypt=yes,
291 AC_MSG_ERROR([
292cannot find NSS headers with lowlevel hash function interfaces]))
293 old_LIBS="$LIBS"
294 LIBS="$LIBS -lfreebl3"
295 AC_LINK_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
296#include <hasht.h>
297#include <nsslowhash.h>],
298 [NSSLOW_Init();])],
299 libc_cv_nss_crypt=yes,
300 AC_MSG_ERROR([
301cannot link program using lowlevel NSS hash functions]))
302 CFLAGS="$old_CFLAGS"
303 LIBS="$old_LIBS"
304else
305 libc_cv_nss_crypt=no
306fi
307AC_SUBST(libc_cv_nss_crypt)
308
3a097cc7 309
021db4be
AJ
310AC_ARG_ENABLE([obsolete-rpc],
311 AC_HELP_STRING([--enable-obsolete-rpc],
312 [build and install the obsolete RPC code for link-time usage]),
313 [link_obsolete_rpc=$enableval],
314 [link_obsolete_rpc=no])
315AC_SUBST(link_obsolete_rpc)
316
317if test "$link_obsolete_rpc" = yes; then
318 AC_DEFINE(LINK_OBSOLETE_RPC)
319fi
320
3a097cc7
RM
321AC_ARG_ENABLE([systemtap],
322 [AS_HELP_STRING([--enable-systemtap],
323 [enable systemtap static probe points @<:@default=no@:>@])],
324 [systemtap=$enableval],
325 [systemtap=no])
326if test "x$systemtap" != xno; then
327 AC_CACHE_CHECK([for systemtap static probe support], libc_cv_sdt, [dnl
328 old_CFLAGS="$CFLAGS"
329 CFLAGS="-std=gnu99 $CFLAGS"
0e3933b9 330 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <sys/sdt.h>
3a097cc7
RM
331void foo (int i, void *p)
332{
333 asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
334 :: STAP_PROBE_ASM_OPERANDS (2, i, p));
0e3933b9 335}]])], [libc_cv_sdt=yes], [libc_cv_sdt=no])
3a097cc7
RM
336 CFLAGS="$old_CFLAGS"])
337 if test $libc_cv_sdt = yes; then
338 AC_DEFINE([USE_STAP_PROBE])
339 elif test "x$systemtap" != xauto; then
340 AC_MSG_FAILURE([systemtap support needs sys/sdt.h with asm support])
341 fi
342fi
343
c53d909c
RM
344AC_ARG_ENABLE([build-nscd],
345 [AS_HELP_STRING([--disable-build-nscd],
346 [disable building and installing the nscd daemon])],
347 [build_nscd=$enableval],
348 [build_nscd=default])
349AC_SUBST(build_nscd)
350
3cc3ef96
RM
351# Note the use of $use_nscd is near the bottom of the file.
352AC_ARG_ENABLE([nscd],
353 [AS_HELP_STRING([--disable-nscd],
354 [library functions will not contact the nscd daemon])],
355 [use_nscd=$enableval],
356 [use_nscd=yes])
357
e4608715
CD
358AC_ARG_ENABLE([pt_chown],
359 [AS_HELP_STRING([--enable-pt_chown],
360 [Enable building and installing pt_chown])],
361 [build_pt_chown=$enableval],
362 [build_pt_chown=no])
363AC_SUBST(build_pt_chown)
8c12f01d 364if test "$build_pt_chown" = yes; then
e4608715
CD
365 AC_DEFINE(HAVE_PT_CHOWN)
366fi
367
28f540f4
RM
368# We keep the original values in `$config_*' and never modify them, so we
369# can write them unchanged into config.make. Everything else uses
370# $machine, $vendor, and $os, and changes them whenever convenient.
371config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
372
2f64b655
UD
373# Don't allow vendor == "unknown"
374test "$config_vendor" = unknown && config_vendor=
375config_os="`echo $config_os | sed 's/^unknown-//'`"
376
a2fe9c76 377# Some configurations imply other options.
0269750c 378elf=yes
a2fe9c76 379
8f73811b
RM
380# The configure fragment of an add-on port can modify these to supplement
381# or override the table in the case statement below. No fragment should
382# ever change the config_* variables, however.
28f540f4
RM
383machine=$config_machine
384vendor=$config_vendor
385os=$config_os
b22d21b3 386base_os=''
28f540f4 387
2ceaa76a
RM
388submachine=
389AC_ARG_WITH([cpu],
390 AS_HELP_STRING([--with-cpu=CPU], [select code for CPU variant]),
391 [dnl
392 case "$withval" in
393 yes|'') AC_MSG_ERROR([--with-cpu requires an argument]) ;;
394 no) ;;
395 *) submachine="$withval" ;;
396 esac
397])
398
10a803e0
RM
399dnl Let sysdeps/*/preconfigure act here, like they can in add-ons.
400LIBC_PRECONFIGURE([$srcdir], [for sysdeps])
401
e0a3ed4f 402# An add-on can set this when it wants to disable the sanity check below.
8f73811b
RM
403libc_config_ok=no
404
405dnl Having this here, though empty, makes sure that if add-ons' fragments
406dnl do AC_CONFIG_SUBDIRS([some-dir]), which just sets $subdirs, then
407dnl our AC_OUTPUT will actually use it.
408AC_CONFIG_SUBDIRS()
409
e0a3ed4f
RM
410case "$enable_add_ons" in
411''|no) add_ons= ;;
412yes|'*')
413 add_ons=`cd $srcdir && ls -d 2> /dev/null */configure */sysdeps |
414 sed 's@/[[^/]]*$@@' | sort | uniq`
415 add_ons_automatic=yes
416 ;;
417*) add_ons=`echo "$enable_add_ons" | sed 's/,/ /g'`
418 add_ons_automatic=no ;;
419esac
420
421configured_add_ons=
8f73811b
RM
422add_ons_sfx=
423add_ons_pfx=
424if test x"$add_ons" != x; then
425 for f in $add_ons; do
426 # Some sanity checks
427 case "$f" in
428 crypt)
429 AC_MSG_ERROR([
430*** It seems that you're using an old \`crypt' add-on. crypt is now
431*** part of glibc and using the old add-on will not work with this
432*** release. Start again with fresh sources and without the old
433*** \`crypt' add-on.])
434 ;;
435 localedata)
436 AC_MSG_ERROR([
437*** It seems that you're using an old \`localedata' add-on. localedata
438*** is now part of glibc and using the old add-on will not work with
439*** this release. Start again with fresh sources and without the old
440*** \`localedata' add-on.])
441 ;;
442 esac
8f73811b
RM
443 done
444
9382fcee 445 # Now source each add-on's configure fragment.
c80e931a
RM
446 # The fragments can use $srcdir/$libc_add_on to find themselves,
447 # and test $add_ons_automatic to see if they were explicitly requested.
448 # A fragment can clear (or even change) $libc_add_on to affect
449 # whether it goes into the list to be actually used in the build.
450 use_add_ons=
9382fcee 451 for libc_add_on in $add_ons; do
e0a3ed4f
RM
452 # Test whether such a directory really exists.
453 # It can be absolute, or relative to $srcdir, or relative to the build dir.
454 case "$libc_add_on" in
455 /*)
456 libc_add_on_srcdir=$libc_add_on
457 ;;
458 *)
459 test -d "$srcdir/$libc_add_on" || {
77e8bddf 460 if test -d "$libc_add_on"; then
e0a3ed4f
RM
461 libc_add_on="`pwd`/$libc_add_on"
462 else
463 AC_MSG_ERROR(add-on directory \"$libc_add_on\" does not exist)
464 fi
465 }
466 libc_add_on_srcdir=$srcdir/$libc_add_on
467 ;;
468 esac
469
470 libc_add_on_frag=$libc_add_on_srcdir/configure
471 libc_add_on_canonical=
7967983f 472 libc_add_on_config_subdirs=
e0a3ed4f
RM
473 if test -r "$libc_add_on_frag"; then
474 AC_MSG_NOTICE(running configure fragment for add-on $libc_add_on)
475 libc_add_on_canonical=unknown
476 libc_add_on_subdirs=
477 . "$libc_add_on_frag"
478 test -z "$libc_add_on" || {
77e8bddf 479 configured_add_ons="$configured_add_ons $libc_add_on"
e0a3ed4f
RM
480 if test "x$libc_add_on_canonical" = xunknown; then
481 AC_MSG_ERROR(fragment must set \$libc_add_on_canonical)
482 fi
483 for d in $libc_add_on_subdirs; do
484 case "$libc_add_on" in
485 /*) subdir_srcdir="$libc_add_on" ;;
486 *) subdir_srcdir="\$(..)$libc_add_on" ;;
487 esac
488 case "$d" in
489 .)
490 d="${libc_add_on_canonical:-$libc_add_on}"
491 ;;
492 /*)
493 subdir_srcdir="$d"
494 ;;
495 *)
496 subdir_srcdir="$subdir_srcdir/$d"
497 ;;
498 esac
499 d=`echo "$d" | sed 's@/*$@@;s@^.*/@@'`
500 add_on_subdirs="$add_on_subdirs $d"
501 test "$subdir_srcdir" = "\$(..)$d" || config_vars="$config_vars
502$d-srcdir = $subdir_srcdir"
503 done
7967983f
RM
504 for d in $libc_add_on_config_subdirs; do
505 case "$d" in
506 /*) AC_MSG_ERROR(dnl
507fragment uses absolute path in \$libc_add_on_config_subdirs) ;;
508 esac
509 if test ! -d "$libc_add_on_srcdir/$d"; then
510 AC_MSG_ERROR(fragment wants to configure missing directory $d)
511 fi
512 case "$libc_add_on" in
513 /*) AC_MSG_ERROR(dnl
514relative path required for add-on using \$libc_add_on_config_subdirs) ;;
515 esac
516 subdirs="$subdirs $libc_add_on/$d"
517 done
e0a3ed4f 518 }
8f73811b 519 fi
619f9448 520 if test -n "$libc_add_on"; then
10a803e0 521 LIBC_PRECONFIGURE([$libc_add_on_srcdir], [add-on $libc_add_on for])
619f9448
RM
522 use_add_ons="$use_add_ons $libc_add_on"
523 add_ons_pfx="$add_ons_pfx $libc_add_on/"
e0a3ed4f
RM
524 test -z "$libc_add_on_canonical" ||
525 add_ons_sfx="$add_ons_sfx /$libc_add_on_canonical"
619f9448 526 fi
8f73811b 527 done
c80e931a
RM
528 # Use echo to strip excess whitespace.
529 add_ons="`echo $use_add_ons`"
8f73811b
RM
530fi
531AC_SUBST(add_ons)
e0a3ed4f 532AC_SUBST(add_on_subdirs)
8f73811b
RM
533
534
bdc8eb03
UD
535###
536### I put this here to prevent those annoying emails from people who cannot
537### read and try to compile glibc on unsupported platforms. --drepper
538###
539### By using the undocumented --enable-hacker-mode option for configure
540### one can skip this test to make the configuration not fail for unsupported
541### platforms.
542###
8f73811b 543if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then
bdc8eb03 544 case "$machine-$host_os" in
2ce4f015 545 *-linux* | *-gnu*)
bdc8eb03
UD
546 ;;
547 *)
548 echo "*** The GNU C library is currently not available for this platform."
549 echo "*** So far nobody cared to port it and if there is no volunteer it"
550 echo "*** might never happen. So, if you have interest to see glibc on"
551 echo "*** this platform visit"
552 echo "*** http://www.gnu.org/software/libc/porting.html"
553 echo "*** and join the group of porters"
554 exit 1
555 ;;
556 esac
557fi
558
3e239be6
JM
559# Set base_machine if not set by a preconfigure fragment.
560test -n "$base_machine" || base_machine=$machine
f0523145 561AC_SUBST(base_machine)
28f540f4 562
0cae3f4b
MF
563# For the multi-arch option we need support in the assembler & linker.
564AC_CACHE_CHECK([for assembler and linker STT_GNU_IFUNC support],
565 libc_cv_ld_gnu_indirect_function, [dnl
786b0b67 566cat > conftest.S <<EOF
84b9230c 567.type foo,%gnu_indirect_function
0cae3f4b
MF
568foo:
569.globl _start
570_start:
571.globl __start
572__start:
573.data
786b0b67
AS
574#ifdef _LP64
575.quad foo
576#else
0cae3f4b 577.long foo
786b0b67 578#endif
84b9230c 579EOF
0cae3f4b
MF
580libc_cv_ld_gnu_indirect_function=no
581if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
582 -nostartfiles -nostdlib \
786b0b67 583 -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
0cae3f4b
MF
584 # Do a link to see if the backend supports IFUNC relocs.
585 $READELF -r conftest 1>&AS_MESSAGE_LOG_FD
586 LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || {
587 libc_cv_ld_gnu_indirect_function=yes
588 }
84b9230c
MF
589fi
590rm -f conftest*])
591
592AC_MSG_CHECKING(whether .text pseudo-op must be used)
593AC_CACHE_VAL(libc_cv_dot_text, [dnl
594cat > conftest.s <<EOF
595.text
596EOF
597libc_cv_dot_text=
598if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
599 libc_cv_dot_text=.text
600fi
601rm -f conftest*])
602if test -z "$libc_cv_dot_text"; then
603 AC_MSG_RESULT(no)
604else
605 AC_MSG_RESULT(yes)
606fi
607
0cae3f4b 608if test x"$libc_cv_ld_gnu_indirect_function" != xyes; then
84b9230c
MF
609 if test x"$multi_arch" = xyes; then
610 AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
611 else
612 multi_arch=no
613 fi
614fi
6270516e 615multi_arch_d=
84b9230c
MF
616if test x"$multi_arch" != xno; then
617 multi_arch_d=/multiarch
618fi
619
f0523145 620# Compute the list of sysdep directories for this configuration.
f332db02 621# This can take a while to compute.
f0523145 622sysdep_dir=$srcdir/sysdeps
f332db02 623AC_MSG_CHECKING(sysdep dirs)
f0523145
RM
624dnl We need to use [ and ] for other purposes for a while now.
625changequote(,)dnl
28f540f4
RM
626# Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
627os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
628
b22d21b3 629test "x$base_os" != x || case "$os" in
28f540f4
RM
630gnu*)
631 base_os=mach/hurd ;;
2ce4f015 632linux*)
28f540f4 633 base_os=unix/sysv ;;
28f540f4
RM
634esac
635
636# For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
637tail=$os
638ostry=$os
639while o=`echo $tail | sed 's/\.[^.]*$//'`; test $o != $tail; do
640 ostry="$ostry /$o"
641 tail=$o
75914335 642done
28f540f4
RM
643o=`echo $tail | sed 's/[0-9]*$//'`
644if test $o != $tail; then
645 ostry="$ostry /$o"
646fi
ec4b0518
UD
647# For linux-gnu, try linux-gnu, then linux.
648o=`echo $tail | sed 's/-.*$//'`
649if test $o != $tail; then
650 ostry="$ostry /$o"
651fi
28f540f4
RM
652
653# For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
654base=
655tail=$base_os
656while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$b"; do
657 set $b
658 base="$base /$1"
659 tail="$2"
660done
661
ae6b8730 662# For sparc/sparc32, try sparc/sparc32 and then sparc.
28f540f4 663mach=
2ceaa76a 664tail=$machine${submachine:+/$submachine}
28f540f4
RM
665while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
666 set $m
10ceac89
RM
667 # Prepend the machine's FPU directory unless --without-fp.
668 if test "$with_fp" = yes; then
6270516e 669 maybe_fpu=/fpu
f4b07664 670 else
6270516e 671 maybe_fpu=/nofpu
82d00cab 672 fi
6270516e
RM
673 # For each machine term, try it with and then without /multiarch.
674 for try_fpu in $maybe_fpu ''; do
675 for try_multi in $multi_arch_d ''; do
676 mach="$mach /$1$try_fpu$try_multi"
677 done
678 done
28f540f4
RM
679 tail="$2"
680done
681
682dnl We are done with glob and regexp uses of [ and ]; return to autoconf.
683changequote([,])dnl
684
685# Find what sysdep directories exist.
e0a3ed4f 686sysnames_add_ons=
28f540f4 687sysnames=
4b69abad
RM
688for b in $base ''; do
689 for m0 in $mach ''; do
690 for v in /$vendor ''; do
691 test "$v" = / && continue
692 for o in /$ostry ''; do
693 test "$o" = / && continue
6270516e 694 for m in $mach ''; do
4b69abad 695 for d in $add_ons_pfx ''; do
8f73811b 696 for a in $add_ons_sfx ''; do
1c9f1a02
RM
697 try_suffix="$m0$b$v$o$m"
698 if test -n "$try_suffix"; then
77e8bddf
AS
699 try_srcdir="${srcdir}/"
700 case "$d" in
e0a3ed4f
RM
701 /*) try_srcdir= ;;
702 esac
1c9f1a02 703 try="${d}sysdeps$try_suffix$a"
8f73811b
RM
704 test -n "$enable_debug_configure" &&
705 echo "$0 [DEBUG]: try $try" >&2
e0a3ed4f 706 if test -d "$try_srcdir$try"; then
8f73811b
RM
707 sysnames="$sysnames $try"
708 { test -n "$o" || test -n "$b"; } && os_used=t
709 { test -n "$m" || test -n "$m0"; } && machine_used=t
4b69abad
RM
710 case x${m0:-$m} in
711 x*/$submachine) submachine_used=t ;;
712 esac
e0a3ed4f
RM
713 if test -n "$d"; then
714 case "$sysnames_add_ons" in
715 *" $d "*) ;;
716 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
717 esac
718 fi
8f73811b 719 fi
57ba7bb4 720 fi
8f73811b 721 done
57ba7bb4 722 done
28f540f4
RM
723 done
724 done
725 done
726 done
4b69abad 727done
28f540f4 728
6f89d2f3
L
729# If the assembler supports gnu_indirect_function symbol type and the
730# architecture supports multi-arch, we enable multi-arch by default.
84b9230c
MF
731case $sysnames_add_ons$sysnames in
732*"$multi_arch_d"*)
733 ;;
734*)
77e8bddf 735 test x"$multi_arch" = xdefault && multi_arch=no
84b9230c
MF
736 ;;
737esac
738if test x"$multi_arch" != xno; then
6f89d2f3
L
739 AC_DEFINE(USE_MULTIARCH)
740fi
741AC_SUBST(multi_arch)
742
28f540f4
RM
743if test -z "$os_used" && test "$os" != none; then
744 AC_MSG_ERROR(Operating system $os is not supported.)
745fi
746if test -z "$machine_used" && test "$machine" != none; then
747 AC_MSG_ERROR(The $machine is not supported.)
748fi
2ceaa76a
RM
749if test -z "$submachine_used" && test -n "$submachine"; then
750 AC_MSG_ERROR(The $submachine subspecies of $host_cpu is not supported.)
751fi
752AC_SUBST(submachine)
28f540f4
RM
753
754# We have now validated the configuration.
755
28f540f4
RM
756# Expand the list of system names into a full list of directories
757# from each element's parent name and Implies file (if present).
758set $sysnames
e50ec9f9 759names=
28f540f4
RM
760while test $# -gt 0; do
761 name=$1
762 shift
763
e50ec9f9 764 case " $names " in *" $name "*)
f332db02
RM
765 # Already in the list.
766 continue
e50ec9f9 767 esac
f332db02
RM
768
769 # Report each name as we discover it, so there is no long pause in output.
0b4ee387 770 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
f332db02 771
57ba7bb4
UD
772 name_base=`echo $name | sed -e 's@\(.*sysdeps\)/.*@\1@'`
773
774 case $name in
775 /*) xsrcdir= ;;
776 *) xsrcdir=$srcdir/ ;;
777 esac
778 test -n "$enable_debug_configure" &&
779 echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2
780
ba75122d
RM
781 for implies_file in Implies Implies-before Implies-after; do
782 implies_type=`echo $implies_file | sed s/-/_/`
783 eval ${implies_type}=
784 if test -f $xsrcdir$name/$implies_file; then
785 # Collect more names from the `Implies' file (removing comments).
786 implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/$implies_file`"
787 for x in $implied_candidate; do
788 found=no
789 if test -d $xsrcdir$name_base/$x; then
790 eval "${implies_type}=\"\$${implies_type} \$name_base/\$x\""
636ccfc8 791 found=yes
ba75122d
RM
792 fi
793 for d in $add_ons_pfx ''; do
794 try="${d}sysdeps/$x"
795 case $d in
796 /*) try_srcdir= ;;
797 *) try_srcdir=$srcdir/ ;;
e0a3ed4f 798 esac
ba75122d
RM
799 test -n "$enable_debug_configure" &&
800 echo "[DEBUG]: $name $implies_file $x try($d) {$try_srcdir}$try" >&2
801 if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
802 then
803 eval "${implies_type}=\"\$${implies_type} \$try\""
804 found=yes
805 case "$sysnames_add_ons" in
806 *" $d "*) ;;
807 *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
808 esac
809 fi
810 done
811 if test $found = no; then
812 AC_MSG_WARN($name/$implies_file specifies nonexistent $x)
636ccfc8
UD
813 fi
814 done
ba75122d
RM
815 fi
816 done
28f540f4
RM
817
818 # Add NAME to the list of names.
819 names="$names $name"
820
821 # Find the parent of NAME, using the empty string if it has none.
822changequote(,)dnl
57ba7bb4 823 parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
28f540f4
RM
824changequote([,])dnl
825
ba75122d
RM
826 test -n "$enable_debug_configure" &&
827 echo "[DEBUG]: $name Implies='$Implies' rest='$*' parent='$parent' \
57633811 828Implies_before='$Implies_before' Implies_after='$Implies_after'" >&2
ba75122d 829
28f540f4
RM
830 # Add the names implied by NAME, and NAME's parent (if it has one), to
831 # the list of names to be processed (the argument list). We prepend the
832 # implied names to the list and append the parent. We want implied
833 # directories to come before further directories inferred from the
834 # configuration components; this ensures that for sysv4, unix/common
835 # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
836 # after sysv4).
ba75122d 837 sysnames="`echo $Implies $* $Implies_before $parent $Implies_after`"
28f540f4
RM
838 test -n "$sysnames" && set $sysnames
839done
840
841# Add the default directories.
83ef87ba 842default_sysnames="sysdeps/generic"
ecdc196c 843sysnames="$names $default_sysnames"
f332db02
RM
844AC_SUBST(sysnames)
845# The other names were emitted during the scan.
ecdc196c 846AC_MSG_RESULT($default_sysnames)
28f540f4 847
e0a3ed4f
RM
848# Collect the list of add-ons that supply partial sysdeps trees.
849sysdeps_add_ons=
850for add_on in $add_ons; do
851 case "$add_on" in
852 /*) xsrcdir= ;;
853 *) xsrcdir="$srcdir/" ;;
854 esac
855
856 test -d "$xsrcdir$add_on/sysdeps" || {
857 case "$configured_add_ons " in
858 *" $add_on "*) ;;
859 *|'')
860 AC_MSG_ERROR(add-on $add_on has no configure fragment or sysdeps tree)
861 ;;
862 esac
863 continue
864 }
865
866 sysdeps_add_ons="$sysdeps_add_ons $add_on"
867 case "$sysnames_add_ons" in
868 *" $add_on/ "*) ;;
869 *|'')
870 AC_MSG_WARN(add-on $add_on contributed no sysdeps directories)
871 continue ;;
872 esac
873
874 found=no
875 for d in $sysnames; do
876 case "$d" in
877 $add_on/sysdeps/*) ;;
878 *) continue ;;
879 esac
880 (cd "$xsrcdir$d" && for f in *[[!~]]; do
881 case "$f" in
882 sys|bits)
883 for ff in $f/*.h; do
884 test -d "$ff" || { test -e "$ff" && exit 88; }
885 done
886 ;;
887 *)
77e8bddf 888 test -d "$f" || { test -e "$f" && exit 88; }
e0a3ed4f
RM
889 ;;
890 esac
891 done)
892 if test $? -eq 88; then
893 found=yes
894 break
895 fi
896 done
897 if test $found = no; then
898 AC_MSG_WARN(add-on $add_on contributed no useful sysdeps directories)
899 fi
900done
901AC_SUBST(sysdeps_add_ons)
902
f332db02
RM
903
904### Locate tools.
28f540f4 905
28f540f4 906AC_PROG_INSTALL
2b80a372 907if test "$INSTALL" = "${srcdir}/scripts/install-sh -c"; then
28f540f4 908 # The makefiles need to use a different form to find it in $srcdir.
2b80a372 909 INSTALL='\$(..)./scripts/install-sh -c'
28f540f4 910fi
0e3426bb 911AC_PROG_LN_S
ae828bc6 912
4baa087a 913LIBC_PROG_BINUTILS
4baa087a 914
bec039bc 915# Accept binutils 2.20 or newer.
4baa087a
RM
916AC_CHECK_PROG_VER(AS, $AS, --version,
917 [GNU assembler.* \([0-9]*\.[0-9.]*\)],
bec039bc 918 [2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], AS=: critic_missing="$critic_missing as")
4baa087a
RM
919AC_CHECK_PROG_VER(LD, $LD, --version,
920 [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
bec039bc 921 [2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], LD=: critic_missing="$critic_missing ld")
4baa087a 922
63bda0c1 923# These programs are version sensitive.
3a12e572 924AC_CHECK_TOOL_PREFIX
4bca4c17 925AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
cbe7d24b 926 [version \([egcygnustpi-]*[0-9.]*\)], [4.[4-9].* | 4.[1-9][0-9].* | [5-9].* ],
90d1d40b 927 critic_missing="$critic_missing gcc")
22e65f8f 928AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
8fc1e2ca 929 [GNU Make[^0-9]*\([0-9][0-9.]*\)],
28d708c4 930 [3.79* | 3.[89]* | [4-9].* | [1-9][0-9]*], critic_missing="$critic_missing make")
63bda0c1 931
22e65f8f 932AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
bdd421cc 933 [GNU gettext.* \([0-9]*\.[0-9.]*\)],
aefdff34
RM
934 [0.10.3[6-9]* | 0.10.[4-9][0-9]* | 0.1[1-9]* | 0.[2-9][0-9]* | [1-9].*],
935 MSGFMT=: aux_missing="$aux_missing msgfmt")
63bda0c1 936AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
8b7fb588 937 [GNU texinfo.* \([0-9][0-9.]*\)],
6a3951a0 938 [4.[5-9]*|4.[1-9][0-9]*|[5-9].*],
aefdff34 939 MAKEINFO=: aux_missing="$aux_missing makeinfo")
d6a97a28 940AC_CHECK_PROG_VER(SED, sed, --version,
07e51550 941 [GNU sed[^0-9]* \([0-9]*\.[0-9.]*\)],
aefdff34
RM
942 [3.0[2-9]*|3.[1-9]*|[4-9]*],
943 SED=: aux_missing="$aux_missing sed")
0786794f
AM
944AC_CHECK_PROG_VER(AWK, gawk, --version,
945 [GNU Awk[^0-9]*\([0-9][0-9.]*\)],
12086fb4 946 [3.1.[2-9]*|3.[2-9]*|[4-9]*], critic_missing="$critic_missing gawk")
63bda0c1 947
30b99d79 948AC_CHECK_TOOL(NM, nm, false)
d30cf5bb 949
8894bad3
AM
950if test "x$maintainer" = "xyes"; then
951 AC_CHECK_PROGS(AUTOCONF, autoconf, no)
952 case "x$AUTOCONF" in
953 xno|x|x:) AUTOCONF=no ;;
954 *)
955 AC_CACHE_CHECK(dnl
956 whether $AUTOCONF${ACFLAGS:+ }$ACFLAGS works, libc_cv_autoconf_works, [dnl
957 if (cd $srcdir; $AUTOCONF $ACFLAGS configure.ac > /dev/null 2>&1); then
958 libc_cv_autoconf_works=yes
959 else
960 libc_cv_autoconf_works=no
961 fi])
962 test $libc_cv_autoconf_works = yes || AUTOCONF=no
963 ;;
964 esac
965 if test "x$AUTOCONF" = xno; then
966 aux_missing="$aux_missing autoconf"
967 fi
9e8ac24b
AM
968else
969 AUTOCONF=no
14519931 970fi
1400de2e 971
32a448ed
RM
972test -n "$critic_missing" && AC_MSG_ERROR([
973*** These critical programs are missing or too old:$critic_missing
974*** Check the INSTALL file for required versions.])
975
4bca4c17 976test -n "$aux_missing" && AC_MSG_WARN([
9c6fffc0 977*** These auxiliary programs are missing or incompatible versions:$aux_missing
63bda0c1
UD
978*** some features will be disabled.
979*** Check the INSTALL file for required versions.])
28f540f4 980
dbe7a0f5
UD
981# if using special system headers, find out the compiler's sekrit
982# header directory and add that to the list. NOTE: Only does the right
983# thing on a system that doesn't need fixincludes. (Not presently a problem.)
984if test -n "$sysheaders"; then
67fbfa5c
RM
985 SYSINCLUDES=-nostdinc
986 for d in include include-fixed; do
987 i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
988 SYSINCLUDES="$SYSINCLUDES -isystem $i"
989 done
990 SYSINCLUDES="$SYSINCLUDES \
3d6ce23a 991-isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
ef226fec 992 if test -n "$CXX"; then
7872cfb0 993 CXX_SYSINCLUDES=
67060746
AC
994 for cxxheaders in `$CXX -v -S -x c++ /dev/null -o /dev/null 2>&1 \
995 | sed -n -e '1,/#include/d' -e 's/^ \(\/.*\/[cg]++\)/\1/p'`; do
996 test "x$cxxheaders" != x &&
997 CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders"
998 done
ef226fec 999 fi
dbe7a0f5
UD
1000fi
1001AC_SUBST(SYSINCLUDES)
ef226fec 1002AC_SUBST(CXX_SYSINCLUDES)
dbe7a0f5 1003
3911660e
UD
1004# Test if LD_LIBRARY_PATH contains the notation for the current directory
1005# since this would lead to problems installing/building glibc.
1006# LD_LIBRARY_PATH contains the current directory if one of the following
1007# is true:
1008# - one of the terminals (":" and ";") is the first or last sign
1009# - two terminals occur directly after each other
1010# - the path contains an element with a dot in it
1011AC_MSG_CHECKING(LD_LIBRARY_PATH variable)
1012changequote(,)dnl
1013case ${LD_LIBRARY_PATH} in
1014 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
b3a86ae1 1015 ld_library_path_setting="contains current directory"
3911660e
UD
1016 ;;
1017 *)
1018 ld_library_path_setting="ok"
1019 ;;
1020esac
1021changequote([,])dnl
1022AC_MSG_RESULT($ld_library_path_setting)
1023if test "$ld_library_path_setting" != "ok"; then
63bda0c1
UD
1024AC_MSG_ERROR([
1025*** LD_LIBRARY_PATH shouldn't contain the current directory when
1026*** building glibc. Please change the environment variable
1027*** and run configure again.])
3911660e 1028fi
8e31cf7e 1029
74bd2300 1030AC_CACHE_CHECK(whether GCC supports -static-libgcc, libc_cv_gcc_static_libgcc, [dnl
8175a253 1031if $CC -v -static-libgcc 2>&1 | grep 'unrecognized option.*static-libgcc' >/dev/null; then
74bd2300
UD
1032 libc_cv_gcc_static_libgcc=
1033else
1034 libc_cv_gcc_static_libgcc=-static-libgcc
1035fi])
1036AC_SUBST(libc_cv_gcc_static_libgcc)
1037
26f56c1c 1038AC_PATH_PROG(BASH_SHELL, bash, no)
84384f5b 1039
c0016081 1040AC_PATH_PROG(PERL, perl, no)
2fd5d029
RM
1041if test "$PERL" != no &&
1042 (eval `$PERL -V:apiversion`; test `expr "$apiversion" \< 5` -ne 0); then
1043 PERL=no
ecb06196 1044fi
2f512715
AS
1045AC_PATH_PROG(INSTALL_INFO, install-info, no,
1046 $PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin)
2de00372
UD
1047AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin)
1048
b8dc6a10 1049AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl
28f540f4
RM
1050AC_TRY_COMPILE(dnl
1051[#define __need_size_t
1052#define __need_wchar_t
1053#include <stddef.h>
1054#define __need_NULL
1055#include <stddef.h>], [size_t size; wchar_t wchar;
1056#ifdef offsetof
1057#error stddef.h ignored __need_*
1058#endif
1059if (&size == NULL || &wchar == NULL) abort ();],
77e8bddf
AS
1060 libc_cv_friendly_stddef=yes,
1061 libc_cv_friendly_stddef=no)])
28f540f4
RM
1062if test $libc_cv_friendly_stddef = yes; then
1063 config_vars="$config_vars
1064override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
1065fi
1066
b8dc6a10
RM
1067AC_CACHE_CHECK(whether we need to use -P to assemble .S files,
1068 libc_cv_need_minus_P, [dnl
28f540f4
RM
1069cat > conftest.S <<EOF
1070#include "confdefs.h"
1071/* Nothing whatsoever. */
1072EOF
3217788f 1073if AC_TRY_COMMAND(${CC-cc} $CPPFLAGS $ASFLAGS -c conftest.S 1>&AS_MESSAGE_LOG_FD); then
28f540f4
RM
1074 libc_cv_need_minus_P=no
1075else
1076 libc_cv_need_minus_P=yes
1077fi
1078rm -f conftest*])
28f540f4
RM
1079if test $libc_cv_need_minus_P = yes; then
1080 config_vars="$config_vars
1081asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
1082fi
1083
b8dc6a10 1084AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl
9a70fcab 1085cat > conftest.s <<EOF
2293395f 1086${libc_cv_dot_text}
ae1025be 1087foo:
df2a0c93 1088.set glibc_conftest_frobozz,foo
7b8e0d49 1089.globl glibc_conftest_frobozz
e215c478 1090EOF
df2a0c93
RM
1091# The alpha-dec-osf1 assembler gives only a warning for `.set'
1092# (but it doesn't work), so we must do a linking check to be sure.
1093cat > conftest1.c <<\EOF
1094extern int glibc_conftest_frobozz;
640f0119 1095void _start() { glibc_conftest_frobozz = 1; }
df2a0c93
RM
1096EOF
1097if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
640f0119 1098 -nostartfiles -nostdlib \
0b4ee387 1099 -o conftest conftest.s conftest1.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
e215c478
RM
1100 libc_cv_asm_set_directive=yes
1101else
1102 libc_cv_asm_set_directive=no
1103fi
65b3cbcb 1104rm -f conftest*])
e215c478
RM
1105if test $libc_cv_asm_set_directive = yes; then
1106 AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
1107fi
1108
415ac3df
UD
1109AC_CACHE_CHECK(for assembler gnu_unique_object symbol type,
1110 libc_cv_asm_unique_object, [dnl
1111cat > conftest.s <<EOF
1112${libc_cv_dot_text}
1113_sym:
b67e9372 1114.type _sym, %gnu_unique_object
415ac3df
UD
1115EOF
1116if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
1117 libc_cv_asm_unique_object=yes
1118else
1119 libc_cv_asm_unique_object=no
1120fi
1121rm -f conftest*])
1122if test $libc_cv_asm_unique_object = yes; then
1123 AC_DEFINE(HAVE_ASM_UNIQUE_OBJECT)
1124fi
1125
a0da5fe1
UD
1126AC_CACHE_CHECK(for .previous assembler directive,
1127 libc_cv_asm_previous_directive, [dnl
1128cat > conftest.s <<EOF
fd26970f
UD
1129.section foo_section
1130.previous
a0da5fe1
UD
1131EOF
1132if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1133 libc_cv_asm_previous_directive=yes
1134else
1135 libc_cv_asm_previous_directive=no
1136fi
1137rm -f conftest*])
1138if test $libc_cv_asm_previous_directive = yes; then
1139 AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
1140else
1141 AC_CACHE_CHECK(for .popsection assembler directive,
1142 libc_cv_asm_popsection_directive, [dnl
1143 cat > conftest.s <<EOF
1144.pushsection foo_section
1145.popsection
fd26970f 1146EOF
3217788f 1147 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
a0da5fe1 1148 libc_cv_asm_popsection_directive=yes
fd26970f 1149 else
a0da5fe1 1150 libc_cv_asm_popsection_directive=no
fd26970f
UD
1151 fi
1152 rm -f conftest*])
a0da5fe1
UD
1153 if test $libc_cv_asm_popsection_directive = yes; then
1154 AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
fd26970f 1155 fi
a0da5fe1
UD
1156fi
1157AC_CACHE_CHECK(for .protected and .hidden assembler directive,
1158 libc_cv_asm_protected_directive, [dnl
1159cat > conftest.s <<EOF
2d499f55
UD
1160.protected foo
1161foo:
1162.hidden bar
1163bar:
1164EOF
a0da5fe1
UD
1165if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
1166 libc_cv_asm_protected_directive=yes
1167else
1168 AC_MSG_ERROR(assembler support for symbol visibility is required)
1169fi
1170rm -f conftest*])
0fb7851f 1171
a0da5fe1
UD
1172if test $libc_cv_asm_protected_directive = yes; then
1173 AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
0d01dace
UD
1174 libc_cv_visibility_attribute,
1175 [cat > conftest.c <<EOF
1176 int foo __attribute__ ((visibility ("hidden"))) = 1;
1177 int bar __attribute__ ((visibility ("protected"))) = 1;
1178EOF
1179 libc_cv_visibility_attribute=no
61cea1c3 1180 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
0d01dace
UD
1181 if grep '\.hidden.*foo' conftest.s >/dev/null; then
1182 if grep '\.protected.*bar' conftest.s >/dev/null; then
1183 libc_cv_visibility_attribute=yes
1184 fi
1185 fi
1186 fi
f7d82dc9 1187 rm -f conftest.{c,s}
0d01dace 1188 ])
a0da5fe1
UD
1189 if test $libc_cv_visibility_attribute != yes; then
1190 AC_MSG_ERROR(compiler support for visibility attribute is required)
0d01dace 1191 fi
a0da5fe1 1192fi
0d01dace 1193
a0da5fe1
UD
1194if test $libc_cv_visibility_attribute = yes; then
1195 AC_CACHE_CHECK(for broken __attribute__((visibility())),
37ba7d66
UD
1196 libc_cv_broken_visibility_attribute,
1197 [cat > conftest.c <<EOF
1198 int foo (int x);
1199 int bar (int x) __asm__ ("foo") __attribute__ ((visibility ("hidden")));
1200 int bar (int x) { return x; }
1201EOF
1202 libc_cv_broken_visibility_attribute=yes
f7d82dc9 1203 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
37ba7d66
UD
1204changequote(,)dnl
1205 if grep '\.hidden[ _]foo' conftest.s >/dev/null; then
1206changequote([,])dnl
1207 libc_cv_broken_visibility_attribute=no
1208 fi
1209 fi
1210 rm -f conftest.c conftest.s
1211 ])
a0da5fe1
UD
1212 if test $libc_cv_broken_visibility_attribute = yes; then
1213 AC_MSG_ERROR(working compiler support for visibility attribute is required)
37ba7d66 1214 fi
a0da5fe1 1215fi
37ba7d66 1216
a0da5fe1
UD
1217AC_CACHE_CHECK(for broken __attribute__((alias())),
1218 libc_cv_broken_alias_attribute,
1219 [cat > conftest.c <<EOF
1220 extern int foo (int x) __asm ("xyzzy");
1221 int bar (int x) { return x; }
1222 extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
1223 extern int dfoo;
1224 extern __typeof (dfoo) dfoo __asm ("abccb");
1225 int dfoo = 1;
37ba7d66 1226EOF
a0da5fe1
UD
1227 libc_cv_broken_alias_attribute=yes
1228 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
1229 if grep 'xyzzy' conftest.s >/dev/null &&
1230 grep 'abccb' conftest.s >/dev/null; then
1231 libc_cv_broken_alias_attribute=no
1232 fi
1233 fi
1234 rm -f conftest.c conftest.s
1235 ])
1236if test $libc_cv_broken_alias_attribute = yes; then
1237 AC_MSG_ERROR(working alias attribute support required)
1238fi
1239
1240if test $libc_cv_visibility_attribute = yes; then
1241 AC_CACHE_CHECK(whether to put _rtld_local into .sdata section,
0d01dace
UD
1242 libc_cv_have_sdata_section,
1243 [echo "int i;" > conftest.c
1244 libc_cv_have_sdata_section=no
dbc92dc6 1245 if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
0d01dace
UD
1246 | grep '\.sdata' >/dev/null; then
1247 libc_cv_have_sdata_section=yes
1248 fi
1249 rm -f conftest.c conftest.so
1250 ])
a0da5fe1
UD
1251 if test $libc_cv_have_sdata_section = yes; then
1252 AC_DEFINE(HAVE_SDATA_SECTION)
0d01dace 1253 fi
a0da5fe1 1254fi
0d01dace 1255
a0da5fe1
UD
1256AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
1257 libc_cv_initfini_array, [dnl
07037eeb 1258LIBC_TRY_LINK_STATIC([
5241882c 1259int foo (void) { return 1; }
2c617417 1260int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
07037eeb
JM
1261],
1262 [if $READELF -S conftest | fgrep INIT_ARRAY > /dev/null; then
a0da5fe1 1263 libc_cv_initfini_array=yes
5241882c 1264 else
ce33ee7c 1265 libc_cv_initfini_array=no
07037eeb
JM
1266 fi],
1267 [libc_cv_initfini_array=no])
1268])
a0da5fe1
UD
1269if test $libc_cv_initfini_array != yes; then
1270 AC_MSG_ERROR([Need linker with .init_array/.fini_array support.])
1271fi
62bede13 1272
a0da5fe1
UD
1273AC_CACHE_CHECK(whether to use .ctors/.dtors header and trailer,
1274 libc_cv_ctors_header, [dnl
1275 libc_cv_ctors_header=yes
07037eeb
JM
1276 LIBC_TRY_LINK_STATIC([
1277__attribute__ ((constructor)) void ctor (void) { asm (""); }
1278__attribute__ ((destructor)) void dtor (void) { asm (""); }
113ddea4 1279],
a0da5fe1 1280 [dnl
113ddea4 1281 AS_IF([$READELF -WS conftest$ac_exeext | $AWK '
92963737 1282 { gsub(/\@<:@ */, "@<:@") }
113ddea4
RM
1283 $2 == ".ctors" || $2 == ".dtors" {
1284 size = strtonum("0x" $6)
1285 align = strtonum("0x" $NF)
1286 seen@<:@$2@:>@ = 1
1287 stub@<:@$2@:>@ = size == align * 2
92963737 1288 }
113ddea4
RM
1289 END {
1290 ctors_ok = !seen@<:@".ctors"@:>@ || stub@<:@".ctors"@:>@
1291 dtors_ok = !seen@<:@".dtors"@:>@ || stub@<:@".dtors"@:>@
1292 exit ((ctors_ok && dtors_ok) ? 0 : 1)
1293 }
1294 '], [libc_cv_ctors_header=no])
1295 ], [dnl
1296 AC_MSG_ERROR([missing __attribute__ ((constructor)) support??])
1297 ])
a0da5fe1
UD
1298])
1299if test $libc_cv_ctors_header = no; then
1300 AC_DEFINE(NO_CTORS_DTORS_SECTIONS)
1301fi
5241882c 1302
a0da5fe1
UD
1303AC_CACHE_CHECK(for libunwind-support in compiler,
1304 libc_cv_cc_with_libunwind, [
1305 cat > conftest.c <<EOF
cbdb12de
UD
1306int main (void) { return 0; }
1307EOF
a0da5fe1 1308 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
8175a253 1309 conftest.c -v 2>&1 >/dev/null | grep ' -lunwind ' >/dev/null; then
a0da5fe1
UD
1310 libc_cv_cc_with_libunwind=yes
1311 else
1312 libc_cv_cc_with_libunwind=no
c776b3d7 1313 fi
a0da5fe1
UD
1314 rm -f conftest*])
1315AC_SUBST(libc_cv_cc_with_libunwind)
1316if test $libc_cv_cc_with_libunwind = yes; then
1317 AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
1318fi
c776b3d7 1319
6bfea974
L
1320LIBC_LINKER_FEATURE([-z nodelete], [-Wl,--enable-new-dtags,-z,nodelete],
1321 [libc_cv_z_nodelete=yes],
1322 [AC_MSG_ERROR(linker with -z nodelete support required)])
2f54c82d 1323
6bfea974
L
1324LIBC_LINKER_FEATURE([-z nodlopen], [-Wl,--enable-new-dtags,-z,nodlopen],
1325 [libc_cv_z_nodlopen=yes],
1326 [AC_MSG_ERROR(linker with -z nodlopen support required)])
5d916713 1327
6bfea974
L
1328LIBC_LINKER_FEATURE([-z initfirst], [-Wl,--enable-new-dtags,-z,initfirst],
1329 [libc_cv_z_initfirst=yes],
1330 [AC_MSG_ERROR(linker with -z initfirst support required)])
639c3248 1331
a0da5fe1
UD
1332AC_CACHE_CHECK(for -Bgroup option,
1333 libc_cv_Bgroup, [dnl
1334cat > conftest.c <<EOF
639c3248
UD
1335int _start (void) { return 42; }
1336EOF
a0da5fe1
UD
1337if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1338 -fPIC -shared -o conftest.so conftest.c
1339 -Wl,-Bgroup -nostdlib 1>&AS_MESSAGE_LOG_FD])
1340then
1341 libc_cv_Bgroup=yes
1342else
1343 libc_cv_Bgroup=no
1344fi
1345rm -f conftest*])
1346AC_SUBST(libc_cv_Bgroup)
a711b01d 1347
a0da5fe1
UD
1348ASFLAGS_config=
1349AC_CACHE_CHECK(whether --noexecstack is desirable for .S files,
1350 libc_cv_as_noexecstack, [dnl
1351cat > conftest.c <<EOF
35915ec8
UD
1352void foo (void) { }
1353EOF
a0da5fe1
UD
1354if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS
1355 -S -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD]) \
8175a253 1356 && grep .note.GNU-stack conftest.s >/dev/null \
a0da5fe1
UD
1357 && AC_TRY_COMMAND([${CC-cc} $ASFLAGS -Wa,--noexecstack
1358 -c -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD])
1359then
1360 libc_cv_as_noexecstack=yes
1361else
1362 libc_cv_as_noexecstack=no
1363fi
1364rm -f conftest*])
1365if test $libc_cv_as_noexecstack = yes; then
1366 ASFLAGS_config="$ASFLAGS_config -Wa,--noexecstack"
1367fi
1368AC_SUBST(ASFLAGS_config)
2abf9ff1 1369
a0da5fe1
UD
1370AC_CACHE_CHECK(for -z combreloc,
1371 libc_cv_z_combreloc, [dnl
1372cat > conftest.c <<EOF
d555194c
UD
1373extern int bar (int);
1374extern int mumble;
1375int foo (void) { return bar (mumble); }
a711b01d 1376EOF
a0da5fe1 1377if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
dbc92dc6 1378 -fPIC -shared -o conftest.so conftest.c
35cd3c97 1379 -nostdlib -nostartfiles
c2f55635 1380 -Wl,-z,combreloc 1>&AS_MESSAGE_LOG_FD])
a0da5fe1 1381then
a711b01d
UD
1382dnl The following test is a bit weak. We must use a tool which can test
1383dnl cross-platform since the gcc used can be a cross compiler. Without
1384dnl introducing new options this is not easily doable. Instead use a tool
1385dnl which always is cross-platform: readelf. To detect whether -z combreloc
1386dnl look for a section named .rel.dyn.
a0da5fe1
UD
1387 if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
1388 libc_cv_z_combreloc=yes
fdde8349
UD
1389 else
1390 libc_cv_z_combreloc=no
a711b01d 1391 fi
a0da5fe1
UD
1392else
1393 libc_cv_z_combreloc=no
1394fi
1395rm -f conftest*])
1396if test "$libc_cv_z_combreloc" = yes; then
1397 AC_DEFINE(HAVE_Z_COMBRELOC)
1398fi
1399AC_SUBST(libc_cv_z_combreloc)
2abf9ff1 1400
6bfea974
L
1401LIBC_LINKER_FEATURE([-z execstack], [-Wl,-z,execstack],
1402 [libc_cv_z_execstack=yes], [libc_cv_z_execstack=no])
a0da5fe1 1403AC_SUBST(libc_cv_z_execstack)
c9c60884 1404
a0da5fe1 1405AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
4da0431d
JM
1406LIBC_TRY_CC_OPTION([-fpie], [libc_cv_fpie=yes], [libc_cv_fpie=no])
1407])
c9c60884 1408
a0da5fe1 1409AC_SUBST(libc_cv_fpie)
871b9158 1410
a0da5fe1
UD
1411AC_CACHE_CHECK(for --hash-style option,
1412 libc_cv_hashstyle, [dnl
1413cat > conftest.c <<EOF
871b9158
UD
1414int _start (void) { return 42; }
1415EOF
a0da5fe1
UD
1416if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
1417 -fPIC -shared -o conftest.so conftest.c
1418 -Wl,--hash-style=both -nostdlib 1>&AS_MESSAGE_LOG_FD])
1419then
1420 libc_cv_hashstyle=yes
1421else
1422 libc_cv_hashstyle=no
1423fi
1424rm -f conftest*])
1425AC_SUBST(libc_cv_hashstyle)
1426
1427# The linker's default -shared behavior is good enough if it
1428# does these things that our custom linker scripts ensure that
1429# all allocated NOTE sections come first.
1430if test "$use_default_link" = default; then
1431 AC_CACHE_CHECK([for sufficient default -shared layout],
1432 libc_cv_use_default_link, [dnl
1433 libc_cv_use_default_link=no
1434 cat > conftest.s <<\EOF
fd5e21c7
RM
1435 .section .note.a,"a",%note
1436 .balign 4
1437 .long 4,4,9
1438 .string "GNU"
1439 .string "foo"
1440 .section .note.b,"a",%note
1441 .balign 4
1442 .long 4,4,9
1443 .string "GNU"
1444 .string "bar"
1445EOF
a0da5fe1 1446 if AC_TRY_COMMAND([dnl
fd5e21c7
RM
1447 ${CC-cc} $ASFLAGS -shared -o conftest.so conftest.s 1>&AS_MESSAGE_LOG_FD]) &&
1448 ac_try=`$READELF -S conftest.so | sed -n \
1449 ['${x;p;}
1450 s/^ *\[ *[1-9][0-9]*\] *\([^ ][^ ]*\) *\([^ ][^ ]*\) .*$/\2 \1/
1451 t a
1452 b
1453 : a
1454 H']`
a0da5fe1
UD
1455 then
1456 libc_seen_a=no libc_seen_b=no
1457 set -- $ac_try
1458 while test $# -ge 2 -a "$1" = NOTE; do
1459 case "$2" in
1460 .note.a) libc_seen_a=yes ;;
1461 .note.b) libc_seen_b=yes ;;
1462 esac
1463 shift 2
1464 done
1465 case "$libc_seen_a$libc_seen_b" in
1466 yesyes)
1467 libc_cv_use_default_link=yes
1468 ;;
1469 *)
1470 echo >&AS_MESSAGE_LOG_FD "\
fd5e21c7
RM
1471$libc_seen_a$libc_seen_b from:
1472$ac_try"
a0da5fe1
UD
1473 ;;
1474 esac
fd5e21c7 1475 fi
a0da5fe1
UD
1476 rm -f conftest*])
1477 use_default_link=$libc_cv_use_default_link
fd26970f 1478fi
49803108 1479
5c550700
RM
1480AC_CACHE_CHECK(linker output format, libc_cv_output_format, [dnl
1481if libc_cv_output_format=`
1482${CC-cc} -nostartfiles -nostdlib -Wl,--print-output-format 2>&AS_MESSAGE_LOG_FD`
1483then
1484 :
1485else
1486 libc_cv_output_format=
1487fi
1488test -n "$libc_cv_output_format" || libc_cv_output_format=unknown])
1489AC_SUBST(libc_cv_output_format)
1490
22dca1ea 1491AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl
49803108
AJ
1492cat > conftest.c <<EOF
1493int foo;
1494EOF
22dca1ea 1495if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder -fno-section-anchors
49803108
AJ
1496 conftest.c 1>&AS_MESSAGE_LOG_FD])
1497then
18e2ac6d 1498 libc_cv_fno_toplevel_reorder=yes
49803108 1499else
18e2ac6d 1500 libc_cv_fno_toplevel_reorder=no
49803108
AJ
1501fi
1502rm -f conftest*])
18e2ac6d 1503if test $libc_cv_fno_toplevel_reorder = yes; then
22dca1ea 1504 fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors"
18e2ac6d 1505else
49803108
AJ
1506 fno_unit_at_a_time=-fno-unit-at-a-time
1507fi
1508AC_SUBST(fno_unit_at_a_time)
fd26970f 1509
401a9ec9 1510AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
17228132
TS
1511LIBC_TRY_CC_OPTION([$CFLAGS $CPPFLAGS -Werror -fstack-protector],
1512 [libc_cv_ssp=yes],
1513 [libc_cv_ssp=no])
1514])
401a9ec9
UD
1515AC_SUBST(libc_cv_ssp)
1516
b037a293
UD
1517AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
1518cat > conftest.c <<EOF
1519int foo;
1520#ifdef __GNUC_GNU_INLINE__
1521main () { return 0;}
1522#else
1523#error
1524#endif
1525EOF
371f84a4
JJ
1526if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -std=gnu99 -fgnu89-inline
1527 -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD])
b037a293
UD
1528then
1529 libc_cv_gnu89_inline=yes
1530else
1531 libc_cv_gnu89_inline=no
1532fi
1533rm -f conftest*])
1534if test $libc_cv_gnu89_inline = yes; then
1c7570ff 1535 gnu89_inline=-fgnu89-inline
b037a293 1536else
1c7570ff 1537 gnu89_inline=
b037a293 1538fi
1c7570ff 1539AC_SUBST(gnu89_inline)
b037a293 1540
a0da5fe1
UD
1541AC_CACHE_CHECK(whether cc puts quotes around section names,
1542 libc_cv_have_section_quotes,
1543 [cat > conftest.c <<EOF
1544 static const int foo
1545 __attribute__ ((section ("bar"))) = 1;
e26dd47f 1546EOF
a0da5fe1
UD
1547 if ${CC-cc} -S conftest.c -o conftest.s; then
1548 if grep '\.section.*"bar"' conftest.s >/dev/null; then
1549 libc_cv_have_section_quotes=yes
e26dd47f 1550 else
a0da5fe1 1551 libc_cv_have_section_quotes=no
e26dd47f 1552 fi
a0da5fe1
UD
1553 else
1554 libc_cv_have_section_quotes=unknown
1555 fi
1556 rm -f conftest.{c,s}
1557 ])
1558if test $libc_cv_have_section_quotes = yes; then
1559 AC_DEFINE(HAVE_SECTION_QUOTES)
9a97d1f7
UD
1560fi
1561
1562AC_CACHE_CHECK(for assembler .weak directive, libc_cv_asm_weak_directive,
75d86c1f 1563 [dnl
c224a18a 1564cat > conftest.s <<EOF
2293395f 1565${libc_cv_dot_text}
7b8e0d49 1566.globl foo
ae1025be 1567foo:
c224a18a
RM
1568.weak foo
1569.weak bar; bar = foo
1570EOF
3217788f 1571if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
9a97d1f7
UD
1572 libc_cv_asm_weak_directive=yes
1573else
1574 libc_cv_asm_weak_directive=no
1575fi
1576rm -f conftest*])
c224a18a 1577
c8cf0b14 1578if test $libc_cv_asm_weak_directive = no; then
c224a18a
RM
1579 AC_CACHE_CHECK(for assembler .weakext directive,
1580 libc_cv_asm_weakext_directive,
1581 [dnl
1582cat > conftest.s <<EOF
2293395f 1583${libc_cv_dot_text}
7b8e0d49 1584.globl foo
ae1025be 1585foo:
f802accb
UD
1586.weakext bar foo
1587.weakext baz
7b8e0d49 1588.globl baz
9a97d1f7 1589baz:
c224a18a 1590EOF
3217788f 1591 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
c224a18a
RM
1592 libc_cv_asm_weakext_directive=yes
1593 else
1594 libc_cv_asm_weakext_directive=no
1595 fi
1596 rm -f conftest*])
1597
9a97d1f7 1598fi # no .weak
c224a18a 1599
ffcf9634 1600if test $libc_cv_asm_weak_directive = yes; then
c224a18a 1601 AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
ffcf9634 1602elif test $libc_cv_asm_weakext_directive = yes; then
c224a18a
RM
1603 AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)
1604fi
1605
a641835a
RM
1606AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
1607cat > conftest.c <<\EOF
5f0e6fc7 1608_start () {}
dcf0671d
UD
1609int __eh_pc;
1610__throw () {}
a641835a 1611EOF
dcea62dd 1612dnl No \ in command here because it ends up inside ''.
3217788f 1613if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
dcea62dd 1614 -nostdlib -nostartfiles -Wl,--no-whole-archive
c2f55635 1615 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
a641835a
RM
1616 libc_cv_ld_no_whole_archive=yes
1617else
1618 libc_cv_ld_no_whole_archive=no
1619fi
1620rm -f conftest*])
3ce1f295
UD
1621if test $libc_cv_ld_no_whole_archive = no; then
1622 AC_MSG_ERROR([support for --no-whole-archive is needed])
b17277cf 1623fi
a641835a 1624
dff14448 1625AC_CACHE_CHECK(for gcc -fexceptions, libc_cv_gcc_exceptions, [dnl
b236e99d
UD
1626cat > conftest.c <<\EOF
1627_start () {}
1628int __eh_pc;
1629__throw () {}
1630EOF
1631dnl No \ in command here because it ends up inside ''.
3217788f 1632if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
dff14448 1633 -nostdlib -nostartfiles -fexceptions
c2f55635 1634 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
dff14448 1635 libc_cv_gcc_exceptions=yes
b236e99d 1636else
dff14448 1637 libc_cv_gcc_exceptions=no
b236e99d
UD
1638fi
1639rm -f conftest*])
dff14448
UD
1640if test $libc_cv_gcc_exceptions = yes; then
1641 exceptions=-fexceptions
b17277cf 1642fi
dff14448 1643AC_SUBST(exceptions)dnl
b236e99d 1644
d555194c
UD
1645AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
1646cat > conftest.c <<\EOF
1647void zero (void *x)
1648{
a52d1562 1649 __builtin_memset (x, 0, 1000);
d555194c
UD
1650}
1651EOF
1652dnl
1653if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null]);
1654then
1655 libc_cv_gcc_builtin_memset=no
1656else
1657 libc_cv_gcc_builtin_memset=yes
1658fi
1659rm -f conftest* ])
1660if test "$libc_cv_gcc_builtin_memset" = yes ; then
1661 AC_DEFINE(HAVE_BUILTIN_MEMSET)
1662fi
1663
85dd1003
UD
1664AC_CACHE_CHECK(for redirection of built-in functions, libc_cv_gcc_builtin_redirection, [dnl
1665cat > conftest.c <<\EOF
1666extern char *strstr (const char *, const char *) __asm ("my_strstr");
1667char *foo (const char *a, const char *b)
1668{
1669 return __builtin_strstr (a, b);
1670}
1671EOF
1672dnl
1673if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "my_strstr" > /dev/null]);
1674then
1675 libc_cv_gcc_builtin_redirection=yes
1676else
1677 libc_cv_gcc_builtin_redirection=no
1678fi
1679rm -f conftest* ])
3ce1f295
UD
1680if test "$libc_cv_gcc_builtin_redirection" = no; then
1681 AC_MSG_ERROR([support for the symbol redirection needed])
85dd1003
UD
1682fi
1683
739d440d 1684dnl Check whether the compiler supports the __thread keyword.
3ce1f295
UD
1685AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
1686[cat > conftest.c <<\EOF
fbb18522
RM
1687__thread int a = 42;
1688EOF
3ce1f295
UD
1689if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
1690 libc_cv_gcc___thread=yes
739d440d
UD
1691else
1692 libc_cv_gcc___thread=no
1693fi
3ce1f295
UD
1694rm -f conftest*])
1695if test "$libc_cv_gcc___thread" = no; then
1696 AC_MSG_ERROR([support for the __thread keyword is required])
1697fi
739d440d 1698
3ce1f295
UD
1699dnl Check whether the compiler supports the tls_model attribute.
1700AC_CACHE_CHECK([for tls_model attribute], libc_cv_gcc_tls_model_attr, [dnl
1701cat > conftest.c <<\EOF
9b21e6bc
RM
1702extern __thread int a __attribute__((tls_model ("initial-exec")));
1703EOF
3ce1f295
UD
1704if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&AS_MESSAGE_LOG_FD]); then
1705 libc_cv_gcc_tls_model_attr=yes
1706else
1707 libc_cv_gcc_tls_model_attr=no
1708fi
1709rm -f conftest*])
1710if test "$libc_cv_gcc_tls_model_attr" = no; then
1711 AC_MSG_ERROR([support for the tls_model attribute is required])
9b21e6bc 1712fi
739d440d 1713
7998fa78
AS
1714dnl Determine how to disable generation of FMA instructions.
1715AC_CACHE_CHECK([for compiler option to disable generation of FMA instructions],
1716 libc_cv_cc_nofma, [dnl
1717libc_cv_cc_nofma=
1718for opt in -ffp-contract=off -mno-fused-madd; do
1719 LIBC_TRY_CC_OPTION([$opt], [libc_cv_cc_nofma=$opt; break])
1720done])
bef0b507 1721AC_SUBST(libc_cv_cc_nofma)
7998fa78 1722
2cf9ad57
RM
1723if test -n "$submachine"; then
1724 AC_CACHE_CHECK([for compiler option for CPU variant],
f7d82dc9 1725 libc_cv_cc_submachine, [dnl
2cf9ad57
RM
1726 libc_cv_cc_submachine=no
1727 for opt in "-march=$submachine" "-mcpu=$submachine"; do
40b601fb 1728 LIBC_TRY_CC_OPTION([$opt], [
2cf9ad57 1729 libc_cv_cc_submachine="$opt"
40b601fb 1730 break], [])
2cf9ad57
RM
1731 done])
1732 if test "x$libc_cv_cc_submachine" = xno; then
1733 AC_MSG_ERROR([${CC-cc} does not support $submachine])
1734 fi
1735fi
1736AC_SUBST(libc_cv_cc_submachine)
1737
85c2e611
AZ
1738AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \
1739__attribute__ ((__optimize__)), libc_cv_cc_loop_to_function, [dnl
1740cat > conftest.c <<EOF
1741void
1742__attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
1743foo (void) {}
1744EOF
1745libc_cv_cc_loop_to_function=no
1746if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c])
1747then
1748 libc_cv_cc_loop_to_function=yes
1749fi
1750rm -f conftest*])
1751if test $libc_cv_cc_loop_to_function = yes; then
1752 AC_DEFINE(HAVE_CC_INHIBIT_LOOP_TO_LIBCALL)
1753fi
1754AC_SUBST(libc_cv_cc_loop_to_function)
1755
c8f3e6db
UD
1756dnl Check whether we have the gd library available.
1757AC_MSG_CHECKING(for libgd)
6dab8688
UD
1758if test "$with_gd" != "no"; then
1759 old_CFLAGS="$CFLAGS"
1760 CFLAGS="$CFLAGS $libgd_include"
1761 old_LDFLAGS="$LDFLAGS"
1762 LDFLAGS="$LDFLAGS $libgd_ldflags"
1763 old_LIBS="$LIBS"
1764 LIBS="$LIBS -lgd -lpng -lz -lm"
1765 AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
1766 CFLAGS="$old_CFLAGS"
1767 LDFLAGS="$old_LDFLAGS"
1768 LIBS="$old_LIBS"
1769else
1770 LIBGD=no
1771fi
c8f3e6db
UD
1772AC_MSG_RESULT($LIBGD)
1773AC_SUBST(LIBGD)
3d558f4e 1774
2fff3d93
UD
1775# SELinux detection
1776if test x$with_selinux = xno ; then
1777 have_selinux=no;
1778else
1779 # See if we have the SELinux library
1780 AC_CHECK_LIB(selinux, is_selinux_enabled,
1781 have_selinux=yes, have_selinux=no)
49155d51 1782 if test x$with_selinux = xyes ; then
2fff3d93 1783 if test x$have_selinux = xno ; then
0699f766 1784 AC_MSG_ERROR([SELinux explicitly required, but SELinux library not found])
2fff3d93
UD
1785 fi
1786 fi
1787fi
1788# Check if we're building with SELinux support.
1789if test "x$have_selinux" = xyes; then
943db9eb 1790 AC_DEFINE(HAVE_SELINUX, 1, [SELinux support])
ec23b9be
UD
1791
1792 # See if we have the libaudit library
943db9eb 1793 AC_CHECK_LIB(audit, audit_log_user_avc_message,
77e8bddf 1794 have_libaudit=yes, have_libaudit=no)
ec23b9be 1795 if test "x$have_libaudit" = xyes; then
943db9eb 1796 AC_DEFINE(HAVE_LIBAUDIT, 1, [SELinux libaudit support])
ec23b9be
UD
1797 fi
1798 AC_SUBST(have_libaudit)
1f063dca
UD
1799
1800 # See if we have the libcap library
1801 AC_CHECK_LIB(cap, cap_init, have_libcap=yes, have_libcap=no)
1802 if test "x$have_libcap" = xyes; then
1803 AC_DEFINE(HAVE_LIBCAP, 1, [SELinux libcap support])
1804 fi
1805 AC_SUBST(have_libcap)
2fff3d93
UD
1806fi
1807AC_SUBST(have_selinux)
1808
8ed1e7d5
GK
1809dnl check for the size of 'long double'.
1810AC_CHECK_SIZEOF(long double, 0)
1811sizeof_long_double=$ac_cv_sizeof_long_double
1812AC_SUBST(sizeof_long_double)
1813
61653dfb
RM
1814CPPUNDEFS=
1815dnl Check for silly hacked compilers predefining _FORTIFY_SOURCE.
1816dnl Since we are building the implementations of the fortified functions here,
1817dnl having the macro defined interacts very badly.
1818AC_CACHE_CHECK([for _FORTIFY_SOURCE predefine], libc_cv_predef_fortify_source,
1819[AC_TRY_COMPILE([], [
1820#ifdef _FORTIFY_SOURCE
1821# error bogon
1822#endif],
1823 [libc_cv_predef_fortify_source=no],
1824 [libc_cv_predef_fortify_source=yes])])
1825if test $libc_cv_predef_fortify_source = yes; then
1826 CPPUNDEFS="${CPPUNDEFS:+$CPPUNDEFS }-U_FORTIFY_SOURCE"
1827fi
1828AC_SUBST(CPPUNDEFS)
1829
30b99d79
RM
1830dnl Check for silly hacked compilers inserting -fstack-protector.
1831dnl This breaks badly for the early startup code we compile, since
1832dnl the compiled code can refer to a magic machine-dependent location
1833dnl for the canary value before we have sufficient setup for that to
1834dnl work. It's also questionable to build all of libc with this flag
1835dnl even when you're doing that for most applications you build, since
1836dnl libc's code is so heavily-used and performance-sensitive. If we
1837dnl ever really want to make that work, it should be enabled explicitly
1838dnl in the libc build, not inherited from implicit compiler settings.
1839AC_CACHE_CHECK([whether $CC implicitly enables -fstack-protector],
1840 libc_cv_predef_stack_protector, [
1841AC_TRY_COMPILE([extern void foobar (char *);],
1842 [char large_array[2048]; foobar (large_array);], [
1843libc_undefs=`$NM -u conftest.o |
1844 LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
1845 2>&AS_MESSAGE_LOG_FD` || {
1846 AC_MSG_ERROR([confusing output from $NM -u])
1847}
1848echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
59f0c22e
JM
1849# On some architectures, there are architecture-specific undefined
1850# symbols (resolved by the linker), so filter out unknown symbols.
1851# This will fail to produce the correct result if the compiler
1852# defaults to -fstack-protector but this produces an undefined symbol
1853# other than __stack_chk_fail. However, compilers like that have not
1854# been encountered in practice.
1855libc_undefs=`echo "$libc_undefs" | egrep '^(foobar|__stack_chk_fail)$'`
30b99d79
RM
1856case "$libc_undefs" in
1857foobar) libc_cv_predef_stack_protector=no ;;
1858'__stack_chk_fail
1859foobar') libc_cv_predef_stack_protector=yes ;;
1860*) AC_MSG_ERROR([unexpected symbols in test: $libc_undefs]) ;;
1861esac],
1862 [AC_MSG_ERROR([test compilation failed])])
1863])
1864libc_extra_cflags=
1865if test $libc_cv_predef_stack_protector = yes; then
7ffa9423 1866 libc_extra_cflags="$libc_extra_cflags -fno-stack-protector"
30b99d79 1867fi
7ffa9423 1868libc_extra_cppflags=
30b99d79 1869
61b1ef6e
MF
1870# Some linkers on some architectures support __ehdr_start but with
1871# bugs. Make sure usage of it does not create relocations in the
1872# output (as the linker should resolve them all for us).
1873AC_CACHE_CHECK([whether the linker provides working __ehdr_start],
44c4e5d5
RM
1874 libc_cv_ehdr_start, [
1875old_CFLAGS="$CFLAGS"
1876old_LDFLAGS="$LDFLAGS"
1877old_LIBS="$LIBS"
1878CFLAGS="$CFLAGS -fPIC"
1879LDFLAGS="$LDFLAGS -nostdlib -nostartfiles -shared"
1880LIBS=
1881AC_LINK_IFELSE([AC_LANG_SOURCE([
61b1ef6e
MF
1882typedef struct {
1883 char foo;
1884 long val;
1885} Ehdr;
1886extern const Ehdr __ehdr_start __attribute__ ((visibility ("hidden")));
1887long ehdr (void) { return __ehdr_start.val; }
44c4e5d5 1888])],
61b1ef6e
MF
1889 [if $READELF -r conftest | fgrep __ehdr_start >/dev/null; then
1890 libc_cv_ehdr_start=broken
1891 else
1892 libc_cv_ehdr_start=yes
1893 fi], [libc_cv_ehdr_start=no])
44c4e5d5
RM
1894CFLAGS="$old_CFLAGS"
1895LDFLAGS="$old_LDFLAGS"
1896LIBS="$old_LIBS"
1897])
61b1ef6e 1898if test "$libc_cv_ehdr_start" = yes; then
44c4e5d5 1899 AC_DEFINE([HAVE_EHDR_START])
61b1ef6e
MF
1900elif test "$libc_cv_ehdr_start" = broken; then
1901 AC_MSG_WARN([linker is broken -- you should upgrade])
9fe7e787
RM
1902fi
1903
1904AC_CACHE_CHECK(for __builtin_trap with no external dependencies,
1905 libc_cv_builtin_trap, [dnl
1906libc_cv_builtin_trap=no
1907AC_TRY_COMPILE([], [__builtin_trap ()], [
1908libc_undefs=`$NM -u conftest.o |
1909 LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
1910 2>&AS_MESSAGE_LOG_FD` || {
1911 AC_MSG_ERROR([confusing output from $NM -u])
1912}
1913echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
1914if test -z "$libc_undefs"; then
1915 libc_cv_builtin_trap=yes
1916fi])])
1917if test $libc_cv_builtin_trap = yes; then
1918 AC_DEFINE([HAVE_BUILTIN_TRAP])
44c4e5d5
RM
1919fi
1920
c224a18a
RM
1921### End of automated tests.
1922### Now run sysdeps configure fragments.
1923
cb343854 1924# They also can set these variables.
591e1ffb 1925use_ldconfig=no
cb343854 1926ldd_rewrite_script=no
77259608 1927libc_cv_sysconfdir=$sysconfdir
4248b1b1 1928libc_cv_localstatedir=$localstatedir
74bd2300 1929libc_cv_gcc_unwind_find_fde=no
e2fd3cbe 1930libc_cv_idn=no
cb343854 1931
28f540f4 1932# Iterate over all the sysdep directories we will use, running their
09055553 1933# configure fragments.
28f540f4 1934for dir in $sysnames; do
57ba7bb4
UD
1935 case $dir in
1936 /*) dest=$dir ;;
1937 *) dest=$srcdir/$dir ;;
1938 esac
1939 if test -r $dest/configure; then
d1149385 1940 AC_MSG_RESULT(running configure fragment for $dir)
57ba7bb4 1941 . $dest/configure
28f540f4 1942 fi
28f540f4
RM
1943done
1944
7ffa9423
AZ
1945AC_SUBST(libc_extra_cflags)
1946AC_SUBST(libc_extra_cppflags)
1947
74bd2300
UD
1948if test x$libc_cv_gcc_unwind_find_fde = xyes; then
1949 AC_DEFINE(EXPORT_UNWIND_FIND_FDE)
1950fi
1951AC_SUBST(libc_cv_gcc_unwind_find_fde)
1952
6e6249d0
RM
1953# A sysdeps configure fragment can reset this if IFUNC is not actually
1954# usable even though the assembler knows how to generate the symbol type.
1955if test x"$libc_cv_ld_gnu_indirect_function" = xyes; then
1956 AC_DEFINE(HAVE_IFUNC)
1957fi
1958
3cc3ef96
RM
1959# This is far from the AC_ARG_ENABLE that sets it so that a sysdeps
1960# configure fragment can override the value to prevent this AC_DEFINE.
1961AC_SUBST(use_nscd)
1962if test "x$use_nscd" != xno; then
1963 AC_DEFINE([USE_NSCD])
1964fi
c53d909c
RM
1965if test "x$build_nscd" = xdefault; then
1966 build_nscd=$use_nscd
1967fi
3cc3ef96 1968
a53bad16
UD
1969# Test for old glibc 2.0.x headers so that they can be removed properly
1970# Search only in includedir.
1971AC_MSG_CHECKING(for old glibc 2.0.x headers)
350eb336 1972if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
a53bad16
UD
1973then
1974 old_glibc_headers=yes
1975else
1976 old_glibc_headers=no
1977fi
1978AC_MSG_RESULT($old_glibc_headers)
1979if test ${old_glibc_headers} = yes; then
1980 AC_MSG_WARN(*** During \"make install\" old headers from glibc 2.0.x will)
1981 AC_MSG_WARN(*** be removed.)
1982fi
b195f6bc 1983AC_SUBST(old_glibc_headers)
26b4d766 1984
84384f5b 1985AC_SUBST(libc_cv_slibdir)
aaa8cb4b 1986AC_SUBST(libc_cv_rtlddir)
a1d84548 1987AC_SUBST(libc_cv_localedir)
77259608 1988AC_SUBST(libc_cv_sysconfdir)
4248b1b1 1989AC_SUBST(libc_cv_localstatedir)
1ef32c3d 1990AC_SUBST(libc_cv_rootsbindir)
bcd5f356 1991AC_SUBST(libc_cv_forced_unwind)
1ef32c3d 1992
f57f8055
RM
1993if test x$use_ldconfig = xyes; then
1994 AC_DEFINE(USE_LDCONFIG)
1995fi
591e1ffb 1996AC_SUBST(use_ldconfig)
cb343854 1997AC_SUBST(ldd_rewrite_script)
84384f5b 1998
650425ce 1999AC_SUBST(static)
ff3d7ed3 2000AC_SUBST(shared)
a334319f 2001
ff886b82
UD
2002AC_CACHE_CHECK([whether -fPIC is default], libc_cv_pic_default,
2003[libc_cv_pic_default=yes
cc3fa755 2004cat > conftest.c <<EOF
9756dfe1 2005#if defined __PIC__ || defined __pic__ || defined PIC || defined pic
cc3fa755
UD
2006# error PIC is default.
2007#endif
2008EOF
0b4ee387 2009if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
ff886b82 2010 libc_cv_pic_default=no
cc3fa755
UD
2011fi
2012rm -f conftest.*])
ff886b82 2013AC_SUBST(libc_cv_pic_default)
cc3fa755 2014
ff3d7ed3 2015AC_SUBST(profile)
5107cf1d 2016AC_SUBST(static_nss)
ff3d7ed3 2017
edf5b2d7
UD
2018AC_SUBST(DEFINES)
2019
cb8a6dbd 2020dnl See sysdeps/mach/configure.ac for this variable.
61c83c3f
RM
2021AC_SUBST(mach_interface_list)
2022
ee74a442
UD
2023VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
2024RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
df4ef2ab 2025AC_SUBST(VERSION)
ee74a442 2026AC_SUBST(RELEASE)
df4ef2ab 2027
728e272a 2028AC_CONFIG_FILES([config.make Makefile])
c118d634 2029AC_CONFIG_COMMANDS([default],[[
737547be
UD
2030case $CONFIG_FILES in *config.make*)
2031echo "$config_vars" >> config.make;;
2032esac
c118d634
RM
2033test -d bits || mkdir bits]],[[config_vars='$config_vars']])
2034AC_OUTPUT