2 dnl Initialize basic configure bits, set toplevel_srcdir for Makefiles.
4 dnl GLIBCXX_TOPREL_CONFIGURE
5 AC_DEFUN(GLIBCXX_TOPREL_CONFIGURE, [
6 dnl Default to --enable-multilib (this is also passed by default
7 dnl from the ubercommon-top-level configure)
8 AC_ARG_ENABLE(multilib,
9 [ --enable-multilib build hella library versions (default)],
10 [case "${enableval}" in
13 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
14 esac], [multilib=yes])dnl
16 # When building with srcdir == objdir, links to the source files will
17 # be created in directories within the target_subdir. We have to
18 # adjust toplevel_srcdir accordingly, so that configure finds
19 # install-sh and other auxiliary files that live in the top-level
21 if test "${srcdir}" = "."; then
22 if test -z "${with_target_subdir}"; then
25 if test "${with_target_subdir}" != "."; then
26 toprel="${with_multisrctop}../.."
28 toprel="${with_multisrctop}.."
34 AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
35 toplevel_srcdir=\${top_srcdir}/$toprel
36 AC_SUBST(toplevel_srcdir)
40 dnl Initialize the rest of the library configury.
43 AC_DEFUN(GLIBCXX_CONFIGURE, [
44 # Export build and source directories.
45 # These need to be absolute paths, yet at the same time need to
46 # canonicalize only relative paths, because then amd will not unmount
47 # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
48 glibcxx_builddir=`${PWDCMD-pwd}`
50 [\\/$]* | ?:[\\/]*) glibcxx_srcdir=${srcdir} ;;
51 *) glibcxx_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
53 AC_SUBST(glibcxx_builddir)
54 AC_SUBST(glibcxx_srcdir)
56 dnl This is here just to satisfy automake.
57 ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
60 # Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.5x, can also
61 # be 'cp -p' if linking isn't available. Uncomment the next line to
62 # force a particular method.
63 #ac_cv_prog_LN_S='cp -p'
66 # We use these options to decide which functions to include.
67 AC_ARG_WITH(target-subdir,
68 [ --with-target-subdir=SUBDIR
69 configuring in a subdirectory])
70 AC_ARG_WITH(cross-host,
71 [ --with-cross-host=HOST configuring with a cross compiler])
74 [ --with-newlib Configuring with newlib])
76 glibcxx_basedir=$srcdir/$toprel/$1/libstdc++-v3
77 AC_SUBST(glibcxx_basedir)
79 # Never versions of autoconf add an underscore to these functions.
80 # Prevent future problems ...
81 ifdef([AC_PROG_CC_G],[],[define([AC_PROG_CC_G],defn([_AC_PROG_CC_G]))])
82 ifdef([AC_PROG_CC_GNU],[],[define([AC_PROG_CC_GNU],defn([_AC_PROG_CC_GNU]))])
83 ifdef([AC_PROG_CXX_G],[],[define([AC_PROG_CXX_G],defn([_AC_PROG_CXX_G]))])
84 ifdef([AC_PROG_CXX_GNU],[],[define([AC_PROG_CXX_GNU],defn([_AC_PROG_CXX_GNU]))])
87 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
88 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
89 # are probably using a cross compiler, which will not be able to fully
90 # link an executable. This is addressed in later versions of autoconf.
92 AC_DEFUN(LIB_AC_PROG_CC,
93 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
94 dnl Fool anybody using AC_PROG_CC.
95 AC_PROVIDE([AC_PROG_CC])
96 AC_CHECK_PROG(CC, gcc, gcc)
97 if test -z "$CC"; then
98 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
99 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
104 if test $ac_cv_prog_gcc = yes; then
106 dnl Check whether -g works, even if CFLAGS is set, in case the package
107 dnl plays around with CFLAGS (such as to build both debugging and
108 dnl normal versions of a library), tasteless as that idea is.
109 ac_test_CFLAGS="${CFLAGS+set}"
110 ac_save_CFLAGS="$CFLAGS"
113 if test "$ac_test_CFLAGS" = set; then
114 CFLAGS="$ac_save_CFLAGS"
115 elif test $ac_cv_prog_cc_g = yes; then
122 test "${CFLAGS+set}" = set || CFLAGS="-g"
128 # Likewise for AC_PROG_CXX. We can't just call it directly because g++
129 # will try to link in libstdc++.
130 AC_DEFUN(LIB_AC_PROG_CXX,
131 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
132 dnl Fool anybody using AC_PROG_CXX.
133 AC_PROVIDE([AC_PROG_CXX])
134 # Use glibcxx_CXX so that we do not cause CXX to be cached with the
135 # flags that come in CXX while configuring libstdc++. They're different
136 # from those used for all other target libraries. If CXX is set in
137 # the environment, respect that here.
139 AC_CHECK_PROGS(glibcxx_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
140 AC_SUBST(glibcxx_CXX)
142 test -z "$glibcxx_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
146 if test $ac_cv_prog_gxx = yes; then
148 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
149 dnl plays around with CXXFLAGS (such as to build both debugging and
150 dnl normal versions of a library), tasteless as that idea is.
151 ac_test_CXXFLAGS="${CXXFLAGS+set}"
152 ac_save_CXXFLAGS="$CXXFLAGS"
155 if test "$ac_test_CXXFLAGS" = set; then
156 CXXFLAGS="$ac_save_CXXFLAGS"
157 elif test $ac_cv_prog_cxx_g = yes; then
164 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
170 # For directory versioning (e.g., headers) and other variables.
171 AC_MSG_CHECKING([for GCC version number])
172 gcc_version=`$glibcxx_CXX -dumpversion`
173 AC_MSG_RESULT($gcc_version)
175 # For some reason, gettext needs this.
178 AC_CHECK_TOOL(AS, as)
179 AC_CHECK_TOOL(AR, ar)
180 AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
185 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
186 # at least currently, we never actually build a program, so we never
187 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
188 # fails, because we are probably configuring with a cross compiler
189 # which can't create executables. So we include AC_EXEEXT to keep
190 # automake happy, but we don't execute it, since we don't care about
193 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
194 # to nothing, so nothing would remain between `then' and `fi' if it
195 # were not for the `:' below.
200 case [$]{glibcxx_basedir} in
201 /* | [A-Za-z]:[\\/]*) libgcj_flagbasedir=[$]{glibcxx_basedir} ;;
202 *) glibcxx_flagbasedir='[$](top_builddir)/'[$]{glibcxx_basedir} ;;
205 # Set up safe default values for all subsequent AM_CONDITIONAL tests.
215 # Find platform-specific directories containing configuration info. In
216 # addition to possibly modifying the same flags, it also sets up symlinks.
222 dnl Check to see if g++ can compile this library, and if so, if any version-
223 dnl specific precautions need to be taken.
225 dnl GLIBCXX_CHECK_COMPILER_VERSION
226 AC_DEFUN(GLIBCXX_CHECK_COMPILER_VERSION, [
227 if test ! -f stamp-sanity-compiler; then
228 AC_MSG_CHECKING([for g++ that will successfully compile libstdc++-v3])
235 ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to GCC 3.0 or above]))
237 AC_MSG_RESULT($gpp_satisfactory)
238 touch stamp-sanity-compiler
244 dnl Tests for newer compiler features, or features that are present in newer
245 dnl compiler versions but not older compiler versions still in use, should
248 dnl Define WERROR='-Werror' if requested and possible; g++'s that lack the
249 dnl new inlining code or the new system_header pragma will die on -Werror.
250 dnl Leave it out by default and use maint-mode to use it.
252 dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
253 dnl compiler supports it and the user has not requested debug mode.
255 dnl GLIBCXX_CHECK_COMPILER_FEATURES
256 AC_DEFUN(GLIBCXX_CHECK_COMPILER_FEATURES, [
257 # All these tests are for C++; save the language and the compiler flags.
258 # The CXXFLAGS thing is suspicious, but based on similar bits previously
259 # found in GLIBCXX_CONFIGURE.
262 ac_test_CXXFLAGS="${CXXFLAGS+set}"
263 ac_save_CXXFLAGS="$CXXFLAGS"
265 # Check for maintainer-mode bits.
266 if test x"$USE_MAINTAINER_MODE" = xno; then
272 # Check for -ffunction-sections -fdata-sections
273 AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
274 CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
275 AC_TRY_COMPILE(, [int foo;
276 ], [ac_fdsections=yes], [ac_fdsections=no])
277 if test "$ac_test_CXXFLAGS" = set; then
278 CXXFLAGS="$ac_save_CXXFLAGS"
280 # this is the suspicious part
283 if test x"$ac_fdsections" = x"yes"; then
284 SECTION_FLAGS='-ffunction-sections -fdata-sections'
286 AC_MSG_RESULT($ac_fdsections)
290 AC_SUBST(SECTION_FLAGS)
295 dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
296 dnl the native linker is in use, all variables will be defined to something
297 dnl safe (like an empty string).
299 dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible.
300 dnl Define OPT_LDFLAGS='-Wl,-O1' if possible.
301 dnl Define LD, with_gnu_ld, and (possibly) glibcxx_gnu_ld_version as
302 dnl side-effects of testing. The last will be a single integer, e.g.,
303 dnl version 1.23.45.0.67.89 will set glibcxx_gnu_ld_version to 12345.
305 dnl GLIBCXX_CHECK_LINKER_FEATURES
306 AC_DEFUN(GLIBCXX_CHECK_LINKER_FEATURES, [
307 # If we're not using GNU ld, then there's no point in even trying these
308 # tests. Check for that first. We should have already tested for gld
309 # by now (in libtool), but require it now just to be safe...
310 test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
311 test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
312 AC_REQUIRE([AC_PROG_LD])
314 # The name set by libtool depends on the version of libtool. Shame on us
315 # for depending on an impl detail, but c'est la vie. Older versions used
316 # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
317 # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
318 # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
319 # set (hence we're using an older libtool), then set it.
320 if test x${with_gnu_ld+set} != xset; then
321 if test x${ac_cv_prog_gnu_ld+set} != xset; then
322 # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
325 with_gnu_ld=$ac_cv_prog_gnu_ld
329 # Start by getting the version number. I think the libtool test already
330 # does some of this, but throws away the result.
332 ldver=`$LD --version 2>/dev/null | head -1 | \
333 sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
335 glibcxx_gnu_ld_version=`echo $ldver | \
336 $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
339 if test "$with_gnu_ld" = "notbroken"; then
340 # GNU ld it is! Joy and bunny rabbits!
342 # All these tests are for C++; save the language and the compiler flags.
343 # Need to do this so that g++ won't try to link in libstdc++
344 ac_test_CFLAGS="${CFLAGS+set}"
345 ac_save_CFLAGS="$CFLAGS"
346 CFLAGS='-x c++ -Wl,--gc-sections'
348 # Check for -Wl,--gc-sections
349 # XXX This test is broken at the moment, as symbols required for
350 # linking are now in libsupc++ (not built yet.....). In addition,
351 # this test has cored on solaris in the past. In addition,
352 # --gc-sections doesn't really work at the moment (keeps on discarding
353 # used sections, first .eh_frame and now some of the glibc sections for
354 # iconv). Bzzzzt. Thanks for playing, maybe next time.
355 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
363 ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
364 if test "$ac_test_CFLAGS" = set; then
365 CFLAGS="$ac_save_CFLAGS"
367 # this is the suspicious part
370 if test "$ac_sectionLDflags" = "yes"; then
371 SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
373 AC_MSG_RESULT($ac_sectionLDflags)
376 # Set linker optimization flags.
377 if test x"$with_gnu_ld" = x"yes"; then
378 OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
381 AC_SUBST(SECTION_LDFLAGS)
382 AC_SUBST(OPT_LDFLAGS)
387 dnl Check to see if the (math function) argument passed is
388 dnl declared when using the c++ compiler
389 dnl ASSUMES argument is a math function with ONE parameter
391 dnl GLIBCXX_CHECK_MATH_DECL_1
392 AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_1, [
393 AC_MSG_CHECKING([for $1 declaration])
394 if test x${glibcxx_cv_func_$1_use+set} != xset; then
395 AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
398 AC_TRY_COMPILE([#include <math.h>
404 [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
408 AC_MSG_RESULT($glibcxx_cv_func_$1_use)
412 dnl Check to see if the (math function) argument passed is
413 dnl 1) declared when using the c++ compiler
414 dnl 2) has "C" linkage
415 dnl 3) if not, see if 1) and 2) for argument prepended with '_'
417 dnl Define HAVE_CARGF etc if "cargf" is declared and links
419 dnl argument 1 is name of function to check
421 dnl ASSUMES argument is a math function with ONE parameter
423 dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1
424 AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1, [
425 GLIBCXX_CHECK_MATH_DECL_1($1)
426 if test x$glibcxx_cv_func_$1_use = x"yes"; then
429 GLIBCXX_CHECK_MATH_DECL_1(_$1)
430 if test x$glibcxx_cv_func__$1_use = x"yes"; then
438 dnl Like GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
439 dnl of functions at once. It's an all-or-nothing check -- either
440 dnl HAVE_XYZ is defined for each of the functions, or for none of them.
441 dnl Doing it this way saves significant configure time.
442 AC_DEFUN(GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1, [
443 AC_MSG_CHECKING([for $1 functions])
444 AC_CACHE_VAL(glibcxx_cv_func_$2_use, [
447 AC_TRY_COMPILE([#include <math.h>],
448 [ `for x in $3; do echo "$x (0);"; done` ],
449 [glibcxx_cv_func_$2_use=yes],
450 [glibcxx_cv_func_$2_use=no])
452 AC_MSG_RESULT($glibcxx_cv_func_$2_use)
453 if test x$glibcxx_cv_func_$2_use = x"yes"; then
459 dnl Check to see if the (math function) argument passed is
460 dnl declared when using the c++ compiler
461 dnl ASSUMES argument is a math function with TWO parameters
463 dnl GLIBCXX_CHECK_MATH_DECL_2
464 AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_2, [
465 AC_MSG_CHECKING([for $1 declaration])
466 if test x${glibcxx_cv_func_$1_use+set} != xset; then
467 AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
470 AC_TRY_COMPILE([#include <math.h>],
472 [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
476 AC_MSG_RESULT($glibcxx_cv_func_$1_use)
480 dnl Check to see if the (math function) argument passed is
481 dnl 1) declared when using the c++ compiler
482 dnl 2) has "C" linkage
484 dnl Define HAVE_CARGF etc if "cargf" is declared and links
486 dnl argument 1 is name of function to check
488 dnl ASSUMES argument is a math function with TWO parameters
490 dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2
491 AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2, [
492 GLIBCXX_CHECK_MATH_DECL_2($1)
493 if test x$glibcxx_cv_func_$1_use = x"yes"; then
496 GLIBCXX_CHECK_MATH_DECL_2(_$1)
497 if test x$glibcxx_cv_func__$1_use = x"yes"; then
505 dnl Check to see if the (math function) argument passed is
506 dnl declared when using the c++ compiler
507 dnl ASSUMES argument is a math function with THREE parameters
509 dnl GLIBCXX_CHECK_MATH_DECL_3
510 AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_3, [
511 AC_MSG_CHECKING([for $1 declaration])
512 if test x${glibcxx_cv_func_$1_use+set} != xset; then
513 AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
516 AC_TRY_COMPILE([#include <math.h>],
518 [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
522 AC_MSG_RESULT($glibcxx_cv_func_$1_use)
526 dnl Check to see if the (math function) argument passed is
527 dnl 1) declared when using the c++ compiler
528 dnl 2) has "C" linkage
530 dnl Define HAVE_CARGF etc if "cargf" is declared and links
532 dnl argument 1 is name of function to check
534 dnl ASSUMES argument is a math function with THREE parameters
536 dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3
537 AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3, [
538 GLIBCXX_CHECK_MATH_DECL_3($1)
539 if test x$glibcxx_cv_func_$1_use = x"yes"; then
542 GLIBCXX_CHECK_MATH_DECL_3(_$1)
543 if test x$glibcxx_cv_func__$1_use = x"yes"; then
551 dnl Check to see if the (stdlib function) argument passed is
552 dnl 1) declared when using the c++ compiler
553 dnl 2) has "C" linkage
555 dnl argument 1 is name of function to check
557 dnl ASSUMES argument is a math function with TWO parameters
559 dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2
560 AC_DEFUN(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
561 AC_MSG_CHECKING([for $1 declaration])
562 if test x${glibcxx_cv_func_$1_use+set} != xset; then
563 AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
566 AC_TRY_COMPILE([#include <stdlib.h>],
568 [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
572 AC_MSG_RESULT($glibcxx_cv_func_$1_use)
573 if test x$glibcxx_cv_func_$1_use = x"yes"; then
580 dnl Check to see if the (stdlib function) argument passed is
581 dnl 1) declared when using the c++ compiler
582 dnl 2) has "C" linkage
584 dnl argument 1 is name of function to check
586 dnl ASSUMES argument is a function with THREE parameters
588 dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3
589 AC_DEFUN(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3, [
590 AC_MSG_CHECKING([for $1 declaration])
591 if test x${glibcxx_cv_func_$1_use+set} != xset; then
592 AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
595 AC_TRY_COMPILE([#include <stdlib.h>],
597 [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
601 AC_MSG_RESULT($glibcxx_cv_func_$1_use)
602 if test x$glibcxx_cv_func_$1_use = x"yes"; then
608 dnl Because the builtins are picky picky picky about the arguments they take,
609 dnl do an explict linkage tests here.
610 dnl Check to see if the (math function) argument passed is
611 dnl 1) declared when using the c++ compiler
612 dnl 2) has "C" linkage
614 dnl Define HAVE_CARGF etc if "cargf" is declared and links
616 dnl argument 1 is name of function to check
618 dnl ASSUMES argument is a math function with ONE parameter
620 dnl GLIBCXX_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
621 AC_DEFUN(GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
622 AC_MSG_CHECKING([for $1 declaration])
623 if test x${glibcxx_cv_func_$1_use+set} != xset; then
624 AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
627 AC_TRY_COMPILE([#include <math.h>],
629 [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
633 AC_MSG_RESULT($glibcxx_cv_func_$1_use)
634 if test x$glibcxx_cv_func_$1_use = x"yes"; then
635 AC_MSG_CHECKING([for $1 linkage])
636 if test x${glibcxx_cv_func_$1_link+set} != xset; then
637 AC_CACHE_VAL(glibcxx_cv_func_$1_link, [
638 AC_TRY_LINK([#include <math.h>],
640 [glibcxx_cv_func_$1_link=yes], [glibcxx_cv_func_$1_link=no])
643 AC_MSG_RESULT($glibcxx_cv_func_$1_link)
644 if test x$glibcxx_cv_func_$1_link = x"yes"; then
645 ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
646 AC_DEFINE_UNQUOTED(${ac_tr_func})
653 dnl Check to see what builtin math functions are supported
655 dnl check for __builtin_abs
656 dnl check for __builtin_fabsf
657 dnl check for __builtin_fabs
658 dnl check for __builtin_fabl
659 dnl check for __builtin_labs
660 dnl check for __builtin_sqrtf
661 dnl check for __builtin_sqrtl
662 dnl check for __builtin_sqrt
663 dnl check for __builtin_sinf
664 dnl check for __builtin_sin
665 dnl check for __builtin_sinl
666 dnl check for __builtin_cosf
667 dnl check for __builtin_cos
668 dnl check for __builtin_cosl
670 dnl GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
671 AC_DEFUN(GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT, [
672 dnl Test for builtin math functions.
673 dnl These are made in gcc/c-common.c
674 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
675 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
676 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
677 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
678 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
680 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
681 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt)
682 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
684 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
685 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
686 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
688 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
689 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
690 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
692 dnl There is, without a doubt, a more elegant way to have these
693 dnl names exported so that they won't be stripped out of acconfig.h by
694 dnl autoheader. I leave this as an exercise to somebody less frustrated
695 dnl than I.... please email the libstdc++ list if you can figure out a
696 dnl more elegant approach (see autoconf/acgen.m4 and specifically
697 dnl AC_CHECK_FUNC for things to steal.)
699 if test x$dummyvar = x"yes"; then
700 AC_DEFINE(HAVE___BUILTIN_ABS)
701 AC_DEFINE(HAVE___BUILTIN_LABS)
702 AC_DEFINE(HAVE___BUILTIN_COS)
703 AC_DEFINE(HAVE___BUILTIN_COSF)
704 AC_DEFINE(HAVE___BUILTIN_COSL)
705 AC_DEFINE(HAVE___BUILTIN_FABS)
706 AC_DEFINE(HAVE___BUILTIN_FABSF)
707 AC_DEFINE(HAVE___BUILTIN_FABSL)
708 AC_DEFINE(HAVE___BUILTIN_SIN)
709 AC_DEFINE(HAVE___BUILTIN_SINF)
710 AC_DEFINE(HAVE___BUILTIN_SINL)
711 AC_DEFINE(HAVE___BUILTIN_SQRT)
712 AC_DEFINE(HAVE___BUILTIN_SQRTF)
713 AC_DEFINE(HAVE___BUILTIN_SQRTL)
718 dnl Check to see what the underlying c library is like
719 dnl These checks need to do two things:
720 dnl 1) make sure the name is declared when using the c++ compiler
721 dnl 2) make sure the name has "C" linkage
722 dnl This might seem like overkill but experience has shown that it's not...
724 dnl Define HAVE_STRTOLD if "strtold" is declared and links
725 dnl Define HAVE_STRTOF if "strtof" is declared and links
726 dnl Define HAVE_DRAND48 if "drand48" is declared and links
728 dnl GLIBCXX_CHECK_STDLIB_SUPPORT
729 AC_DEFUN(GLIBCXX_CHECK_STDLIB_SUPPORT, [
730 ac_test_CXXFLAGS="${CXXFLAGS+set}"
731 ac_save_CXXFLAGS="$CXXFLAGS"
732 CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
734 GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
735 GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)
736 AC_CHECK_FUNCS(drand48)
738 CXXFLAGS="$ac_save_CXXFLAGS"
742 dnl Check to see what the underlying c library or math library is like.
743 dnl These checks need to do two things:
744 dnl 1) make sure the name is declared when using the c++ compiler
745 dnl 2) make sure the name has "C" linkage
746 dnl This might seem like overkill but experience has shown that it's not...
748 dnl Define HAVE_CARGF etc if "cargf" is found.
750 dnl GLIBCXX_CHECK_MATH_SUPPORT
751 AC_DEFUN(GLIBCXX_CHECK_MATH_SUPPORT, [
752 ac_test_CXXFLAGS="${CXXFLAGS+set}"
753 ac_save_CXXFLAGS="$CXXFLAGS"
754 CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
757 AC_CHECK_LIB(m, sin, libm="-lm")
761 dnl Check to see if certain C math functions exist.
762 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
763 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
764 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
765 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
766 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
767 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
768 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
769 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypot)
771 dnl Check to see if basic C math functions have float versions.
772 GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
777 GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
780 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(expf)
781 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
782 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
783 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
784 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
785 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
786 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
787 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf)
788 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
789 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
790 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
791 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
792 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
793 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
794 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
795 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
797 dnl Check to see if basic C math functions have long double versions.
798 GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
803 GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
806 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
807 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
808 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
809 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
810 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
811 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
812 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
813 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
814 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl)
815 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
816 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
817 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
818 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
819 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
820 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
821 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
822 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
824 dnl Some runtimes have these functions with a preceding underscore. Please
825 dnl keep this sync'd with the one above. And if you add any new symbol,
826 dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
827 dnl Check to see if certain C math functions exist.
829 dnl Check to see if basic C math functions have float versions.
830 GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
832 _acosf _asinf _atanf \
834 _coshf _sinhf _tanhf)
835 GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
839 dnl Check to see if basic C math functions have long double versions.
840 GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
842 _acosl _asinl _atanl \
844 _coshl _sinhl _tanhl)
845 GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
850 CXXFLAGS="$ac_save_CXXFLAGS"
855 dnl Check to see if there is native support for complex
857 dnl Don't compile bits in math/* if native support exits.
859 dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
861 dnl GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
862 AC_DEFUN(GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT, [
863 dnl Check for complex versions of math functions of platform. This will
864 dnl always pass if libm is available, and fail if it isn't. If it is
865 dnl available, we assume we'll need it later, so add it to LIBS.
866 AC_CHECK_LIB(m, main)
867 AC_REPLACE_MATHFUNCS(nan copysignf)
869 dnl For __signbit to signbit conversions.
870 AC_CHECK_FUNCS([__signbit], , [LIBMATHOBJS="$LIBMATHOBJS signbit.lo"])
871 AC_CHECK_FUNCS([__signbitf], , [LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"])
873 dnl Compile the long double complex functions only if the function
874 dnl provides the non-complex long double functions that are needed.
875 dnl Currently this includes copysignl, which should be
876 dnl cached from the GLIBCXX_CHECK_MATH_SUPPORT macro, above.
877 if test x$ac_cv_func_copysignl = x"yes"; then
878 AC_CHECK_FUNCS([__signbitl], , [LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"])
881 if test -n "$LIBMATHOBJS"; then
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 GLIBCXX_CHECK_HOST
893 AC_DEFUN(GLIBCXX_CHECK_HOST, [
894 . [$]{glibcxx_basedir}/configure.host
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 _GLIBCXX_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 GLIBCXX_CHECK_WCHAR_T_SUPPORT
909 AC_DEFUN(GLIBCXX_CHECK_WCHAR_T_SUPPORT, [
910 dnl Wide characters disabled by default.
912 dnl Test wchar.h for mbstate_t, which is needed for char_traits and
913 dnl others even if wchar_t support is not on.
914 AC_MSG_CHECKING([for mbstate_t])
915 AC_TRY_COMPILE([#include <wchar.h>],
916 [mbstate_t teststate;],
917 have_mbstate_t=yes, have_mbstate_t=no)
918 AC_MSG_RESULT($have_mbstate_t)
919 if test x"$have_mbstate_t" = xyes; then
920 AC_DEFINE(HAVE_MBSTATE_T)
923 dnl Sanity check for existence of ISO C99 headers for extended encoding.
924 AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
925 AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
927 dnl Only continue checking if the ISO C99 headers exist and support is on.
928 if test x"$ac_has_wchar_h" = xyes &&
929 test x"$ac_has_wctype_h" = xyes &&
930 test x"$enable_c_mbchar" != xno; then
932 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
933 dnl numeric_limits can instantiate type_traits<wchar_t>
934 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
935 AC_TRY_COMPILE([#include <wchar.h>],
936 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
937 has_wchar_minmax=yes, has_wchar_minmax=no)
938 AC_MSG_RESULT($has_wchar_minmax)
940 dnl Test wchar.h for WEOF, which is what we use to determine whether
941 dnl to specialize for char_traits<wchar_t> or not.
942 AC_MSG_CHECKING([for WEOF])
945 #include <stddef.h>],
947 has_weof=yes, has_weof=no)
948 AC_MSG_RESULT($has_weof)
950 dnl Tests for wide character functions used in char_traits<wchar_t>.
952 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
955 dnl Checks for names injected into std:: by the c_std headers.
956 AC_CHECK_FUNCS(btowc wctob fgetwc fgetws fputwc fputws fwide \
957 fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
958 vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
959 mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
960 wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
961 wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr,, \
964 AC_MSG_CHECKING([for ISO C99 wchar_t support])
965 if test x"$has_weof" = xyes &&
966 test x"$has_wchar_minmax" = xyes &&
967 test x"$ac_wfuncs" = xyes; then
968 ac_isoC99_wchar_t=yes
972 AC_MSG_RESULT($ac_isoC99_wchar_t)
974 dnl Use iconv for wchar_t to char conversions. As such, check for
975 dnl X/Open Portability Guide, version 2 features (XPG2).
976 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
977 AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
979 dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
980 AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
982 LIBS="$LIBS $libiconv"
984 AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
985 ac_XPG2funcs=yes, ac_XPG2funcs=no)
989 AC_MSG_CHECKING([for XPG2 wchar_t support])
990 if test x"$ac_has_iconv_h" = xyes &&
991 test x"$ac_has_langinfo_h" = xyes &&
992 test x"$ac_XPG2funcs" = xyes; then
997 AC_MSG_RESULT($ac_XPG2_wchar_t)
999 dnl At the moment, only enable wchar_t specializations if all the
1000 dnl above support is present.
1001 if test x"$ac_isoC99_wchar_t" = xyes &&
1002 test x"$ac_XPG2_wchar_t" = xyes; then
1003 AC_DEFINE(_GLIBCXX_USE_WCHAR_T)
1007 AC_MSG_CHECKING([for enabled wchar_t specializations])
1008 AC_MSG_RESULT($enable_wchar_t)
1013 dnl Check to see if debugging libraries are to be built.
1015 dnl GLIBCXX_ENABLE_DEBUG
1017 dnl --enable-libstdcxx-debug
1018 dnl builds a separate set of debugging libraries in addition to the
1019 dnl normal (shared, static) libstdc++ binaries.
1021 dnl --disable-libstdcxx-debug
1022 dnl builds only one (non-debug) version of libstdc++.
1024 dnl --enable-libstdcxx-debug-flags=FLAGS
1025 dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
1027 dnl + Usage: GLIBCXX_ENABLE_DEBUG[(DEFAULT)]
1028 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1029 dnl defaults to `no'.
1030 AC_DEFUN(GLIBCXX_ENABLE_DEBUG, [dnl
1031 define([GLIBCXX_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
1032 AC_ARG_ENABLE(libstdcxx_debug,
1033 changequote(<<, >>)dnl
1034 << --enable-libstdcxx-debug build extra debug library [default=>>GLIBCXX_ENABLE_DEBUG_DEFAULT],
1035 changequote([, ])dnl
1036 [case "${enableval}" in
1037 yes) enable_libstdcxx_debug=yes ;;
1038 no) enable_libstdcxx_debug=no ;;
1039 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
1041 enable_libstdcxx_debug=GLIBCXX_ENABLE_DEBUG_DEFAULT)dnl
1042 AC_MSG_CHECKING([for additional debug build])
1043 AC_MSG_RESULT($enable_libstdcxx_debug)
1044 AM_CONDITIONAL(GLIBCXX_BUILD_DEBUG, test "$enable_libstdcxx_debug" = yes)
1048 dnl Check for explicit debug flags.
1050 dnl GLIBCXX_ENABLE_DEBUG_FLAGS
1052 dnl --enable-libstdcxx-debug-flags='-O1'
1053 dnl is a general method for passing flags to be used when
1054 dnl building debug libraries with --enable-debug.
1056 dnl --disable-libstdcxx-debug-flags does nothing.
1057 dnl + Usage: GLIBCXX_ENABLE_DEBUG_FLAGS(default flags)
1058 dnl If "default flags" is an empty string (or "none"), the effect is
1059 dnl the same as --disable or --enable=no.
1060 AC_DEFUN(GLIBCXX_ENABLE_DEBUG_FLAGS, [dnl
1061 define([GLIBCXX_ENABLE_DEBUG_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1062 AC_ARG_ENABLE(libstdcxx_debug_flags,
1063 changequote(<<, >>)dnl
1064 << --enable-libstdcxx-debug-flags=FLAGS pass compiler FLAGS when building
1066 [default=>>GLIBCXX_ENABLE_DEBUG_FLAGS_DEFAULT],
1067 changequote([, ])dnl
1068 [case "${enableval}" in
1070 -*) enable_libstdcxx_debug_flags="${enableval}" ;;
1071 *) AC_MSG_ERROR([Unknown argument to extra debugging flags]) ;;
1073 enable_libstdcxx_debug_flags=GLIBCXX_ENABLE_DEBUG_FLAGS_DEFAULT)dnl
1075 dnl Option parsed, now set things appropriately
1076 case x"$enable_libstdcxx_debug" in
1078 case "$enable_libstdcxx_debug_flags" in
1080 DEBUG_FLAGS="-g3 -O0";;
1082 DEBUG_FLAGS="${enableval}"
1089 AC_SUBST(DEBUG_FLAGS)
1091 AC_MSG_CHECKING([for debug build flags])
1092 AC_MSG_RESULT($DEBUG_FLAGS)
1097 dnl Check for "unusual" flags to pass to the compiler while building.
1099 dnl GLIBCXX_ENABLE_CXX_FLAGS
1100 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
1101 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
1102 dnl Somehow this same set of flags must be passed when [re]building
1104 dnl --disable-cxx-flags passes nothing.
1105 dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
1106 dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
1107 dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
1108 dnl + Usage: GLIBCXX_ENABLE_CXX_FLAGS(default flags)
1109 dnl If "default flags" is an empty string (or "none"), the effect is
1110 dnl the same as --disable or --enable=no.
1111 AC_DEFUN(GLIBCXX_ENABLE_CXX_FLAGS, [dnl
1112 define([GLIBCXX_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1113 AC_MSG_CHECKING([for extra compiler flags for building])
1114 AC_ARG_ENABLE(cxx_flags,
1115 changequote(<<, >>)dnl
1116 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
1117 [default=>>GLIBCXX_ENABLE_CXX_FLAGS_DEFAULT],
1118 changequote([, ])dnl
1119 [case "x$enable_cxx_flags" in
1121 AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
1123 enable_cxx_flags='' ;;
1125 enable_cxx_flags="$enableval" ;;
1127 enable_cxx_flags=GLIBCXX_ENABLE_CXX_FLAGS_DEFAULT)
1129 dnl Run through flags (either default or command-line) and set anything
1130 dnl extra (e.g., #defines) that must accompany particular g++ options.
1131 if test -n "$enable_cxx_flags"; then
1132 for f in $enable_cxx_flags; do
1136 *) # and we're trying to pass /what/ exactly?
1137 AC_MSG_ERROR([compiler flags start with a -]) ;;
1141 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1142 AC_MSG_RESULT($EXTRA_CXX_FLAGS)
1143 AC_SUBST(EXTRA_CXX_FLAGS)
1148 dnl Check for which locale library to use: gnu or generic.
1150 dnl GLIBCXX_ENABLE_CLOCALE
1151 dnl --enable-clocale=gnu sets config/locale/c_locale_gnu.cc and friends
1152 dnl --enable-clocale=generic sets config/locale/c_locale_generic.cc and friends
1154 dnl default is generic
1156 AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
1157 AC_MSG_CHECKING([for clocale to use])
1158 AC_ARG_ENABLE(clocale,
1159 [ --enable-clocale enable model for target locale package.
1160 --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
1162 if test x$enable_clocale = xno; then
1167 enable_clocale_flag=$enable_clocale
1169 dnl Probe for locale support if no specific model is specified.
1170 dnl Default to "generic"
1171 if test x$enable_clocale_flag = xno; then
1172 case x${target_os} in
1174 AC_EGREP_CPP([_GLIBCXX_ok], [
1175 #include <features.h>
1176 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1179 ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
1181 # Test for bugs early in glibc-2.2.x series
1182 if test x$enable_clocale_flag = xgnu; then
1184 #define _GNU_SOURCE 1
1187 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
1188 extern __typeof(newlocale) __newlocale;
1189 extern __typeof(duplocale) __duplocale;
1190 extern __typeof(strcoll_l) __strcoll_l;
1194 const char __one[] = "Äuglein Augmen";
1195 const char __two[] = "Äuglein";
1200 loc = __newlocale(1 << LC_ALL, "de_DE", 0);
1201 loc_dup = __duplocale(loc);
1202 i = __strcoll_l(__one, __two, loc);
1203 j = __strcoll_l(__one, __two, loc_dup);
1207 [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
1208 [enable_clocale_flag=generic])
1211 # ... at some point put __strxfrm_l tests in as well.
1214 enable_clocale_flag=generic
1219 dnl Deal with gettext issues.
1221 [ --enable-nls use Native Language Support (default)],
1225 dnl Set configure bits for specified locale package
1226 case x${enable_clocale_flag} in
1228 AC_MSG_RESULT(generic)
1230 CLOCALE_H=config/locale/generic/c_locale.h
1231 CLOCALE_CC=config/locale/generic/c_locale.cc
1232 CCODECVT_H=config/locale/generic/codecvt_specializations.h
1233 CCODECVT_CC=config/locale/generic/codecvt_members.cc
1234 CCOLLATE_CC=config/locale/generic/collate_members.cc
1235 CCTYPE_CC=config/locale/generic/ctype_members.cc
1236 CMESSAGES_H=config/locale/generic/messages_members.h
1237 CMESSAGES_CC=config/locale/generic/messages_members.cc
1238 CMONEY_CC=config/locale/generic/monetary_members.cc
1239 CNUMERIC_CC=config/locale/generic/numeric_members.cc
1240 CTIME_H=config/locale/generic/time_members.h
1241 CTIME_CC=config/locale/generic/time_members.cc
1242 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
1247 # Declare intention to use gettext, and add support for specific
1249 # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
1252 # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
1253 AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
1254 if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
1257 # Export the build objects.
1258 for ling in $ALL_LINGUAS; do \
1259 glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
1260 glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
1262 AC_SUBST(glibcxx_MOFILES)
1263 AC_SUBST(glibcxx_POFILES)
1265 CLOCALE_H=config/locale/gnu/c_locale.h
1266 CLOCALE_CC=config/locale/gnu/c_locale.cc
1267 CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
1268 CCODECVT_CC=config/locale/gnu/codecvt_members.cc
1269 CCOLLATE_CC=config/locale/gnu/collate_members.cc
1270 CCTYPE_CC=config/locale/gnu/ctype_members.cc
1271 CMESSAGES_H=config/locale/gnu/messages_members.h
1272 CMESSAGES_CC=config/locale/gnu/messages_members.cc
1273 CMONEY_CC=config/locale/gnu/monetary_members.cc
1274 CNUMERIC_CC=config/locale/gnu/numeric_members.cc
1275 CTIME_H=config/locale/gnu/time_members.h
1276 CTIME_CC=config/locale/gnu/time_members.cc
1277 CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
1280 AC_MSG_RESULT(IEEE 1003.1)
1282 CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
1283 CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc
1284 CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
1285 CCODECVT_CC=config/locale/generic/codecvt_members.cc
1286 CCOLLATE_CC=config/locale/generic/collate_members.cc
1287 CCTYPE_CC=config/locale/generic/ctype_members.cc
1288 CMESSAGES_H=config/locale/ieee_1003.1-2001/messages_members.h
1289 CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc
1290 CMONEY_CC=config/locale/generic/monetary_members.cc
1291 CNUMERIC_CC=config/locale/generic/numeric_members.cc
1292 CTIME_H=config/locale/generic/time_members.h
1293 CTIME_CC=config/locale/generic/time_members.cc
1294 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
1297 echo "$enable_clocale is an unknown locale package" 1>&2
1302 # This is where the testsuite looks for locale catalogs, using the
1303 # -DLOCALEDIR define during testsuite compilation.
1304 glibcxx_localedir=${glibcxx_builddir}/po/share/locale
1305 AC_SUBST(glibcxx_localedir)
1307 # A standalone libintl (e.g., GNU libintl) may be in use.
1308 if test $USE_NLS = yes; then
1309 AC_CHECK_HEADERS([libintl.h], [], USE_NLS=no)
1310 AC_SEARCH_LIBS(gettext, intl, [], USE_NLS=no)
1312 if test $USE_NLS = yes; then
1313 AC_DEFINE(_GLIBCXX_USE_NLS)
1318 AC_SUBST(CCODECVT_H)
1319 AC_SUBST(CMESSAGES_H)
1320 AC_SUBST(CCODECVT_CC)
1321 AC_SUBST(CCOLLATE_CC)
1323 AC_SUBST(CMESSAGES_CC)
1325 AC_SUBST(CNUMERIC_CC)
1328 AC_SUBST(CLOCALE_CC)
1329 AC_SUBST(CLOCALE_INTERNAL_H)
1334 dnl Check for which I/O library to use: stdio, or something specific.
1336 dnl GLIBCXX_ENABLE_CSTDIO
1338 dnl default is stdio
1340 AC_DEFUN(GLIBCXX_ENABLE_CSTDIO, [
1341 AC_MSG_CHECKING([for cstdio to use])
1342 AC_ARG_ENABLE(cstdio,
1343 [ --enable-cstdio enable stdio for target io package.
1344 --enable-cstdio=LIB use LIB target-specific io package. [default=stdio]
1346 if test x$enable_cstdio = xno; then
1349 enable_cstdio=stdio)
1351 enable_cstdio_flag=$enable_cstdio
1353 dnl Check if a valid I/O package
1354 case x${enable_cstdio_flag} in
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)
1363 echo "$enable_cstdio is an unknown io package" 1>&2
1368 dnl Set directory for fpos.h
1369 FPOS_H=$fpos_include_dir
1373 AC_SUBST(BASIC_FILE_H)
1374 AC_SUBST(BASIC_FILE_CC)
1379 dnl Check to see if building and using a C++ precompiled header can be done.
1381 dnl GLIBCXX_ENABLE_PCH
1383 dnl --enable-libstdcxx-pch=yes
1384 dnl default, this shows intent to use stdc++.h.gch If it looks like it
1385 dnl may work, after some light-hearted attempts to puzzle out compiler
1386 dnl support, flip bits on in include/Makefile.am
1388 dnl --disable-libstdcxx-pch
1389 dnl turns off attempts to use or build stdc++.h.gch.
1391 AC_DEFUN(GLIBCXX_ENABLE_PCH, [dnl
1392 define([GLIBCXX_ENABLE_PCH_DEFAULT], ifelse($1,,, $1))dnl
1393 AC_ARG_ENABLE(libstdcxx_pch,
1394 changequote(<<, >>)dnl
1395 << --enable-libstdcxx-pch build pre-compiled libstdc++ includes [default=>>GLIBCXX_ENABLE_PCH_DEFAULT],
1396 changequote([, ])dnl
1397 [case ${enableval} in
1398 yes) enable_libstdcxx_pch=yes ;;
1399 no) enable_libstdcxx_pch=no ;;
1400 *) AC_MSG_ERROR([Unknown argument to enable/disable PCH]) ;;
1402 enable_libstdcxx_pch=GLIBCXX_ENABLE_PCH_DEFAULT)dnl
1404 if test x$enable_libstdcxx_pch = xyes; then
1405 AC_CACHE_CHECK([for pch support], [libstdcxx_cv_pch_comp],[
1408 ac_save_CXXFLAGS=$CXXFLAGS
1409 CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated"
1410 echo '#include <math.h>' > conftest.h
1411 if ${CXX-g++} $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \
1412 -o conftest.h.gch 1>&5 2>&1 &&
1413 echo '#error "pch failed"' > conftest.h &&
1414 echo '#include "conftest.h"' > conftest.C &&
1415 ${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.C 1>&5 2>&1 ; then
1416 libstdcxx_cv_pch_comp=yes
1418 libstdcxx_cv_pch_comp=no
1421 CXXFLAGS=$ac_save_CXXFLAGS
1426 if test x"$enable_libstdcxx_pch" = xyes &&
1427 test x"$libstdcxx_cv_pch_comp" = xno; then
1428 enable_libstdcxx_pch=no
1431 AC_MSG_CHECKING([for enabled PCH])
1432 AC_MSG_RESULT([$enable_libstdcxx_pch])
1434 AM_CONDITIONAL(GLIBCXX_BUILD_PCH, test "$enable_libstdcxx_pch" = yes)
1435 if test "$enable_libstdcxx_pch" = yes; then
1436 glibcxx_PCHFLAGS="-include bits/stdc++.h"
1440 AC_SUBST(glibcxx_PCHFLAGS)
1444 dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
1445 dnl We must stage the required headers so that they will be installed
1446 dnl with the library (unlike libgcc, the STL implementation is provided
1447 dnl solely within headers). Since we must not inject random user-space
1448 dnl macro names into user-provided C++ code, we first stage into <file>-in
1449 dnl and process to <file> with an output command. The reason for a two-
1450 dnl stage process here is to correctly handle $srcdir!=$objdir without
1451 dnl having to write complex code (the sed commands to clean the macro
1452 dnl namespace are complex and fragile enough as it is). We must also
1453 dnl add a relative path so that -I- is supported properly.
1455 AC_DEFUN(GLIBCXX_ENABLE_THREADS, [
1456 AC_MSG_CHECKING([for thread model used by GCC])
1457 target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
1458 AC_MSG_RESULT([$target_thread_file])
1460 if test $target_thread_file != single; then
1461 AC_DEFINE(HAVE_GTHR_DEFAULT)
1462 AC_DEFINE(_GLIBCXX_SUPPORTS_WEAK, __GXX_WEAK__)
1465 glibcxx_thread_h=gthr-$target_thread_file.h
1466 AC_SUBST(glibcxx_thread_h)
1471 dnl Check for exception handling support. If an explicit enable/disable
1472 dnl sjlj exceptions is given, we don't have to detect. Otherwise the
1473 dnl target may or may not support call frame exceptions.
1475 dnl GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
1476 dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
1477 dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
1479 dnl Define _GLIBCXX_SJLJ_EXCEPTIONS if the compiler is configured for it.
1481 AC_DEFUN(GLIBCXX_ENABLE_SJLJ_EXCEPTIONS, [
1482 AC_MSG_CHECKING([for exception model to use])
1485 AC_ARG_ENABLE(sjlj-exceptions,
1486 [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
1488 [dnl Botheration. Now we've got to detect the exception model.
1489 dnl Link tests against libgcc.a are problematic since -- at least
1490 dnl as of this writing -- we've not been given proper -L bits for
1491 dnl single-tree newlib and libgloss.
1493 dnl This is what AC_TRY_COMPILE would do if it didn't delete the
1494 dnl conftest files before we got a change to grep them first.
1495 cat > conftest.$ac_ext << EOF
1496 [#]line __oline__ "configure"
1505 old_CXXFLAGS="$CXXFLAGS"
1507 if AC_TRY_EVAL(ac_compile); then
1508 if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
1509 enable_sjlj_exceptions=yes
1510 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
1511 enable_sjlj_exceptions=no
1514 CXXFLAGS="$old_CXXFLAGS"
1516 if test x$enable_sjlj_exceptions = xyes; then
1517 AC_DEFINE(_GLIBCXX_SJLJ_EXCEPTIONS, 1,
1518 [Define if the compiler is configured for setjmp/longjmp exceptions.])
1519 ac_exception_model_name=sjlj
1520 elif test x$enable_sjlj_exceptions = xno; then
1521 ac_exception_model_name="call frame"
1523 AC_MSG_ERROR([unable to detect exception model])
1526 AC_MSG_RESULT($ac_exception_model_name)
1531 dnl Check for libunwind exception handling support. If enabled then
1532 dnl we assume that the _Unwind_* functions that make up the Unwind ABI
1533 dnl (_Unwind_RaiseException, _Unwind_Resume, etc.) are defined by
1534 dnl libunwind instead of libgcc and that libstdc++ has a dependency
1535 dnl on libunwind as well as libgcc.
1537 dnl GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS
1538 dnl --enable-libunwind-exceptions forces the use of libunwind.
1539 dnl --disable-libunwind-exceptions assumes there is no libunwind.
1541 dnl Define _GLIBCXX_LIBUNWIND_EXCEPTIONS if requested.
1543 AC_DEFUN(GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS, [
1544 AC_MSG_CHECKING([for use of libunwind])
1545 AC_ARG_ENABLE(libunwind-exceptions,
1546 [ --enable-libunwind-exceptions force use of libunwind for exceptions],
1547 use_libunwind_exceptions=$enableval,
1548 use_libunwind_exceptions=no)
1549 AC_MSG_RESULT($use_libunwind_exceptions)
1550 dnl Option parsed, now set things appropriately
1551 if test x"$use_libunwind_exceptions" = xyes; then
1552 LIBUNWIND_FLAG="-lunwind"
1556 AC_SUBST(LIBUNWIND_FLAG)
1560 dnl Check for ISO/IEC 9899:1999 "C99" support.
1562 dnl GLIBCXX_ENABLE_C99
1563 dnl --enable-c99 defines _GLIBCXX_USE_C99
1564 dnl --disable-c99 leaves _GLIBCXX_USE_C99 undefined
1565 dnl + Usage: GLIBCXX_ENABLE_C99[(DEFAULT)]
1566 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1567 dnl defaults to `no'.
1568 dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
1570 dnl GLIBCXX_ENABLE_C99
1571 AC_DEFUN(GLIBCXX_ENABLE_C99, [dnl
1572 define([GLIBCXX_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
1575 changequote(<<, >>)dnl
1576 <<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCXX_ENABLE_C99_DEFAULT],
1577 changequote([, ])dnl
1578 [case "$enableval" in
1579 yes) enable_c99=yes ;;
1580 no) enable_c99=no ;;
1581 *) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
1583 enable_c99=GLIBCXX_ENABLE_C99_DEFAULT)dnl
1588 # Check for the existence of <math.h> functions used if C99 is enabled.
1590 AC_MSG_CHECKING([for ISO C99 support in <math.h>])
1591 AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
1592 AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
1593 AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
1594 AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
1595 AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
1596 AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
1597 AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
1598 AC_TRY_COMPILE([#include <math.h>],
1599 [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
1600 AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
1601 AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
1602 AC_TRY_COMPILE([#include <math.h>],
1603 [islessgreater(0.0,0.0);],, [ac_c99_math=no])
1604 AC_TRY_COMPILE([#include <math.h>],
1605 [isunordered(0.0,0.0);],, [ac_c99_math=no])
1606 AC_MSG_RESULT($ac_c99_math)
1608 # Check for the existence in <stdio.h> of vscanf, et. al.
1610 AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
1611 AC_TRY_COMPILE([#include <stdio.h>],
1612 [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
1613 AC_TRY_COMPILE([#include <stdio.h>
1615 void foo(char* fmt, ...)
1616 {va_list args; va_start(args, fmt);
1617 vfscanf(stderr, "%i", args);}],
1618 [],, [ac_c99_stdio=no])
1619 AC_TRY_COMPILE([#include <stdio.h>
1621 void foo(char* fmt, ...)
1622 {va_list args; va_start(args, fmt);
1623 vscanf("%i", args);}],
1624 [],, [ac_c99_stdio=no])
1625 AC_TRY_COMPILE([#include <stdio.h>
1627 void foo(char* fmt, ...)
1628 {va_list args; va_start(args, fmt);
1629 vsnprintf(fmt, 0, "%i", args);}],
1630 [],, [ac_c99_stdio=no])
1631 AC_TRY_COMPILE([#include <stdio.h>
1633 void foo(char* fmt, ...)
1634 {va_list args; va_start(args, fmt);
1635 vsscanf(fmt, "%i", args);}],
1636 [],, [ac_c99_stdio=no])
1637 AC_MSG_RESULT($ac_c99_stdio)
1639 # Check for the existence in <stdlib.h> of lldiv_t, et. al.
1641 AC_MSG_CHECKING([for lldiv_t declaration])
1642 AC_CACHE_VAL(ac_c99_lldiv_t, [
1643 AC_TRY_COMPILE([#include <stdlib.h>],
1645 [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
1647 AC_MSG_RESULT($ac_c99_lldiv_t)
1649 AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
1650 AC_TRY_COMPILE([#include <stdlib.h>],
1651 [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
1652 AC_TRY_COMPILE([#include <stdlib.h>],
1653 [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
1654 AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
1655 AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
1656 AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
1657 AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
1658 if test x"$ac_c99_lldiv_t" = x"no"; then
1661 AC_MSG_RESULT($ac_c99_stdlib)
1663 # Check for the existence of <wchar.h> functions used if C99 is enabled.
1664 # XXX the wchar.h checks should be rolled into the general C99 bits.
1666 AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
1667 AC_TRY_COMPILE([#include <wchar.h>],
1668 [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
1669 AC_TRY_COMPILE([#include <wchar.h>],
1670 [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
1671 AC_TRY_COMPILE([#include <wchar.h>],
1672 [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
1673 AC_MSG_RESULT($ac_c99_wchar)
1675 AC_MSG_CHECKING([for enabled ISO C99 support])
1676 if test x"$ac_c99_math" = x"no" ||
1677 test x"$ac_c99_stdio" = x"no" ||
1678 test x"$ac_c99_stdlib" = x"no" ||
1679 test x"$ac_c99_wchar" = x"no"; then
1682 AC_MSG_RESULT($enable_c99)
1684 # Option parsed, now set things appropriately
1685 if test x"$enable_c99" = x"yes"; then
1686 AC_DEFINE(_GLIBCXX_USE_C99)
1694 dnl Check for template specializations for the 'long long' type extension.
1695 dnl The result determines only whether 'long long' I/O is enabled; things
1696 dnl like numeric_limits<> specializations are always available.
1698 dnl GLIBCXX_ENABLE_LONG_LONG
1699 dnl --enable-long-long defines _GLIBCXX_USE_LONG_LONG
1700 dnl --disable-long-long leaves _GLIBCXX_USE_LONG_LONG undefined
1701 dnl + Usage: GLIBCXX_ENABLE_LONG_LONG[(DEFAULT)]
1702 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1703 dnl defaults to `no'.
1704 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1706 dnl GLIBCXX_ENABLE_LONG_LONG
1707 AC_DEFUN(GLIBCXX_ENABLE_LONG_LONG, [dnl
1708 define([GLIBCXX_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
1710 AC_ARG_ENABLE(long-long,
1711 changequote(<<, >>)dnl
1712 <<--enable-long-long turns on 'long long' [default=>>GLIBCXX_ENABLE_LONG_LONG_DEFAULT],
1713 changequote([, ])dnl
1714 [case "$enableval" in
1715 yes) enable_long_long=yes ;;
1716 no) enable_long_long=no ;;
1717 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1719 enable_long_long=GLIBCXX_ENABLE_LONG_LONG_DEFAULT)dnl
1724 AC_MSG_CHECKING([for enabled long long I/O support])
1725 # iostreams require strtoll, strtoull to compile
1726 AC_TRY_COMPILE([#include <stdlib.h>],
1727 [char* tmp; strtoll("gnu", &tmp, 10);],,[enable_long_long=no])
1728 AC_TRY_COMPILE([#include <stdlib.h>],
1729 [char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
1731 # Option parsed, now set things appropriately
1732 if test x"$enable_long_long" = xyes; then
1733 AC_DEFINE(_GLIBCXX_USE_LONG_LONG)
1735 AC_MSG_RESULT($enable_long_long)
1742 dnl Check for what type of C headers to use.
1744 dnl GLIBCXX_ENABLE_CHEADERS
1745 dnl --enable-cheaders= [does stuff].
1746 dnl --disable-cheaders [does not do anything, really].
1747 dnl + Usage: GLIBCXX_ENABLE_CHEADERS[(DEFAULT)]
1748 dnl Where DEFAULT is either `c' or `c_std'.
1749 dnl If ommitted, it defaults to `c_std'.
1750 AC_DEFUN(GLIBCXX_ENABLE_CHEADERS, [dnl
1751 define([GLIBCXX_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
1752 AC_MSG_CHECKING([for c header strategy to use])
1753 AC_ARG_ENABLE(cheaders,
1754 changequote(<<, >>)dnl
1755 << --enable-cheaders=MODEL construct "C" header files for g++ [default=>>GLIBCXX_ENABLE_CHEADERS_DEFAULT],
1757 [case "$enableval" in
1762 enable_cheaders=c_std
1764 *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
1767 enable_cheaders=GLIBCXX_ENABLE_CHEADERS_DEFAULT)
1768 AC_MSG_RESULT($enable_cheaders)
1770 dnl Option parsed, now set things appropriately
1771 case "$enable_cheaders" in
1773 C_INCLUDE_DIR='${glibcxx_srcdir}/include/c_std'
1776 C_INCLUDE_DIR='${glibcxx_srcdir}/include/c'
1780 AC_SUBST(C_INCLUDE_DIR)
1781 AM_CONDITIONAL(GLIBCXX_C_HEADERS_C, test "$enable_cheaders" = c)
1782 AM_CONDITIONAL(GLIBCXX_C_HEADERS_C_STD, test "$enable_cheaders" = c_std)
1783 AM_CONDITIONAL(GLIBCXX_C_HEADERS_COMPATIBILITY, test "$c_compatibility" = yes)
1788 dnl Check for wide character support. Has the same effect as the option
1789 dnl in gcc's configure, but in a form that autoconf can mess with.
1791 dnl GLIBCXX_ENABLE_C_MBCHAR
1792 dnl --enable-c-mbchar requests all the wchar_t stuff.
1793 dnl --disable-c-mbchar doesn't.
1794 dnl + Usage: GLIBCXX_ENABLE_C_MBCHAR[(DEFAULT)]
1795 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1796 dnl defaults to `no'.
1797 AC_DEFUN(GLIBCXX_ENABLE_C_MBCHAR, [dnl
1798 define([GLIBCXX_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
1799 AC_ARG_ENABLE(c-mbchar,
1800 changequote(<<, >>)dnl
1801 << --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCXX_ENABLE_C_MBCHAR_DEFAULT],
1802 changequote([, ])dnl
1803 [case "$enableval" in
1804 yes) enable_c_mbchar=yes ;;
1805 no) enable_c_mbchar=no ;;
1806 *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
1808 enable_c_mbchar=GLIBCXX_ENABLE_C_MBCHAR_DEFAULT)dnl
1809 dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
1814 dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
1816 dnl TOPLEVEL_INCLUDES
1817 dnl LIBMATH_INCLUDES
1818 dnl LIBSUPCXX_INCLUDES
1820 dnl GLIBCXX_EXPORT_INCLUDES
1821 AC_DEFUN(GLIBCXX_EXPORT_INCLUDES, [
1822 # Root level of the build directory include sources.
1823 GLIBCXX_INCLUDES="-I${glibcxx_builddir}/include/${target_alias} -I${glibcxx_builddir}/include"
1825 # Passed down for canadian crosses.
1826 if test x"$CANADIAN" = xyes; then
1827 TOPLEVEL_INCLUDES='-I$(includedir)'
1830 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1832 LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
1834 # Now, export this to all the little Makefiles....
1835 AC_SUBST(GLIBCXX_INCLUDES)
1836 AC_SUBST(TOPLEVEL_INCLUDES)
1837 AC_SUBST(LIBMATH_INCLUDES)
1838 AC_SUBST(LIBSUPCXX_INCLUDES)
1843 dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
1845 AC_DEFUN(GLIBCXX_EXPORT_FLAGS, [
1846 # Optimization flags that are probably a good idea for thrill-seekers. Just
1847 # uncomment the lines below and make, everything else is ready to go...
1848 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
1850 AC_SUBST(OPTIMIZE_CXXFLAGS)
1852 WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings'
1853 AC_SUBST(WARN_FLAGS)
1857 dnl GLIBCXX_EXPORT_INSTALL_INFO
1858 dnl calculates gxx_install_dir
1859 dnl exports glibcxx_toolexecdir
1860 dnl exports glibcxx_toolexeclibdir
1861 dnl exports glibcxx_prefixdir
1863 dnl Assumes cross_compiling bits already done, and with_cross_host in
1866 dnl GLIBCXX_EXPORT_INSTALL_INFO
1867 AC_DEFUN(GLIBCXX_EXPORT_INSTALL_INFO, [
1868 # Assumes glibcxx_builddir, glibcxx_srcdir are alreay set up and
1869 # exported correctly in GLIBCXX_CONFIGURE.
1870 glibcxx_toolexecdir=no
1871 glibcxx_toolexeclibdir=no
1872 glibcxx_prefixdir=${prefix}
1874 # Process the option --with-gxx-include-dir=<path to include-files directory>
1875 AC_MSG_CHECKING([for --with-gxx-include-dir])
1876 AC_ARG_WITH(gxx-include-dir,
1877 [ --with-gxx-include-dir the installation directory for include files],
1878 [case "${withval}" in
1880 AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
1887 gxx_include_dir=${withval}
1889 esac], [gxx_include_dir=no])
1890 AC_MSG_RESULT($gxx_include_dir)
1892 # Process the option "--enable-version-specific-runtime-libs"
1893 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
1894 AC_ARG_ENABLE(version-specific-runtime-libs,
1895 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
1896 [case "$enableval" in
1897 yes) version_specific_libs=yes ;;
1898 no) version_specific_libs=no ;;
1899 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
1901 version_specific_libs=no)dnl
1902 # Option set, now we can test it.
1903 AC_MSG_RESULT($version_specific_libs)
1905 # Default case for install directory for include files.
1906 if test $version_specific_libs = no && test $gxx_include_dir = no; then
1907 gxx_include_dir='$(prefix)'/include/c++/${gcc_version}
1910 # Version-specific runtime libs processing.
1911 if test $version_specific_libs = yes; then
1912 # Need the gcc compiler version to know where to install libraries
1913 # and header files if --enable-version-specific-runtime-libs option
1915 if test x"$gxx_include_dir" = x"no"; then
1916 gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/c++
1918 glibcxx_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1919 glibcxx_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
1922 # Calculate glibcxx_toolexecdir, glibcxx_toolexeclibdir
1923 # Install a library built with a cross compiler in tooldir, not libdir.
1924 if test x"$glibcxx_toolexecdir" = x"no"; then
1925 if test -n "$with_cross_host" &&
1926 test x"$with_cross_host" != x"no"; then
1927 glibcxx_toolexecdir='$(exec_prefix)/$(target_alias)'
1928 glibcxx_toolexeclibdir='$(toolexecdir)/lib'
1930 glibcxx_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1931 glibcxx_toolexeclibdir='$(libdir)'
1933 multi_os_directory=`$CC -print-multi-os-directory`
1934 case $multi_os_directory in
1935 .) ;; # Avoid trailing /.
1936 *) glibcxx_toolexeclibdir=$glibcxx_toolexeclibdir/$multi_os_directory ;;
1940 AC_MSG_CHECKING([for install location])
1941 AC_MSG_RESULT($gxx_include_dir)
1943 AC_SUBST(glibcxx_prefixdir)
1944 AC_SUBST(gxx_include_dir)
1945 AC_SUBST(glibcxx_toolexecdir)
1946 AC_SUBST(glibcxx_toolexeclibdir)
1950 # Check for functions in math library.
1951 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1953 # This file can be copied and used freely without restrictions. It can
1954 # be used in projects which are not available under the GNU Public License
1955 # but which still want to provide support for the GNU gettext functionality.
1956 # Please note that the actual code is *not* freely available.
1960 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1961 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1962 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])])
1965 dnl This macro searches for a GNU version of make. If a match is found, the
1966 dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
1967 dnl set to "#". This is useful for including a special features in a Makefile,
1968 dnl which cannot be handled by other versions of make. The variable
1969 dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
1970 dnl the empty string otherwise.
1972 dnl Here is an example of its use:
1974 dnl Makefile.in might contain:
1976 dnl # A failsafe way of putting a dependency rule into a makefile
1978 dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
1980 dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
1981 dnl @ifGNUmake@ include $(DEPEND)
1982 dnl @ifGNUmake@ endif
1984 dnl Then configure.in would normally contain:
1986 dnl CHECK_GNU_MAKE()
1987 dnl AC_OUTPUT(Makefile)
1989 dnl Then perhaps to cause gnu make to override any other make, we could do
1990 dnl something like this (note that GNU make always looks for GNUmakefile first):
1992 dnl if ! test x$_cv_gnu_make_command = x ; then
1993 dnl mv Makefile GNUmakefile
1994 dnl echo .DEFAULT: > Makefile ;
1995 dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
1998 dnl Then, if any (well almost any) other make is called, and GNU make also
1999 dnl exists, then the other make wraps the GNU make.
2001 dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
2002 dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
2004 dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
2005 dnl #### GLIBCXX_ to the macro name; adding the :-make fallback in the
2006 dnl #### conditional's subshell (" --version" is not a command), using a
2007 dnl #### different option to grep(1).
2009 dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
2010 dnl #### ${MAKE:-make}).
2013 GLIBCXX_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
2014 _cv_gnu_make_command='' ;
2015 dnl Search all the common names for GNU make
2016 for a in "${MAKE-make}" make gmake gnumake ; do
2017 if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
2019 _cv_gnu_make_command=$a ;
2024 dnl If there was a GNU version, then set @ifGNUmake@ to the empty
2025 dnl string, '#' otherwise
2026 if test "x$_cv_gnu_make_command" != "x" ; then
2035 dnl Check for headers for, and arguments to, the setrlimit() function.
2036 dnl Used only in testsuite_hooks.h.
2037 AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT_ancilliary, [
2038 AC_TRY_COMPILE([#include <unistd.h>
2039 #include <sys/time.h>
2040 #include <sys/resource.h>
2041 ], [ int f = RLIMIT_$1 ; ],
2042 [glibcxx_mresult=1], [glibcxx_mresult=0])
2043 AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcxx_mresult,
2044 [Only used in build directory testsuite_hooks.h.])
2046 AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT, [
2047 setrlimit_have_headers=yes
2048 AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
2050 setrlimit_have_headers=no)
2051 # If don't have the headers, then we can't run the tests now, and we
2052 # won't be seeing any of these during testsuite compilation.
2053 if test $setrlimit_have_headers = yes; then
2054 # Can't do these in a loop, else the resulting syntax is wrong.
2055 GLIBCXX_CHECK_SETRLIMIT_ancilliary(DATA)
2056 GLIBCXX_CHECK_SETRLIMIT_ancilliary(RSS)
2057 GLIBCXX_CHECK_SETRLIMIT_ancilliary(VMEM)
2058 GLIBCXX_CHECK_SETRLIMIT_ancilliary(AS)
2060 # Check for rlimit, setrlimit.
2061 AC_CACHE_VAL(ac_setrlimit, [
2062 AC_TRY_COMPILE([#include <unistd.h>
2063 #include <sys/time.h>
2064 #include <sys/resource.h>
2066 [ struct rlimit r; setrlimit(0, &r);],
2067 [ac_setrlimit=yes], [ac_setrlimit=no])
2071 AC_MSG_CHECKING([for testsuite memory limit support])
2072 if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
2074 AC_DEFINE(_GLIBCXX_MEM_LIMITS)
2078 AC_MSG_RESULT($ac_mem_limits)
2083 dnl Does any necessary configuration of the testsuite directory. Generates
2084 dnl the testsuite_hooks.h header.
2086 dnl GLIBCXX_CONFIGURE_TESTSUITE [no args]
2087 AC_DEFUN(GLIBCXX_CONFIGURE_TESTSUITE, [
2089 if test x"$GLIBCXX_IS_CROSS_COMPILING" = xfalse; then
2090 # Do checks for memory limit functions.
2091 GLIBCXX_CHECK_SETRLIMIT
2093 # Look for setenv, so that extended locale tests can be performed.
2094 GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
2097 # Export file names for ABI checking.
2098 baseline_dir="${glibcxx_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
2099 AC_SUBST(baseline_dir)
2101 # Determine if checking the ABI is desirable.
2102 if test x$enable_symvers = xno; then
2107 enable_abi_check=no ;;
2109 enable_abi_check=yes ;;
2113 AM_CONDITIONAL(GLIBCXX_TEST_WCHAR_T, test "$enable_wchar_t" = yes)
2114 AM_CONDITIONAL(GLIBCXX_TEST_ABI, test "$enable_abi_check" = yes)
2118 sinclude(../libtool.m4)
2119 dnl The lines below arrange for aclocal not to bring an installed
2120 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
2121 dnl add a definition of LIBTOOL to Makefile.in.
2122 ifelse(,,,[AC_SUBST(LIBTOOL)
2123 AC_DEFUN([AM_PROG_LIBTOOL])
2124 AC_DEFUN([AC_LIBTOOL_DLOPEN])
2125 AC_DEFUN([AC_PROG_LD])
2129 dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
2132 AC_DEFUN(GLIBCXX_CHECK_S_ISREG_OR_S_IFREG, [
2133 AC_CACHE_VAL(glibcxx_cv_S_ISREG, [
2134 AC_TRY_LINK([#include <sys/stat.h>],
2135 [struct stat buffer; fstat(0, &buffer); S_ISREG(buffer.st_mode); ],
2136 [glibcxx_cv_S_ISREG=yes],
2137 [glibcxx_cv_S_ISREG=no])
2139 AC_CACHE_VAL(glibcxx_cv_S_IFREG, [
2140 AC_TRY_LINK([#include <sys/stat.h>],
2141 [struct stat buffer; fstat(0, &buffer); S_IFREG & buffer.st_mode; ],
2142 [glibcxx_cv_S_IFREG=yes],
2143 [glibcxx_cv_S_IFREG=no])
2145 if test x$glibcxx_cv_S_ISREG = xyes; then
2146 AC_DEFINE(HAVE_S_ISREG)
2147 elif test x$glibcxx_cv_S_IFREG = xyes; then
2148 AC_DEFINE(HAVE_S_IFREG)
2153 dnl Check whether poll is available in <poll.h>.
2156 AC_DEFUN(GLIBCXX_CHECK_POLL, [
2157 AC_CACHE_VAL(glibcxx_cv_POLL, [
2158 AC_TRY_COMPILE([#include <poll.h>],
2159 [struct pollfd pfd[1]; pfd[0].events = POLLIN; poll(pfd, 1, 0); ],
2160 [glibcxx_cv_POLL=yes],
2161 [glibcxx_cv_POLL=no])
2163 if test x$glibcxx_cv_POLL = xyes; then
2164 AC_DEFINE(HAVE_POLL)
2169 dnl Check whether writev is available in <sys/uio.h>.
2172 AC_DEFUN(GLIBCXX_CHECK_WRITEV, [
2173 AC_CACHE_VAL(glibcxx_cv_WRITEV, [
2174 AC_TRY_COMPILE([#include <sys/uio.h>],
2175 [struct iovec iov[2]; writev(0, iov, 0); ],
2176 [glibcxx_cv_WRITEV=yes],
2177 [glibcxx_cv_WRITEV=no])
2179 if test x$glibcxx_cv_WRITEV = xyes; then
2180 AC_DEFINE(HAVE_WRITEV)
2185 # Check whether LC_MESSAGES is available in <locale.h>.
2186 # Ulrich Drepper <drepper@cygnus.com>, 1995.
2188 # This file file be copied and used freely without restrictions. It can
2189 # be used in projects which are not available under the GNU Public License
2190 # but which still want to provide support for the GNU gettext functionality.
2191 # Please note that the actual code is *not* freely available.
2195 AC_DEFUN(AC_LC_MESSAGES, [
2196 AC_CHECK_HEADER(locale.h, [
2197 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
2198 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2199 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
2200 if test $ac_cv_val_LC_MESSAGES = yes; then
2201 AC_DEFINE(HAVE_LC_MESSAGES)
2208 dnl Check for whether the Boost-derived checks should be turned on.
2210 dnl GLIBCXX_ENABLE_CONCEPT_CHECKS
2211 dnl --enable-concept-checks turns them on.
2212 dnl --disable-concept-checks leaves them off.
2213 dnl + Usage: GLIBCXX_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
2214 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
2215 dnl defaults to `no'.
2216 AC_DEFUN(GLIBCXX_ENABLE_CONCEPT_CHECKS, [dnl
2217 define([GLIBCXX_ENABLE_CONCEPT_CHECKS_DEFAULT], ifelse($1, yes, yes, no))dnl
2218 AC_ARG_ENABLE(concept-checks,
2219 changequote(<<, >>)dnl
2220 << --enable-concept-checks use Boost-derived template checks [default=>>GLIBCXX_ENABLE_CONCEPT_CHECKS_DEFAULT],
2221 changequote([, ])dnl
2222 [case "$enableval" in
2223 yes) enable_concept_checks=yes ;;
2224 no) enable_concept_checks=no ;;
2225 *) AC_MSG_ERROR([Unknown argument to enable/disable concept checks]) ;;
2227 enable_concept_checks=GLIBCXX_ENABLE_CONCEPT_CHECKS_DEFAULT)dnl
2228 dnl Option parsed, now set things appropriately
2229 if test x"$enable_concept_checks" = xyes; then
2230 AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS)
2236 dnl Add version tags to symbols in shared library (or not), additionally
2237 dnl marking other symbols as private/local (or not).
2239 dnl GLIBCXX_ENABLE_SYMVERS
2240 dnl --enable-symvers=style adds a version script to the linker call when
2241 dnl creating the shared library. The choice of version script is
2242 dnl controlled by 'style'.
2243 dnl --disable-symvers does not.
2244 dnl + Usage: GLIBCXX_ENABLE_SYMVERS[(DEFAULT)]
2245 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
2246 dnl defaults to `no'. Passing `yes' tries to choose a default style
2247 dnl based on linker characteristics. Passing 'no' disables versioning.
2248 AC_DEFUN(GLIBCXX_ENABLE_SYMVERS, [dnl
2249 define([GLIBCXX_ENABLE_SYMVERS_DEFAULT], ifelse($1, yes, yes, no))dnl
2250 AC_ARG_ENABLE(symvers,
2251 changequote(<<, >>)dnl
2252 << --enable-symvers=style enables symbol versioning of the shared library [default=>>GLIBCXX_ENABLE_SYMVERS_DEFAULT],
2253 changequote([, ])dnl
2254 [case "$enableval" in
2255 yes) enable_symvers=yes ;;
2256 no) enable_symvers=no ;;
2257 # other names here, just as sanity checks
2258 #gnu|sun|etcetera) enable_symvers=$enableval ;;
2259 gnu) enable_symvers=$enableval ;;
2260 *) AC_MSG_ERROR([Unknown argument to enable/disable symvers]) ;;
2262 enable_symvers=GLIBCXX_ENABLE_SYMVERS_DEFAULT)dnl
2264 # If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we
2265 # don't know enough about $LD to do tricks...
2266 if test x$enable_shared = xno ||
2268 test x$glibcxx_gnu_ld_version = x; then
2272 # Check to see if libgcc_s exists, indicating that shared libgcc is possible.
2273 if test $enable_symvers != no; then
2274 AC_MSG_CHECKING([for shared libgcc])
2275 ac_save_CFLAGS="$CFLAGS"
2277 AC_TRY_LINK(, [return 0], glibcxx_shared_libgcc=yes, glibcxx_shared_libgcc=no)
2278 CFLAGS="$ac_save_CFLAGS"
2279 AC_MSG_RESULT($glibcxx_shared_libgcc)
2282 # For GNU ld, we need at least this version. The format is described in
2283 # GLIBCXX_CHECK_LINKER_FEATURES above.
2284 glibcxx_min_gnu_ld_version=21400
2286 # Check to see if unspecified "yes" value can win, given results above.
2287 # Change "yes" into either "no" or a style name.
2288 if test $enable_symvers = yes ; then
2289 if test $with_gnu_ld = yes &&
2290 test $glibcxx_shared_libgcc = yes ;
2292 if test $glibcxx_gnu_ld_version -ge $glibcxx_min_gnu_ld_version ; then
2295 # The right tools, the right setup, but too old. Fallbacks?
2296 AC_MSG_WARN(=== Linker version $glibcxx_gnu_ld_version is too old for)
2297 AC_MSG_WARN(=== full symbol versioning support in this release of GCC.)
2298 AC_MSG_WARN(=== You would need to upgrade your binutils to version)
2299 AC_MSG_WARN(=== $glibcxx_min_gnu_ld_version or later and rebuild GCC.)
2300 AC_MSG_WARN([=== Symbol versioning will be disabled.])
2305 AC_MSG_WARN([=== You have requested some kind of symbol versioning, but])
2306 AC_MSG_WARN([=== either you are not using a supported linker, or you are])
2307 AC_MSG_WARN([=== not building a shared libgcc_s (which is required).])
2308 AC_MSG_WARN([=== Symbol versioning will be disabled.])
2313 dnl Everything parsed; figure out what file to use.
2314 case $enable_symvers in
2316 SYMVER_MAP=config/linker-map.dummy
2319 SYMVER_MAP=config/linker-map.gnu
2320 AC_DEFINE(_GLIBCXX_SYMVER)
2324 AC_SUBST(SYMVER_MAP)
2325 AC_SUBST(port_specific_symbol_files)
2326 AM_CONDITIONAL(GLIBCXX_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
2327 AC_MSG_CHECKING([versioning on shared library symbols])
2328 AC_MSG_RESULT($enable_symvers)