1 dnl aclocal.m4 generated automatically by aclocal 1.4-p5
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
14 dnl Initialize configure bits.
17 AC_DEFUN(GLIBCPP_CONFIGURE, [
18 dnl Default to --enable-multilib (this is also passed by default
19 dnl from the ubercommon-top-level configure)
20 AC_ARG_ENABLE(multilib,
21 [ --enable-multilib build hella library versions (default)],
22 [case "${enableval}" in
25 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
26 esac], [multilib=yes])dnl
28 # When building with srcdir == objdir, links to the source files will
29 # be created in directories within the target_subdir. We have to
30 # adjust toplevel_srcdir accordingly, so that configure finds
31 # install-sh and other auxiliary files that live in the top-level
33 if test "${srcdir}" = "."; then
34 if test -z "${with_target_subdir}"; then
37 if test "${with_target_subdir}" != "."; then
38 toprel="${with_multisrctop}../.."
40 toprel="${with_multisrctop}.."
46 AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
47 toplevel_srcdir=\${top_srcdir}/$toprel
48 AC_SUBST(toplevel_srcdir)
50 #possibly test for the presence of the compiler sources here?
52 # Export build and source directories.
53 # These need to be absolute paths, yet at the same time need to
54 # canonicalize only relative paths, because then amd will not unmount
55 # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
56 glibcpp_builddir=`${PWDCMD-pwd}`
58 [\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;;
59 *) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
61 AC_SUBST(glibcpp_builddir)
62 AC_SUBST(glibcpp_srcdir)
64 dnl This is here just to satisfy automake.
65 ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
68 # Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.5x, can also
69 # be 'cp -p' if linking isn't available. Uncomment the next line to
70 # force a particular method.
71 #ac_cv_prog_LN_S='cp -p'
74 # We use these options to decide which functions to include.
75 AC_ARG_WITH(target-subdir,
76 [ --with-target-subdir=SUBDIR
77 configuring in a subdirectory])
78 AC_ARG_WITH(cross-host,
79 [ --with-cross-host=HOST configuring with a cross compiler])
81 glibcpp_basedir=$srcdir/$toprel/$1/libstdc++-v3
82 AC_SUBST(glibcpp_basedir)
84 # Never versions of autoconf add an underscore to these functions.
85 # Prevent future problems ...
86 ifdef([AC_PROG_CC_G],[],[define([AC_PROG_CC_G],defn([_AC_PROG_CC_G]))])
87 ifdef([AC_PROG_CC_GNU],[],[define([AC_PROG_CC_GNU],defn([_AC_PROG_CC_GNU]))])
88 ifdef([AC_PROG_CXX_G],[],[define([AC_PROG_CXX_G],defn([_AC_PROG_CXX_G]))])
89 ifdef([AC_PROG_CXX_GNU],[],[define([AC_PROG_CXX_GNU],defn([_AC_PROG_CXX_GNU]))])
92 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
93 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
94 # are probably using a cross compiler, which will not be able to fully
95 # link an executable. This is addressed in later versions of autoconf.
97 AC_DEFUN(LIB_AC_PROG_CC,
98 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
99 dnl Fool anybody using AC_PROG_CC.
100 AC_PROVIDE([AC_PROG_CC])
101 AC_CHECK_PROG(CC, gcc, gcc)
102 if test -z "$CC"; then
103 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
104 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
109 if test $ac_cv_prog_gcc = yes; then
111 dnl Check whether -g works, even if CFLAGS is set, in case the package
112 dnl plays around with CFLAGS (such as to build both debugging and
113 dnl normal versions of a library), tasteless as that idea is.
114 ac_test_CFLAGS="${CFLAGS+set}"
115 ac_save_CFLAGS="$CFLAGS"
118 if test "$ac_test_CFLAGS" = set; then
119 CFLAGS="$ac_save_CFLAGS"
120 elif test $ac_cv_prog_cc_g = yes; then
127 test "${CFLAGS+set}" = set || CFLAGS="-g"
133 # Likewise for AC_PROG_CXX. We can't just call it directly because g++
134 # will try to link in libstdc++.
135 AC_DEFUN(LIB_AC_PROG_CXX,
136 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
137 dnl Fool anybody using AC_PROG_CXX.
138 AC_PROVIDE([AC_PROG_CXX])
139 # Use glibcpp_CXX so that we do not cause CXX to be cached with the
140 # flags that come in CXX while configuring libstdc++. They're different
141 # from those used for all other target libraries. If CXX is set in
142 # the environment, respect that here.
144 AC_CHECK_PROGS(glibcpp_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
145 AC_SUBST(glibcpp_CXX)
147 test -z "$glibcpp_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
151 if test $ac_cv_prog_gxx = yes; then
153 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
154 dnl plays around with CXXFLAGS (such as to build both debugging and
155 dnl normal versions of a library), tasteless as that idea is.
156 ac_test_CXXFLAGS="${CXXFLAGS+set}"
157 ac_save_CXXFLAGS="$CXXFLAGS"
160 if test "$ac_test_CXXFLAGS" = set; then
161 CXXFLAGS="$ac_save_CXXFLAGS"
162 elif test $ac_cv_prog_cxx_g = yes; then
169 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
175 # For some reason, gettext needs this.
178 AC_CHECK_TOOL(AS, as)
179 AC_CHECK_TOOL(AR, ar)
180 AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
185 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
186 # at least currently, we never actually build a program, so we never
187 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
188 # fails, because we are probably configuring with a cross compiler
189 # which can't create executables. So we include AC_EXEEXT to keep
190 # automake happy, but we don't execute it, since we don't care about
193 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
194 # to nothing, so nothing would remain between `then' and `fi' if it
195 # were not for the `:' below.
200 case [$]{glibcpp_basedir} in
201 /* | [A-Za-z]:[\\/]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
202 *) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
205 # Find platform-specific directories containing configuration info. In
206 # addition to possibly modifying the same flags, it also sets up symlinks.
213 dnl Check to see if g++ can compile this library, and if so, if any version-
214 dnl specific precautions need to be taken.
216 dnl GLIBCPP_CHECK_COMPILER_VERSION
217 AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
218 if test ! -f stamp-sanity-compiler; then
219 AC_MSG_CHECKING([for g++ that will successfully compile libstdc++-v3])
226 ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to GCC 3.0 or above]))
228 AC_MSG_RESULT($gpp_satisfactory)
229 touch stamp-sanity-compiler
235 dnl Tests for newer compiler features, or features that are present in newer
236 dnl compiler versions but not older compiler versions still in use, should
239 dnl Define WERROR='-Werror' if requested and possible; g++'s that lack the
240 dnl new inlining code or the new system_header pragma will die on -Werror.
241 dnl Leave it out by default and use maint-mode to use it.
243 dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
244 dnl compiler supports it and the user has not requested debug mode.
246 dnl GLIBCPP_CHECK_COMPILER_FEATURES
247 AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
248 # All these tests are for C++; save the language and the compiler flags.
249 # The CXXFLAGS thing is suspicious, but based on similar bits previously
250 # found in GLIBCPP_CONFIGURE.
253 ac_test_CXXFLAGS="${CXXFLAGS+set}"
254 ac_save_CXXFLAGS="$CXXFLAGS"
256 # Check for maintainer-mode bits.
257 if test x"$USE_MAINTAINER_MODE" = xno; then
263 # Check for -ffunction-sections -fdata-sections
264 AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
265 CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
266 AC_TRY_COMPILE(, [int foo;
267 ], [ac_fdsections=yes], [ac_fdsections=no])
268 if test "$ac_test_CXXFLAGS" = set; then
269 CXXFLAGS="$ac_save_CXXFLAGS"
271 # this is the suspicious part
274 if test x"$ac_fdsections" = x"yes" &&
275 test x"$enable_debug" = x"no"; then
276 SECTION_FLAGS='-ffunction-sections -fdata-sections'
278 AC_MSG_RESULT($ac_fdsections)
282 AC_SUBST(SECTION_FLAGS)
287 dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
288 dnl the native linker is in use, all variables will be defined to something
289 dnl safe (like an empty string).
291 dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible.
292 dnl Define OPT_LDFLAGS='-Wl,-O1' if possible.
293 dnl Define LD, with_gnu_ld, and (possibly) glibcpp_gnu_ld_version as
294 dnl side-effects of testing.
296 dnl GLIBCPP_CHECK_LINKER_FEATURES
297 AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
298 # If we're not using GNU ld, then there's no point in even trying these
299 # tests. Check for that first. We should have already tested for gld
300 # by now (in libtool), but require it now just to be safe...
301 test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
302 test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
303 AC_REQUIRE([AC_PROG_LD])
305 # The name set by libtool depends on the version of libtool. Shame on us
306 # for depending on an impl detail, but c'est la vie. Older versions used
307 # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
308 # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
309 # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
310 # set (hence we're using an older libtool), then set it.
311 if test x${with_gnu_ld+set} != xset; then
312 if test x${ac_cv_prog_gnu_ld+set} != xset; then
313 # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
316 with_gnu_ld=$ac_cv_prog_gnu_ld
320 # Start by getting the version number. I think the libtool test already
321 # does some of this, but throws away the result.
323 ldver=`$LD --version 2>/dev/null | head -1 | \
324 sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
326 glibcpp_gnu_ld_version=`echo $ldver | \
327 $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
330 if test "$with_gnu_ld" = "notbroken"; then
331 # GNU ld it is! Joy and bunny rabbits!
333 # All these tests are for C++; save the language and the compiler flags.
334 # Need to do this so that g++ won't try to link in libstdc++
335 ac_test_CFLAGS="${CFLAGS+set}"
336 ac_save_CFLAGS="$CFLAGS"
337 CFLAGS='-x c++ -Wl,--gc-sections'
339 # Check for -Wl,--gc-sections
340 # XXX This test is broken at the moment, as symbols required for
341 # linking are now in libsupc++ (not built yet.....). In addition,
342 # this test has cored on solaris in the past. In addition,
343 # --gc-sections doesn't really work at the moment (keeps on discarding
344 # used sections, first .eh_frame and now some of the glibc sections for
345 # iconv). Bzzzzt. Thanks for playing, maybe next time.
346 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
354 ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
355 if test "$ac_test_CFLAGS" = set; then
356 CFLAGS="$ac_save_CFLAGS"
358 # this is the suspicious part
361 if test "$ac_sectionLDflags" = "yes"; then
362 SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
364 AC_MSG_RESULT($ac_sectionLDflags)
367 # Set linker optimization flags.
368 if test x"$with_gnu_ld" = x"yes" && test x"$enable_debug" = x"no"; then
369 OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
372 AC_SUBST(SECTION_LDFLAGS)
373 AC_SUBST(OPT_LDFLAGS)
378 dnl Check to see if the (math function) argument passed is
379 dnl declared when using the c++ compiler
380 dnl ASSUMES argument is a math function with ONE parameter
382 dnl GLIBCPP_CHECK_MATH_DECL_1
383 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_1, [
384 AC_MSG_CHECKING([for $1 declaration])
385 if test x${glibcpp_cv_func_$1_use+set} != xset; then
386 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
389 AC_TRY_COMPILE([#include <math.h>
395 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
399 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
403 dnl Check to see if the (math function) argument passed is
404 dnl 1) declared when using the c++ compiler
405 dnl 2) has "C" linkage
406 dnl 3) if not, see if 1) and 2) for argument prepended with '_'
408 dnl Define HAVE_CARGF etc if "cargf" is declared and links
410 dnl argument 1 is name of function to check
412 dnl ASSUMES argument is a math function with ONE parameter
414 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1
415 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
416 GLIBCPP_CHECK_MATH_DECL_1($1)
417 if test x$glibcpp_cv_func_$1_use = x"yes"; then
420 GLIBCPP_CHECK_MATH_DECL_1(_$1)
421 if test x$glibcpp_cv_func__$1_use = x"yes"; then
429 dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
430 dnl of functions at once. It's an all-or-nothing check -- either
431 dnl HAVE_XYZ is defined for each of the functions, or for none of them.
432 dnl Doing it this way saves significant configure time.
433 AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
434 AC_MSG_CHECKING([for $1 functions])
435 AC_CACHE_VAL(glibcpp_cv_func_$2_use, [
438 AC_TRY_COMPILE([#include <math.h>],
439 [ `for x in $3; do echo "$x (0);"; done` ],
440 [glibcpp_cv_func_$2_use=yes],
441 [glibcpp_cv_func_$2_use=no])
443 AC_MSG_RESULT($glibcpp_cv_func_$2_use)
444 if test x$glibcpp_cv_func_$2_use = x"yes"; then
450 dnl Check to see if the (math function) argument passed is
451 dnl declared when using the c++ compiler
452 dnl ASSUMES argument is a math function with TWO parameters
454 dnl GLIBCPP_CHECK_MATH_DECL_2
455 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_2, [
456 AC_MSG_CHECKING([for $1 declaration])
457 if test x${glibcpp_cv_func_$1_use+set} != xset; then
458 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
461 AC_TRY_COMPILE([#include <math.h>],
463 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
467 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
471 dnl Check to see if the (math function) argument passed is
472 dnl 1) declared when using the c++ compiler
473 dnl 2) has "C" linkage
475 dnl Define HAVE_CARGF etc if "cargf" is declared and links
477 dnl argument 1 is name of function to check
479 dnl ASSUMES argument is a math function with TWO parameters
481 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2
482 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
483 GLIBCPP_CHECK_MATH_DECL_2($1)
484 if test x$glibcpp_cv_func_$1_use = x"yes"; then
487 GLIBCPP_CHECK_MATH_DECL_2(_$1)
488 if test x$glibcpp_cv_func__$1_use = x"yes"; then
496 dnl Check to see if the (math function) argument passed is
497 dnl declared when using the c++ compiler
498 dnl ASSUMES argument is a math function with THREE parameters
500 dnl GLIBCPP_CHECK_MATH_DECL_3
501 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_3, [
502 AC_MSG_CHECKING([for $1 declaration])
503 if test x${glibcpp_cv_func_$1_use+set} != xset; then
504 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
507 AC_TRY_COMPILE([#include <math.h>],
509 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
513 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
517 dnl Check to see if the (math function) argument passed is
518 dnl 1) declared when using the c++ compiler
519 dnl 2) has "C" linkage
521 dnl Define HAVE_CARGF etc if "cargf" is declared and links
523 dnl argument 1 is name of function to check
525 dnl ASSUMES argument is a math function with THREE parameters
527 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3
528 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
529 GLIBCPP_CHECK_MATH_DECL_3($1)
530 if test x$glibcpp_cv_func_$1_use = x"yes"; then
533 GLIBCPP_CHECK_MATH_DECL_3(_$1)
534 if test x$glibcpp_cv_func__$1_use = x"yes"; then
542 dnl Check to see if the (stdlib function) argument passed is
543 dnl 1) declared when using the c++ compiler
544 dnl 2) has "C" linkage
546 dnl argument 1 is name of function to check
548 dnl ASSUMES argument is a math function with TWO parameters
550 dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2
551 AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
552 AC_MSG_CHECKING([for $1 declaration])
553 if test x${glibcpp_cv_func_$1_use+set} != xset; then
554 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
557 AC_TRY_COMPILE([#include <stdlib.h>],
559 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
563 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
564 if test x$glibcpp_cv_func_$1_use = x"yes"; then
571 dnl Check to see if the (stdlib function) argument passed is
572 dnl 1) declared when using the c++ compiler
573 dnl 2) has "C" linkage
575 dnl argument 1 is name of function to check
577 dnl ASSUMES argument is a function with THREE parameters
579 dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3
580 AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3, [
581 AC_MSG_CHECKING([for $1 declaration])
582 if test x${glibcpp_cv_func_$1_use+set} != xset; then
583 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
586 AC_TRY_COMPILE([#include <stdlib.h>],
588 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
592 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
593 if test x$glibcpp_cv_func_$1_use = x"yes"; then
600 dnl Because the builtins are picky picky picky about the arguments they take,
601 dnl do an explict linkage tests here.
602 dnl Check to see if the (math function) argument passed is
603 dnl 1) declared when using the c++ compiler
604 dnl 2) has "C" linkage
606 dnl Define HAVE_CARGF etc if "cargf" is declared and links
608 dnl argument 1 is name of function to check
610 dnl ASSUMES argument is a math function with ONE parameter
612 dnl GLIBCPP_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
613 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
614 AC_MSG_CHECKING([for $1 declaration])
615 if test x${glibcpp_cv_func_$1_use+set} != xset; then
616 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
619 AC_TRY_COMPILE([#include <math.h>],
621 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
625 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
626 if test x$glibcpp_cv_func_$1_use = x"yes"; then
627 AC_MSG_CHECKING([for $1 linkage])
628 if test x${glibcpp_cv_func_$1_link+set} != xset; then
629 AC_CACHE_VAL(glibcpp_cv_func_$1_link, [
630 AC_TRY_LINK([#include <math.h>],
632 [glibcpp_cv_func_$1_link=yes], [glibcpp_cv_func_$1_link=no])
635 AC_MSG_RESULT($glibcpp_cv_func_$1_link)
636 if test x$glibcpp_cv_func_$1_link = x"yes"; then
637 ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
638 AC_DEFINE_UNQUOTED(${ac_tr_func})
645 dnl Check to see what builtin math functions are supported
647 dnl check for __builtin_abs
648 dnl check for __builtin_fabsf
649 dnl check for __builtin_fabs
650 dnl check for __builtin_fabl
651 dnl check for __builtin_labs
652 dnl check for __builtin_sqrtf
653 dnl check for __builtin_sqrtl
654 dnl check for __builtin_sqrt
655 dnl check for __builtin_sinf
656 dnl check for __builtin_sin
657 dnl check for __builtin_sinl
658 dnl check for __builtin_cosf
659 dnl check for __builtin_cos
660 dnl check for __builtin_cosl
662 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
663 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
664 dnl Test for builtin math functions.
665 dnl These are made in gcc/c-common.c
666 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
667 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
668 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
669 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
670 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
672 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
673 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt)
674 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
676 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
677 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
678 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
680 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
681 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
682 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
684 dnl There is, without a doubt, a more elegant way to have these
685 dnl names exported so that they won't be stripped out of acconfig.h by
686 dnl autoheader. I leave this as an exercise to somebody less frustrated
687 dnl than I.... please email the libstdc++ list if you can figure out a
688 dnl more elegant approach (see autoconf/acgen.m4 and specifically
689 dnl AC_CHECK_FUNC for things to steal.)
691 if test x$dummyvar = x"yes"; then
692 AC_DEFINE(HAVE___BUILTIN_ABS)
693 AC_DEFINE(HAVE___BUILTIN_LABS)
694 AC_DEFINE(HAVE___BUILTIN_COS)
695 AC_DEFINE(HAVE___BUILTIN_COSF)
696 AC_DEFINE(HAVE___BUILTIN_COSL)
697 AC_DEFINE(HAVE___BUILTIN_FABS)
698 AC_DEFINE(HAVE___BUILTIN_FABSF)
699 AC_DEFINE(HAVE___BUILTIN_FABSL)
700 AC_DEFINE(HAVE___BUILTIN_SIN)
701 AC_DEFINE(HAVE___BUILTIN_SINF)
702 AC_DEFINE(HAVE___BUILTIN_SINL)
703 AC_DEFINE(HAVE___BUILTIN_SQRT)
704 AC_DEFINE(HAVE___BUILTIN_SQRTF)
705 AC_DEFINE(HAVE___BUILTIN_SQRTL)
711 dnl Check to see what the underlying c library
712 dnl These checks need to do two things:
713 dnl 1) make sure the name is declared when using the c++ compiler
714 dnl 2) make sure the name has "C" linkage
715 dnl This might seem like overkill but experience has shown that it's not...
717 dnl Define HAVE_STRTOLD if "strtold" is declared and links
718 dnl Define HAVE_STRTOF if "strtof" is declared and links
719 dnl Define HAVE_DRAND48 if "drand48" is declared and links
721 dnl GLIBCPP_CHECK_STDLIB_SUPPORT
722 AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
723 ac_test_CXXFLAGS="${CXXFLAGS+set}"
724 ac_save_CXXFLAGS="$CXXFLAGS"
725 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
727 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
728 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)
729 AC_CHECK_FUNCS(drand48)
731 CXXFLAGS="$ac_save_CXXFLAGS"
736 dnl Check to see what the underlying c library or math library is like.
737 dnl These checks need to do two things:
738 dnl 1) make sure the name is declared when using the c++ compiler
739 dnl 2) make sure the name has "C" linkage
740 dnl This might seem like overkill but experience has shown that it's not...
742 dnl Define HAVE_CARGF etc if "cargf" is found.
744 dnl GLIBCPP_CHECK_MATH_SUPPORT
745 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
746 ac_test_CXXFLAGS="${CXXFLAGS+set}"
747 ac_save_CXXFLAGS="$CXXFLAGS"
748 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
751 AC_CHECK_LIB(m, sin, libm="-lm")
755 dnl Check to see if certain C math functions exist.
756 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
757 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
758 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
759 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
760 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
761 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
762 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
763 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypot)
765 dnl Check to see if basic C math functions have float versions.
766 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
771 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
774 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expf)
775 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
776 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
777 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
778 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
779 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
780 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
781 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf)
782 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
783 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
784 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
785 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
786 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
787 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
788 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
789 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
791 dnl Check to see if basic C math functions have long double versions.
792 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
797 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
800 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
801 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
802 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
803 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
804 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
805 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
806 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
807 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
808 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl)
809 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
810 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
811 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
812 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
813 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
814 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
815 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
816 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
818 dnl Some runtimes have these functions with a preceding underscore. Please
819 dnl keep this sync'd with the one above. And if you add any new symbol,
820 dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
821 dnl Check to see if certain C math functions exist.
823 dnl Check to see if basic C math functions have float versions.
824 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
826 _acosf _asinf _atanf \
828 _coshf _sinhf _tanhf)
829 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
833 dnl Check to see if basic C math functions have long double versions.
834 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
836 _acosl _asinl _atanl \
838 _coshl _sinhl _tanhl)
839 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
844 CXXFLAGS="$ac_save_CXXFLAGS"
849 dnl Check to see if there is native support for complex
851 dnl Don't compile bits in math/* if native support exits.
853 dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
855 dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
856 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
857 dnl Check for complex versions of math functions of platform.
858 AC_CHECK_LIB(m, main)
859 AC_REPLACE_MATHFUNCS(nan copysignf)
861 dnl For __signbit to signbit conversions.
862 AC_CHECK_FUNCS([__signbit], , [LIBMATHOBJS="$LIBMATHOBJS signbit.lo"])
863 AC_CHECK_FUNCS([__signbitf], , [LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"])
865 dnl Compile the long double complex functions only if the function
866 dnl provides the non-complex long double functions that are needed.
867 dnl Currently this includes copysignl, which should be
868 dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
869 if test x$ac_cv_func_copysignl = x"yes"; then
870 AC_CHECK_FUNCS([__signbitl], , [LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"])
873 AC_SUBST(LIBMATHOBJS)
877 dnl Check to see what architecture and operating system we are compiling
878 dnl for. Also, if architecture- or OS-specific flags are required for
879 dnl compilation, pick them up here.
881 dnl GLIBCPP_CHECK_TARGET
882 AC_DEFUN(GLIBCPP_CHECK_TARGET, [
883 . [$]{glibcpp_basedir}/configure.target
884 AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
885 AC_MSG_RESULT(OS config directory is $os_include_dir)
890 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
891 dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
892 dnl must have been previously checked.)
894 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
895 dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
897 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
898 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
900 dnl Test wchar.h for mbstate_t, which is needed for char_traits and
901 dnl others even if wchar_t support is not on.
902 AC_MSG_CHECKING([for mbstate_t])
903 AC_TRY_COMPILE([#include <wchar.h>],
904 [mbstate_t teststate;],
905 have_mbstate_t=yes, have_mbstate_t=no)
906 AC_MSG_RESULT($have_mbstate_t)
907 if test x"$have_mbstate_t" = xyes; then
908 AC_DEFINE(HAVE_MBSTATE_T)
911 dnl Sanity check for existence of ISO C99 headers for extended encoding.
912 AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
913 AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
915 dnl Only continue checking if the ISO C99 headers exist and support is on.
916 if test x"$ac_has_wchar_h" = xyes &&
917 test x"$ac_has_wctype_h" = xyes &&
918 test x"$enable_c_mbchar" != xno; then
920 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
921 dnl numeric_limits can instantiate type_traits<wchar_t>
922 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
923 AC_TRY_COMPILE([#include <wchar.h>],
924 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
925 has_wchar_minmax=yes, has_wchar_minmax=no)
926 AC_MSG_RESULT($has_wchar_minmax)
928 dnl Test wchar.h for WEOF, which is what we use to determine whether
929 dnl to specialize for char_traits<wchar_t> or not.
930 AC_MSG_CHECKING([for WEOF])
933 #include <stddef.h>],
935 has_weof=yes, has_weof=no)
936 AC_MSG_RESULT($has_weof)
938 dnl Tests for wide character functions used in char_traits<wchar_t>.
940 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
943 dnl Checks for names injected into std:: by the c_std headers.
944 AC_CHECK_FUNCS(btowc wctob fgetwc fgetwc fgetws fputwc fputws fwide \
945 fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
946 vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
947 mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
948 wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
949 wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr,, \
952 AC_MSG_CHECKING([for ISO C99 wchar_t support])
953 if test x"$has_weof" = xyes &&
954 test x"$has_wchar_minmax" = xyes &&
955 test x"$ac_wfuncs" = xyes; then
956 ac_isoC99_wchar_t=yes
960 AC_MSG_RESULT($ac_isoC99_wchar_t)
962 dnl Use iconv for wchar_t to char conversions. As such, check for
963 dnl X/Open Portability Guide, version 2 features (XPG2).
964 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
965 AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
967 dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
968 AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
970 LIBS="$LIBS $libiconv"
972 AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
973 ac_XPG2funcs=yes, ac_XPG2funcs=no)
977 AC_MSG_CHECKING([for XPG2 wchar_t support])
978 if test x"$ac_has_iconv_h" = xyes &&
979 test x"$ac_has_langinfo_h" = xyes &&
980 test x"$ac_XPG2funcs" = xyes; then
985 AC_MSG_RESULT($ac_XPG2_wchar_t)
987 dnl At the moment, only enable wchar_t specializations if all the
988 dnl above support is present.
989 AC_MSG_CHECKING([for enabled wchar_t specializations])
990 if test x"$ac_isoC99_wchar_t" = xyes &&
991 test x"$ac_XPG2_wchar_t" = xyes; then
992 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
998 dnl Wide characters disabled by the user.
999 AC_MSG_WARN([wchar_t support disabled.])
1005 dnl Check for special debugging mode; not for production use.
1007 dnl GLIBCPP_ENABLE_DEBUG
1008 dnl --enable-debug sets '-ggdb3 -O0'.
1009 dnl --disable-debug sets '-g' and whatever optimization options the
1010 dnl compiler can handle.
1011 dnl + --enable-maintainer-mode automatically defaults this to on.
1012 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
1013 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
1014 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1015 dnl defaults to `no'.
1016 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
1017 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
1018 AC_ARG_ENABLE(debug,
1019 changequote(<<, >>)dnl
1020 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
1021 changequote([, ])dnl
1022 [case "${enableval}" in
1023 yes) enable_debug=yes ;;
1024 no) enable_debug=no ;;
1025 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
1027 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
1029 dnl Option parsed, now set things appropriately
1030 case "${enable_debug}" in
1032 DEBUG_FLAGS='-O0 -ggdb3'
1038 AC_SUBST(DEBUG_FLAGS)
1043 dnl Check for "unusual" flags to pass to the compiler while building.
1045 dnl GLIBCPP_ENABLE_CXX_FLAGS
1046 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
1047 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
1048 dnl Somehow this same set of flags must be passed when [re]building
1050 dnl --disable-cxx-flags passes nothing.
1051 dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
1052 dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
1053 dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
1054 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
1055 dnl If "default flags" is an empty string (or "none"), the effect is
1056 dnl the same as --disable or --enable=no.
1057 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
1058 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1059 AC_ARG_ENABLE(cxx-flags,
1060 changequote(<<, >>)dnl
1061 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
1062 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
1063 changequote([, ])dnl
1064 [case "x$enableval" in
1066 AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
1068 enable_cxx_flags='' ;;
1070 enable_cxx_flags="$enableval" ;;
1072 enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
1074 dnl Thinko on my part during design. This kludge is the workaround.
1075 if test "$enable_cxx_flags" = "none"; then
1076 enable_cxx_flags='';
1079 dnl Run through flags (either default or command-line) and set anything
1080 dnl extra (e.g., #defines) that must accompany particular g++ options.
1081 if test -n "$enable_cxx_flags"; then
1082 for f in $enable_cxx_flags; do
1086 *) # and we're trying to pass /what/ exactly?
1087 AC_MSG_ERROR([compiler flags start with a -]) ;;
1091 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1092 AC_SUBST(EXTRA_CXX_FLAGS)
1097 dnl Check for which locale library to use: gnu or generic.
1099 dnl GLIBCPP_ENABLE_CLOCALE
1100 dnl --enable-clocale=gnu sets config/locale/c_locale_gnu.cc and friends
1101 dnl --enable-clocale=generic sets config/locale/c_locale_generic.cc and friends
1103 dnl default is generic
1105 AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
1106 AC_MSG_CHECKING([for clocale to use])
1107 AC_ARG_ENABLE(clocale,
1108 [ --enable-clocale enable model for target locale package.
1109 --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
1111 if test x$enable_clocale = xno; then
1116 enable_clocale_flag=$enable_clocale
1118 dnl Probe for locale support if no specific model is specified.
1119 dnl Default to "generic"
1120 if test x$enable_clocale_flag = xno; then
1121 case x${target_os} in
1123 AC_EGREP_CPP([_GLIBCPP_ok], [
1124 #include <features.h>
1125 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1128 ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
1130 # Test for bugs early in glibc-2.2.x series
1131 if test x$enable_clocale_flag = xgnu; then
1133 #define _GNU_SOURCE 1
1137 const char __one[] = "Äuglein Augmen";
1138 const char __two[] = "Äuglein";
1143 loc = __newlocale(1 << LC_ALL, "de_DE", 0);
1144 loc_dup = __duplocale(loc);
1145 i = __strcoll_l(__one, __two, loc);
1146 j = __strcoll_l(__one, __two, loc_dup);
1150 [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
1151 [enable_clocale_flag=generic])
1154 # ... at some point put __strxfrm_l tests in as well.
1157 enable_clocale_flag=generic
1162 dnl Deal with gettext issues.
1164 [ --enable-nls use Native Language Support (default)],
1168 dnl Set configure bits for specified locale package
1169 case x${enable_clocale_flag} in
1171 AC_MSG_RESULT(generic)
1173 CLOCALE_H=config/locale/generic/c_locale.h
1174 CLOCALE_CC=config/locale/generic/c_locale.cc
1175 CCODECVT_H=config/locale/generic/codecvt_specializations.h
1176 CCOLLATE_CC=config/locale/generic/collate_members.cc
1177 CCTYPE_CC=config/locale/generic/ctype_members.cc
1178 CMESSAGES_H=config/locale/generic/messages_members.h
1179 CMESSAGES_CC=config/locale/generic/messages_members.cc
1180 CMONEY_CC=config/locale/generic/monetary_members.cc
1181 CNUMERIC_CC=config/locale/generic/numeric_members.cc
1182 CTIME_CC=config/locale/generic/time_members.cc
1187 # Declare intention to use gettext, and add support for specific
1189 # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
1192 # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
1193 AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
1194 if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
1197 # Export the build objects.
1198 for ling in $ALL_LINGUAS; do \
1199 glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
1200 glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
1202 AC_SUBST(glibcpp_MOFILES)
1203 AC_SUBST(glibcpp_POFILES)
1205 CLOCALE_H=config/locale/gnu/c_locale.h
1206 CLOCALE_CC=config/locale/gnu/c_locale.cc
1207 CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
1208 CCOLLATE_CC=config/locale/gnu/collate_members.cc
1209 CCTYPE_CC=config/locale/gnu/ctype_members.cc
1210 CMESSAGES_H=config/locale/gnu/messages_members.h
1211 CMESSAGES_CC=config/locale/gnu/messages_members.cc
1212 CMONEY_CC=config/locale/gnu/monetary_members.cc
1213 CNUMERIC_CC=config/locale/gnu/numeric_members.cc
1214 CTIME_CC=config/locale/gnu/time_members.cc
1217 AC_MSG_RESULT(generic)
1219 CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
1220 CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc
1221 CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
1222 CCOLLATE_CC=config/locale/generic/collate_members.cc
1223 CCTYPE_CC=config/locale/generic/ctype_members.cc
1224 CMESSAGES_H=config/locale/ieee_1003.1-2001/messages_members.h
1225 CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc
1226 CMONEY_CC=config/locale/generic/monetary_members.cc
1227 CNUMERIC_CC=config/locale/generic/numeric_members.cc
1228 CTIME_CC=config/locale/generic/time_members.cc
1231 echo "$enable_clocale is an unknown locale package" 1>&2
1236 # This is where the testsuite looks for locale catalogs, using the
1237 # -DLOCALEDIR define during testsuite compilation.
1238 glibcpp_localedir=${glibcpp_builddir}/po/share/locale
1239 AC_SUBST(glibcpp_localedir)
1243 AC_SUBST(CCODECVT_H)
1244 AC_SUBST(CMESSAGES_H)
1245 AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
1246 AC_LINK_FILES($CCOLLATE_CC, src/collate.cc)
1247 AC_LINK_FILES($CCTYPE_CC, src/ctype.cc)
1248 AC_LINK_FILES($CMESSAGES_CC, src/messages.cc)
1249 AC_LINK_FILES($CMONEY_CC, src/monetary.cc)
1250 AC_LINK_FILES($CNUMERIC_CC, src/numeric.cc)
1251 AC_LINK_FILES($CTIME_CC, src/time.cc)
1256 dnl Check for which I/O library to use: libio, or something specific.
1258 dnl GLIBCPP_ENABLE_CSTDIO
1259 dnl --enable-cstdio=libio sets config/io/c_io_libio.h and friends
1261 dnl default is stdio
1263 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
1264 AC_MSG_CHECKING([for cstdio to use])
1265 AC_ARG_ENABLE(cstdio,
1266 [ --enable-cstdio enable stdio for target io package.
1267 --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
1269 if test x$enable_cstdio = xno; then
1272 enable_cstdio=stdio)
1274 enable_cstdio_flag=$enable_cstdio
1276 dnl Check if a valid I/O package
1277 case x${enable_cstdio_flag} in
1279 CSTDIO_H=config/io/c_io_libio.h
1280 BASIC_FILE_H=config/io/basic_file_libio.h
1281 BASIC_FILE_CC=config/io/basic_file_libio.cc
1282 AC_MSG_RESULT(libio)
1284 # see if we are on a system with libio native (ie, linux)
1285 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
1287 # Need to check and see what version of glibc is being used. If
1288 # it's not glibc-2.2 or higher, then we'll need to go ahead and
1289 # compile most of libio for linux systems.
1290 if test x$has_libio = x"yes"; then
1293 AC_MSG_CHECKING([for glibc version >= 2.2])
1294 AC_EGREP_CPP([ok], [
1295 #include <features.h>
1296 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1299 ], glibc_satisfactory=yes, glibc_satisfactory=no)
1300 AC_MSG_RESULT($glibc_satisfactory)
1304 # XXX at the moment, admit defeat and force the recompilation
1305 # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
1306 glibc_satisfactory=no
1308 if test x$glibc_satisfactory = x"yes"; then
1313 # bkoz XXX need to add checks to enable this
1314 # pme XXX here's a first pass at such a check
1315 if test x$enable_c_mbchar != xno; then
1323 # Using libio, but <libio.h> doesn't exist on the target system. . .
1325 # bkoz XXX need to add checks to enable this
1326 # pme XXX here's a first pass at such a check
1327 if test x$enable_c_mbchar != xno; then
1334 xstdio | x | xno | xnone | xyes)
1336 CSTDIO_H=config/io/c_io_stdio.h
1337 BASIC_FILE_H=config/io/basic_file_stdio.h
1338 BASIC_FILE_CC=config/io/basic_file_stdio.cc
1339 AC_MSG_RESULT(stdio)
1341 # We're not using stdio.
1346 echo "$enable_cstdio is an unknown io package" 1>&2
1351 AC_SUBST(BASIC_FILE_H)
1352 AC_LINK_FILES($BASIC_FILE_CC, src/basic_file.cc)
1354 # 2000-08-04 bkoz hack
1355 CCODECVT_C=config/io/c_io_libio_codecvt.c
1356 AC_SUBST(CCODECVT_C)
1357 # 2000-08-04 bkoz hack
1359 AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
1360 test "$need_libio" = yes || test "$need_wlibio" = yes)
1361 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
1362 AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
1363 if test "$need_libio" = yes || test "$need_wlibio" = yes; then
1364 libio_la=../libio/libio.la
1373 dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
1374 dnl We must stage the required headers so that they will be installed
1375 dnl with the library (unlike libgcc, the STL implementation is provided
1376 dnl solely within headers). Since we must not inject random user-space
1377 dnl macro names into user-provided C++ code, we first stage into <file>-in
1378 dnl and process to <file> with an output command. The reason for a two-
1379 dnl stage process here is to correctly handle $srcdir!=$objdir without
1380 dnl having to write complex code (the sed commands to clean the macro
1381 dnl namespace are complex and fragile enough as it is). We must also
1382 dnl add a relative path so that -I- is supported properly.
1384 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
1385 AC_MSG_CHECKING([for thread model used by GCC])
1386 target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
1387 AC_MSG_RESULT([$target_thread_file])
1389 if test $target_thread_file != single; then
1390 AC_DEFINE(HAVE_GTHR_DEFAULT)
1391 AC_DEFINE(_GLIBCPP_SUPPORTS_WEAK, __GXX_WEAK__)
1394 glibcpp_thread_h=gthr-$target_thread_file.h
1395 AC_SUBST(glibcpp_thread_h)
1400 dnl Check for exception handling support. If an explicit enable/disable
1401 dnl sjlj exceptions is given, we don't have to detect. Otherwise the
1402 dnl target may or may not support call frame exceptions.
1404 dnl GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
1405 dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
1406 dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
1408 dnl Define _GLIBCPP_SJLJ_EXCEPTIONS if the compiler is configured for it.
1410 AC_DEFUN(GLIBCPP_ENABLE_SJLJ_EXCEPTIONS, [
1411 AC_MSG_CHECKING([for exception model to use])
1414 AC_ARG_ENABLE(sjlj-exceptions,
1415 [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
1417 [dnl Botheration. Now we've got to detect the exception model.
1418 dnl Link tests against libgcc.a are problematic since -- at least
1419 dnl as of this writing -- we've not been given proper -L bits for
1420 dnl single-tree newlib and libgloss.
1422 dnl This is what AC_TRY_COMPILE would do if it didn't delete the
1423 dnl conftest files before we got a change to grep them first.
1424 cat > conftest.$ac_ext << EOF
1425 [#]line __oline__ "configure"
1434 old_CXXFLAGS="$CXXFLAGS"
1436 if AC_TRY_EVAL(ac_compile); then
1437 if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
1438 enable_sjlj_exceptions=yes
1439 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
1440 enable_sjlj_exceptions=no
1443 CXXFLAGS="$old_CXXFLAGS"
1445 if test x$enable_sjlj_exceptions = xyes; then
1446 AC_DEFINE(_GLIBCPP_SJLJ_EXCEPTIONS, 1,
1447 [Define if the compiler is configured for setjmp/longjmp exceptions.])
1448 ac_exception_model_name=sjlj
1449 elif test x$enable_sjlj_exceptions = xno; then
1450 ac_exception_model_name="call frame"
1452 AC_MSG_ERROR([unable to detect exception model])
1455 AC_MSG_RESULT($ac_exception_model_name)
1460 dnl Check for libunwind exception handling support. If enabled then
1461 dnl we assume that the _Unwind_* functions that make up the Unwind ABI
1462 dnl (_Unwind_RaiseException, _Unwind_Resume, etc.) are defined by
1463 dnl libunwind instead of libgcc and that libstdc++ has a dependency
1464 dnl on libunwind as well as libgcc.
1466 dnl GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
1467 dnl --enable-libunwind-exceptions forces the use of libunwind.
1468 dnl --disable-libunwind-exceptions assumes there is no libunwind.
1470 dnl Define _GLIBCPP_LIBUNWIND_EXCEPTIONS if requested.
1472 AC_DEFUN(GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS, [
1473 AC_MSG_CHECKING([for use of libunwind])
1474 AC_ARG_ENABLE(libunwind-exceptions,
1475 [ --enable-libunwind-exceptions force use of libunwind for exceptions],
1476 use_libunwind_exceptions=$enableval,
1477 use_libunwind_exceptions=no)
1478 AC_MSG_RESULT($use_libunwind_exceptions)
1479 dnl Option parsed, now set things appropriately
1480 if test x"$use_libunwind_exceptions" = xyes; then
1481 LIBUNWIND_FLAG="-lunwind"
1485 AC_SUBST(LIBUNWIND_FLAG)
1489 dnl Check for ISO/IEC 9899:1999 "C99" support.
1491 dnl GLIBCPP_ENABLE_C99
1492 dnl --enable-c99 defines _GLIBCPP_USE_C99
1493 dnl --disable-c99 leaves _GLIBCPP_USE_C99 undefined
1494 dnl + Usage: GLIBCPP_ENABLE_C99[(DEFAULT)]
1495 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1496 dnl defaults to `no'.
1497 dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
1499 dnl GLIBCPP_ENABLE_C99
1500 AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
1501 define([GLIBCPP_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
1504 changequote(<<, >>)dnl
1505 <<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCPP_ENABLE_C99_DEFAULT],
1506 changequote([, ])dnl
1507 [case "$enableval" in
1508 yes) enable_c99=yes ;;
1509 no) enable_c99=no ;;
1510 *) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
1512 enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
1517 # Check for the existence of <math.h> functions used if C99 is enabled.
1519 AC_MSG_CHECKING([for ISO C99 support in <math.h>])
1520 AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
1521 AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
1522 AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
1523 AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
1524 AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
1525 AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
1526 AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
1527 AC_TRY_COMPILE([#include <math.h>],
1528 [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
1529 AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
1530 AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
1531 AC_TRY_COMPILE([#include <math.h>],
1532 [islessgreater(0.0,0.0);],, [ac_c99_math=no])
1533 AC_TRY_COMPILE([#include <math.h>],
1534 [isunordered(0.0,0.0);],, [ac_c99_math=no])
1535 AC_MSG_RESULT($ac_c99_math)
1537 # Check for the existence in <stdio.h> of vscanf, et. al.
1539 AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
1540 AC_TRY_COMPILE([#include <stdio.h>],
1541 [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
1542 AC_TRY_COMPILE([#include <stdio.h>
1544 void foo(char* fmt, ...)
1545 {va_list args; va_start(args, fmt);
1546 vfscanf(stderr, "%i", args);}],
1547 [],, [ac_c99_stdio=no])
1548 AC_TRY_COMPILE([#include <stdio.h>
1550 void foo(char* fmt, ...)
1551 {va_list args; va_start(args, fmt);
1552 vscanf("%i", args);}],
1553 [],, [ac_c99_stdio=no])
1554 AC_TRY_COMPILE([#include <stdio.h>
1556 void foo(char* fmt, ...)
1557 {va_list args; va_start(args, fmt);
1558 vsnprintf(fmt, 0, "%i", args);}],
1559 [],, [ac_c99_stdio=no])
1560 AC_TRY_COMPILE([#include <stdio.h>
1562 void foo(char* fmt, ...)
1563 {va_list args; va_start(args, fmt);
1564 vsscanf(fmt, "%i", args);}],
1565 [],, [ac_c99_stdio=no])
1566 AC_MSG_RESULT($ac_c99_stdio)
1568 # Check for the existence in <stdlib.h> of lldiv_t, et. al.
1570 AC_MSG_CHECKING([for lldiv_t declaration])
1571 AC_CACHE_VAL(ac_c99_lldiv_t, [
1572 AC_TRY_COMPILE([#include <stdlib.h>],
1574 [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
1576 AC_MSG_RESULT($ac_c99_lldiv_t)
1578 AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
1579 AC_TRY_COMPILE([#include <stdlib.h>],
1580 [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
1581 AC_TRY_COMPILE([#include <stdlib.h>],
1582 [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
1583 AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
1584 AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
1585 AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
1586 AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
1587 if test x"$ac_c99_lldiv_t" = x"no"; then
1590 AC_MSG_RESULT($ac_c99_stdlib)
1592 # Check for the existence of <wchar.h> functions used if C99 is enabled.
1593 # XXX the wchar.h checks should be rolled into the general C99 bits.
1595 AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
1596 AC_TRY_COMPILE([#include <wchar.h>],
1597 [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
1598 AC_TRY_COMPILE([#include <wchar.h>],
1599 [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
1600 AC_TRY_COMPILE([#include <wchar.h>],
1601 [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
1602 AC_MSG_RESULT($ac_c99_wchar)
1604 AC_MSG_CHECKING([for enabled ISO C99 support])
1605 if test x"$ac_c99_math" = x"no" ||
1606 test x"$ac_c99_stdio" = x"no" ||
1607 test x"$ac_c99_stdlib" = x"no" ||
1608 test x"$ac_c99_wchar" = x"no"; then
1611 AC_MSG_RESULT($enable_c99)
1613 # Option parsed, now set things appropriately
1614 if test x"$enable_c99" = x"yes"; then
1615 AC_DEFINE(_GLIBCPP_USE_C99)
1623 dnl Check for template specializations for the 'long long' type extension.
1624 dnl The result determines only whether 'long long' I/O is enabled; things
1625 dnl like numeric_limits<> specializations are always available.
1627 dnl GLIBCPP_ENABLE_LONG_LONG
1628 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
1629 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
1630 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
1631 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1632 dnl defaults to `no'.
1633 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1635 dnl GLIBCPP_ENABLE_LONG_LONG
1636 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
1637 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
1639 AC_ARG_ENABLE(long-long,
1640 changequote(<<, >>)dnl
1641 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
1642 changequote([, ])dnl
1643 [case "$enableval" in
1644 yes) enable_long_long=yes ;;
1645 no) enable_long_long=no ;;
1646 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1648 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1653 AC_MSG_CHECKING([for enabled long long I/O support])
1654 # iostreams require strtoll, strtoull to compile
1655 AC_TRY_COMPILE([#include <stdlib.h>],
1656 [char* tmp; strtoll("gnu", &tmp, 10);],,[enable_long_long=no])
1657 AC_TRY_COMPILE([#include <stdlib.h>],
1658 [char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
1660 # Option parsed, now set things appropriately
1661 if test x"$enable_long_long" = xyes; then
1662 AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1664 AC_MSG_RESULT($enable_long_long)
1671 dnl Check for what kind of C headers to use.
1673 dnl GLIBCPP_ENABLE_CHEADERS
1674 dnl --enable-cheaders= [does stuff].
1675 dnl --disable-cheaders [does not do anything, really].
1676 dnl + This will eventually need to be 'c_shadow' by default.
1677 dnl + Usage: GLIBCPP_ENABLE_CHEADERS[(DEFAULT)]
1678 dnl Where DEFAULT is either `c' or `c_std' or 'c_shadow'.
1679 dnl If ommitted, it defaults to `c_std'.
1680 AC_DEFUN(GLIBCPP_ENABLE_CHEADERS, [dnl
1681 define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
1682 AC_MSG_CHECKING([for c header strategy to use])
1683 AC_ARG_ENABLE(cheaders,
1684 changequote(<<, >>)dnl
1685 << --enable-cheaders construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
1687 [case "$enableval" in
1692 enable_cheaders=c_std
1695 enable_cheaders=c_shadow
1697 *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
1700 enable_cheaders=GLIBCPP_ENABLE_CHEADERS_DEFAULT)
1701 AC_MSG_RESULT($enable_cheaders)
1703 dnl Option parsed, now set things appropriately
1704 case "$enable_cheaders" in
1706 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_shadow'
1709 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
1712 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
1716 AC_SUBST(C_INCLUDE_DIR)
1717 AM_CONDITIONAL(GLIBCPP_C_HEADERS_C, test "$enable_cheaders" = c)
1718 AM_CONDITIONAL(GLIBCPP_C_HEADERS_C_STD, test "$enable_cheaders" = c_std)
1719 AM_CONDITIONAL(GLIBCPP_C_HEADERS_COMPATIBILITY, test "$c_compatibility" = yes)
1724 dnl Check for wide character support. Has the same effect as the option
1725 dnl in gcc's configure, but in a form that autoconf can mess with.
1727 dnl GLIBCPP_ENABLE_C_MBCHAR
1728 dnl --enable-c-mbchar requests all the wchar_t stuff.
1729 dnl --disable-c-mbchar doesn't.
1730 dnl + Usage: GLIBCPP_ENABLE_C_MBCHAR[(DEFAULT)]
1731 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1732 dnl defaults to `no'.
1733 AC_DEFUN(GLIBCPP_ENABLE_C_MBCHAR, [dnl
1734 define([GLIBCPP_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
1735 AC_ARG_ENABLE(c-mbchar,
1736 changequote(<<, >>)dnl
1737 << --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCPP_ENABLE_C_MBCHAR_DEFAULT],
1738 changequote([, ])dnl
1739 [case "$enableval" in
1740 yes) enable_c_mbchar=yes ;;
1741 no) enable_c_mbchar=no ;;
1742 *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
1744 enable_c_mbchar=GLIBCPP_ENABLE_C_MBCHAR_DEFAULT)dnl
1745 dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
1750 dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
1752 dnl TOPLEVEL_INCLUDES
1753 dnl LIBMATH_INCLUDES
1754 dnl LIBSUPCXX_INCLUDES
1756 dnl CSHADOW_INCLUDES
1758 dnl GLIBCPP_EXPORT_INCLUDES
1759 AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
1760 # Root level of the build directory include sources.
1761 GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
1763 # Passed down for canadian crosses.
1764 if test x"$CANADIAN" = xyes; then
1765 TOPLEVEL_INCLUDES='-I$(includedir)'
1768 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1770 LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
1772 if test x"$need_libio" = xyes; then
1773 LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
1774 AC_SUBST(LIBIO_INCLUDES)
1777 # Now, export this to all the little Makefiles....
1778 AC_SUBST(GLIBCPP_INCLUDES)
1779 AC_SUBST(TOPLEVEL_INCLUDES)
1780 AC_SUBST(LIBMATH_INCLUDES)
1781 AC_SUBST(LIBSUPCXX_INCLUDES)
1786 dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
1788 AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
1789 # Optimization flags that are probably a good idea for thrill-seekers. Just
1790 # uncomment the lines below and make, everything else is ready to go...
1791 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
1793 AC_SUBST(OPTIMIZE_CXXFLAGS)
1795 WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings -Winline'
1796 AC_SUBST(WARN_FLAGS)
1800 dnl GLIBCPP_EXPORT_INSTALL_INFO
1801 dnl calculates gxx_install_dir
1802 dnl exports glibcpp_toolexecdir
1803 dnl exports glibcpp_toolexeclibdir
1804 dnl exports glibcpp_prefixdir
1806 dnl Assumes cross_compiling bits already done, and with_cross_host in
1809 dnl GLIBCPP_EXPORT_INSTALL_INFO
1810 AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
1811 # Assumes glibcpp_builddir, glibcpp_srcdir are alreay set up and
1812 # exported correctly in GLIBCPP_CONFIGURE.
1813 glibcpp_toolexecdir=no
1814 glibcpp_toolexeclibdir=no
1815 glibcpp_prefixdir=${prefix}
1817 AC_MSG_CHECKING([for interface version number])
1818 libstdcxx_interface=$INTERFACE
1819 AC_MSG_RESULT($libstdcxx_interface)
1821 # Process the option --with-gxx-include-dir=<path to include-files directory>
1822 AC_MSG_CHECKING([for --with-gxx-include-dir])
1823 AC_ARG_WITH(gxx-include-dir,
1824 [ --with-gxx-include-dir the installation directory for include files],
1825 [case "${withval}" in
1827 AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
1834 gxx_include_dir=${withval}
1836 esac], [gxx_include_dir=no])
1837 AC_MSG_RESULT($gxx_include_dir)
1839 # Process the option "--enable-version-specific-runtime-libs"
1840 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
1841 AC_ARG_ENABLE(version-specific-runtime-libs,
1842 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
1843 [case "$enableval" in
1844 yes) version_specific_libs=yes ;;
1845 no) version_specific_libs=no ;;
1846 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
1848 version_specific_libs=no)dnl
1849 # Option set, now we can test it.
1850 AC_MSG_RESULT($version_specific_libs)
1852 if test $version_specific_libs = yes; then
1853 # Need the gcc compiler version to know where to install libraries
1854 # and header files if --enable-version-specific-runtime-libs option
1857 gcc_version_trigger=${srcdir}/../gcc/version.c
1858 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
1859 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
1860 if test x"$gxx_include_dir" = x"no"; then
1861 gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
1863 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1864 glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
1868 # Default case for install directory for include files.
1869 if test $version_specific_libs = no &&
1870 test $gxx_include_dir = no; then
1871 gxx_include_dir='$(prefix)'/include/g++-${libstdcxx_interface}
1874 # Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
1875 # Install a library built with a cross compiler in tooldir, not libdir.
1876 if test x"$glibcpp_toolexecdir" = x"no"; then
1877 if test -n "$with_cross_host" &&
1878 test x"$with_cross_host" != x"no"; then
1879 glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
1880 glibcpp_toolexeclibdir='$(toolexecdir)/lib$(MULTISUBDIR)'
1882 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1883 glibcpp_toolexeclibdir='$(libdir)$(MULTISUBDIR)'
1887 AC_MSG_CHECKING([for install location])
1888 AC_MSG_RESULT($gxx_include_dir)
1890 AC_SUBST(glibcpp_prefixdir)
1891 AC_SUBST(gxx_include_dir)
1892 AC_SUBST(glibcpp_toolexecdir)
1893 AC_SUBST(glibcpp_toolexeclibdir)
1897 # Check for functions in math library.
1898 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1900 # This file can be copied and used freely without restrictions. It can
1901 # be used in projects which are not available under the GNU Public License
1902 # but which still want to provide support for the GNU gettext functionality.
1903 # Please note that the actual code is *not* freely available.
1907 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1908 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1909 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])])
1912 dnl This macro searches for a GNU version of make. If a match is found, the
1913 dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
1914 dnl set to "#". This is useful for including a special features in a Makefile,
1915 dnl which cannot be handled by other versions of make. The variable
1916 dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
1917 dnl the empty string otherwise.
1919 dnl Here is an example of its use:
1921 dnl Makefile.in might contain:
1923 dnl # A failsafe way of putting a dependency rule into a makefile
1925 dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
1927 dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
1928 dnl @ifGNUmake@ include $(DEPEND)
1929 dnl @ifGNUmake@ endif
1931 dnl Then configure.in would normally contain:
1933 dnl CHECK_GNU_MAKE()
1934 dnl AC_OUTPUT(Makefile)
1936 dnl Then perhaps to cause gnu make to override any other make, we could do
1937 dnl something like this (note that GNU make always looks for GNUmakefile first):
1939 dnl if ! test x$_cv_gnu_make_command = x ; then
1940 dnl mv Makefile GNUmakefile
1941 dnl echo .DEFAULT: > Makefile ;
1942 dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
1945 dnl Then, if any (well almost any) other make is called, and GNU make also
1946 dnl exists, then the other make wraps the GNU make.
1948 dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
1949 dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
1951 dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
1952 dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
1953 dnl #### conditional's subshell (" --version" is not a command), using a
1954 dnl #### different option to grep(1).
1956 dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
1957 dnl #### ${MAKE:-make}).
1960 GLIBCPP_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
1961 _cv_gnu_make_command='' ;
1962 dnl Search all the common names for GNU make
1963 for a in "${MAKE-make}" make gmake gnumake ; do
1964 if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
1966 _cv_gnu_make_command=$a ;
1971 dnl If there was a GNU version, then set @ifGNUmake@ to the empty
1972 dnl string, '#' otherwise
1973 if test "x$_cv_gnu_make_command" != "x" ; then
1982 dnl Check for headers for, and arguments to, the setrlimit() function.
1983 dnl Used only in testsuite_hooks.h.
1984 AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT_ancilliary, [
1985 AC_TRY_COMPILE([#include <unistd.h>
1986 #include <sys/time.h>
1987 #include <sys/resource.h>
1988 ], [ int f = RLIMIT_$1 ; ],
1989 [glibcpp_mresult=1], [glibcpp_mresult=0])
1990 AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcpp_mresult,
1991 [Only used in build directory testsuite_hooks.h.])
1993 AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
1994 setrlimit_have_headers=yes
1995 AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
1997 setrlimit_have_headers=no)
1998 # If don't have the headers, then we can't run the tests now, and we
1999 # won't be seeing any of these during testsuite compilation.
2000 if test $setrlimit_have_headers = yes; then
2001 # Can't do these in a loop, else the resulting syntax is wrong.
2002 GLIBCPP_CHECK_SETRLIMIT_ancilliary(DATA)
2003 GLIBCPP_CHECK_SETRLIMIT_ancilliary(RSS)
2004 GLIBCPP_CHECK_SETRLIMIT_ancilliary(VMEM)
2005 GLIBCPP_CHECK_SETRLIMIT_ancilliary(AS)
2007 # Check for rlimit, setrlimit.
2008 AC_CACHE_VAL(ac_setrlimit, [
2009 AC_TRY_COMPILE([#include <unistd.h>
2010 #include <sys/time.h>
2011 #include <sys/resource.h>
2013 [ struct rlimit r; setrlimit(0, &r);],
2014 [ac_setrlimit=yes], [ac_setrlimit=no])
2018 AC_MSG_CHECKING([for testsuite memory limit support])
2019 if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
2021 AC_DEFINE(_GLIBCPP_MEM_LIMITS)
2025 AC_MSG_RESULT($ac_mem_limits)
2030 dnl Does any necessary configuration of the testsuite directory. Generates
2031 dnl the testsuite_hooks.h header.
2033 dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
2034 AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
2035 GLIBCPP_CHECK_SETRLIMIT
2037 # Look for setenv, so that extended locale tests can be performed.
2038 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
2042 sinclude(../libtool.m4)
2043 dnl The lines below arrange for aclocal not to bring an installed
2044 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
2045 dnl add a definition of LIBTOOL to Makefile.in.
2046 ifelse(,,,[AC_SUBST(LIBTOOL)
2047 AC_DEFUN([AM_PROG_LIBTOOL])
2048 AC_DEFUN([AC_LIBTOOL_DLOPEN])
2049 AC_DEFUN([AC_PROG_LD])
2053 # Check whether LC_MESSAGES is available in <locale.h>.
2054 # Ulrich Drepper <drepper@cygnus.com>, 1995.
2056 # This file file be copied and used freely without restrictions. It can
2057 # be used in projects which are not available under the GNU Public License
2058 # but which still want to provide support for the GNU gettext functionality.
2059 # Please note that the actual code is *not* freely available.
2063 AC_DEFUN(AC_LC_MESSAGES, [
2064 AC_CHECK_HEADER(locale.h, [
2065 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
2066 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2067 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
2068 if test $ac_cv_val_LC_MESSAGES = yes; then
2069 AC_DEFINE(HAVE_LC_MESSAGES)
2076 dnl Check for whether the Boost-derived checks should be turned on.
2078 dnl GLIBCPP_ENABLE_CONCEPT_CHECKS
2079 dnl --enable-concept-checks turns them on.
2080 dnl --disable-concept-checks leaves them off.
2081 dnl + Usage: GLIBCPP_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
2082 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
2083 dnl defaults to `no'.
2084 AC_DEFUN(GLIBCPP_ENABLE_CONCEPT_CHECKS, [dnl
2085 define([GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT], ifelse($1, yes, yes, no))dnl
2086 AC_ARG_ENABLE(concept-checks,
2087 changequote(<<, >>)dnl
2088 << --enable-concept-checks use Boost-derived template checks [default=>>GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT],
2089 changequote([, ])dnl
2090 [case "$enableval" in
2091 yes) enable_concept_checks=yes ;;
2092 no) enable_concept_checks=no ;;
2093 *) AC_MSG_ERROR([Unknown argument to enable/disable concept checks]) ;;
2095 enable_concept_checks=GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT)dnl
2096 dnl Option parsed, now set things appropriately
2097 if test x"$enable_concept_checks" = xyes; then
2098 AC_DEFINE(_GLIBCPP_CONCEPT_CHECKS)
2104 dnl Add version tags to symbols in shared library (or not), additionally
2105 dnl marking other symbols as private/local (or not).
2107 dnl GLIBCPP_ENABLE_SYMVERS
2108 dnl --enable-symvers=style adds a version script to the linker call when
2109 dnl creating the shared library. The choice of version script is
2110 dnl controlled by 'style'.
2111 dnl --disable-symvers does not.
2112 dnl + Usage: GLIBCPP_ENABLE_SYMVERS[(DEFAULT)]
2113 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
2114 dnl defaults to `no'. Passing `yes' tries to choose a default style
2115 dnl based on linker characteristics. Passing 'no' disables versioning.
2116 AC_DEFUN(GLIBCPP_ENABLE_SYMVERS, [dnl
2117 define([GLIBCPP_ENABLE_SYMVERS_DEFAULT], ifelse($1, yes, yes, no))dnl
2118 AC_ARG_ENABLE(symvers,
2119 changequote(<<, >>)dnl
2120 << --enable-symvers=style enables symbol versioning of the shared library [default=>>GLIBCPP_ENABLE_SYMVERS_DEFAULT],
2121 changequote([, ])dnl
2122 [case "$enableval" in
2123 yes) enable_symvers=yes ;;
2124 no) enable_symvers=no ;;
2125 # other names here, just as sanity checks
2126 #gnu|sun|etcetera) enable_symvers=$enableval ;;
2127 gnu) enable_symvers=$enableval ;;
2128 *) AC_MSG_ERROR([Unknown argument to enable/disable symvers]) ;;
2130 enable_symvers=GLIBCPP_ENABLE_SYMVERS_DEFAULT)dnl
2132 # If we never went through the GLIBCPP_CHECK_LINKER_FEATURES macro, then we
2133 # don't know enough about $LD to do tricks...
2134 if test x$enable_shared = xno ||
2136 test x$glibcpp_gnu_ld_version = x; then
2140 # Check to see if libgcc_s exists, indicating that shared libgcc is possible.
2141 if test $enable_symvers != no; then
2142 AC_MSG_CHECKING([for shared libgcc])
2143 ac_save_CFLAGS="$CFLAGS"
2145 AC_TRY_LINK(, [return 0], glibcpp_shared_libgcc=yes, glibcpp_shared_libgcc=no)
2146 CFLAGS="$ac_save_CFLAGS"
2147 AC_MSG_RESULT($glibcpp_shared_libgcc)
2150 # For GNU ld, we need at least this version. It's 2.12 in the same format
2151 # as the tested-for version. See GLIBCPP_CHECK_LINKER_FEATURES for more.
2152 glibcpp_min_gnu_ld_version=21200
2154 # Check to see if unspecified "yes" value can win, given results
2156 if test $enable_symvers = yes ; then
2157 if test $with_gnu_ld = yes &&
2158 test $glibcpp_shared_libgcc = yes ;
2160 if test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version ; then
2163 ac_test_CFLAGS="${CFLAGS+set}"
2164 ac_save_CFLAGS="$CFLAGS"
2165 CFLAGS='-shared -Wl,--version-script,conftest.map'
2168 echo 'FOO { global: f[a-z]o; local: *; };' > conftest.map
2170 AC_TRY_LINK([int foo;],, enable_symvers=gnu)
2171 if test "$ac_test_CFLAGS" = set; then
2172 CFLAGS="$ac_save_CFLAGS"
2174 # this is the suspicious part
2185 dnl Everything parsed; figure out what file to use.
2186 case $enable_symvers in
2188 LINKER_MAP=config/linker-map.dummy
2191 LINKER_MAP=config/linker-map.gnu
2195 AC_LINK_FILES($LINKER_MAP, src/linker.map)
2196 AM_CONDITIONAL(GLIBCPP_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
2197 AC_MSG_CHECKING([versioning on shared library symbols])
2198 AC_MSG_RESULT($enable_symvers)
2202 # isc-posix.m4 serial 1 (gettext-0.10.40)
2203 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2204 dnl This file is free software, distributed under the terms of the GNU
2205 dnl General Public License. As a special exception to the GNU General
2206 dnl Public License, this file may be distributed as part of a program
2207 dnl that contains a configuration script generated by Autoconf, under
2208 dnl the same distribution terms as the rest of that program.
2210 # This test replaces the one in autoconf.
2211 # Currently this macro should have the same name as the autoconf macro
2212 # because gettext's gettext.m4 (distributed in the automake package)
2213 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
2214 # give these diagnostics:
2215 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
2216 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
2218 undefine([AC_ISC_POSIX])
2220 AC_DEFUN([AC_ISC_POSIX],
2222 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
2223 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
2227 # Add --enable-maintainer-mode option to configure.
2232 AC_DEFUN([AM_MAINTAINER_MODE],
2233 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
2234 dnl maintainer-mode is disabled by default
2235 AC_ARG_ENABLE(maintainer-mode,
2236 [ --enable-maintainer-mode enable make rules and dependencies not useful
2237 (and sometimes confusing) to the casual installer],
2238 USE_MAINTAINER_MODE=$enableval,
2239 USE_MAINTAINER_MODE=no)
2240 AC_MSG_RESULT($USE_MAINTAINER_MODE)
2241 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
2242 MAINT=$MAINTAINER_MODE_TRUE
2247 # Define a conditional.
2249 AC_DEFUN([AM_CONDITIONAL],
2260 # Do all the work for Automake. This macro actually does too much --
2261 # some checks are only needed if your package does certain things.
2262 # But this isn't really a big deal.
2267 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
2269 AC_DEFUN([AM_INIT_AUTOMAKE],
2270 [AC_REQUIRE([AC_PROG_INSTALL])
2275 dnl test to see if srcdir already configured
2276 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
2277 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2280 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
2281 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
2282 AC_REQUIRE([AM_SANITY_CHECK])
2283 AC_REQUIRE([AC_ARG_PROGRAM])
2284 dnl FIXME This is truly gross.
2285 missing_dir=`cd $ac_aux_dir && pwd`
2286 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
2287 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
2288 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
2289 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
2290 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
2291 AC_REQUIRE([AC_PROG_MAKE_SET])])
2294 # Check to make sure that the build environment is sane.
2297 AC_DEFUN([AM_SANITY_CHECK],
2298 [AC_MSG_CHECKING([whether build environment is sane])
2301 echo timestamp > conftestfile
2302 # Do `set' in a subshell so we don't clobber the current shell's
2303 # arguments. Must try -L first in case configure is actually a
2304 # symlink; some systems play weird games with the mod time of symlinks
2305 # (eg FreeBSD returns the mod time of the symlink's containing
2308 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
2309 if test "[$]*" = "X"; then
2311 set X `ls -t $srcdir/configure conftestfile`
2313 if test "[$]*" != "X $srcdir/configure conftestfile" \
2314 && test "[$]*" != "X conftestfile $srcdir/configure"; then
2316 # If neither matched, then we have a broken ls. This can happen
2317 # if, for instance, CONFIG_SHELL is bash and it inherits a
2318 # broken ls alias from the environment. This has actually
2319 # happened. Such a system could not be considered "sane".
2320 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
2321 alias in your environment])
2324 test "[$]2" = conftestfile
2330 AC_MSG_ERROR([newly created file is older than distributed files!
2331 Check your system clock])
2334 AC_MSG_RESULT(yes)])
2336 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
2337 dnl The program must properly implement --version.
2338 AC_DEFUN([AM_MISSING_PROG],
2339 [AC_MSG_CHECKING(for working $2)
2340 # Run test in a subshell; some versions of sh will print an error if
2341 # an executable is not found, even if stderr is redirected.
2342 # Redirect stdin to placate older versions of autoconf. Sigh.
2343 if ($2 --version) < /dev/null > /dev/null 2>&1; then
2345 AC_MSG_RESULT(found)
2348 AC_MSG_RESULT(missing)
2352 # Like AC_CONFIG_HEADER, but automatically create stamp file.
2354 AC_DEFUN([AM_CONFIG_HEADER],
2356 AC_CONFIG_HEADER([$1])
2357 dnl When config.status generates a header, we must update the stamp-h file.
2358 dnl This file resides in the same directory as the config header
2359 dnl that is generated. We must strip everything past the first ":",
2360 dnl and everything past the last "/".
2361 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
2362 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
2363 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
2365 for am_file in <<$1>>; do
2366 case " <<$>>CONFIG_HEADERS " in
2367 *" <<$>>am_file "*<<)>>
2368 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
2371 am_indx=`expr "<<$>>am_indx" + 1`