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 basic configure bits, set toplevel_srcdir for Makefiles.
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 the rest of the library configury.
55 AC_DEFUN(GLIBCPP_CONFIGURE, [
56 # Export build and source directories.
57 # These need to be absolute paths, yet at the same time need to
58 # canonicalize only relative paths, because then amd will not unmount
59 # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
60 glibcpp_builddir=`${PWDCMD-pwd}`
62 [\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;;
63 *) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
65 AC_SUBST(glibcpp_builddir)
66 AC_SUBST(glibcpp_srcdir)
68 dnl This is here just to satisfy automake.
69 ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
72 # Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.5x, can also
73 # be 'cp -p' if linking isn't available. Uncomment the next line to
74 # force a particular method.
75 #ac_cv_prog_LN_S='cp -p'
78 # We use these options to decide which functions to include.
79 AC_ARG_WITH(target-subdir,
80 [ --with-target-subdir=SUBDIR
81 configuring in a subdirectory])
82 AC_ARG_WITH(cross-host,
83 [ --with-cross-host=HOST configuring with a cross compiler])
86 [ --with-newlib Configuring with newlib])
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 # Set up safe default values for all subsequent AM_CONDITIONAL tests.
227 # Find platform-specific directories containing configuration info. In
228 # addition to possibly modifying the same flags, it also sets up symlinks.
234 dnl Check to see if g++ can compile this library, and if so, if any version-
235 dnl specific precautions need to be taken.
237 dnl GLIBCPP_CHECK_COMPILER_VERSION
238 AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
239 if test ! -f stamp-sanity-compiler; then
240 AC_MSG_CHECKING([for g++ that will successfully compile libstdc++-v3])
247 ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to GCC 3.0 or above]))
249 AC_MSG_RESULT($gpp_satisfactory)
250 touch stamp-sanity-compiler
256 dnl Tests for newer compiler features, or features that are present in newer
257 dnl compiler versions but not older compiler versions still in use, should
260 dnl Define WERROR='-Werror' if requested and possible; g++'s that lack the
261 dnl new inlining code or the new system_header pragma will die on -Werror.
262 dnl Leave it out by default and use maint-mode to use it.
264 dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
265 dnl compiler supports it and the user has not requested debug mode.
267 dnl GLIBCPP_CHECK_COMPILER_FEATURES
268 AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
269 # All these tests are for C++; save the language and the compiler flags.
270 # The CXXFLAGS thing is suspicious, but based on similar bits previously
271 # found in GLIBCPP_CONFIGURE.
274 ac_test_CXXFLAGS="${CXXFLAGS+set}"
275 ac_save_CXXFLAGS="$CXXFLAGS"
277 # Check for maintainer-mode bits.
278 if test x"$USE_MAINTAINER_MODE" = xno; then
284 # Check for -ffunction-sections -fdata-sections
285 AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
286 CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
287 AC_TRY_COMPILE(, [int foo;
288 ], [ac_fdsections=yes], [ac_fdsections=no])
289 if test "$ac_test_CXXFLAGS" = set; then
290 CXXFLAGS="$ac_save_CXXFLAGS"
292 # this is the suspicious part
295 if test x"$ac_fdsections" = x"yes"; then
296 SECTION_FLAGS='-ffunction-sections -fdata-sections'
298 AC_MSG_RESULT($ac_fdsections)
302 AC_SUBST(SECTION_FLAGS)
307 dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
308 dnl the native linker is in use, all variables will be defined to something
309 dnl safe (like an empty string).
311 dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible.
312 dnl Define OPT_LDFLAGS='-Wl,-O1' if possible.
313 dnl Define LD, with_gnu_ld, and (possibly) glibcpp_gnu_ld_version as
314 dnl side-effects of testing.
316 dnl GLIBCPP_CHECK_LINKER_FEATURES
317 AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
318 # If we're not using GNU ld, then there's no point in even trying these
319 # tests. Check for that first. We should have already tested for gld
320 # by now (in libtool), but require it now just to be safe...
321 test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
322 test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
323 AC_REQUIRE([AC_PROG_LD])
325 # The name set by libtool depends on the version of libtool. Shame on us
326 # for depending on an impl detail, but c'est la vie. Older versions used
327 # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
328 # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
329 # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
330 # set (hence we're using an older libtool), then set it.
331 if test x${with_gnu_ld+set} != xset; then
332 if test x${ac_cv_prog_gnu_ld+set} != xset; then
333 # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
336 with_gnu_ld=$ac_cv_prog_gnu_ld
340 # Start by getting the version number. I think the libtool test already
341 # does some of this, but throws away the result.
343 ldver=`$LD --version 2>/dev/null | head -1 | \
344 sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
346 glibcpp_gnu_ld_version=`echo $ldver | \
347 $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
350 if test "$with_gnu_ld" = "notbroken"; then
351 # GNU ld it is! Joy and bunny rabbits!
353 # All these tests are for C++; save the language and the compiler flags.
354 # Need to do this so that g++ won't try to link in libstdc++
355 ac_test_CFLAGS="${CFLAGS+set}"
356 ac_save_CFLAGS="$CFLAGS"
357 CFLAGS='-x c++ -Wl,--gc-sections'
359 # Check for -Wl,--gc-sections
360 # XXX This test is broken at the moment, as symbols required for
361 # linking are now in libsupc++ (not built yet.....). In addition,
362 # this test has cored on solaris in the past. In addition,
363 # --gc-sections doesn't really work at the moment (keeps on discarding
364 # used sections, first .eh_frame and now some of the glibc sections for
365 # iconv). Bzzzzt. Thanks for playing, maybe next time.
366 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
374 ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
375 if test "$ac_test_CFLAGS" = set; then
376 CFLAGS="$ac_save_CFLAGS"
378 # this is the suspicious part
381 if test "$ac_sectionLDflags" = "yes"; then
382 SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
384 AC_MSG_RESULT($ac_sectionLDflags)
387 # Set linker optimization flags.
388 if test x"$with_gnu_ld" = x"yes"; then
389 OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
392 AC_SUBST(SECTION_LDFLAGS)
393 AC_SUBST(OPT_LDFLAGS)
398 dnl Check to see if the (math function) argument passed is
399 dnl declared when using the c++ compiler
400 dnl ASSUMES argument is a math function with ONE parameter
402 dnl GLIBCPP_CHECK_MATH_DECL_1
403 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_1, [
404 AC_MSG_CHECKING([for $1 declaration])
405 if test x${glibcpp_cv_func_$1_use+set} != xset; then
406 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
409 AC_TRY_COMPILE([#include <math.h>
415 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
419 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
423 dnl Check to see if the (math function) argument passed is
424 dnl 1) declared when using the c++ compiler
425 dnl 2) has "C" linkage
426 dnl 3) if not, see if 1) and 2) for argument prepended with '_'
428 dnl Define HAVE_CARGF etc if "cargf" is declared and links
430 dnl argument 1 is name of function to check
432 dnl ASSUMES argument is a math function with ONE parameter
434 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1
435 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
436 GLIBCPP_CHECK_MATH_DECL_1($1)
437 if test x$glibcpp_cv_func_$1_use = x"yes"; then
440 GLIBCPP_CHECK_MATH_DECL_1(_$1)
441 if test x$glibcpp_cv_func__$1_use = x"yes"; then
449 dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
450 dnl of functions at once. It's an all-or-nothing check -- either
451 dnl HAVE_XYZ is defined for each of the functions, or for none of them.
452 dnl Doing it this way saves significant configure time.
453 AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
454 AC_MSG_CHECKING([for $1 functions])
455 AC_CACHE_VAL(glibcpp_cv_func_$2_use, [
458 AC_TRY_COMPILE([#include <math.h>],
459 [ `for x in $3; do echo "$x (0);"; done` ],
460 [glibcpp_cv_func_$2_use=yes],
461 [glibcpp_cv_func_$2_use=no])
463 AC_MSG_RESULT($glibcpp_cv_func_$2_use)
464 if test x$glibcpp_cv_func_$2_use = x"yes"; then
470 dnl Check to see if the (math function) argument passed is
471 dnl declared when using the c++ compiler
472 dnl ASSUMES argument is a math function with TWO parameters
474 dnl GLIBCPP_CHECK_MATH_DECL_2
475 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_2, [
476 AC_MSG_CHECKING([for $1 declaration])
477 if test x${glibcpp_cv_func_$1_use+set} != xset; then
478 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
481 AC_TRY_COMPILE([#include <math.h>],
483 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
487 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
491 dnl Check to see if the (math function) argument passed is
492 dnl 1) declared when using the c++ compiler
493 dnl 2) has "C" linkage
495 dnl Define HAVE_CARGF etc if "cargf" is declared and links
497 dnl argument 1 is name of function to check
499 dnl ASSUMES argument is a math function with TWO parameters
501 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2
502 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
503 GLIBCPP_CHECK_MATH_DECL_2($1)
504 if test x$glibcpp_cv_func_$1_use = x"yes"; then
507 GLIBCPP_CHECK_MATH_DECL_2(_$1)
508 if test x$glibcpp_cv_func__$1_use = x"yes"; then
516 dnl Check to see if the (math function) argument passed is
517 dnl declared when using the c++ compiler
518 dnl ASSUMES argument is a math function with THREE parameters
520 dnl GLIBCPP_CHECK_MATH_DECL_3
521 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_3, [
522 AC_MSG_CHECKING([for $1 declaration])
523 if test x${glibcpp_cv_func_$1_use+set} != xset; then
524 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
527 AC_TRY_COMPILE([#include <math.h>],
529 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
533 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
537 dnl Check to see if the (math function) argument passed is
538 dnl 1) declared when using the c++ compiler
539 dnl 2) has "C" linkage
541 dnl Define HAVE_CARGF etc if "cargf" is declared and links
543 dnl argument 1 is name of function to check
545 dnl ASSUMES argument is a math function with THREE parameters
547 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3
548 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
549 GLIBCPP_CHECK_MATH_DECL_3($1)
550 if test x$glibcpp_cv_func_$1_use = x"yes"; then
553 GLIBCPP_CHECK_MATH_DECL_3(_$1)
554 if test x$glibcpp_cv_func__$1_use = x"yes"; then
562 dnl Check to see if the (stdlib function) argument passed is
563 dnl 1) declared when using the c++ compiler
564 dnl 2) has "C" linkage
566 dnl argument 1 is name of function to check
568 dnl ASSUMES argument is a math function with TWO parameters
570 dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2
571 AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
572 AC_MSG_CHECKING([for $1 declaration])
573 if test x${glibcpp_cv_func_$1_use+set} != xset; then
574 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
577 AC_TRY_COMPILE([#include <stdlib.h>],
579 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
583 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
584 if test x$glibcpp_cv_func_$1_use = x"yes"; then
591 dnl Check to see if the (stdlib function) argument passed is
592 dnl 1) declared when using the c++ compiler
593 dnl 2) has "C" linkage
595 dnl argument 1 is name of function to check
597 dnl ASSUMES argument is a function with THREE parameters
599 dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3
600 AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3, [
601 AC_MSG_CHECKING([for $1 declaration])
602 if test x${glibcpp_cv_func_$1_use+set} != xset; then
603 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
606 AC_TRY_COMPILE([#include <stdlib.h>],
608 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
612 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
613 if test x$glibcpp_cv_func_$1_use = x"yes"; then
619 dnl Because the builtins are picky picky picky about the arguments they take,
620 dnl do an explict linkage tests here.
621 dnl Check to see if the (math function) argument passed is
622 dnl 1) declared when using the c++ compiler
623 dnl 2) has "C" linkage
625 dnl Define HAVE_CARGF etc if "cargf" is declared and links
627 dnl argument 1 is name of function to check
629 dnl ASSUMES argument is a math function with ONE parameter
631 dnl GLIBCPP_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
632 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
633 AC_MSG_CHECKING([for $1 declaration])
634 if test x${glibcpp_cv_func_$1_use+set} != xset; then
635 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
638 AC_TRY_COMPILE([#include <math.h>],
640 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
644 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
645 if test x$glibcpp_cv_func_$1_use = x"yes"; then
646 AC_MSG_CHECKING([for $1 linkage])
647 if test x${glibcpp_cv_func_$1_link+set} != xset; then
648 AC_CACHE_VAL(glibcpp_cv_func_$1_link, [
649 AC_TRY_LINK([#include <math.h>],
651 [glibcpp_cv_func_$1_link=yes], [glibcpp_cv_func_$1_link=no])
654 AC_MSG_RESULT($glibcpp_cv_func_$1_link)
655 if test x$glibcpp_cv_func_$1_link = x"yes"; then
656 ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
657 AC_DEFINE_UNQUOTED(${ac_tr_func})
664 dnl Check to see what builtin math functions are supported
666 dnl check for __builtin_abs
667 dnl check for __builtin_fabsf
668 dnl check for __builtin_fabs
669 dnl check for __builtin_fabl
670 dnl check for __builtin_labs
671 dnl check for __builtin_sqrtf
672 dnl check for __builtin_sqrtl
673 dnl check for __builtin_sqrt
674 dnl check for __builtin_sinf
675 dnl check for __builtin_sin
676 dnl check for __builtin_sinl
677 dnl check for __builtin_cosf
678 dnl check for __builtin_cos
679 dnl check for __builtin_cosl
681 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
682 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
683 dnl Test for builtin math functions.
684 dnl These are made in gcc/c-common.c
685 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
686 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
687 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
688 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
689 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
691 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
692 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt)
693 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
695 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
696 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
697 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
699 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
700 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
701 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
703 dnl There is, without a doubt, a more elegant way to have these
704 dnl names exported so that they won't be stripped out of acconfig.h by
705 dnl autoheader. I leave this as an exercise to somebody less frustrated
706 dnl than I.... please email the libstdc++ list if you can figure out a
707 dnl more elegant approach (see autoconf/acgen.m4 and specifically
708 dnl AC_CHECK_FUNC for things to steal.)
710 if test x$dummyvar = x"yes"; then
711 AC_DEFINE(HAVE___BUILTIN_ABS)
712 AC_DEFINE(HAVE___BUILTIN_LABS)
713 AC_DEFINE(HAVE___BUILTIN_COS)
714 AC_DEFINE(HAVE___BUILTIN_COSF)
715 AC_DEFINE(HAVE___BUILTIN_COSL)
716 AC_DEFINE(HAVE___BUILTIN_FABS)
717 AC_DEFINE(HAVE___BUILTIN_FABSF)
718 AC_DEFINE(HAVE___BUILTIN_FABSL)
719 AC_DEFINE(HAVE___BUILTIN_SIN)
720 AC_DEFINE(HAVE___BUILTIN_SINF)
721 AC_DEFINE(HAVE___BUILTIN_SINL)
722 AC_DEFINE(HAVE___BUILTIN_SQRT)
723 AC_DEFINE(HAVE___BUILTIN_SQRTF)
724 AC_DEFINE(HAVE___BUILTIN_SQRTL)
729 dnl Check to see what the underlying c library is like
730 dnl These checks need to do two things:
731 dnl 1) make sure the name is declared when using the c++ compiler
732 dnl 2) make sure the name has "C" linkage
733 dnl This might seem like overkill but experience has shown that it's not...
735 dnl Define HAVE_STRTOLD if "strtold" is declared and links
736 dnl Define HAVE_STRTOF if "strtof" is declared and links
737 dnl Define HAVE_DRAND48 if "drand48" is declared and links
739 dnl GLIBCPP_CHECK_STDLIB_SUPPORT
740 AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
741 ac_test_CXXFLAGS="${CXXFLAGS+set}"
742 ac_save_CXXFLAGS="$CXXFLAGS"
743 CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
745 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
746 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)
747 AC_CHECK_FUNCS(drand48)
749 CXXFLAGS="$ac_save_CXXFLAGS"
753 dnl Check to see what the underlying c library or math library is like.
754 dnl These checks need to do two things:
755 dnl 1) make sure the name is declared when using the c++ compiler
756 dnl 2) make sure the name has "C" linkage
757 dnl This might seem like overkill but experience has shown that it's not...
759 dnl Define HAVE_CARGF etc if "cargf" is found.
761 dnl GLIBCPP_CHECK_MATH_SUPPORT
762 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
763 ac_test_CXXFLAGS="${CXXFLAGS+set}"
764 ac_save_CXXFLAGS="$CXXFLAGS"
765 CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
768 AC_CHECK_LIB(m, sin, libm="-lm")
772 dnl Check to see if certain C math functions exist.
773 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
774 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
775 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
776 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
777 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
778 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
779 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
780 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypot)
782 dnl Check to see if basic C math functions have float versions.
783 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
788 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
791 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expf)
792 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
793 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
794 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
795 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
796 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
797 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
798 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf)
799 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
800 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
801 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
802 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
803 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
804 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
805 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
806 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
808 dnl Check to see if basic C math functions have long double versions.
809 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
814 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
817 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
818 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
819 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
820 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
821 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
822 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
823 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
824 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
825 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl)
826 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
827 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
828 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
829 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
830 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
831 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
832 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
833 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
835 dnl Some runtimes have these functions with a preceding underscore. Please
836 dnl keep this sync'd with the one above. And if you add any new symbol,
837 dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
838 dnl Check to see if certain C math functions exist.
840 dnl Check to see if basic C math functions have float versions.
841 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
843 _acosf _asinf _atanf \
845 _coshf _sinhf _tanhf)
846 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
850 dnl Check to see if basic C math functions have long double versions.
851 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
853 _acosl _asinl _atanl \
855 _coshl _sinhl _tanhl)
856 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
861 CXXFLAGS="$ac_save_CXXFLAGS"
866 dnl Check to see if there is native support for complex
868 dnl Don't compile bits in math/* if native support exits.
870 dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
872 dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
873 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
874 dnl Check for complex versions of math functions of platform. This will
875 dnl always pass if libm is available, and fail if it isn't. If it is
876 dnl available, we assume we'll need it later, so add it to LIBS.
877 AC_CHECK_LIB(m, main)
878 AC_REPLACE_MATHFUNCS(nan copysignf)
880 dnl For __signbit to signbit conversions.
881 AC_CHECK_FUNCS([__signbit], , [LIBMATHOBJS="$LIBMATHOBJS signbit.lo"])
882 AC_CHECK_FUNCS([__signbitf], , [LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"])
884 dnl Compile the long double complex functions only if the function
885 dnl provides the non-complex long double functions that are needed.
886 dnl Currently this includes copysignl, which should be
887 dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
888 if test x$ac_cv_func_copysignl = x"yes"; then
889 AC_CHECK_FUNCS([__signbitl], , [LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"])
892 if test -n "$LIBMATHOBJS"; then
895 AC_SUBST(LIBMATHOBJS)
899 dnl Check to see what architecture and operating system we are compiling
900 dnl for. Also, if architecture- or OS-specific flags are required for
901 dnl compilation, pick them up here.
903 dnl GLIBCPP_CHECK_HOST
904 AC_DEFUN(GLIBCPP_CHECK_HOST, [
905 . [$]{glibcpp_basedir}/configure.host
906 AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
907 AC_MSG_RESULT(OS config directory is $os_include_dir)
912 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
913 dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
914 dnl must have been previously checked.)
916 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
917 dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
919 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
920 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
921 dnl Wide characters disabled by default.
923 dnl Test wchar.h for mbstate_t, which is needed for char_traits and
924 dnl others even if wchar_t support is not on.
925 AC_MSG_CHECKING([for mbstate_t])
926 AC_TRY_COMPILE([#include <wchar.h>],
927 [mbstate_t teststate;],
928 have_mbstate_t=yes, have_mbstate_t=no)
929 AC_MSG_RESULT($have_mbstate_t)
930 if test x"$have_mbstate_t" = xyes; then
931 AC_DEFINE(HAVE_MBSTATE_T)
934 dnl Sanity check for existence of ISO C99 headers for extended encoding.
935 AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
936 AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
938 dnl Only continue checking if the ISO C99 headers exist and support is on.
939 if test x"$ac_has_wchar_h" = xyes &&
940 test x"$ac_has_wctype_h" = xyes &&
941 test x"$enable_c_mbchar" != xno; then
943 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
944 dnl numeric_limits can instantiate type_traits<wchar_t>
945 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
946 AC_TRY_COMPILE([#include <wchar.h>],
947 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
948 has_wchar_minmax=yes, has_wchar_minmax=no)
949 AC_MSG_RESULT($has_wchar_minmax)
951 dnl Test wchar.h for WEOF, which is what we use to determine whether
952 dnl to specialize for char_traits<wchar_t> or not.
953 AC_MSG_CHECKING([for WEOF])
956 #include <stddef.h>],
958 has_weof=yes, has_weof=no)
959 AC_MSG_RESULT($has_weof)
961 dnl Tests for wide character functions used in char_traits<wchar_t>.
963 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
966 dnl Checks for names injected into std:: by the c_std headers.
967 AC_CHECK_FUNCS(btowc wctob fgetwc fgetws fputwc fputws fwide \
968 fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
969 vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
970 mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
971 wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
972 wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr,, \
975 AC_MSG_CHECKING([for ISO C99 wchar_t support])
976 if test x"$has_weof" = xyes &&
977 test x"$has_wchar_minmax" = xyes &&
978 test x"$ac_wfuncs" = xyes; then
979 ac_isoC99_wchar_t=yes
983 AC_MSG_RESULT($ac_isoC99_wchar_t)
985 dnl Use iconv for wchar_t to char conversions. As such, check for
986 dnl X/Open Portability Guide, version 2 features (XPG2).
987 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
988 AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
990 dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
991 AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
993 LIBS="$LIBS $libiconv"
995 AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
996 ac_XPG2funcs=yes, ac_XPG2funcs=no)
1000 AC_MSG_CHECKING([for XPG2 wchar_t support])
1001 if test x"$ac_has_iconv_h" = xyes &&
1002 test x"$ac_has_langinfo_h" = xyes &&
1003 test x"$ac_XPG2funcs" = xyes; then
1008 AC_MSG_RESULT($ac_XPG2_wchar_t)
1010 dnl At the moment, only enable wchar_t specializations if all the
1011 dnl above support is present.
1012 if test x"$ac_isoC99_wchar_t" = xyes &&
1013 test x"$ac_XPG2_wchar_t" = xyes; then
1014 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
1018 AC_MSG_CHECKING([for enabled wchar_t specializations])
1019 AC_MSG_RESULT($enable_wchar_t)
1024 dnl Check to see if debugging libraries are to be built.
1026 dnl GLIBCPP_ENABLE_DEBUG
1029 dnl builds a separate set of debugging libraries in addition to the
1030 dnl normal (shared, static) libstdc++ binaries.
1033 dnl builds only one (non-debug) version of libstdc++.
1035 dnl --enable-debug-flags=FLAGS
1036 dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
1038 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
1039 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1040 dnl defaults to `no'.
1041 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
1042 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
1043 AC_ARG_ENABLE(debug,
1044 changequote(<<, >>)dnl
1045 << --enable-debug build extra debug library [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
1046 changequote([, ])dnl
1047 [case "${enableval}" in
1048 yes) enable_debug=yes ;;
1049 no) enable_debug=no ;;
1050 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
1052 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
1053 AC_MSG_CHECKING([for additional debug build])
1054 AC_MSG_RESULT($enable_debug)
1055 AM_CONDITIONAL(GLIBCPP_BUILD_DEBUG, test "$enable_debug" = yes)
1059 dnl Check for explicit debug flags.
1061 dnl GLIBCPP_ENABLE_DEBUG_FLAGS
1063 dnl --enable-debug-flags='-O1'
1064 dnl is a general method for passing flags to be used when
1065 dnl building debug libraries with --enable-debug.
1067 dnl --disable-debug-flags does nothing.
1068 dnl + Usage: GLIBCPP_ENABLE_DEBUG_FLAGS(default flags)
1069 dnl If "default flags" is an empty string (or "none"), the effect is
1070 dnl the same as --disable or --enable=no.
1071 AC_DEFUN(GLIBCPP_ENABLE_DEBUG_FLAGS, [dnl
1072 define([GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1073 AC_ARG_ENABLE(debug_flags,
1074 changequote(<<, >>)dnl
1075 << --enable-debug-flags=FLAGS pass compiler FLAGS when building debug
1076 library;[default=>>GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT],
1077 changequote([, ])dnl
1078 [case "${enableval}" in
1080 -*) enable_debug_flags="${enableval}" ;;
1081 *) AC_MSG_ERROR([Unknown argument to extra debugging flags]) ;;
1083 enable_debug_flags=GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT)dnl
1085 dnl Option parsed, now set things appropriately
1086 case x"$enable_debug" in
1088 case "$enable_debug_flags" in
1090 DEBUG_FLAGS="-g3 -O0";;
1092 DEBUG_FLAGS="${enableval}"
1099 AC_SUBST(DEBUG_FLAGS)
1101 AC_MSG_CHECKING([for debug build flags])
1102 AC_MSG_RESULT($DEBUG_FLAGS)
1107 dnl Check for "unusual" flags to pass to the compiler while building.
1109 dnl GLIBCPP_ENABLE_CXX_FLAGS
1110 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
1111 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
1112 dnl Somehow this same set of flags must be passed when [re]building
1114 dnl --disable-cxx-flags passes nothing.
1115 dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
1116 dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
1117 dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
1118 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
1119 dnl If "default flags" is an empty string (or "none"), the effect is
1120 dnl the same as --disable or --enable=no.
1121 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
1122 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1123 AC_MSG_CHECKING([for extra compiler flags for building])
1124 AC_ARG_ENABLE(cxx_flags,
1125 changequote(<<, >>)dnl
1126 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
1127 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
1128 changequote([, ])dnl
1129 [case "x$enable_cxx_flags" in
1131 AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
1133 enable_cxx_flags='' ;;
1135 enable_cxx_flags="$enableval" ;;
1137 enable_cxx_flags=GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT)
1139 dnl Run through flags (either default or command-line) and set anything
1140 dnl extra (e.g., #defines) that must accompany particular g++ options.
1141 if test -n "$enable_cxx_flags"; then
1142 for f in $enable_cxx_flags; do
1146 *) # and we're trying to pass /what/ exactly?
1147 AC_MSG_ERROR([compiler flags start with a -]) ;;
1151 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1152 AC_MSG_RESULT($EXTRA_CXX_FLAGS)
1153 AC_SUBST(EXTRA_CXX_FLAGS)
1158 dnl Check for which locale library to use: gnu or generic.
1160 dnl GLIBCPP_ENABLE_CLOCALE
1161 dnl --enable-clocale=gnu sets config/locale/c_locale_gnu.cc and friends
1162 dnl --enable-clocale=generic sets config/locale/c_locale_generic.cc and friends
1164 dnl default is generic
1166 AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
1167 AC_MSG_CHECKING([for clocale to use])
1168 AC_ARG_ENABLE(clocale,
1169 [ --enable-clocale enable model for target locale package.
1170 --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
1172 if test x$enable_clocale = xno; then
1177 enable_clocale_flag=$enable_clocale
1179 dnl Probe for locale support if no specific model is specified.
1180 dnl Default to "generic"
1181 if test x$enable_clocale_flag = xno; then
1182 case x${target_os} in
1184 AC_EGREP_CPP([_GLIBCPP_ok], [
1185 #include <features.h>
1186 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1189 ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
1191 # Test for bugs early in glibc-2.2.x series
1192 if test x$enable_clocale_flag = xgnu; then
1194 #define _GNU_SOURCE 1
1197 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
1198 extern __typeof(newlocale) __newlocale;
1199 extern __typeof(duplocale) __duplocale;
1200 extern __typeof(strcoll_l) __strcoll_l;
1204 const char __one[] = "Äuglein Augmen";
1205 const char __two[] = "Äuglein";
1210 loc = __newlocale(1 << LC_ALL, "de_DE", 0);
1211 loc_dup = __duplocale(loc);
1212 i = __strcoll_l(__one, __two, loc);
1213 j = __strcoll_l(__one, __two, loc_dup);
1217 [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
1218 [enable_clocale_flag=generic])
1221 # ... at some point put __strxfrm_l tests in as well.
1224 enable_clocale_flag=generic
1229 dnl Deal with gettext issues.
1231 [ --enable-nls use Native Language Support (default)],
1235 dnl Set configure bits for specified locale package
1236 case x${enable_clocale_flag} in
1238 AC_MSG_RESULT(generic)
1240 CLOCALE_H=config/locale/generic/c_locale.h
1241 CLOCALE_CC=config/locale/generic/c_locale.cc
1242 CCODECVT_H=config/locale/generic/codecvt_specializations.h
1243 CCODECVT_CC=config/locale/generic/codecvt_members.cc
1244 CCOLLATE_CC=config/locale/generic/collate_members.cc
1245 CCTYPE_CC=config/locale/generic/ctype_members.cc
1246 CMESSAGES_H=config/locale/generic/messages_members.h
1247 CMESSAGES_CC=config/locale/generic/messages_members.cc
1248 CMONEY_CC=config/locale/generic/monetary_members.cc
1249 CNUMERIC_CC=config/locale/generic/numeric_members.cc
1250 CTIME_H=config/locale/generic/time_members.h
1251 CTIME_CC=config/locale/generic/time_members.cc
1252 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
1257 # Declare intention to use gettext, and add support for specific
1259 # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
1262 # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
1263 AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
1264 if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
1267 # Export the build objects.
1268 for ling in $ALL_LINGUAS; do \
1269 glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
1270 glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
1272 AC_SUBST(glibcpp_MOFILES)
1273 AC_SUBST(glibcpp_POFILES)
1275 CLOCALE_H=config/locale/gnu/c_locale.h
1276 CLOCALE_CC=config/locale/gnu/c_locale.cc
1277 CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
1278 CCODECVT_CC=config/locale/gnu/codecvt_members.cc
1279 CCOLLATE_CC=config/locale/gnu/collate_members.cc
1280 CCTYPE_CC=config/locale/gnu/ctype_members.cc
1281 CMESSAGES_H=config/locale/gnu/messages_members.h
1282 CMESSAGES_CC=config/locale/gnu/messages_members.cc
1283 CMONEY_CC=config/locale/gnu/monetary_members.cc
1284 CNUMERIC_CC=config/locale/gnu/numeric_members.cc
1285 CTIME_H=config/locale/gnu/time_members.h
1286 CTIME_CC=config/locale/gnu/time_members.cc
1287 CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
1290 AC_MSG_RESULT(IEEE 1003.1)
1292 CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
1293 CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc
1294 CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
1295 CCODECVT_CC=config/locale/generic/codecvt_members.cc
1296 CCOLLATE_CC=config/locale/generic/collate_members.cc
1297 CCTYPE_CC=config/locale/generic/ctype_members.cc
1298 CMESSAGES_H=config/locale/ieee_1003.1-2001/messages_members.h
1299 CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc
1300 CMONEY_CC=config/locale/generic/monetary_members.cc
1301 CNUMERIC_CC=config/locale/generic/numeric_members.cc
1302 CTIME_H=config/locale/generic/time_members.h
1303 CTIME_CC=config/locale/generic/time_members.cc
1304 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
1307 echo "$enable_clocale is an unknown locale package" 1>&2
1312 # This is where the testsuite looks for locale catalogs, using the
1313 # -DLOCALEDIR define during testsuite compilation.
1314 glibcpp_localedir=${glibcpp_builddir}/po/share/locale
1315 AC_SUBST(glibcpp_localedir)
1317 # A standalone libintl (e.g., GNU libintl) may be in use.
1318 if test $USE_NLS = yes; then
1319 AC_CHECK_HEADERS([libintl.h], [], USE_NLS=no)
1320 AC_SEARCH_LIBS(gettext, intl, [], USE_NLS=no)
1322 if test $USE_NLS = yes; then
1323 AC_DEFINE(_GLIBCPP_USE_NLS)
1328 AC_SUBST(CCODECVT_H)
1329 AC_SUBST(CMESSAGES_H)
1330 AC_SUBST(CCODECVT_CC)
1331 AC_SUBST(CCOLLATE_CC)
1333 AC_SUBST(CMESSAGES_CC)
1335 AC_SUBST(CNUMERIC_CC)
1338 AC_SUBST(CLOCALE_CC)
1339 AC_SUBST(CLOCALE_INTERNAL_H)
1344 dnl Check for which I/O library to use: stdio, or something specific.
1346 dnl GLIBCPP_ENABLE_CSTDIO
1348 dnl default is stdio
1350 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
1351 AC_MSG_CHECKING([for cstdio to use])
1352 AC_ARG_ENABLE(cstdio,
1353 [ --enable-cstdio enable stdio for target io package.
1354 --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
1356 if test x$enable_cstdio = xno; then
1359 enable_cstdio=stdio)
1361 enable_cstdio_flag=$enable_cstdio
1363 dnl Check if a valid I/O package
1364 case x${enable_cstdio_flag} in
1365 xstdio | x | xno | xnone | xyes)
1367 CSTDIO_H=config/io/c_io_stdio.h
1368 BASIC_FILE_H=config/io/basic_file_stdio.h
1369 BASIC_FILE_CC=config/io/basic_file_stdio.cc
1370 AC_MSG_RESULT(stdio)
1373 echo "$enable_cstdio is an unknown io package" 1>&2
1378 dnl Set directory for fpos.h
1379 FPOS_H=$fpos_include_dir
1383 AC_SUBST(BASIC_FILE_H)
1384 AC_SUBST(BASIC_FILE_CC)
1389 dnl Check to see if building and using a C++ precompiled header can be done.
1391 dnl GLIBCPP_ENABLE_PCH
1393 dnl --enable-pch=yes
1394 dnl default, this shows intent to use stdc++.h.gch If it looks like it
1395 dnl may work, after some light-hearted attempts to puzzle out compiler
1396 dnl support, flip bits on in include/Makefile.am
1399 dnl turns off attempts to use or build stdc++.h.gch.
1401 AC_DEFUN(GLIBCPP_ENABLE_PCH, [dnl
1402 define([GLIBCPP_ENABLE_PCH_DEFAULT], ifelse($1,,, $1))dnl
1404 changequote(<<, >>)dnl
1405 << --enable-pch build pre-compiled libstdc++ includes [default=>>GLIBCPP_ENABLE_PCH_DEFAULT],
1406 changequote([, ])dnl
1407 [case "${enableval}" in
1408 yes) enable_pch=yes ;;
1409 no) enable_pch=no ;;
1410 *) AC_MSG_ERROR([Unknown argument to enable/disable PCH]) ;;
1412 enable_pch=GLIBCPP_ENABLE_PCH_DEFAULT)dnl
1414 if test x$enable_pch = xyes; then
1415 ac_test_CXXFLAGS="${CXXFLAGS+set}"
1416 ac_save_CXXFLAGS="$CXXFLAGS"
1417 CXXFLAGS='-Werror -Winvalid-pch -Wno-deprecated -x c++-header'
1419 AC_MSG_CHECKING([for compiler that seems to compile .gch files])
1420 if test x${glibcpp_pch_comp+set} != xset; then
1421 AC_CACHE_VAL(glibcpp_pch_comp, [
1424 AC_TRY_COMPILE([#include <math.h>], ,
1425 [glibcpp_pch_comp=yes], [glibcpp_pch_comp=no])
1429 AC_MSG_RESULT([$glibcpp_pch_comp])
1431 CXXFLAGS="$ac_save_CXXFLAGS"
1434 if test x"$enable_pch" = xyes && test x"$glibcpp_pch_comp" = xno; then
1438 AC_MSG_CHECKING([for enabled PCH])
1439 AC_MSG_RESULT([$enable_pch])
1441 AM_CONDITIONAL(GLIBCPP_BUILD_PCH, test "$enable_pch" = yes)
1442 if test "$enable_pch" = yes; then
1443 glibcpp_PCHFLAGS="-include bits/stdc++.h"
1447 AC_SUBST(glibcpp_PCHFLAGS)
1451 dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
1452 dnl We must stage the required headers so that they will be installed
1453 dnl with the library (unlike libgcc, the STL implementation is provided
1454 dnl solely within headers). Since we must not inject random user-space
1455 dnl macro names into user-provided C++ code, we first stage into <file>-in
1456 dnl and process to <file> with an output command. The reason for a two-
1457 dnl stage process here is to correctly handle $srcdir!=$objdir without
1458 dnl having to write complex code (the sed commands to clean the macro
1459 dnl namespace are complex and fragile enough as it is). We must also
1460 dnl add a relative path so that -I- is supported properly.
1462 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
1463 AC_MSG_CHECKING([for thread model used by GCC])
1464 target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
1465 AC_MSG_RESULT([$target_thread_file])
1467 if test $target_thread_file != single; then
1468 AC_DEFINE(HAVE_GTHR_DEFAULT)
1469 AC_DEFINE(_GLIBCPP_SUPPORTS_WEAK, __GXX_WEAK__)
1472 glibcpp_thread_h=gthr-$target_thread_file.h
1473 AC_SUBST(glibcpp_thread_h)
1478 dnl Check for exception handling support. If an explicit enable/disable
1479 dnl sjlj exceptions is given, we don't have to detect. Otherwise the
1480 dnl target may or may not support call frame exceptions.
1482 dnl GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
1483 dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
1484 dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
1486 dnl Define _GLIBCPP_SJLJ_EXCEPTIONS if the compiler is configured for it.
1488 AC_DEFUN(GLIBCPP_ENABLE_SJLJ_EXCEPTIONS, [
1489 AC_MSG_CHECKING([for exception model to use])
1492 AC_ARG_ENABLE(sjlj-exceptions,
1493 [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
1495 [dnl Botheration. Now we've got to detect the exception model.
1496 dnl Link tests against libgcc.a are problematic since -- at least
1497 dnl as of this writing -- we've not been given proper -L bits for
1498 dnl single-tree newlib and libgloss.
1500 dnl This is what AC_TRY_COMPILE would do if it didn't delete the
1501 dnl conftest files before we got a change to grep them first.
1502 cat > conftest.$ac_ext << EOF
1503 [#]line __oline__ "configure"
1512 old_CXXFLAGS="$CXXFLAGS"
1514 if AC_TRY_EVAL(ac_compile); then
1515 if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
1516 enable_sjlj_exceptions=yes
1517 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
1518 enable_sjlj_exceptions=no
1521 CXXFLAGS="$old_CXXFLAGS"
1523 if test x$enable_sjlj_exceptions = xyes; then
1524 AC_DEFINE(_GLIBCPP_SJLJ_EXCEPTIONS, 1,
1525 [Define if the compiler is configured for setjmp/longjmp exceptions.])
1526 ac_exception_model_name=sjlj
1527 elif test x$enable_sjlj_exceptions = xno; then
1528 ac_exception_model_name="call frame"
1530 AC_MSG_ERROR([unable to detect exception model])
1533 AC_MSG_RESULT($ac_exception_model_name)
1538 dnl Check for libunwind exception handling support. If enabled then
1539 dnl we assume that the _Unwind_* functions that make up the Unwind ABI
1540 dnl (_Unwind_RaiseException, _Unwind_Resume, etc.) are defined by
1541 dnl libunwind instead of libgcc and that libstdc++ has a dependency
1542 dnl on libunwind as well as libgcc.
1544 dnl GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
1545 dnl --enable-libunwind-exceptions forces the use of libunwind.
1546 dnl --disable-libunwind-exceptions assumes there is no libunwind.
1548 dnl Define _GLIBCPP_LIBUNWIND_EXCEPTIONS if requested.
1550 AC_DEFUN(GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS, [
1551 AC_MSG_CHECKING([for use of libunwind])
1552 AC_ARG_ENABLE(libunwind-exceptions,
1553 [ --enable-libunwind-exceptions force use of libunwind for exceptions],
1554 use_libunwind_exceptions=$enableval,
1555 use_libunwind_exceptions=no)
1556 AC_MSG_RESULT($use_libunwind_exceptions)
1557 dnl Option parsed, now set things appropriately
1558 if test x"$use_libunwind_exceptions" = xyes; then
1559 LIBUNWIND_FLAG="-lunwind"
1563 AC_SUBST(LIBUNWIND_FLAG)
1567 dnl Check for ISO/IEC 9899:1999 "C99" support.
1569 dnl GLIBCPP_ENABLE_C99
1570 dnl --enable-c99 defines _GLIBCPP_USE_C99
1571 dnl --disable-c99 leaves _GLIBCPP_USE_C99 undefined
1572 dnl + Usage: GLIBCPP_ENABLE_C99[(DEFAULT)]
1573 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1574 dnl defaults to `no'.
1575 dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
1577 dnl GLIBCPP_ENABLE_C99
1578 AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
1579 define([GLIBCPP_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
1582 changequote(<<, >>)dnl
1583 <<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCPP_ENABLE_C99_DEFAULT],
1584 changequote([, ])dnl
1585 [case "$enableval" in
1586 yes) enable_c99=yes ;;
1587 no) enable_c99=no ;;
1588 *) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
1590 enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
1595 # Check for the existence of <math.h> functions used if C99 is enabled.
1597 AC_MSG_CHECKING([for ISO C99 support in <math.h>])
1598 AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
1599 AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
1600 AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
1601 AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
1602 AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
1603 AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
1604 AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
1605 AC_TRY_COMPILE([#include <math.h>],
1606 [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
1607 AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
1608 AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
1609 AC_TRY_COMPILE([#include <math.h>],
1610 [islessgreater(0.0,0.0);],, [ac_c99_math=no])
1611 AC_TRY_COMPILE([#include <math.h>],
1612 [isunordered(0.0,0.0);],, [ac_c99_math=no])
1613 AC_MSG_RESULT($ac_c99_math)
1615 # Check for the existence in <stdio.h> of vscanf, et. al.
1617 AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
1618 AC_TRY_COMPILE([#include <stdio.h>],
1619 [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
1620 AC_TRY_COMPILE([#include <stdio.h>
1622 void foo(char* fmt, ...)
1623 {va_list args; va_start(args, fmt);
1624 vfscanf(stderr, "%i", args);}],
1625 [],, [ac_c99_stdio=no])
1626 AC_TRY_COMPILE([#include <stdio.h>
1628 void foo(char* fmt, ...)
1629 {va_list args; va_start(args, fmt);
1630 vscanf("%i", args);}],
1631 [],, [ac_c99_stdio=no])
1632 AC_TRY_COMPILE([#include <stdio.h>
1634 void foo(char* fmt, ...)
1635 {va_list args; va_start(args, fmt);
1636 vsnprintf(fmt, 0, "%i", args);}],
1637 [],, [ac_c99_stdio=no])
1638 AC_TRY_COMPILE([#include <stdio.h>
1640 void foo(char* fmt, ...)
1641 {va_list args; va_start(args, fmt);
1642 vsscanf(fmt, "%i", args);}],
1643 [],, [ac_c99_stdio=no])
1644 AC_MSG_RESULT($ac_c99_stdio)
1646 # Check for the existence in <stdlib.h> of lldiv_t, et. al.
1648 AC_MSG_CHECKING([for lldiv_t declaration])
1649 AC_CACHE_VAL(ac_c99_lldiv_t, [
1650 AC_TRY_COMPILE([#include <stdlib.h>],
1652 [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
1654 AC_MSG_RESULT($ac_c99_lldiv_t)
1656 AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
1657 AC_TRY_COMPILE([#include <stdlib.h>],
1658 [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
1659 AC_TRY_COMPILE([#include <stdlib.h>],
1660 [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
1661 AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
1662 AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
1663 AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
1664 AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
1665 if test x"$ac_c99_lldiv_t" = x"no"; then
1668 AC_MSG_RESULT($ac_c99_stdlib)
1670 # Check for the existence of <wchar.h> functions used if C99 is enabled.
1671 # XXX the wchar.h checks should be rolled into the general C99 bits.
1673 AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
1674 AC_TRY_COMPILE([#include <wchar.h>],
1675 [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
1676 AC_TRY_COMPILE([#include <wchar.h>],
1677 [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
1678 AC_TRY_COMPILE([#include <wchar.h>],
1679 [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
1680 AC_MSG_RESULT($ac_c99_wchar)
1682 AC_MSG_CHECKING([for enabled ISO C99 support])
1683 if test x"$ac_c99_math" = x"no" ||
1684 test x"$ac_c99_stdio" = x"no" ||
1685 test x"$ac_c99_stdlib" = x"no" ||
1686 test x"$ac_c99_wchar" = x"no"; then
1689 AC_MSG_RESULT($enable_c99)
1691 # Option parsed, now set things appropriately
1692 if test x"$enable_c99" = x"yes"; then
1693 AC_DEFINE(_GLIBCPP_USE_C99)
1701 dnl Check for template specializations for the 'long long' type extension.
1702 dnl The result determines only whether 'long long' I/O is enabled; things
1703 dnl like numeric_limits<> specializations are always available.
1705 dnl GLIBCPP_ENABLE_LONG_LONG
1706 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
1707 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
1708 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
1709 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1710 dnl defaults to `no'.
1711 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1713 dnl GLIBCPP_ENABLE_LONG_LONG
1714 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
1715 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
1717 AC_ARG_ENABLE(long-long,
1718 changequote(<<, >>)dnl
1719 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
1720 changequote([, ])dnl
1721 [case "$enableval" in
1722 yes) enable_long_long=yes ;;
1723 no) enable_long_long=no ;;
1724 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1726 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1731 AC_MSG_CHECKING([for enabled long long I/O support])
1732 # iostreams require strtoll, strtoull to compile
1733 AC_TRY_COMPILE([#include <stdlib.h>],
1734 [char* tmp; strtoll("gnu", &tmp, 10);],,[enable_long_long=no])
1735 AC_TRY_COMPILE([#include <stdlib.h>],
1736 [char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
1738 # Option parsed, now set things appropriately
1739 if test x"$enable_long_long" = xyes; then
1740 AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1742 AC_MSG_RESULT($enable_long_long)
1749 dnl Check for what type of C headers to use.
1751 dnl GLIBCPP_ENABLE_CHEADERS
1752 dnl --enable-cheaders= [does stuff].
1753 dnl --disable-cheaders [does not do anything, really].
1754 dnl + Usage: GLIBCPP_ENABLE_CHEADERS[(DEFAULT)]
1755 dnl Where DEFAULT is either `c' or `c_std'.
1756 dnl If ommitted, it defaults to `c_std'.
1757 AC_DEFUN(GLIBCPP_ENABLE_CHEADERS, [dnl
1758 define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
1759 AC_MSG_CHECKING([for c header strategy to use])
1760 AC_ARG_ENABLE(cheaders,
1761 changequote(<<, >>)dnl
1762 << --enable-cheaders=MODEL construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
1764 [case "$enableval" in
1769 enable_cheaders=c_std
1771 *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
1774 enable_cheaders=GLIBCPP_ENABLE_CHEADERS_DEFAULT)
1775 AC_MSG_RESULT($enable_cheaders)
1777 dnl Option parsed, now set things appropriately
1778 case "$enable_cheaders" in
1780 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
1783 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
1787 AC_SUBST(C_INCLUDE_DIR)
1788 AM_CONDITIONAL(GLIBCPP_C_HEADERS_C, test "$enable_cheaders" = c)
1789 AM_CONDITIONAL(GLIBCPP_C_HEADERS_C_STD, test "$enable_cheaders" = c_std)
1790 AM_CONDITIONAL(GLIBCPP_C_HEADERS_COMPATIBILITY, test "$c_compatibility" = yes)
1795 dnl Check for wide character support. Has the same effect as the option
1796 dnl in gcc's configure, but in a form that autoconf can mess with.
1798 dnl GLIBCPP_ENABLE_C_MBCHAR
1799 dnl --enable-c-mbchar requests all the wchar_t stuff.
1800 dnl --disable-c-mbchar doesn't.
1801 dnl + Usage: GLIBCPP_ENABLE_C_MBCHAR[(DEFAULT)]
1802 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1803 dnl defaults to `no'.
1804 AC_DEFUN(GLIBCPP_ENABLE_C_MBCHAR, [dnl
1805 define([GLIBCPP_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
1806 AC_ARG_ENABLE(c-mbchar,
1807 changequote(<<, >>)dnl
1808 << --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCPP_ENABLE_C_MBCHAR_DEFAULT],
1809 changequote([, ])dnl
1810 [case "$enableval" in
1811 yes) enable_c_mbchar=yes ;;
1812 no) enable_c_mbchar=no ;;
1813 *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
1815 enable_c_mbchar=GLIBCPP_ENABLE_C_MBCHAR_DEFAULT)dnl
1816 dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
1821 dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
1823 dnl TOPLEVEL_INCLUDES
1824 dnl LIBMATH_INCLUDES
1825 dnl LIBSUPCXX_INCLUDES
1827 dnl GLIBCPP_EXPORT_INCLUDES
1828 AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
1829 # Root level of the build directory include sources.
1830 GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
1832 # Passed down for canadian crosses.
1833 if test x"$CANADIAN" = xyes; then
1834 TOPLEVEL_INCLUDES='-I$(includedir)'
1837 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1839 LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
1841 # Now, export this to all the little Makefiles....
1842 AC_SUBST(GLIBCPP_INCLUDES)
1843 AC_SUBST(TOPLEVEL_INCLUDES)
1844 AC_SUBST(LIBMATH_INCLUDES)
1845 AC_SUBST(LIBSUPCXX_INCLUDES)
1850 dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
1852 AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
1853 # Optimization flags that are probably a good idea for thrill-seekers. Just
1854 # uncomment the lines below and make, everything else is ready to go...
1855 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
1857 AC_SUBST(OPTIMIZE_CXXFLAGS)
1859 WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings'
1860 AC_SUBST(WARN_FLAGS)
1864 dnl GLIBCPP_EXPORT_INSTALL_INFO
1865 dnl calculates gxx_install_dir
1866 dnl exports glibcpp_toolexecdir
1867 dnl exports glibcpp_toolexeclibdir
1868 dnl exports glibcpp_prefixdir
1870 dnl Assumes cross_compiling bits already done, and with_cross_host in
1873 dnl GLIBCPP_EXPORT_INSTALL_INFO
1874 AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
1875 # Assumes glibcpp_builddir, glibcpp_srcdir are alreay set up and
1876 # exported correctly in GLIBCPP_CONFIGURE.
1877 glibcpp_toolexecdir=no
1878 glibcpp_toolexeclibdir=no
1879 glibcpp_prefixdir=${prefix}
1881 # Process the option --with-gxx-include-dir=<path to include-files directory>
1882 AC_MSG_CHECKING([for --with-gxx-include-dir])
1883 AC_ARG_WITH(gxx-include-dir,
1884 [ --with-gxx-include-dir the installation directory for include files],
1885 [case "${withval}" in
1887 AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
1894 gxx_include_dir=${withval}
1896 esac], [gxx_include_dir=no])
1897 AC_MSG_RESULT($gxx_include_dir)
1899 # Process the option "--enable-version-specific-runtime-libs"
1900 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
1901 AC_ARG_ENABLE(version-specific-runtime-libs,
1902 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
1903 [case "$enableval" in
1904 yes) version_specific_libs=yes ;;
1905 no) version_specific_libs=no ;;
1906 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
1908 version_specific_libs=no)dnl
1909 # Option set, now we can test it.
1910 AC_MSG_RESULT($version_specific_libs)
1912 # Default case for install directory for include files.
1913 if test $version_specific_libs = no && test $gxx_include_dir = no; then
1914 gxx_include_dir='$(prefix)'/include/c++/${gcc_version}
1917 # Version-specific runtime libs processing.
1918 if test $version_specific_libs = yes; then
1919 # Need the gcc compiler version to know where to install libraries
1920 # and header files if --enable-version-specific-runtime-libs option
1922 if test x"$gxx_include_dir" = x"no"; then
1923 gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/c++
1925 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1926 glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
1929 # Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
1930 # Install a library built with a cross compiler in tooldir, not libdir.
1931 if test x"$glibcpp_toolexecdir" = x"no"; then
1932 if test -n "$with_cross_host" &&
1933 test x"$with_cross_host" != x"no"; then
1934 glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
1935 glibcpp_toolexeclibdir='$(toolexecdir)/lib'
1937 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1938 glibcpp_toolexeclibdir='$(libdir)'
1940 multi_os_directory=`$CC -print-multi-os-directory`
1941 case $multi_os_directory in
1942 .) ;; # Avoid trailing /.
1943 *) glibcpp_toolexeclibdir=$glibcpp_toolexeclibdir/$multi_os_directory ;;
1947 AC_MSG_CHECKING([for install location])
1948 AC_MSG_RESULT($gxx_include_dir)
1950 AC_SUBST(glibcpp_prefixdir)
1951 AC_SUBST(gxx_include_dir)
1952 AC_SUBST(glibcpp_toolexecdir)
1953 AC_SUBST(glibcpp_toolexeclibdir)
1957 # Check for functions in math library.
1958 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1960 # This file can be copied and used freely without restrictions. It can
1961 # be used in projects which are not available under the GNU Public License
1962 # but which still want to provide support for the GNU gettext functionality.
1963 # Please note that the actual code is *not* freely available.
1967 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1968 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1969 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])])
1972 dnl This macro searches for a GNU version of make. If a match is found, the
1973 dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
1974 dnl set to "#". This is useful for including a special features in a Makefile,
1975 dnl which cannot be handled by other versions of make. The variable
1976 dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
1977 dnl the empty string otherwise.
1979 dnl Here is an example of its use:
1981 dnl Makefile.in might contain:
1983 dnl # A failsafe way of putting a dependency rule into a makefile
1985 dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
1987 dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
1988 dnl @ifGNUmake@ include $(DEPEND)
1989 dnl @ifGNUmake@ endif
1991 dnl Then configure.in would normally contain:
1993 dnl CHECK_GNU_MAKE()
1994 dnl AC_OUTPUT(Makefile)
1996 dnl Then perhaps to cause gnu make to override any other make, we could do
1997 dnl something like this (note that GNU make always looks for GNUmakefile first):
1999 dnl if ! test x$_cv_gnu_make_command = x ; then
2000 dnl mv Makefile GNUmakefile
2001 dnl echo .DEFAULT: > Makefile ;
2002 dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
2005 dnl Then, if any (well almost any) other make is called, and GNU make also
2006 dnl exists, then the other make wraps the GNU make.
2008 dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
2009 dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
2011 dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
2012 dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
2013 dnl #### conditional's subshell (" --version" is not a command), using a
2014 dnl #### different option to grep(1).
2016 dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
2017 dnl #### ${MAKE:-make}).
2020 GLIBCPP_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
2021 _cv_gnu_make_command='' ;
2022 dnl Search all the common names for GNU make
2023 for a in "${MAKE-make}" make gmake gnumake ; do
2024 if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
2026 _cv_gnu_make_command=$a ;
2031 dnl If there was a GNU version, then set @ifGNUmake@ to the empty
2032 dnl string, '#' otherwise
2033 if test "x$_cv_gnu_make_command" != "x" ; then
2042 dnl Check for headers for, and arguments to, the setrlimit() function.
2043 dnl Used only in testsuite_hooks.h.
2044 AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT_ancilliary, [
2045 AC_TRY_COMPILE([#include <unistd.h>
2046 #include <sys/time.h>
2047 #include <sys/resource.h>
2048 ], [ int f = RLIMIT_$1 ; ],
2049 [glibcpp_mresult=1], [glibcpp_mresult=0])
2050 AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcpp_mresult,
2051 [Only used in build directory testsuite_hooks.h.])
2053 AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
2054 setrlimit_have_headers=yes
2055 AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
2057 setrlimit_have_headers=no)
2058 # If don't have the headers, then we can't run the tests now, and we
2059 # won't be seeing any of these during testsuite compilation.
2060 if test $setrlimit_have_headers = yes; then
2061 # Can't do these in a loop, else the resulting syntax is wrong.
2062 GLIBCPP_CHECK_SETRLIMIT_ancilliary(DATA)
2063 GLIBCPP_CHECK_SETRLIMIT_ancilliary(RSS)
2064 GLIBCPP_CHECK_SETRLIMIT_ancilliary(VMEM)
2065 GLIBCPP_CHECK_SETRLIMIT_ancilliary(AS)
2067 # Check for rlimit, setrlimit.
2068 AC_CACHE_VAL(ac_setrlimit, [
2069 AC_TRY_COMPILE([#include <unistd.h>
2070 #include <sys/time.h>
2071 #include <sys/resource.h>
2073 [ struct rlimit r; setrlimit(0, &r);],
2074 [ac_setrlimit=yes], [ac_setrlimit=no])
2078 AC_MSG_CHECKING([for testsuite memory limit support])
2079 if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
2081 AC_DEFINE(_GLIBCPP_MEM_LIMITS)
2085 AC_MSG_RESULT($ac_mem_limits)
2090 dnl Does any necessary configuration of the testsuite directory. Generates
2091 dnl the testsuite_hooks.h header.
2093 dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
2094 AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
2096 if test x"$GLIBCPP_IS_CROSS_COMPILING" = xfalse; then
2097 # Do checks for memory limit functions.
2098 GLIBCPP_CHECK_SETRLIMIT
2100 # Look for setenv, so that extended locale tests can be performed.
2101 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
2104 # Export file names for ABI checking.
2105 baseline_dir="${glibcpp_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
2106 AC_SUBST(baseline_dir)
2108 # Determine if checking the ABI is desirable.
2109 if test x$enable_symvers = xno; then
2114 enable_abi_check=no ;;
2116 enable_abi_check=yes ;;
2120 AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes)
2121 AM_CONDITIONAL(GLIBCPP_TEST_ABI, test "$enable_abi_check" = yes)
2125 sinclude(../libtool.m4)
2126 dnl The lines below arrange for aclocal not to bring an installed
2127 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
2128 dnl add a definition of LIBTOOL to Makefile.in.
2129 ifelse(,,,[AC_SUBST(LIBTOOL)
2130 AC_DEFUN([AM_PROG_LIBTOOL])
2131 AC_DEFUN([AC_LIBTOOL_DLOPEN])
2132 AC_DEFUN([AC_PROG_LD])
2136 dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
2139 AC_DEFUN(GLIBCPP_CHECK_S_ISREG_OR_S_IFREG, [
2140 AC_CACHE_VAL(glibcpp_cv_S_ISREG, [
2141 AC_TRY_LINK([#include <sys/stat.h>],
2142 [struct stat buffer; fstat(0, &buffer); S_ISREG(buffer.st_mode); ],
2143 [glibcpp_cv_S_ISREG=yes],
2144 [glibcpp_cv_S_ISREG=no])
2146 AC_CACHE_VAL(glibcpp_cv_S_IFREG, [
2147 AC_TRY_LINK([#include <sys/stat.h>],
2148 [struct stat buffer; fstat(0, &buffer); S_IFREG & buffer.st_mode; ],
2149 [glibcpp_cv_S_IFREG=yes],
2150 [glibcpp_cv_S_IFREG=no])
2152 if test x$glibcpp_cv_S_ISREG = xyes; then
2153 AC_DEFINE(HAVE_S_ISREG)
2154 elif test x$glibcpp_cv_S_IFREG = xyes; then
2155 AC_DEFINE(HAVE_S_IFREG)
2160 dnl Check whether poll is available in <poll.h>.
2163 AC_DEFUN(GLIBCPP_CHECK_POLL, [
2164 AC_CACHE_VAL(glibcpp_cv_POLL, [
2165 AC_TRY_COMPILE([#include <poll.h>],
2166 [struct pollfd pfd[1]; pfd[0].events = POLLIN; poll(pfd, 1, 0); ],
2167 [glibcpp_cv_POLL=yes],
2168 [glibcpp_cv_POLL=no])
2170 if test x$glibcpp_cv_POLL = xyes; then
2171 AC_DEFINE(HAVE_POLL)
2175 # Check whether LC_MESSAGES is available in <locale.h>.
2176 # Ulrich Drepper <drepper@cygnus.com>, 1995.
2178 # This file file be copied and used freely without restrictions. It can
2179 # be used in projects which are not available under the GNU Public License
2180 # but which still want to provide support for the GNU gettext functionality.
2181 # Please note that the actual code is *not* freely available.
2185 AC_DEFUN(AC_LC_MESSAGES, [
2186 AC_CHECK_HEADER(locale.h, [
2187 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
2188 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2189 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
2190 if test $ac_cv_val_LC_MESSAGES = yes; then
2191 AC_DEFINE(HAVE_LC_MESSAGES)
2198 dnl Check for whether the Boost-derived checks should be turned on.
2200 dnl GLIBCPP_ENABLE_CONCEPT_CHECKS
2201 dnl --enable-concept-checks turns them on.
2202 dnl --disable-concept-checks leaves them off.
2203 dnl + Usage: GLIBCPP_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
2204 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
2205 dnl defaults to `no'.
2206 AC_DEFUN(GLIBCPP_ENABLE_CONCEPT_CHECKS, [dnl
2207 define([GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT], ifelse($1, yes, yes, no))dnl
2208 AC_ARG_ENABLE(concept-checks,
2209 changequote(<<, >>)dnl
2210 << --enable-concept-checks use Boost-derived template checks [default=>>GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT],
2211 changequote([, ])dnl
2212 [case "$enableval" in
2213 yes) enable_concept_checks=yes ;;
2214 no) enable_concept_checks=no ;;
2215 *) AC_MSG_ERROR([Unknown argument to enable/disable concept checks]) ;;
2217 enable_concept_checks=GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT)dnl
2218 dnl Option parsed, now set things appropriately
2219 if test x"$enable_concept_checks" = xyes; then
2220 AC_DEFINE(_GLIBCPP_CONCEPT_CHECKS)
2226 dnl Add version tags to symbols in shared library (or not), additionally
2227 dnl marking other symbols as private/local (or not).
2229 dnl GLIBCPP_ENABLE_SYMVERS
2230 dnl --enable-symvers=style adds a version script to the linker call when
2231 dnl creating the shared library. The choice of version script is
2232 dnl controlled by 'style'.
2233 dnl --disable-symvers does not.
2234 dnl + Usage: GLIBCPP_ENABLE_SYMVERS[(DEFAULT)]
2235 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
2236 dnl defaults to `no'. Passing `yes' tries to choose a default style
2237 dnl based on linker characteristics. Passing 'no' disables versioning.
2238 AC_DEFUN(GLIBCPP_ENABLE_SYMVERS, [dnl
2239 define([GLIBCPP_ENABLE_SYMVERS_DEFAULT], ifelse($1, yes, yes, no))dnl
2240 AC_ARG_ENABLE(symvers,
2241 changequote(<<, >>)dnl
2242 << --enable-symvers=style enables symbol versioning of the shared library [default=>>GLIBCPP_ENABLE_SYMVERS_DEFAULT],
2243 changequote([, ])dnl
2244 [case "$enableval" in
2245 yes) enable_symvers=yes ;;
2246 no) enable_symvers=no ;;
2247 # other names here, just as sanity checks
2248 #gnu|sun|etcetera) enable_symvers=$enableval ;;
2249 gnu) enable_symvers=$enableval ;;
2250 *) AC_MSG_ERROR([Unknown argument to enable/disable symvers]) ;;
2252 enable_symvers=GLIBCPP_ENABLE_SYMVERS_DEFAULT)dnl
2254 # If we never went through the GLIBCPP_CHECK_LINKER_FEATURES macro, then we
2255 # don't know enough about $LD to do tricks...
2256 if test x$enable_shared = xno ||
2258 test x$glibcpp_gnu_ld_version = x; then
2262 # Check to see if libgcc_s exists, indicating that shared libgcc is possible.
2263 if test $enable_symvers != no; then
2264 AC_MSG_CHECKING([for shared libgcc])
2265 ac_save_CFLAGS="$CFLAGS"
2267 AC_TRY_LINK(, [return 0], glibcpp_shared_libgcc=yes, glibcpp_shared_libgcc=no)
2268 CFLAGS="$ac_save_CFLAGS"
2269 AC_MSG_RESULT($glibcpp_shared_libgcc)
2272 # For GNU ld, we need at least this version. It's 2.12 in the same format
2273 # as the tested-for version. See GLIBCPP_CHECK_LINKER_FEATURES for more.
2274 glibcpp_min_gnu_ld_version=21200
2276 # Check to see if unspecified "yes" value can win, given results
2278 if test $enable_symvers = yes ; then
2279 if test $with_gnu_ld = yes &&
2280 test $glibcpp_shared_libgcc = yes ;
2282 if test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version ; then
2285 ac_test_CFLAGS="${CFLAGS+set}"
2286 ac_save_CFLAGS="$CFLAGS"
2287 CFLAGS='-shared -Wl,--version-script,conftest.map'
2290 echo 'FOO { global: f[a-z]o; local: *; };' > conftest.map
2292 AC_TRY_LINK([int foo;],, enable_symvers=gnu)
2293 if test "$ac_test_CFLAGS" = set; then
2294 CFLAGS="$ac_save_CFLAGS"
2296 # this is the suspicious part
2307 dnl Everything parsed; figure out what file to use.
2308 case $enable_symvers in
2310 SYMVER_MAP=config/linker-map.dummy
2313 SYMVER_MAP=config/linker-map.gnu
2314 AC_DEFINE(_GLIBCPP_SYMVER)
2318 AC_SUBST(SYMVER_MAP)
2319 AM_CONDITIONAL(GLIBCPP_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
2320 AC_MSG_CHECKING([versioning on shared library symbols])
2321 AC_MSG_RESULT($enable_symvers)
2325 # isc-posix.m4 serial 2 (gettext-0.11.2)
2326 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2327 dnl This file is free software, distributed under the terms of the GNU
2328 dnl General Public License. As a special exception to the GNU General
2329 dnl Public License, this file may be distributed as part of a program
2330 dnl that contains a configuration script generated by Autoconf, under
2331 dnl the same distribution terms as the rest of that program.
2333 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
2335 # This test replaces the one in autoconf.
2336 # Currently this macro should have the same name as the autoconf macro
2337 # because gettext's gettext.m4 (distributed in the automake package)
2338 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
2339 # give these diagnostics:
2340 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
2341 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
2343 undefine([AC_ISC_POSIX])
2345 AC_DEFUN([AC_ISC_POSIX],
2347 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
2348 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
2352 # Add --enable-maintainer-mode option to configure.
2357 AC_DEFUN([AM_MAINTAINER_MODE],
2358 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
2359 dnl maintainer-mode is disabled by default
2360 AC_ARG_ENABLE(maintainer-mode,
2361 [ --enable-maintainer-mode enable make rules and dependencies not useful
2362 (and sometimes confusing) to the casual installer],
2363 USE_MAINTAINER_MODE=$enableval,
2364 USE_MAINTAINER_MODE=no)
2365 AC_MSG_RESULT($USE_MAINTAINER_MODE)
2366 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
2367 MAINT=$MAINTAINER_MODE_TRUE
2372 # Define a conditional.
2374 AC_DEFUN([AM_CONDITIONAL],
2385 # Do all the work for Automake. This macro actually does too much --
2386 # some checks are only needed if your package does certain things.
2387 # But this isn't really a big deal.
2392 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
2394 AC_DEFUN([AM_INIT_AUTOMAKE],
2395 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
2396 AC_REQUIRE([AC_PROG_INSTALL])
2401 dnl test to see if srcdir already configured
2402 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
2403 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2406 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
2407 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
2408 AC_REQUIRE([AM_SANITY_CHECK])
2409 AC_REQUIRE([AC_ARG_PROGRAM])
2410 dnl FIXME This is truly gross.
2411 missing_dir=`cd $ac_aux_dir && pwd`
2412 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
2413 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
2414 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
2415 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
2416 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
2417 AC_REQUIRE([AC_PROG_MAKE_SET])])
2419 # Copyright 2002 Free Software Foundation, Inc.
2421 # This program is free software; you can redistribute it and/or modify
2422 # it under the terms of the GNU General Public License as published by
2423 # the Free Software Foundation; either version 2, or (at your option)
2424 # any later version.
2426 # This program is distributed in the hope that it will be useful,
2427 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2428 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2429 # GNU General Public License for more details.
2431 # You should have received a copy of the GNU General Public License
2432 # along with this program; if not, write to the Free Software
2433 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2435 # AM_AUTOMAKE_VERSION(VERSION)
2436 # ----------------------------
2437 # Automake X.Y traces this macro to ensure aclocal.m4 has been
2438 # generated from the m4 files accompanying Automake X.Y.
2439 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
2441 # AM_SET_CURRENT_AUTOMAKE_VERSION
2442 # -------------------------------
2443 # Call AM_AUTOMAKE_VERSION so it can be traced.
2444 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
2445 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
2446 [AM_AUTOMAKE_VERSION([1.4-p6])])
2449 # Check to make sure that the build environment is sane.
2452 AC_DEFUN([AM_SANITY_CHECK],
2453 [AC_MSG_CHECKING([whether build environment is sane])
2456 echo timestamp > conftestfile
2457 # Do `set' in a subshell so we don't clobber the current shell's
2458 # arguments. Must try -L first in case configure is actually a
2459 # symlink; some systems play weird games with the mod time of symlinks
2460 # (eg FreeBSD returns the mod time of the symlink's containing
2463 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
2464 if test "[$]*" = "X"; then
2466 set X `ls -t $srcdir/configure conftestfile`
2468 if test "[$]*" != "X $srcdir/configure conftestfile" \
2469 && test "[$]*" != "X conftestfile $srcdir/configure"; then
2471 # If neither matched, then we have a broken ls. This can happen
2472 # if, for instance, CONFIG_SHELL is bash and it inherits a
2473 # broken ls alias from the environment. This has actually
2474 # happened. Such a system could not be considered "sane".
2475 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
2476 alias in your environment])
2479 test "[$]2" = conftestfile
2485 AC_MSG_ERROR([newly created file is older than distributed files!
2486 Check your system clock])
2489 AC_MSG_RESULT(yes)])
2491 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
2492 dnl The program must properly implement --version.
2493 AC_DEFUN([AM_MISSING_PROG],
2494 [AC_MSG_CHECKING(for working $2)
2495 # Run test in a subshell; some versions of sh will print an error if
2496 # an executable is not found, even if stderr is redirected.
2497 # Redirect stdin to placate older versions of autoconf. Sigh.
2498 if ($2 --version) < /dev/null > /dev/null 2>&1; then
2500 AC_MSG_RESULT(found)
2503 AC_MSG_RESULT(missing)
2507 # Like AC_CONFIG_HEADER, but automatically create stamp file.
2509 AC_DEFUN([AM_CONFIG_HEADER],
2511 AC_CONFIG_HEADER([$1])
2512 dnl When config.status generates a header, we must update the stamp-h file.
2513 dnl This file resides in the same directory as the config header
2514 dnl that is generated. We must strip everything past the first ":",
2515 dnl and everything past the last "/".
2516 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
2517 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
2518 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
2520 for am_file in <<$1>>; do
2521 case " <<$>>CONFIG_HEADERS " in
2522 *" <<$>>am_file "*<<)>>
2523 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
2526 am_indx=`expr "<<$>>am_indx" + 1`