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