1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
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.
16 dnl GLIBCPP_TOPREL_CONFIGURE
17 AC_DEFUN(GLIBCPP_TOPREL_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)
52 dnl Initialize configure bits.
55 AC_DEFUN(GLIBCPP_CONFIGURE, [
57 #possibly test for the presence of the compiler sources here?
59 # Export build and source directories.
60 # These need to be absolute paths, yet at the same time need to
61 # canonicalize only relative paths, because then amd will not unmount
62 # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
63 glibcpp_builddir=`${PWDCMD-pwd}`
65 [\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;;
66 *) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
68 AC_SUBST(glibcpp_builddir)
69 AC_SUBST(glibcpp_srcdir)
71 dnl This is here just to satisfy automake.
72 ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
75 # Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.5x, can also
76 # be 'cp -p' if linking isn't available. Uncomment the next line to
77 # force a particular method.
78 #ac_cv_prog_LN_S='cp -p'
81 # We use these options to decide which functions to include.
82 AC_ARG_WITH(target-subdir,
83 [ --with-target-subdir=SUBDIR
84 configuring in a subdirectory])
85 AC_ARG_WITH(cross-host,
86 [ --with-cross-host=HOST configuring with a cross compiler])
88 glibcpp_basedir=$srcdir/$toprel/$1/libstdc++-v3
89 AC_SUBST(glibcpp_basedir)
91 # Never versions of autoconf add an underscore to these functions.
92 # Prevent future problems ...
93 ifdef([AC_PROG_CC_G],[],[define([AC_PROG_CC_G],defn([_AC_PROG_CC_G]))])
94 ifdef([AC_PROG_CC_GNU],[],[define([AC_PROG_CC_GNU],defn([_AC_PROG_CC_GNU]))])
95 ifdef([AC_PROG_CXX_G],[],[define([AC_PROG_CXX_G],defn([_AC_PROG_CXX_G]))])
96 ifdef([AC_PROG_CXX_GNU],[],[define([AC_PROG_CXX_GNU],defn([_AC_PROG_CXX_GNU]))])
99 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
100 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
101 # are probably using a cross compiler, which will not be able to fully
102 # link an executable. This is addressed in later versions of autoconf.
104 AC_DEFUN(LIB_AC_PROG_CC,
105 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
106 dnl Fool anybody using AC_PROG_CC.
107 AC_PROVIDE([AC_PROG_CC])
108 AC_CHECK_PROG(CC, gcc, gcc)
109 if test -z "$CC"; then
110 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
111 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
116 if test $ac_cv_prog_gcc = yes; then
118 dnl Check whether -g works, even if CFLAGS is set, in case the package
119 dnl plays around with CFLAGS (such as to build both debugging and
120 dnl normal versions of a library), tasteless as that idea is.
121 ac_test_CFLAGS="${CFLAGS+set}"
122 ac_save_CFLAGS="$CFLAGS"
125 if test "$ac_test_CFLAGS" = set; then
126 CFLAGS="$ac_save_CFLAGS"
127 elif test $ac_cv_prog_cc_g = yes; then
134 test "${CFLAGS+set}" = set || CFLAGS="-g"
140 # Likewise for AC_PROG_CXX. We can't just call it directly because g++
141 # will try to link in libstdc++.
142 AC_DEFUN(LIB_AC_PROG_CXX,
143 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
144 dnl Fool anybody using AC_PROG_CXX.
145 AC_PROVIDE([AC_PROG_CXX])
146 # Use glibcpp_CXX so that we do not cause CXX to be cached with the
147 # flags that come in CXX while configuring libstdc++. They're different
148 # from those used for all other target libraries. If CXX is set in
149 # the environment, respect that here.
151 AC_CHECK_PROGS(glibcpp_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
152 AC_SUBST(glibcpp_CXX)
154 test -z "$glibcpp_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
158 if test $ac_cv_prog_gxx = yes; then
160 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
161 dnl plays around with CXXFLAGS (such as to build both debugging and
162 dnl normal versions of a library), tasteless as that idea is.
163 ac_test_CXXFLAGS="${CXXFLAGS+set}"
164 ac_save_CXXFLAGS="$CXXFLAGS"
167 if test "$ac_test_CXXFLAGS" = set; then
168 CXXFLAGS="$ac_save_CXXFLAGS"
169 elif test $ac_cv_prog_cxx_g = yes; then
176 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
182 # For directory versioning (e.g., headers) and other variables.
183 AC_MSG_CHECKING([for GCC version number])
184 gcc_version=`$glibcpp_CXX -dumpversion`
185 AC_MSG_RESULT($gcc_version)
187 # For some reason, gettext needs this.
190 AC_CHECK_TOOL(AS, as)
191 AC_CHECK_TOOL(AR, ar)
192 AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
197 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
198 # at least currently, we never actually build a program, so we never
199 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
200 # fails, because we are probably configuring with a cross compiler
201 # which can't create executables. So we include AC_EXEEXT to keep
202 # automake happy, but we don't execute it, since we don't care about
205 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
206 # to nothing, so nothing would remain between `then' and `fi' if it
207 # were not for the `:' below.
212 case [$]{glibcpp_basedir} in
213 /* | [A-Za-z]:[\\/]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
214 *) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
217 # Find platform-specific directories containing configuration info. In
218 # addition to possibly modifying the same flags, it also sets up symlinks.
224 dnl Check to see if g++ can compile this library, and if so, if any version-
225 dnl specific precautions need to be taken.
227 dnl GLIBCPP_CHECK_COMPILER_VERSION
228 AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
229 if test ! -f stamp-sanity-compiler; then
230 AC_MSG_CHECKING([for g++ that will successfully compile libstdc++-v3])
237 ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to GCC 3.0 or above]))
239 AC_MSG_RESULT($gpp_satisfactory)
240 touch stamp-sanity-compiler
246 dnl Tests for newer compiler features, or features that are present in newer
247 dnl compiler versions but not older compiler versions still in use, should
250 dnl Define WERROR='-Werror' if requested and possible; g++'s that lack the
251 dnl new inlining code or the new system_header pragma will die on -Werror.
252 dnl Leave it out by default and use maint-mode to use it.
254 dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
255 dnl compiler supports it and the user has not requested debug mode.
257 dnl GLIBCPP_CHECK_COMPILER_FEATURES
258 AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
259 # All these tests are for C++; save the language and the compiler flags.
260 # The CXXFLAGS thing is suspicious, but based on similar bits previously
261 # found in GLIBCPP_CONFIGURE.
264 ac_test_CXXFLAGS="${CXXFLAGS+set}"
265 ac_save_CXXFLAGS="$CXXFLAGS"
267 # Check for maintainer-mode bits.
268 if test x"$USE_MAINTAINER_MODE" = xno; then
274 # Check for -ffunction-sections -fdata-sections
275 AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
276 CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
277 AC_TRY_COMPILE(, [int foo;
278 ], [ac_fdsections=yes], [ac_fdsections=no])
279 if test "$ac_test_CXXFLAGS" = set; then
280 CXXFLAGS="$ac_save_CXXFLAGS"
282 # this is the suspicious part
285 if test x"$ac_fdsections" = x"yes" &&
286 test x"$enable_debug" = x"no"; then
287 SECTION_FLAGS='-ffunction-sections -fdata-sections'
289 AC_MSG_RESULT($ac_fdsections)
293 AC_SUBST(SECTION_FLAGS)
298 dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
299 dnl the native linker is in use, all variables will be defined to something
300 dnl safe (like an empty string).
302 dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible.
303 dnl Define OPT_LDFLAGS='-Wl,-O1' if possible.
304 dnl Define LD, with_gnu_ld, and (possibly) glibcpp_gnu_ld_version as
305 dnl side-effects of testing.
307 dnl GLIBCPP_CHECK_LINKER_FEATURES
308 AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
309 # If we're not using GNU ld, then there's no point in even trying these
310 # tests. Check for that first. We should have already tested for gld
311 # by now (in libtool), but require it now just to be safe...
312 test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
313 test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
314 AC_REQUIRE([AC_PROG_LD])
316 # The name set by libtool depends on the version of libtool. Shame on us
317 # for depending on an impl detail, but c'est la vie. Older versions used
318 # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
319 # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
320 # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
321 # set (hence we're using an older libtool), then set it.
322 if test x${with_gnu_ld+set} != xset; then
323 if test x${ac_cv_prog_gnu_ld+set} != xset; then
324 # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
327 with_gnu_ld=$ac_cv_prog_gnu_ld
331 # Start by getting the version number. I think the libtool test already
332 # does some of this, but throws away the result.
334 ldver=`$LD --version 2>/dev/null | head -1 | \
335 sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
337 glibcpp_gnu_ld_version=`echo $ldver | \
338 $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
341 if test "$with_gnu_ld" = "notbroken"; then
342 # GNU ld it is! Joy and bunny rabbits!
344 # All these tests are for C++; save the language and the compiler flags.
345 # Need to do this so that g++ won't try to link in libstdc++
346 ac_test_CFLAGS="${CFLAGS+set}"
347 ac_save_CFLAGS="$CFLAGS"
348 CFLAGS='-x c++ -Wl,--gc-sections'
350 # Check for -Wl,--gc-sections
351 # XXX This test is broken at the moment, as symbols required for
352 # linking are now in libsupc++ (not built yet.....). In addition,
353 # this test has cored on solaris in the past. In addition,
354 # --gc-sections doesn't really work at the moment (keeps on discarding
355 # used sections, first .eh_frame and now some of the glibc sections for
356 # iconv). Bzzzzt. Thanks for playing, maybe next time.
357 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
365 ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
366 if test "$ac_test_CFLAGS" = set; then
367 CFLAGS="$ac_save_CFLAGS"
369 # this is the suspicious part
372 if test "$ac_sectionLDflags" = "yes"; then
373 SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
375 AC_MSG_RESULT($ac_sectionLDflags)
378 # Set linker optimization flags.
379 if test x"$with_gnu_ld" = x"yes" && test x"$enable_debug" = x"no"; then
380 OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
383 AC_SUBST(SECTION_LDFLAGS)
384 AC_SUBST(OPT_LDFLAGS)
389 dnl Check to see if the (math function) argument passed is
390 dnl declared when using the c++ compiler
391 dnl ASSUMES argument is a math function with ONE parameter
393 dnl GLIBCPP_CHECK_MATH_DECL_1
394 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_1, [
395 AC_MSG_CHECKING([for $1 declaration])
396 if test x${glibcpp_cv_func_$1_use+set} != xset; then
397 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
400 AC_TRY_COMPILE([#include <math.h>
406 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
410 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
414 dnl Check to see if the (math function) argument passed is
415 dnl 1) declared when using the c++ compiler
416 dnl 2) has "C" linkage
417 dnl 3) if not, see if 1) and 2) for argument prepended with '_'
419 dnl Define HAVE_CARGF etc if "cargf" is declared and links
421 dnl argument 1 is name of function to check
423 dnl ASSUMES argument is a math function with ONE parameter
425 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1
426 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
427 GLIBCPP_CHECK_MATH_DECL_1($1)
428 if test x$glibcpp_cv_func_$1_use = x"yes"; then
431 GLIBCPP_CHECK_MATH_DECL_1(_$1)
432 if test x$glibcpp_cv_func__$1_use = x"yes"; then
440 dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
441 dnl of functions at once. It's an all-or-nothing check -- either
442 dnl HAVE_XYZ is defined for each of the functions, or for none of them.
443 dnl Doing it this way saves significant configure time.
444 AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
445 AC_MSG_CHECKING([for $1 functions])
446 AC_CACHE_VAL(glibcpp_cv_func_$2_use, [
449 AC_TRY_COMPILE([#include <math.h>],
450 [ `for x in $3; do echo "$x (0);"; done` ],
451 [glibcpp_cv_func_$2_use=yes],
452 [glibcpp_cv_func_$2_use=no])
454 AC_MSG_RESULT($glibcpp_cv_func_$2_use)
455 if test x$glibcpp_cv_func_$2_use = x"yes"; then
461 dnl Check to see if the (math function) argument passed is
462 dnl declared when using the c++ compiler
463 dnl ASSUMES argument is a math function with TWO parameters
465 dnl GLIBCPP_CHECK_MATH_DECL_2
466 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_2, [
467 AC_MSG_CHECKING([for $1 declaration])
468 if test x${glibcpp_cv_func_$1_use+set} != xset; then
469 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
472 AC_TRY_COMPILE([#include <math.h>],
474 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
478 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
482 dnl Check to see if the (math function) argument passed is
483 dnl 1) declared when using the c++ compiler
484 dnl 2) has "C" linkage
486 dnl Define HAVE_CARGF etc if "cargf" is declared and links
488 dnl argument 1 is name of function to check
490 dnl ASSUMES argument is a math function with TWO parameters
492 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2
493 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
494 GLIBCPP_CHECK_MATH_DECL_2($1)
495 if test x$glibcpp_cv_func_$1_use = x"yes"; then
498 GLIBCPP_CHECK_MATH_DECL_2(_$1)
499 if test x$glibcpp_cv_func__$1_use = x"yes"; then
507 dnl Check to see if the (math function) argument passed is
508 dnl declared when using the c++ compiler
509 dnl ASSUMES argument is a math function with THREE parameters
511 dnl GLIBCPP_CHECK_MATH_DECL_3
512 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_3, [
513 AC_MSG_CHECKING([for $1 declaration])
514 if test x${glibcpp_cv_func_$1_use+set} != xset; then
515 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
518 AC_TRY_COMPILE([#include <math.h>],
520 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
524 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
528 dnl Check to see if the (math function) argument passed is
529 dnl 1) declared when using the c++ compiler
530 dnl 2) has "C" linkage
532 dnl Define HAVE_CARGF etc if "cargf" is declared and links
534 dnl argument 1 is name of function to check
536 dnl ASSUMES argument is a math function with THREE parameters
538 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3
539 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
540 GLIBCPP_CHECK_MATH_DECL_3($1)
541 if test x$glibcpp_cv_func_$1_use = x"yes"; then
544 GLIBCPP_CHECK_MATH_DECL_3(_$1)
545 if test x$glibcpp_cv_func__$1_use = x"yes"; then
553 dnl Check to see if the (stdlib function) argument passed is
554 dnl 1) declared when using the c++ compiler
555 dnl 2) has "C" linkage
557 dnl argument 1 is name of function to check
559 dnl ASSUMES argument is a math function with TWO parameters
561 dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2
562 AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
563 AC_MSG_CHECKING([for $1 declaration])
564 if test x${glibcpp_cv_func_$1_use+set} != xset; then
565 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
568 AC_TRY_COMPILE([#include <stdlib.h>],
570 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
574 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
575 if test x$glibcpp_cv_func_$1_use = x"yes"; then
582 dnl Check to see if the (stdlib function) argument passed is
583 dnl 1) declared when using the c++ compiler
584 dnl 2) has "C" linkage
586 dnl argument 1 is name of function to check
588 dnl ASSUMES argument is a function with THREE parameters
590 dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3
591 AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3, [
592 AC_MSG_CHECKING([for $1 declaration])
593 if test x${glibcpp_cv_func_$1_use+set} != xset; then
594 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
597 AC_TRY_COMPILE([#include <stdlib.h>],
599 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
603 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
604 if test x$glibcpp_cv_func_$1_use = x"yes"; then
611 dnl Because the builtins are picky picky picky about the arguments they take,
612 dnl do an explict linkage tests here.
613 dnl Check to see if the (math function) argument passed is
614 dnl 1) declared when using the c++ compiler
615 dnl 2) has "C" linkage
617 dnl Define HAVE_CARGF etc if "cargf" is declared and links
619 dnl argument 1 is name of function to check
621 dnl ASSUMES argument is a math function with ONE parameter
623 dnl GLIBCPP_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
624 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
625 AC_MSG_CHECKING([for $1 declaration])
626 if test x${glibcpp_cv_func_$1_use+set} != xset; then
627 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
630 AC_TRY_COMPILE([#include <math.h>],
632 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
636 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
637 if test x$glibcpp_cv_func_$1_use = x"yes"; then
638 AC_MSG_CHECKING([for $1 linkage])
639 if test x${glibcpp_cv_func_$1_link+set} != xset; then
640 AC_CACHE_VAL(glibcpp_cv_func_$1_link, [
641 AC_TRY_LINK([#include <math.h>],
643 [glibcpp_cv_func_$1_link=yes], [glibcpp_cv_func_$1_link=no])
646 AC_MSG_RESULT($glibcpp_cv_func_$1_link)
647 if test x$glibcpp_cv_func_$1_link = x"yes"; then
648 ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
649 AC_DEFINE_UNQUOTED(${ac_tr_func})
656 dnl Check to see what builtin math functions are supported
658 dnl check for __builtin_abs
659 dnl check for __builtin_fabsf
660 dnl check for __builtin_fabs
661 dnl check for __builtin_fabl
662 dnl check for __builtin_labs
663 dnl check for __builtin_sqrtf
664 dnl check for __builtin_sqrtl
665 dnl check for __builtin_sqrt
666 dnl check for __builtin_sinf
667 dnl check for __builtin_sin
668 dnl check for __builtin_sinl
669 dnl check for __builtin_cosf
670 dnl check for __builtin_cos
671 dnl check for __builtin_cosl
673 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
674 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
675 dnl Test for builtin math functions.
676 dnl These are made in gcc/c-common.c
677 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
678 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
679 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
680 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
681 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
683 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
684 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt)
685 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
687 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
688 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
689 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
691 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
692 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
693 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
695 dnl There is, without a doubt, a more elegant way to have these
696 dnl names exported so that they won't be stripped out of acconfig.h by
697 dnl autoheader. I leave this as an exercise to somebody less frustrated
698 dnl than I.... please email the libstdc++ list if you can figure out a
699 dnl more elegant approach (see autoconf/acgen.m4 and specifically
700 dnl AC_CHECK_FUNC for things to steal.)
702 if test x$dummyvar = x"yes"; then
703 AC_DEFINE(HAVE___BUILTIN_ABS)
704 AC_DEFINE(HAVE___BUILTIN_LABS)
705 AC_DEFINE(HAVE___BUILTIN_COS)
706 AC_DEFINE(HAVE___BUILTIN_COSF)
707 AC_DEFINE(HAVE___BUILTIN_COSL)
708 AC_DEFINE(HAVE___BUILTIN_FABS)
709 AC_DEFINE(HAVE___BUILTIN_FABSF)
710 AC_DEFINE(HAVE___BUILTIN_FABSL)
711 AC_DEFINE(HAVE___BUILTIN_SIN)
712 AC_DEFINE(HAVE___BUILTIN_SINF)
713 AC_DEFINE(HAVE___BUILTIN_SINL)
714 AC_DEFINE(HAVE___BUILTIN_SQRT)
715 AC_DEFINE(HAVE___BUILTIN_SQRTF)
716 AC_DEFINE(HAVE___BUILTIN_SQRTL)
722 dnl Check to see what the underlying c library
723 dnl These checks need to do two things:
724 dnl 1) make sure the name is declared when using the c++ compiler
725 dnl 2) make sure the name has "C" linkage
726 dnl This might seem like overkill but experience has shown that it's not...
728 dnl Define HAVE_STRTOLD if "strtold" is declared and links
729 dnl Define HAVE_STRTOF if "strtof" is declared and links
730 dnl Define HAVE_DRAND48 if "drand48" is declared and links
732 dnl GLIBCPP_CHECK_STDLIB_SUPPORT
733 AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
734 ac_test_CXXFLAGS="${CXXFLAGS+set}"
735 ac_save_CXXFLAGS="$CXXFLAGS"
736 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
738 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
739 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)
740 AC_CHECK_FUNCS(drand48)
742 CXXFLAGS="$ac_save_CXXFLAGS"
747 dnl Check to see what the underlying c library or math library is like.
748 dnl These checks need to do two things:
749 dnl 1) make sure the name is declared when using the c++ compiler
750 dnl 2) make sure the name has "C" linkage
751 dnl This might seem like overkill but experience has shown that it's not...
753 dnl Define HAVE_CARGF etc if "cargf" is found.
755 dnl GLIBCPP_CHECK_MATH_SUPPORT
756 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
757 ac_test_CXXFLAGS="${CXXFLAGS+set}"
758 ac_save_CXXFLAGS="$CXXFLAGS"
759 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
762 AC_CHECK_LIB(m, sin, libm="-lm")
766 dnl Check to see if certain C math functions exist.
767 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
768 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
769 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
770 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
771 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
772 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
773 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
774 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypot)
776 dnl Check to see if basic C math functions have float versions.
777 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
782 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
785 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expf)
786 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
787 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
788 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
789 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
790 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
791 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
792 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf)
793 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
794 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
795 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
796 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
797 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
798 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
799 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
800 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
802 dnl Check to see if basic C math functions have long double versions.
803 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
808 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
811 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
812 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
813 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
814 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
815 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
816 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
817 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
818 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
819 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl)
820 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
821 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
822 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
823 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
824 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
825 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
826 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
827 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
829 dnl Some runtimes have these functions with a preceding underscore. Please
830 dnl keep this sync'd with the one above. And if you add any new symbol,
831 dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
832 dnl Check to see if certain C math functions exist.
834 dnl Check to see if basic C math functions have float versions.
835 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
837 _acosf _asinf _atanf \
839 _coshf _sinhf _tanhf)
840 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
844 dnl Check to see if basic C math functions have long double versions.
845 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
847 _acosl _asinl _atanl \
849 _coshl _sinhl _tanhl)
850 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
855 CXXFLAGS="$ac_save_CXXFLAGS"
860 dnl Check to see if there is native support for complex
862 dnl Don't compile bits in math/* if native support exits.
864 dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
866 dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
867 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
868 dnl Check for complex versions of math functions of platform.
869 AC_CHECK_LIB(m, main)
870 AC_REPLACE_MATHFUNCS(nan copysignf)
872 dnl For __signbit to signbit conversions.
873 AC_CHECK_FUNCS([__signbit], , [LIBMATHOBJS="$LIBMATHOBJS signbit.lo"])
874 AC_CHECK_FUNCS([__signbitf], , [LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"])
876 dnl Compile the long double complex functions only if the function
877 dnl provides the non-complex long double functions that are needed.
878 dnl Currently this includes copysignl, which should be
879 dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
880 if test x$ac_cv_func_copysignl = x"yes"; then
881 AC_CHECK_FUNCS([__signbitl], , [LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"])
884 AC_SUBST(LIBMATHOBJS)
888 dnl Check to see what architecture and operating system we are compiling
889 dnl for. Also, if architecture- or OS-specific flags are required for
890 dnl compilation, pick them up here.
892 dnl GLIBCPP_CHECK_TARGET
893 AC_DEFUN(GLIBCPP_CHECK_TARGET, [
894 . [$]{glibcpp_basedir}/configure.target
895 AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
896 AC_MSG_RESULT(OS config directory is $os_include_dir)
901 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
902 dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
903 dnl must have been previously checked.)
905 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
906 dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
908 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
909 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
911 dnl Test wchar.h for mbstate_t, which is needed for char_traits and
912 dnl others even if wchar_t support is not on.
913 AC_MSG_CHECKING([for mbstate_t])
914 AC_TRY_COMPILE([#include <wchar.h>],
915 [mbstate_t teststate;],
916 have_mbstate_t=yes, have_mbstate_t=no)
917 AC_MSG_RESULT($have_mbstate_t)
918 if test x"$have_mbstate_t" = xyes; then
919 AC_DEFINE(HAVE_MBSTATE_T)
922 dnl Sanity check for existence of ISO C99 headers for extended encoding.
923 AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
924 AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
926 dnl Only continue checking if the ISO C99 headers exist and support is on.
927 if test x"$ac_has_wchar_h" = xyes &&
928 test x"$ac_has_wctype_h" = xyes &&
929 test x"$enable_c_mbchar" != xno; then
931 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
932 dnl numeric_limits can instantiate type_traits<wchar_t>
933 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
934 AC_TRY_COMPILE([#include <wchar.h>],
935 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
936 has_wchar_minmax=yes, has_wchar_minmax=no)
937 AC_MSG_RESULT($has_wchar_minmax)
939 dnl Test wchar.h for WEOF, which is what we use to determine whether
940 dnl to specialize for char_traits<wchar_t> or not.
941 AC_MSG_CHECKING([for WEOF])
944 #include <stddef.h>],
946 has_weof=yes, has_weof=no)
947 AC_MSG_RESULT($has_weof)
949 dnl Tests for wide character functions used in char_traits<wchar_t>.
951 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
954 dnl Checks for names injected into std:: by the c_std headers.
955 AC_CHECK_FUNCS(btowc wctob fgetwc fgetwc fgetws fputwc fputws fwide \
956 fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
957 vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
958 mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
959 wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
960 wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr,, \
963 AC_MSG_CHECKING([for ISO C99 wchar_t support])
964 if test x"$has_weof" = xyes &&
965 test x"$has_wchar_minmax" = xyes &&
966 test x"$ac_wfuncs" = xyes; then
967 ac_isoC99_wchar_t=yes
971 AC_MSG_RESULT($ac_isoC99_wchar_t)
973 dnl Use iconv for wchar_t to char conversions. As such, check for
974 dnl X/Open Portability Guide, version 2 features (XPG2).
975 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
976 AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
978 dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
979 AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
981 LIBS="$LIBS $libiconv"
983 AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
984 ac_XPG2funcs=yes, ac_XPG2funcs=no)
988 AC_MSG_CHECKING([for XPG2 wchar_t support])
989 if test x"$ac_has_iconv_h" = xyes &&
990 test x"$ac_has_langinfo_h" = xyes &&
991 test x"$ac_XPG2funcs" = xyes; then
996 AC_MSG_RESULT($ac_XPG2_wchar_t)
998 dnl At the moment, only enable wchar_t specializations if all the
999 dnl above support is present.
1000 AC_MSG_CHECKING([for enabled wchar_t specializations])
1001 if test x"$ac_isoC99_wchar_t" = xyes &&
1002 test x"$ac_XPG2_wchar_t" = xyes; then
1003 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
1004 AC_MSG_RESULT("yes")
1009 dnl Wide characters disabled by the user.
1010 AC_MSG_WARN([wchar_t support disabled.])
1016 dnl Check for special debugging mode; not for production use.
1018 dnl GLIBCPP_ENABLE_DEBUG
1019 dnl --enable-debug sets '-ggdb3 -O0'.
1020 dnl --disable-debug sets '-g' and whatever optimization options the
1021 dnl compiler can handle.
1022 dnl + --enable-maintainer-mode automatically defaults this to on.
1023 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
1024 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
1025 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1026 dnl defaults to `no'.
1027 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
1028 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
1029 AC_ARG_ENABLE(debug,
1030 changequote(<<, >>)dnl
1031 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
1032 changequote([, ])dnl
1033 [case "${enableval}" in
1034 yes) enable_debug=yes ;;
1035 no) enable_debug=no ;;
1036 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
1038 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
1040 dnl Option parsed, now set things appropriately
1041 case "${enable_debug}" in
1043 DEBUG_FLAGS='-O0 -ggdb3'
1049 AC_SUBST(DEBUG_FLAGS)
1054 dnl Check for "unusual" flags to pass to the compiler while building.
1056 dnl GLIBCPP_ENABLE_CXX_FLAGS
1057 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
1058 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
1059 dnl Somehow this same set of flags must be passed when [re]building
1061 dnl --disable-cxx-flags passes nothing.
1062 dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
1063 dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
1064 dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
1065 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
1066 dnl If "default flags" is an empty string (or "none"), the effect is
1067 dnl the same as --disable or --enable=no.
1068 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
1069 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1070 AC_ARG_ENABLE(cxx-flags,
1071 changequote(<<, >>)dnl
1072 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
1073 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
1074 changequote([, ])dnl
1075 [case "x$enableval" in
1077 AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
1079 enable_cxx_flags='' ;;
1081 enable_cxx_flags="$enableval" ;;
1083 enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
1085 dnl Thinko on my part during design. This kludge is the workaround.
1086 if test "$enable_cxx_flags" = "none"; then
1087 enable_cxx_flags='';
1090 dnl Run through flags (either default or command-line) and set anything
1091 dnl extra (e.g., #defines) that must accompany particular g++ options.
1092 if test -n "$enable_cxx_flags"; then
1093 for f in $enable_cxx_flags; do
1097 *) # and we're trying to pass /what/ exactly?
1098 AC_MSG_ERROR([compiler flags start with a -]) ;;
1102 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1103 AC_SUBST(EXTRA_CXX_FLAGS)
1108 dnl Check for which locale library to use: gnu or generic.
1110 dnl GLIBCPP_ENABLE_CLOCALE
1111 dnl --enable-clocale=gnu sets config/locale/c_locale_gnu.cc and friends
1112 dnl --enable-clocale=generic sets config/locale/c_locale_generic.cc and friends
1114 dnl default is generic
1116 AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
1117 AC_MSG_CHECKING([for clocale to use])
1118 AC_ARG_ENABLE(clocale,
1119 [ --enable-clocale enable model for target locale package.
1120 --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
1122 if test x$enable_clocale = xno; then
1127 enable_clocale_flag=$enable_clocale
1129 dnl Probe for locale support if no specific model is specified.
1130 dnl Default to "generic"
1131 if test x$enable_clocale_flag = xno; then
1132 case x${target_os} in
1134 AC_EGREP_CPP([_GLIBCPP_ok], [
1135 #include <features.h>
1136 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1139 ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
1141 # Test for bugs early in glibc-2.2.x series
1142 if test x$enable_clocale_flag = xgnu; then
1144 #define _GNU_SOURCE 1
1147 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
1148 extern __typeof(newlocale) __newlocale;
1149 extern __typeof(duplocale) __duplocale;
1150 extern __typeof(strcoll_l) __strcoll_l;
1154 const char __one[] = "Äuglein Augmen";
1155 const char __two[] = "Äuglein";
1160 loc = __newlocale(1 << LC_ALL, "de_DE", 0);
1161 loc_dup = __duplocale(loc);
1162 i = __strcoll_l(__one, __two, loc);
1163 j = __strcoll_l(__one, __two, loc_dup);
1167 [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
1168 [enable_clocale_flag=generic])
1171 # ... at some point put __strxfrm_l tests in as well.
1174 enable_clocale_flag=generic
1179 dnl Deal with gettext issues.
1181 [ --enable-nls use Native Language Support (default)],
1185 dnl Set configure bits for specified locale package
1186 case x${enable_clocale_flag} in
1188 AC_MSG_RESULT(generic)
1190 CLOCALE_H=config/locale/generic/c_locale.h
1191 CLOCALE_CC=config/locale/generic/c_locale.cc
1192 CCODECVT_H=config/locale/generic/codecvt_specializations.h
1193 CCOLLATE_CC=config/locale/generic/collate_members.cc
1194 CCTYPE_CC=config/locale/generic/ctype_members.cc
1195 CMESSAGES_H=config/locale/generic/messages_members.h
1196 CMESSAGES_CC=config/locale/generic/messages_members.cc
1197 CMONEY_CC=config/locale/generic/monetary_members.cc
1198 CNUMERIC_CC=config/locale/generic/numeric_members.cc
1199 CTIME_CC=config/locale/generic/time_members.cc
1200 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
1205 # Declare intention to use gettext, and add support for specific
1207 # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
1210 # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
1211 AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
1212 if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
1215 # Export the build objects.
1216 for ling in $ALL_LINGUAS; do \
1217 glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
1218 glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
1220 AC_SUBST(glibcpp_MOFILES)
1221 AC_SUBST(glibcpp_POFILES)
1223 CLOCALE_H=config/locale/gnu/c_locale.h
1224 CLOCALE_CC=config/locale/gnu/c_locale.cc
1225 CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
1226 CCOLLATE_CC=config/locale/gnu/collate_members.cc
1227 CCTYPE_CC=config/locale/gnu/ctype_members.cc
1228 CMESSAGES_H=config/locale/gnu/messages_members.h
1229 CMESSAGES_CC=config/locale/gnu/messages_members.cc
1230 CMONEY_CC=config/locale/gnu/monetary_members.cc
1231 CNUMERIC_CC=config/locale/gnu/numeric_members.cc
1232 CTIME_CC=config/locale/gnu/time_members.cc
1233 CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
1236 AC_MSG_RESULT(generic)
1238 CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
1239 CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc
1240 CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
1241 CCOLLATE_CC=config/locale/generic/collate_members.cc
1242 CCTYPE_CC=config/locale/generic/ctype_members.cc
1243 CMESSAGES_H=config/locale/ieee_1003.1-2001/messages_members.h
1244 CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc
1245 CMONEY_CC=config/locale/generic/monetary_members.cc
1246 CNUMERIC_CC=config/locale/generic/numeric_members.cc
1247 CTIME_CC=config/locale/generic/time_members.cc
1248 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
1251 echo "$enable_clocale is an unknown locale package" 1>&2
1256 # This is where the testsuite looks for locale catalogs, using the
1257 # -DLOCALEDIR define during testsuite compilation.
1258 glibcpp_localedir=${glibcpp_builddir}/po/share/locale
1259 AC_SUBST(glibcpp_localedir)
1263 AC_SUBST(CCODECVT_H)
1264 AC_SUBST(CMESSAGES_H)
1265 AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
1266 AC_LINK_FILES($CCOLLATE_CC, src/collate.cc)
1267 AC_LINK_FILES($CCTYPE_CC, src/ctype.cc)
1268 AC_LINK_FILES($CMESSAGES_CC, src/messages.cc)
1269 AC_LINK_FILES($CMONEY_CC, src/monetary.cc)
1270 AC_LINK_FILES($CNUMERIC_CC, src/numeric.cc)
1271 AC_LINK_FILES($CTIME_CC, src/time.cc)
1272 AC_LINK_FILES($CLOCALE_INTERNAL_H, src/c++locale_internal.h)
1277 dnl Check for which I/O library to use: libio, or something specific.
1279 dnl GLIBCPP_ENABLE_CSTDIO
1280 dnl --enable-cstdio=libio sets config/io/c_io_libio.h and friends
1282 dnl default is stdio
1284 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
1285 AC_MSG_CHECKING([for cstdio to use])
1286 AC_ARG_ENABLE(cstdio,
1287 [ --enable-cstdio enable stdio for target io package.
1288 --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
1290 if test x$enable_cstdio = xno; then
1293 enable_cstdio=stdio)
1295 enable_cstdio_flag=$enable_cstdio
1297 dnl Check if a valid I/O package
1298 case x${enable_cstdio_flag} in
1300 CSTDIO_H=config/io/c_io_libio.h
1301 BASIC_FILE_H=config/io/basic_file_libio.h
1302 BASIC_FILE_CC=config/io/basic_file_libio.cc
1303 AC_MSG_RESULT(libio)
1305 # see if we are on a system with libio native (ie, linux)
1306 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
1308 # Need to check and see what version of glibc is being used. If
1309 # it's not glibc-2.2 or higher, then we'll need to go ahead and
1310 # compile most of libio for linux systems.
1311 if test x$has_libio = x"yes"; then
1314 AC_MSG_CHECKING([for glibc version >= 2.2])
1315 AC_EGREP_CPP([ok], [
1316 #include <features.h>
1317 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1320 ], glibc_satisfactory=yes, glibc_satisfactory=no)
1321 AC_MSG_RESULT($glibc_satisfactory)
1325 # XXX at the moment, admit defeat and force the recompilation
1326 # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
1327 glibc_satisfactory=no
1329 if test x$glibc_satisfactory = x"yes"; then
1334 # bkoz XXX need to add checks to enable this
1335 # pme XXX here's a first pass at such a check
1336 if test x$enable_c_mbchar != xno; then
1344 # Using libio, but <libio.h> doesn't exist on the target system. . .
1346 # bkoz XXX need to add checks to enable this
1347 # pme XXX here's a first pass at such a check
1348 if test x$enable_c_mbchar != xno; then
1355 xstdio | x | xno | xnone | xyes)
1357 CSTDIO_H=config/io/c_io_stdio.h
1358 BASIC_FILE_H=config/io/basic_file_stdio.h
1359 BASIC_FILE_CC=config/io/basic_file_stdio.cc
1360 AC_MSG_RESULT(stdio)
1362 # We're not using stdio.
1367 echo "$enable_cstdio is an unknown io package" 1>&2
1372 AC_SUBST(BASIC_FILE_H)
1373 AC_LINK_FILES($BASIC_FILE_CC, src/basic_file.cc)
1375 # 2000-08-04 bkoz hack
1376 CCODECVT_C=config/io/c_io_libio_codecvt.c
1377 AC_SUBST(CCODECVT_C)
1378 # 2000-08-04 bkoz hack
1380 AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
1381 test "$need_libio" = yes || test "$need_wlibio" = yes)
1382 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
1383 AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
1384 if test "$need_libio" = yes || test "$need_wlibio" = yes; then
1385 libio_la=../libio/libio.la
1394 dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
1395 dnl We must stage the required headers so that they will be installed
1396 dnl with the library (unlike libgcc, the STL implementation is provided
1397 dnl solely within headers). Since we must not inject random user-space
1398 dnl macro names into user-provided C++ code, we first stage into <file>-in
1399 dnl and process to <file> with an output command. The reason for a two-
1400 dnl stage process here is to correctly handle $srcdir!=$objdir without
1401 dnl having to write complex code (the sed commands to clean the macro
1402 dnl namespace are complex and fragile enough as it is). We must also
1403 dnl add a relative path so that -I- is supported properly.
1405 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
1406 AC_MSG_CHECKING([for thread model used by GCC])
1407 target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
1408 AC_MSG_RESULT([$target_thread_file])
1410 if test $target_thread_file != single; then
1411 AC_DEFINE(HAVE_GTHR_DEFAULT)
1412 AC_DEFINE(_GLIBCPP_SUPPORTS_WEAK, __GXX_WEAK__)
1415 glibcpp_thread_h=gthr-$target_thread_file.h
1416 AC_SUBST(glibcpp_thread_h)
1421 dnl Check for exception handling support. If an explicit enable/disable
1422 dnl sjlj exceptions is given, we don't have to detect. Otherwise the
1423 dnl target may or may not support call frame exceptions.
1425 dnl GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
1426 dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
1427 dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
1429 dnl Define _GLIBCPP_SJLJ_EXCEPTIONS if the compiler is configured for it.
1431 AC_DEFUN(GLIBCPP_ENABLE_SJLJ_EXCEPTIONS, [
1432 AC_MSG_CHECKING([for exception model to use])
1435 AC_ARG_ENABLE(sjlj-exceptions,
1436 [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
1438 [dnl Botheration. Now we've got to detect the exception model.
1439 dnl Link tests against libgcc.a are problematic since -- at least
1440 dnl as of this writing -- we've not been given proper -L bits for
1441 dnl single-tree newlib and libgloss.
1443 dnl This is what AC_TRY_COMPILE would do if it didn't delete the
1444 dnl conftest files before we got a change to grep them first.
1445 cat > conftest.$ac_ext << EOF
1446 [#]line __oline__ "configure"
1455 old_CXXFLAGS="$CXXFLAGS"
1457 if AC_TRY_EVAL(ac_compile); then
1458 if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
1459 enable_sjlj_exceptions=yes
1460 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
1461 enable_sjlj_exceptions=no
1464 CXXFLAGS="$old_CXXFLAGS"
1466 if test x$enable_sjlj_exceptions = xyes; then
1467 AC_DEFINE(_GLIBCPP_SJLJ_EXCEPTIONS, 1,
1468 [Define if the compiler is configured for setjmp/longjmp exceptions.])
1469 ac_exception_model_name=sjlj
1470 elif test x$enable_sjlj_exceptions = xno; then
1471 ac_exception_model_name="call frame"
1473 AC_MSG_ERROR([unable to detect exception model])
1476 AC_MSG_RESULT($ac_exception_model_name)
1481 dnl Check for libunwind exception handling support. If enabled then
1482 dnl we assume that the _Unwind_* functions that make up the Unwind ABI
1483 dnl (_Unwind_RaiseException, _Unwind_Resume, etc.) are defined by
1484 dnl libunwind instead of libgcc and that libstdc++ has a dependency
1485 dnl on libunwind as well as libgcc.
1487 dnl GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
1488 dnl --enable-libunwind-exceptions forces the use of libunwind.
1489 dnl --disable-libunwind-exceptions assumes there is no libunwind.
1491 dnl Define _GLIBCPP_LIBUNWIND_EXCEPTIONS if requested.
1493 AC_DEFUN(GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS, [
1494 AC_MSG_CHECKING([for use of libunwind])
1495 AC_ARG_ENABLE(libunwind-exceptions,
1496 [ --enable-libunwind-exceptions force use of libunwind for exceptions],
1497 use_libunwind_exceptions=$enableval,
1498 use_libunwind_exceptions=no)
1499 AC_MSG_RESULT($use_libunwind_exceptions)
1500 dnl Option parsed, now set things appropriately
1501 if test x"$use_libunwind_exceptions" = xyes; then
1502 LIBUNWIND_FLAG="-lunwind"
1506 AC_SUBST(LIBUNWIND_FLAG)
1510 dnl Check for ISO/IEC 9899:1999 "C99" support.
1512 dnl GLIBCPP_ENABLE_C99
1513 dnl --enable-c99 defines _GLIBCPP_USE_C99
1514 dnl --disable-c99 leaves _GLIBCPP_USE_C99 undefined
1515 dnl + Usage: GLIBCPP_ENABLE_C99[(DEFAULT)]
1516 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1517 dnl defaults to `no'.
1518 dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
1520 dnl GLIBCPP_ENABLE_C99
1521 AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
1522 define([GLIBCPP_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
1525 changequote(<<, >>)dnl
1526 <<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCPP_ENABLE_C99_DEFAULT],
1527 changequote([, ])dnl
1528 [case "$enableval" in
1529 yes) enable_c99=yes ;;
1530 no) enable_c99=no ;;
1531 *) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
1533 enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
1538 # Check for the existence of <math.h> functions used if C99 is enabled.
1540 AC_MSG_CHECKING([for ISO C99 support in <math.h>])
1541 AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
1542 AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
1543 AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
1544 AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
1545 AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
1546 AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
1547 AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
1548 AC_TRY_COMPILE([#include <math.h>],
1549 [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
1550 AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
1551 AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
1552 AC_TRY_COMPILE([#include <math.h>],
1553 [islessgreater(0.0,0.0);],, [ac_c99_math=no])
1554 AC_TRY_COMPILE([#include <math.h>],
1555 [isunordered(0.0,0.0);],, [ac_c99_math=no])
1556 AC_MSG_RESULT($ac_c99_math)
1558 # Check for the existence in <stdio.h> of vscanf, et. al.
1560 AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
1561 AC_TRY_COMPILE([#include <stdio.h>],
1562 [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
1563 AC_TRY_COMPILE([#include <stdio.h>
1565 void foo(char* fmt, ...)
1566 {va_list args; va_start(args, fmt);
1567 vfscanf(stderr, "%i", args);}],
1568 [],, [ac_c99_stdio=no])
1569 AC_TRY_COMPILE([#include <stdio.h>
1571 void foo(char* fmt, ...)
1572 {va_list args; va_start(args, fmt);
1573 vscanf("%i", args);}],
1574 [],, [ac_c99_stdio=no])
1575 AC_TRY_COMPILE([#include <stdio.h>
1577 void foo(char* fmt, ...)
1578 {va_list args; va_start(args, fmt);
1579 vsnprintf(fmt, 0, "%i", args);}],
1580 [],, [ac_c99_stdio=no])
1581 AC_TRY_COMPILE([#include <stdio.h>
1583 void foo(char* fmt, ...)
1584 {va_list args; va_start(args, fmt);
1585 vsscanf(fmt, "%i", args);}],
1586 [],, [ac_c99_stdio=no])
1587 AC_MSG_RESULT($ac_c99_stdio)
1589 # Check for the existence in <stdlib.h> of lldiv_t, et. al.
1591 AC_MSG_CHECKING([for lldiv_t declaration])
1592 AC_CACHE_VAL(ac_c99_lldiv_t, [
1593 AC_TRY_COMPILE([#include <stdlib.h>],
1595 [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
1597 AC_MSG_RESULT($ac_c99_lldiv_t)
1599 AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
1600 AC_TRY_COMPILE([#include <stdlib.h>],
1601 [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
1602 AC_TRY_COMPILE([#include <stdlib.h>],
1603 [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
1604 AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
1605 AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
1606 AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
1607 AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
1608 if test x"$ac_c99_lldiv_t" = x"no"; then
1611 AC_MSG_RESULT($ac_c99_stdlib)
1613 # Check for the existence of <wchar.h> functions used if C99 is enabled.
1614 # XXX the wchar.h checks should be rolled into the general C99 bits.
1616 AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
1617 AC_TRY_COMPILE([#include <wchar.h>],
1618 [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
1619 AC_TRY_COMPILE([#include <wchar.h>],
1620 [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
1621 AC_TRY_COMPILE([#include <wchar.h>],
1622 [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
1623 AC_MSG_RESULT($ac_c99_wchar)
1625 AC_MSG_CHECKING([for enabled ISO C99 support])
1626 if test x"$ac_c99_math" = x"no" ||
1627 test x"$ac_c99_stdio" = x"no" ||
1628 test x"$ac_c99_stdlib" = x"no" ||
1629 test x"$ac_c99_wchar" = x"no"; then
1632 AC_MSG_RESULT($enable_c99)
1634 # Option parsed, now set things appropriately
1635 if test x"$enable_c99" = x"yes"; then
1636 AC_DEFINE(_GLIBCPP_USE_C99)
1644 dnl Check for template specializations for the 'long long' type extension.
1645 dnl The result determines only whether 'long long' I/O is enabled; things
1646 dnl like numeric_limits<> specializations are always available.
1648 dnl GLIBCPP_ENABLE_LONG_LONG
1649 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
1650 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
1651 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
1652 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1653 dnl defaults to `no'.
1654 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1656 dnl GLIBCPP_ENABLE_LONG_LONG
1657 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
1658 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
1660 AC_ARG_ENABLE(long-long,
1661 changequote(<<, >>)dnl
1662 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
1663 changequote([, ])dnl
1664 [case "$enableval" in
1665 yes) enable_long_long=yes ;;
1666 no) enable_long_long=no ;;
1667 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1669 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1674 AC_MSG_CHECKING([for enabled long long I/O support])
1675 # iostreams require strtoll, strtoull to compile
1676 AC_TRY_COMPILE([#include <stdlib.h>],
1677 [char* tmp; strtoll("gnu", &tmp, 10);],,[enable_long_long=no])
1678 AC_TRY_COMPILE([#include <stdlib.h>],
1679 [char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
1681 # Option parsed, now set things appropriately
1682 if test x"$enable_long_long" = xyes; then
1683 AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1685 AC_MSG_RESULT($enable_long_long)
1692 dnl Check for what kind of C headers to use.
1694 dnl GLIBCPP_ENABLE_CHEADERS
1695 dnl --enable-cheaders= [does stuff].
1696 dnl --disable-cheaders [does not do anything, really].
1697 dnl + This will eventually need to be 'c_shadow' by default.
1698 dnl + Usage: GLIBCPP_ENABLE_CHEADERS[(DEFAULT)]
1699 dnl Where DEFAULT is either `c' or `c_std' or 'c_shadow'.
1700 dnl If ommitted, it defaults to `c_std'.
1701 AC_DEFUN(GLIBCPP_ENABLE_CHEADERS, [dnl
1702 define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
1703 AC_MSG_CHECKING([for c header strategy to use])
1704 AC_ARG_ENABLE(cheaders,
1705 changequote(<<, >>)dnl
1706 << --enable-cheaders construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
1708 [case "$enableval" in
1713 enable_cheaders=c_std
1716 enable_cheaders=c_shadow
1718 *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
1721 enable_cheaders=GLIBCPP_ENABLE_CHEADERS_DEFAULT)
1722 AC_MSG_RESULT($enable_cheaders)
1724 dnl Option parsed, now set things appropriately
1725 case "$enable_cheaders" in
1727 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_shadow'
1730 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
1733 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
1737 AC_SUBST(C_INCLUDE_DIR)
1738 AM_CONDITIONAL(GLIBCPP_C_HEADERS_C, test "$enable_cheaders" = c)
1739 AM_CONDITIONAL(GLIBCPP_C_HEADERS_C_STD, test "$enable_cheaders" = c_std)
1740 AM_CONDITIONAL(GLIBCPP_C_HEADERS_COMPATIBILITY, test "$c_compatibility" = yes)
1745 dnl Check for wide character support. Has the same effect as the option
1746 dnl in gcc's configure, but in a form that autoconf can mess with.
1748 dnl GLIBCPP_ENABLE_C_MBCHAR
1749 dnl --enable-c-mbchar requests all the wchar_t stuff.
1750 dnl --disable-c-mbchar doesn't.
1751 dnl + Usage: GLIBCPP_ENABLE_C_MBCHAR[(DEFAULT)]
1752 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1753 dnl defaults to `no'.
1754 AC_DEFUN(GLIBCPP_ENABLE_C_MBCHAR, [dnl
1755 define([GLIBCPP_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
1756 AC_ARG_ENABLE(c-mbchar,
1757 changequote(<<, >>)dnl
1758 << --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCPP_ENABLE_C_MBCHAR_DEFAULT],
1759 changequote([, ])dnl
1760 [case "$enableval" in
1761 yes) enable_c_mbchar=yes ;;
1762 no) enable_c_mbchar=no ;;
1763 *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
1765 enable_c_mbchar=GLIBCPP_ENABLE_C_MBCHAR_DEFAULT)dnl
1766 dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
1771 dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
1773 dnl TOPLEVEL_INCLUDES
1774 dnl LIBMATH_INCLUDES
1775 dnl LIBSUPCXX_INCLUDES
1777 dnl CSHADOW_INCLUDES
1779 dnl GLIBCPP_EXPORT_INCLUDES
1780 AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
1781 # Root level of the build directory include sources.
1782 GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
1784 # Passed down for canadian crosses.
1785 if test x"$CANADIAN" = xyes; then
1786 TOPLEVEL_INCLUDES='-I$(includedir)'
1789 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1791 LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
1793 if test x"$need_libio" = xyes; then
1794 LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
1795 AC_SUBST(LIBIO_INCLUDES)
1798 # Now, export this to all the little Makefiles....
1799 AC_SUBST(GLIBCPP_INCLUDES)
1800 AC_SUBST(TOPLEVEL_INCLUDES)
1801 AC_SUBST(LIBMATH_INCLUDES)
1802 AC_SUBST(LIBSUPCXX_INCLUDES)
1807 dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
1809 AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
1810 # Optimization flags that are probably a good idea for thrill-seekers. Just
1811 # uncomment the lines below and make, everything else is ready to go...
1812 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
1814 AC_SUBST(OPTIMIZE_CXXFLAGS)
1816 WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings -Winline'
1817 AC_SUBST(WARN_FLAGS)
1821 dnl GLIBCPP_EXPORT_INSTALL_INFO
1822 dnl calculates gxx_install_dir
1823 dnl exports glibcpp_toolexecdir
1824 dnl exports glibcpp_toolexeclibdir
1825 dnl exports glibcpp_prefixdir
1827 dnl Assumes cross_compiling bits already done, and with_cross_host in
1830 dnl GLIBCPP_EXPORT_INSTALL_INFO
1831 AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
1832 # Assumes glibcpp_builddir, glibcpp_srcdir are alreay set up and
1833 # exported correctly in GLIBCPP_CONFIGURE.
1834 glibcpp_toolexecdir=no
1835 glibcpp_toolexeclibdir=no
1836 glibcpp_prefixdir=${prefix}
1838 # Process the option --with-gxx-include-dir=<path to include-files directory>
1839 AC_MSG_CHECKING([for --with-gxx-include-dir])
1840 AC_ARG_WITH(gxx-include-dir,
1841 [ --with-gxx-include-dir the installation directory for include files],
1842 [case "${withval}" in
1844 AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
1851 gxx_include_dir=${withval}
1853 esac], [gxx_include_dir=no])
1854 AC_MSG_RESULT($gxx_include_dir)
1856 # Process the option "--enable-version-specific-runtime-libs"
1857 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
1858 AC_ARG_ENABLE(version-specific-runtime-libs,
1859 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
1860 [case "$enableval" in
1861 yes) version_specific_libs=yes ;;
1862 no) version_specific_libs=no ;;
1863 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
1865 version_specific_libs=no)dnl
1866 # Option set, now we can test it.
1867 AC_MSG_RESULT($version_specific_libs)
1869 # Default case for install directory for include files.
1870 if test $version_specific_libs = no && test $gxx_include_dir = no; then
1871 gxx_include_dir='$(prefix)'/include/c++/${gcc_version}
1874 # Version-specific runtime libs processing.
1875 if test $version_specific_libs = yes; then
1876 # Need the gcc compiler version to know where to install libraries
1877 # and header files if --enable-version-specific-runtime-libs option
1879 if test x"$gxx_include_dir" = x"no"; then
1880 gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/c++
1882 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1883 glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
1886 # Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
1887 # Install a library built with a cross compiler in tooldir, not libdir.
1888 if test x"$glibcpp_toolexecdir" = x"no"; then
1889 if test -n "$with_cross_host" &&
1890 test x"$with_cross_host" != x"no"; then
1891 glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
1892 glibcpp_toolexeclibdir='$(toolexecdir)/lib$(MULTISUBDIR)'
1894 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1895 glibcpp_toolexeclibdir='$(libdir)$(MULTISUBDIR)'
1899 AC_MSG_CHECKING([for install location])
1900 AC_MSG_RESULT($gxx_include_dir)
1902 AC_SUBST(glibcpp_prefixdir)
1903 AC_SUBST(gxx_include_dir)
1904 AC_SUBST(glibcpp_toolexecdir)
1905 AC_SUBST(glibcpp_toolexeclibdir)
1909 # Check for functions in math library.
1910 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1912 # This file can be copied and used freely without restrictions. It can
1913 # be used in projects which are not available under the GNU Public License
1914 # but which still want to provide support for the GNU gettext functionality.
1915 # Please note that the actual code is *not* freely available.
1919 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1920 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1921 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])])
1924 dnl This macro searches for a GNU version of make. If a match is found, the
1925 dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
1926 dnl set to "#". This is useful for including a special features in a Makefile,
1927 dnl which cannot be handled by other versions of make. The variable
1928 dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
1929 dnl the empty string otherwise.
1931 dnl Here is an example of its use:
1933 dnl Makefile.in might contain:
1935 dnl # A failsafe way of putting a dependency rule into a makefile
1937 dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
1939 dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
1940 dnl @ifGNUmake@ include $(DEPEND)
1941 dnl @ifGNUmake@ endif
1943 dnl Then configure.in would normally contain:
1945 dnl CHECK_GNU_MAKE()
1946 dnl AC_OUTPUT(Makefile)
1948 dnl Then perhaps to cause gnu make to override any other make, we could do
1949 dnl something like this (note that GNU make always looks for GNUmakefile first):
1951 dnl if ! test x$_cv_gnu_make_command = x ; then
1952 dnl mv Makefile GNUmakefile
1953 dnl echo .DEFAULT: > Makefile ;
1954 dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
1957 dnl Then, if any (well almost any) other make is called, and GNU make also
1958 dnl exists, then the other make wraps the GNU make.
1960 dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
1961 dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
1963 dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
1964 dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
1965 dnl #### conditional's subshell (" --version" is not a command), using a
1966 dnl #### different option to grep(1).
1968 dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
1969 dnl #### ${MAKE:-make}).
1972 GLIBCPP_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
1973 _cv_gnu_make_command='' ;
1974 dnl Search all the common names for GNU make
1975 for a in "${MAKE-make}" make gmake gnumake ; do
1976 if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
1978 _cv_gnu_make_command=$a ;
1983 dnl If there was a GNU version, then set @ifGNUmake@ to the empty
1984 dnl string, '#' otherwise
1985 if test "x$_cv_gnu_make_command" != "x" ; then
1994 dnl Check for headers for, and arguments to, the setrlimit() function.
1995 dnl Used only in testsuite_hooks.h.
1996 AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT_ancilliary, [
1997 AC_TRY_COMPILE([#include <unistd.h>
1998 #include <sys/time.h>
1999 #include <sys/resource.h>
2000 ], [ int f = RLIMIT_$1 ; ],
2001 [glibcpp_mresult=1], [glibcpp_mresult=0])
2002 AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcpp_mresult,
2003 [Only used in build directory testsuite_hooks.h.])
2005 AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
2006 setrlimit_have_headers=yes
2007 AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
2009 setrlimit_have_headers=no)
2010 # If don't have the headers, then we can't run the tests now, and we
2011 # won't be seeing any of these during testsuite compilation.
2012 if test $setrlimit_have_headers = yes; then
2013 # Can't do these in a loop, else the resulting syntax is wrong.
2014 GLIBCPP_CHECK_SETRLIMIT_ancilliary(DATA)
2015 GLIBCPP_CHECK_SETRLIMIT_ancilliary(RSS)
2016 GLIBCPP_CHECK_SETRLIMIT_ancilliary(VMEM)
2017 GLIBCPP_CHECK_SETRLIMIT_ancilliary(AS)
2019 # Check for rlimit, setrlimit.
2020 AC_CACHE_VAL(ac_setrlimit, [
2021 AC_TRY_COMPILE([#include <unistd.h>
2022 #include <sys/time.h>
2023 #include <sys/resource.h>
2025 [ struct rlimit r; setrlimit(0, &r);],
2026 [ac_setrlimit=yes], [ac_setrlimit=no])
2030 AC_MSG_CHECKING([for testsuite memory limit support])
2031 if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
2033 AC_DEFINE(_GLIBCPP_MEM_LIMITS)
2037 AC_MSG_RESULT($ac_mem_limits)
2042 dnl Does any necessary configuration of the testsuite directory. Generates
2043 dnl the testsuite_hooks.h header.
2045 dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
2046 AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
2047 GLIBCPP_CHECK_SETRLIMIT
2049 # Look for setenv, so that extended locale tests can be performed.
2050 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
2052 # Export file names for ABI checking.
2053 baseline_file="${glibcpp_srcdir}/config/abi/${abi_baseline_triplet}/baseline_symbols.txt"
2054 AC_SUBST(baseline_file)
2056 # Don't do ABI checking unless native.
2057 AM_CONDITIONAL(GLIBCPP_BUILD_ABI_CHECK,
2058 test x"$build" = x"$host" && test -z "$with_cross_host")
2062 sinclude(../libtool.m4)
2063 dnl The lines below arrange for aclocal not to bring an installed
2064 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
2065 dnl add a definition of LIBTOOL to Makefile.in.
2066 ifelse(,,,[AC_SUBST(LIBTOOL)
2067 AC_DEFUN([AM_PROG_LIBTOOL])
2068 AC_DEFUN([AC_LIBTOOL_DLOPEN])
2069 AC_DEFUN([AC_PROG_LD])
2073 # Check whether LC_MESSAGES is available in <locale.h>.
2074 # Ulrich Drepper <drepper@cygnus.com>, 1995.
2076 # This file file be copied and used freely without restrictions. It can
2077 # be used in projects which are not available under the GNU Public License
2078 # but which still want to provide support for the GNU gettext functionality.
2079 # Please note that the actual code is *not* freely available.
2083 AC_DEFUN(AC_LC_MESSAGES, [
2084 AC_CHECK_HEADER(locale.h, [
2085 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
2086 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2087 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
2088 if test $ac_cv_val_LC_MESSAGES = yes; then
2089 AC_DEFINE(HAVE_LC_MESSAGES)
2096 dnl Check for whether the Boost-derived checks should be turned on.
2098 dnl GLIBCPP_ENABLE_CONCEPT_CHECKS
2099 dnl --enable-concept-checks turns them on.
2100 dnl --disable-concept-checks leaves them off.
2101 dnl + Usage: GLIBCPP_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
2102 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
2103 dnl defaults to `no'.
2104 AC_DEFUN(GLIBCPP_ENABLE_CONCEPT_CHECKS, [dnl
2105 define([GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT], ifelse($1, yes, yes, no))dnl
2106 AC_ARG_ENABLE(concept-checks,
2107 changequote(<<, >>)dnl
2108 << --enable-concept-checks use Boost-derived template checks [default=>>GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT],
2109 changequote([, ])dnl
2110 [case "$enableval" in
2111 yes) enable_concept_checks=yes ;;
2112 no) enable_concept_checks=no ;;
2113 *) AC_MSG_ERROR([Unknown argument to enable/disable concept checks]) ;;
2115 enable_concept_checks=GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT)dnl
2116 dnl Option parsed, now set things appropriately
2117 if test x"$enable_concept_checks" = xyes; then
2118 AC_DEFINE(_GLIBCPP_CONCEPT_CHECKS)
2124 dnl Add version tags to symbols in shared library (or not), additionally
2125 dnl marking other symbols as private/local (or not).
2127 dnl GLIBCPP_ENABLE_SYMVERS
2128 dnl --enable-symvers=style adds a version script to the linker call when
2129 dnl creating the shared library. The choice of version script is
2130 dnl controlled by 'style'.
2131 dnl --disable-symvers does not.
2132 dnl + Usage: GLIBCPP_ENABLE_SYMVERS[(DEFAULT)]
2133 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
2134 dnl defaults to `no'. Passing `yes' tries to choose a default style
2135 dnl based on linker characteristics. Passing 'no' disables versioning.
2136 AC_DEFUN(GLIBCPP_ENABLE_SYMVERS, [dnl
2137 define([GLIBCPP_ENABLE_SYMVERS_DEFAULT], ifelse($1, yes, yes, no))dnl
2138 AC_ARG_ENABLE(symvers,
2139 changequote(<<, >>)dnl
2140 << --enable-symvers=style enables symbol versioning of the shared library [default=>>GLIBCPP_ENABLE_SYMVERS_DEFAULT],
2141 changequote([, ])dnl
2142 [case "$enableval" in
2143 yes) enable_symvers=yes ;;
2144 no) enable_symvers=no ;;
2145 # other names here, just as sanity checks
2146 #gnu|sun|etcetera) enable_symvers=$enableval ;;
2147 gnu) enable_symvers=$enableval ;;
2148 *) AC_MSG_ERROR([Unknown argument to enable/disable symvers]) ;;
2150 enable_symvers=GLIBCPP_ENABLE_SYMVERS_DEFAULT)dnl
2152 # If we never went through the GLIBCPP_CHECK_LINKER_FEATURES macro, then we
2153 # don't know enough about $LD to do tricks...
2154 if test x$enable_shared = xno ||
2156 test x$glibcpp_gnu_ld_version = x; then
2160 # Check to see if libgcc_s exists, indicating that shared libgcc is possible.
2161 if test $enable_symvers != no; then
2162 AC_MSG_CHECKING([for shared libgcc])
2163 ac_save_CFLAGS="$CFLAGS"
2165 AC_TRY_LINK(, [return 0], glibcpp_shared_libgcc=yes, glibcpp_shared_libgcc=no)
2166 CFLAGS="$ac_save_CFLAGS"
2167 AC_MSG_RESULT($glibcpp_shared_libgcc)
2170 # For GNU ld, we need at least this version. It's 2.12 in the same format
2171 # as the tested-for version. See GLIBCPP_CHECK_LINKER_FEATURES for more.
2172 glibcpp_min_gnu_ld_version=21200
2174 # Check to see if unspecified "yes" value can win, given results
2176 if test $enable_symvers = yes ; then
2177 if test $with_gnu_ld = yes &&
2178 test $glibcpp_shared_libgcc = yes ;
2180 if test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version ; then
2183 ac_test_CFLAGS="${CFLAGS+set}"
2184 ac_save_CFLAGS="$CFLAGS"
2185 CFLAGS='-shared -Wl,--version-script,conftest.map'
2188 echo 'FOO { global: f[a-z]o; local: *; };' > conftest.map
2190 AC_TRY_LINK([int foo;],, enable_symvers=gnu)
2191 if test "$ac_test_CFLAGS" = set; then
2192 CFLAGS="$ac_save_CFLAGS"
2194 # this is the suspicious part
2205 dnl Everything parsed; figure out what file to use.
2206 case $enable_symvers in
2208 LINKER_MAP=config/linker-map.dummy
2211 LINKER_MAP=config/linker-map.gnu
2215 AC_LINK_FILES($LINKER_MAP, src/linker.map)
2216 AM_CONDITIONAL(GLIBCPP_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
2217 AC_MSG_CHECKING([versioning on shared library symbols])
2218 AC_MSG_RESULT($enable_symvers)
2222 # isc-posix.m4 serial 2 (gettext-0.11.2)
2223 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2224 dnl This file is free software, distributed under the terms of the GNU
2225 dnl General Public License. As a special exception to the GNU General
2226 dnl Public License, this file may be distributed as part of a program
2227 dnl that contains a configuration script generated by Autoconf, under
2228 dnl the same distribution terms as the rest of that program.
2230 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
2232 # This test replaces the one in autoconf.
2233 # Currently this macro should have the same name as the autoconf macro
2234 # because gettext's gettext.m4 (distributed in the automake package)
2235 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
2236 # give these diagnostics:
2237 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
2238 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
2240 undefine([AC_ISC_POSIX])
2242 AC_DEFUN([AC_ISC_POSIX],
2244 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
2245 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
2249 # Add --enable-maintainer-mode option to configure.
2254 AC_DEFUN([AM_MAINTAINER_MODE],
2255 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
2256 dnl maintainer-mode is disabled by default
2257 AC_ARG_ENABLE(maintainer-mode,
2258 [ --enable-maintainer-mode enable make rules and dependencies not useful
2259 (and sometimes confusing) to the casual installer],
2260 USE_MAINTAINER_MODE=$enableval,
2261 USE_MAINTAINER_MODE=no)
2262 AC_MSG_RESULT($USE_MAINTAINER_MODE)
2263 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
2264 MAINT=$MAINTAINER_MODE_TRUE
2269 # Define a conditional.
2271 AC_DEFUN([AM_CONDITIONAL],
2282 # Do all the work for Automake. This macro actually does too much --
2283 # some checks are only needed if your package does certain things.
2284 # But this isn't really a big deal.
2289 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
2291 AC_DEFUN([AM_INIT_AUTOMAKE],
2292 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
2293 AC_REQUIRE([AC_PROG_INSTALL])
2298 dnl test to see if srcdir already configured
2299 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
2300 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2303 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
2304 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
2305 AC_REQUIRE([AM_SANITY_CHECK])
2306 AC_REQUIRE([AC_ARG_PROGRAM])
2307 dnl FIXME This is truly gross.
2308 missing_dir=`cd $ac_aux_dir && pwd`
2309 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
2310 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
2311 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
2312 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
2313 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
2314 AC_REQUIRE([AC_PROG_MAKE_SET])])
2316 # Copyright 2002 Free Software Foundation, Inc.
2318 # This program is free software; you can redistribute it and/or modify
2319 # it under the terms of the GNU General Public License as published by
2320 # the Free Software Foundation; either version 2, or (at your option)
2321 # any later version.
2323 # This program is distributed in the hope that it will be useful,
2324 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2325 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2326 # GNU General Public License for more details.
2328 # You should have received a copy of the GNU General Public License
2329 # along with this program; if not, write to the Free Software
2330 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2332 # AM_AUTOMAKE_VERSION(VERSION)
2333 # ----------------------------
2334 # Automake X.Y traces this macro to ensure aclocal.m4 has been
2335 # generated from the m4 files accompanying Automake X.Y.
2336 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
2338 # AM_SET_CURRENT_AUTOMAKE_VERSION
2339 # -------------------------------
2340 # Call AM_AUTOMAKE_VERSION so it can be traced.
2341 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
2342 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
2343 [AM_AUTOMAKE_VERSION([1.4-p6])])
2346 # Check to make sure that the build environment is sane.
2349 AC_DEFUN([AM_SANITY_CHECK],
2350 [AC_MSG_CHECKING([whether build environment is sane])
2353 echo timestamp > conftestfile
2354 # Do `set' in a subshell so we don't clobber the current shell's
2355 # arguments. Must try -L first in case configure is actually a
2356 # symlink; some systems play weird games with the mod time of symlinks
2357 # (eg FreeBSD returns the mod time of the symlink's containing
2360 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
2361 if test "[$]*" = "X"; then
2363 set X `ls -t $srcdir/configure conftestfile`
2365 if test "[$]*" != "X $srcdir/configure conftestfile" \
2366 && test "[$]*" != "X conftestfile $srcdir/configure"; then
2368 # If neither matched, then we have a broken ls. This can happen
2369 # if, for instance, CONFIG_SHELL is bash and it inherits a
2370 # broken ls alias from the environment. This has actually
2371 # happened. Such a system could not be considered "sane".
2372 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
2373 alias in your environment])
2376 test "[$]2" = conftestfile
2382 AC_MSG_ERROR([newly created file is older than distributed files!
2383 Check your system clock])
2386 AC_MSG_RESULT(yes)])
2388 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
2389 dnl The program must properly implement --version.
2390 AC_DEFUN([AM_MISSING_PROG],
2391 [AC_MSG_CHECKING(for working $2)
2392 # Run test in a subshell; some versions of sh will print an error if
2393 # an executable is not found, even if stderr is redirected.
2394 # Redirect stdin to placate older versions of autoconf. Sigh.
2395 if ($2 --version) < /dev/null > /dev/null 2>&1; then
2397 AC_MSG_RESULT(found)
2400 AC_MSG_RESULT(missing)
2404 # Like AC_CONFIG_HEADER, but automatically create stamp file.
2406 AC_DEFUN([AM_CONFIG_HEADER],
2408 AC_CONFIG_HEADER([$1])
2409 dnl When config.status generates a header, we must update the stamp-h file.
2410 dnl This file resides in the same directory as the config header
2411 dnl that is generated. We must strip everything past the first ":",
2412 dnl and everything past the last "/".
2413 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
2414 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
2415 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
2417 for am_file in <<$1>>; do
2418 case " <<$>>CONFIG_HEADERS " in
2419 *" <<$>>am_file "*<<)>>
2420 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
2423 am_indx=`expr "<<$>>am_indx" + 1`