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.
229 # Find platform-specific directories containing configuration info. In
230 # addition to possibly modifying the same flags, it also sets up symlinks.
236 dnl Check to see if g++ can compile this library, and if so, if any version-
237 dnl specific precautions need to be taken.
239 dnl GLIBCPP_CHECK_COMPILER_VERSION
240 AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
241 if test ! -f stamp-sanity-compiler; then
242 AC_MSG_CHECKING([for g++ that will successfully compile libstdc++-v3])
249 ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to GCC 3.0 or above]))
251 AC_MSG_RESULT($gpp_satisfactory)
252 touch stamp-sanity-compiler
258 dnl Tests for newer compiler features, or features that are present in newer
259 dnl compiler versions but not older compiler versions still in use, should
262 dnl Define WERROR='-Werror' if requested and possible; g++'s that lack the
263 dnl new inlining code or the new system_header pragma will die on -Werror.
264 dnl Leave it out by default and use maint-mode to use it.
266 dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
267 dnl compiler supports it and the user has not requested debug mode.
269 dnl GLIBCPP_CHECK_COMPILER_FEATURES
270 AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
271 # All these tests are for C++; save the language and the compiler flags.
272 # The CXXFLAGS thing is suspicious, but based on similar bits previously
273 # found in GLIBCPP_CONFIGURE.
276 ac_test_CXXFLAGS="${CXXFLAGS+set}"
277 ac_save_CXXFLAGS="$CXXFLAGS"
279 # Check for maintainer-mode bits.
280 if test x"$USE_MAINTAINER_MODE" = xno; then
286 # Check for -ffunction-sections -fdata-sections
287 AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
288 CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
289 AC_TRY_COMPILE(, [int foo;
290 ], [ac_fdsections=yes], [ac_fdsections=no])
291 if test "$ac_test_CXXFLAGS" = set; then
292 CXXFLAGS="$ac_save_CXXFLAGS"
294 # this is the suspicious part
297 if test x"$ac_fdsections" = x"yes"; then
298 SECTION_FLAGS='-ffunction-sections -fdata-sections'
300 AC_MSG_RESULT($ac_fdsections)
304 AC_SUBST(SECTION_FLAGS)
309 dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
310 dnl the native linker is in use, all variables will be defined to something
311 dnl safe (like an empty string).
313 dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible.
314 dnl Define OPT_LDFLAGS='-Wl,-O1' if possible.
315 dnl Define LD, with_gnu_ld, and (possibly) glibcpp_gnu_ld_version as
316 dnl side-effects of testing.
318 dnl GLIBCPP_CHECK_LINKER_FEATURES
319 AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
320 # If we're not using GNU ld, then there's no point in even trying these
321 # tests. Check for that first. We should have already tested for gld
322 # by now (in libtool), but require it now just to be safe...
323 test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
324 test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
325 AC_REQUIRE([AC_PROG_LD])
327 # The name set by libtool depends on the version of libtool. Shame on us
328 # for depending on an impl detail, but c'est la vie. Older versions used
329 # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
330 # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
331 # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
332 # set (hence we're using an older libtool), then set it.
333 if test x${with_gnu_ld+set} != xset; then
334 if test x${ac_cv_prog_gnu_ld+set} != xset; then
335 # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
338 with_gnu_ld=$ac_cv_prog_gnu_ld
342 # Start by getting the version number. I think the libtool test already
343 # does some of this, but throws away the result.
345 ldver=`$LD --version 2>/dev/null | head -1 | \
346 sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
348 glibcpp_gnu_ld_version=`echo $ldver | \
349 $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
352 if test "$with_gnu_ld" = "notbroken"; then
353 # GNU ld it is! Joy and bunny rabbits!
355 # All these tests are for C++; save the language and the compiler flags.
356 # Need to do this so that g++ won't try to link in libstdc++
357 ac_test_CFLAGS="${CFLAGS+set}"
358 ac_save_CFLAGS="$CFLAGS"
359 CFLAGS='-x c++ -Wl,--gc-sections'
361 # Check for -Wl,--gc-sections
362 # XXX This test is broken at the moment, as symbols required for
363 # linking are now in libsupc++ (not built yet.....). In addition,
364 # this test has cored on solaris in the past. In addition,
365 # --gc-sections doesn't really work at the moment (keeps on discarding
366 # used sections, first .eh_frame and now some of the glibc sections for
367 # iconv). Bzzzzt. Thanks for playing, maybe next time.
368 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
376 ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
377 if test "$ac_test_CFLAGS" = set; then
378 CFLAGS="$ac_save_CFLAGS"
380 # this is the suspicious part
383 if test "$ac_sectionLDflags" = "yes"; then
384 SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
386 AC_MSG_RESULT($ac_sectionLDflags)
389 # Set linker optimization flags.
390 if test x"$with_gnu_ld" = x"yes"; then
391 OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
394 AC_SUBST(SECTION_LDFLAGS)
395 AC_SUBST(OPT_LDFLAGS)
400 dnl Check to see if the (math function) argument passed is
401 dnl declared when using the c++ compiler
402 dnl ASSUMES argument is a math function with ONE parameter
404 dnl GLIBCPP_CHECK_MATH_DECL_1
405 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_1, [
406 AC_MSG_CHECKING([for $1 declaration])
407 if test x${glibcpp_cv_func_$1_use+set} != xset; then
408 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
411 AC_TRY_COMPILE([#include <math.h>
417 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
421 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
425 dnl Check to see if the (math function) argument passed is
426 dnl 1) declared when using the c++ compiler
427 dnl 2) has "C" linkage
428 dnl 3) if not, see if 1) and 2) for argument prepended with '_'
430 dnl Define HAVE_CARGF etc if "cargf" is declared and links
432 dnl argument 1 is name of function to check
434 dnl ASSUMES argument is a math function with ONE parameter
436 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1
437 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
438 GLIBCPP_CHECK_MATH_DECL_1($1)
439 if test x$glibcpp_cv_func_$1_use = x"yes"; then
442 GLIBCPP_CHECK_MATH_DECL_1(_$1)
443 if test x$glibcpp_cv_func__$1_use = x"yes"; then
451 dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
452 dnl of functions at once. It's an all-or-nothing check -- either
453 dnl HAVE_XYZ is defined for each of the functions, or for none of them.
454 dnl Doing it this way saves significant configure time.
455 AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
456 AC_MSG_CHECKING([for $1 functions])
457 AC_CACHE_VAL(glibcpp_cv_func_$2_use, [
460 AC_TRY_COMPILE([#include <math.h>],
461 [ `for x in $3; do echo "$x (0);"; done` ],
462 [glibcpp_cv_func_$2_use=yes],
463 [glibcpp_cv_func_$2_use=no])
465 AC_MSG_RESULT($glibcpp_cv_func_$2_use)
466 if test x$glibcpp_cv_func_$2_use = x"yes"; then
472 dnl Check to see if the (math function) argument passed is
473 dnl declared when using the c++ compiler
474 dnl ASSUMES argument is a math function with TWO parameters
476 dnl GLIBCPP_CHECK_MATH_DECL_2
477 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_2, [
478 AC_MSG_CHECKING([for $1 declaration])
479 if test x${glibcpp_cv_func_$1_use+set} != xset; then
480 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
483 AC_TRY_COMPILE([#include <math.h>],
485 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
489 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
493 dnl Check to see if the (math function) argument passed is
494 dnl 1) declared when using the c++ compiler
495 dnl 2) has "C" linkage
497 dnl Define HAVE_CARGF etc if "cargf" is declared and links
499 dnl argument 1 is name of function to check
501 dnl ASSUMES argument is a math function with TWO parameters
503 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2
504 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
505 GLIBCPP_CHECK_MATH_DECL_2($1)
506 if test x$glibcpp_cv_func_$1_use = x"yes"; then
509 GLIBCPP_CHECK_MATH_DECL_2(_$1)
510 if test x$glibcpp_cv_func__$1_use = x"yes"; then
518 dnl Check to see if the (math function) argument passed is
519 dnl declared when using the c++ compiler
520 dnl ASSUMES argument is a math function with THREE parameters
522 dnl GLIBCPP_CHECK_MATH_DECL_3
523 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_3, [
524 AC_MSG_CHECKING([for $1 declaration])
525 if test x${glibcpp_cv_func_$1_use+set} != xset; then
526 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
529 AC_TRY_COMPILE([#include <math.h>],
531 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
535 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
539 dnl Check to see if the (math function) argument passed is
540 dnl 1) declared when using the c++ compiler
541 dnl 2) has "C" linkage
543 dnl Define HAVE_CARGF etc if "cargf" is declared and links
545 dnl argument 1 is name of function to check
547 dnl ASSUMES argument is a math function with THREE parameters
549 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3
550 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
551 GLIBCPP_CHECK_MATH_DECL_3($1)
552 if test x$glibcpp_cv_func_$1_use = x"yes"; then
555 GLIBCPP_CHECK_MATH_DECL_3(_$1)
556 if test x$glibcpp_cv_func__$1_use = x"yes"; then
564 dnl Check to see if the (stdlib function) argument passed is
565 dnl 1) declared when using the c++ compiler
566 dnl 2) has "C" linkage
568 dnl argument 1 is name of function to check
570 dnl ASSUMES argument is a math function with TWO parameters
572 dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2
573 AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
574 AC_MSG_CHECKING([for $1 declaration])
575 if test x${glibcpp_cv_func_$1_use+set} != xset; then
576 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
579 AC_TRY_COMPILE([#include <stdlib.h>],
581 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
585 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
586 if test x$glibcpp_cv_func_$1_use = x"yes"; then
593 dnl Check to see if the (stdlib function) argument passed is
594 dnl 1) declared when using the c++ compiler
595 dnl 2) has "C" linkage
597 dnl argument 1 is name of function to check
599 dnl ASSUMES argument is a function with THREE parameters
601 dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3
602 AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3, [
603 AC_MSG_CHECKING([for $1 declaration])
604 if test x${glibcpp_cv_func_$1_use+set} != xset; then
605 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
608 AC_TRY_COMPILE([#include <stdlib.h>],
610 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
614 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
615 if test x$glibcpp_cv_func_$1_use = x"yes"; then
621 dnl Because the builtins are picky picky picky about the arguments they take,
622 dnl do an explict linkage tests here.
623 dnl Check to see if the (math function) argument passed is
624 dnl 1) declared when using the c++ compiler
625 dnl 2) has "C" linkage
627 dnl Define HAVE_CARGF etc if "cargf" is declared and links
629 dnl argument 1 is name of function to check
631 dnl ASSUMES argument is a math function with ONE parameter
633 dnl GLIBCPP_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
634 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
635 AC_MSG_CHECKING([for $1 declaration])
636 if test x${glibcpp_cv_func_$1_use+set} != xset; then
637 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
640 AC_TRY_COMPILE([#include <math.h>],
642 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
646 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
647 if test x$glibcpp_cv_func_$1_use = x"yes"; then
648 AC_MSG_CHECKING([for $1 linkage])
649 if test x${glibcpp_cv_func_$1_link+set} != xset; then
650 AC_CACHE_VAL(glibcpp_cv_func_$1_link, [
651 AC_TRY_LINK([#include <math.h>],
653 [glibcpp_cv_func_$1_link=yes], [glibcpp_cv_func_$1_link=no])
656 AC_MSG_RESULT($glibcpp_cv_func_$1_link)
657 if test x$glibcpp_cv_func_$1_link = x"yes"; then
658 ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
659 AC_DEFINE_UNQUOTED(${ac_tr_func})
666 dnl Check to see what builtin math functions are supported
668 dnl check for __builtin_abs
669 dnl check for __builtin_fabsf
670 dnl check for __builtin_fabs
671 dnl check for __builtin_fabl
672 dnl check for __builtin_labs
673 dnl check for __builtin_sqrtf
674 dnl check for __builtin_sqrtl
675 dnl check for __builtin_sqrt
676 dnl check for __builtin_sinf
677 dnl check for __builtin_sin
678 dnl check for __builtin_sinl
679 dnl check for __builtin_cosf
680 dnl check for __builtin_cos
681 dnl check for __builtin_cosl
683 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
684 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
685 dnl Test for builtin math functions.
686 dnl These are made in gcc/c-common.c
687 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
688 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
689 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
690 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
691 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
693 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
694 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt)
695 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
697 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
698 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
699 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
701 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
702 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
703 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
705 dnl There is, without a doubt, a more elegant way to have these
706 dnl names exported so that they won't be stripped out of acconfig.h by
707 dnl autoheader. I leave this as an exercise to somebody less frustrated
708 dnl than I.... please email the libstdc++ list if you can figure out a
709 dnl more elegant approach (see autoconf/acgen.m4 and specifically
710 dnl AC_CHECK_FUNC for things to steal.)
712 if test x$dummyvar = x"yes"; then
713 AC_DEFINE(HAVE___BUILTIN_ABS)
714 AC_DEFINE(HAVE___BUILTIN_LABS)
715 AC_DEFINE(HAVE___BUILTIN_COS)
716 AC_DEFINE(HAVE___BUILTIN_COSF)
717 AC_DEFINE(HAVE___BUILTIN_COSL)
718 AC_DEFINE(HAVE___BUILTIN_FABS)
719 AC_DEFINE(HAVE___BUILTIN_FABSF)
720 AC_DEFINE(HAVE___BUILTIN_FABSL)
721 AC_DEFINE(HAVE___BUILTIN_SIN)
722 AC_DEFINE(HAVE___BUILTIN_SINF)
723 AC_DEFINE(HAVE___BUILTIN_SINL)
724 AC_DEFINE(HAVE___BUILTIN_SQRT)
725 AC_DEFINE(HAVE___BUILTIN_SQRTF)
726 AC_DEFINE(HAVE___BUILTIN_SQRTL)
731 dnl Check to see what the underlying c library is like
732 dnl These checks need to do two things:
733 dnl 1) make sure the name is declared when using the c++ compiler
734 dnl 2) make sure the name has "C" linkage
735 dnl This might seem like overkill but experience has shown that it's not...
737 dnl Define HAVE_STRTOLD if "strtold" is declared and links
738 dnl Define HAVE_STRTOF if "strtof" is declared and links
739 dnl Define HAVE_DRAND48 if "drand48" is declared and links
741 dnl GLIBCPP_CHECK_STDLIB_SUPPORT
742 AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
743 ac_test_CXXFLAGS="${CXXFLAGS+set}"
744 ac_save_CXXFLAGS="$CXXFLAGS"
745 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
747 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
748 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)
749 AC_CHECK_FUNCS(drand48)
751 CXXFLAGS="$ac_save_CXXFLAGS"
755 dnl Check to see what the underlying c library or math library is like.
756 dnl These checks need to do two things:
757 dnl 1) make sure the name is declared when using the c++ compiler
758 dnl 2) make sure the name has "C" linkage
759 dnl This might seem like overkill but experience has shown that it's not...
761 dnl Define HAVE_CARGF etc if "cargf" is found.
763 dnl GLIBCPP_CHECK_MATH_SUPPORT
764 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
765 ac_test_CXXFLAGS="${CXXFLAGS+set}"
766 ac_save_CXXFLAGS="$CXXFLAGS"
767 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
770 AC_CHECK_LIB(m, sin, libm="-lm")
774 dnl Check to see if certain C math functions exist.
775 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
776 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
777 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
778 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
779 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
780 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
781 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
782 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypot)
784 dnl Check to see if basic C math functions have float versions.
785 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
790 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
793 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expf)
794 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
795 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
796 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
797 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
798 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
799 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
800 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf)
801 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
802 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
803 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
804 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
805 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
806 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
807 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
808 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
810 dnl Check to see if basic C math functions have long double versions.
811 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
816 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
819 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
820 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
821 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
822 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
823 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
824 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
825 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
826 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
827 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl)
828 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
829 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
830 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
831 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
832 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
833 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
834 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
835 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
837 dnl Some runtimes have these functions with a preceding underscore. Please
838 dnl keep this sync'd with the one above. And if you add any new symbol,
839 dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
840 dnl Check to see if certain C math functions exist.
842 dnl Check to see if basic C math functions have float versions.
843 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
845 _acosf _asinf _atanf \
847 _coshf _sinhf _tanhf)
848 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
852 dnl Check to see if basic C math functions have long double versions.
853 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
855 _acosl _asinl _atanl \
857 _coshl _sinhl _tanhl)
858 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
863 CXXFLAGS="$ac_save_CXXFLAGS"
868 dnl Check to see if there is native support for complex
870 dnl Don't compile bits in math/* if native support exits.
872 dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
874 dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
875 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
876 dnl Check for complex versions of math functions of platform. This will
877 dnl always pass if libm is available, and fail if it isn't. If it is
878 dnl available, we assume we'll need it later, so add it to LIBS.
879 AC_CHECK_LIB(m, main)
880 AC_REPLACE_MATHFUNCS(nan copysignf)
882 dnl For __signbit to signbit conversions.
883 AC_CHECK_FUNCS([__signbit], , [LIBMATHOBJS="$LIBMATHOBJS signbit.lo"])
884 AC_CHECK_FUNCS([__signbitf], , [LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"])
886 dnl Compile the long double complex functions only if the function
887 dnl provides the non-complex long double functions that are needed.
888 dnl Currently this includes copysignl, which should be
889 dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
890 if test x$ac_cv_func_copysignl = x"yes"; then
891 AC_CHECK_FUNCS([__signbitl], , [LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"])
894 if test -n "$LIBMATHOBJS"; then
897 AC_SUBST(LIBMATHOBJS)
901 dnl Check to see what architecture and operating system we are compiling
902 dnl for. Also, if architecture- or OS-specific flags are required for
903 dnl compilation, pick them up here.
905 dnl GLIBCPP_CHECK_HOST
906 AC_DEFUN(GLIBCPP_CHECK_HOST, [
907 . [$]{glibcpp_basedir}/configure.host
908 AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
909 AC_MSG_RESULT(OS config directory is $os_include_dir)
914 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
915 dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
916 dnl must have been previously checked.)
918 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
919 dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
921 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
922 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
923 dnl Wide characters disabled by default.
925 dnl Test wchar.h for mbstate_t, which is needed for char_traits and
926 dnl others even if wchar_t support is not on.
927 AC_MSG_CHECKING([for mbstate_t])
928 AC_TRY_COMPILE([#include <wchar.h>],
929 [mbstate_t teststate;],
930 have_mbstate_t=yes, have_mbstate_t=no)
931 AC_MSG_RESULT($have_mbstate_t)
932 if test x"$have_mbstate_t" = xyes; then
933 AC_DEFINE(HAVE_MBSTATE_T)
936 dnl Sanity check for existence of ISO C99 headers for extended encoding.
937 AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
938 AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
940 dnl Only continue checking if the ISO C99 headers exist and support is on.
941 if test x"$ac_has_wchar_h" = xyes &&
942 test x"$ac_has_wctype_h" = xyes &&
943 test x"$enable_c_mbchar" != xno; then
945 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
946 dnl numeric_limits can instantiate type_traits<wchar_t>
947 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
948 AC_TRY_COMPILE([#include <wchar.h>],
949 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
950 has_wchar_minmax=yes, has_wchar_minmax=no)
951 AC_MSG_RESULT($has_wchar_minmax)
953 dnl Test wchar.h for WEOF, which is what we use to determine whether
954 dnl to specialize for char_traits<wchar_t> or not.
955 AC_MSG_CHECKING([for WEOF])
958 #include <stddef.h>],
960 has_weof=yes, has_weof=no)
961 AC_MSG_RESULT($has_weof)
963 dnl Tests for wide character functions used in char_traits<wchar_t>.
965 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
968 dnl Checks for names injected into std:: by the c_std headers.
969 AC_CHECK_FUNCS(btowc wctob fgetwc fgetws fputwc fputws fwide \
970 fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
971 vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
972 mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
973 wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
974 wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr,, \
977 AC_MSG_CHECKING([for ISO C99 wchar_t support])
978 if test x"$has_weof" = xyes &&
979 test x"$has_wchar_minmax" = xyes &&
980 test x"$ac_wfuncs" = xyes; then
981 ac_isoC99_wchar_t=yes
985 AC_MSG_RESULT($ac_isoC99_wchar_t)
987 dnl Use iconv for wchar_t to char conversions. As such, check for
988 dnl X/Open Portability Guide, version 2 features (XPG2).
989 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
990 AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
992 dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
993 AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
995 LIBS="$LIBS $libiconv"
997 AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
998 ac_XPG2funcs=yes, ac_XPG2funcs=no)
1000 LIBS="$ac_save_LIBS"
1002 AC_MSG_CHECKING([for XPG2 wchar_t support])
1003 if test x"$ac_has_iconv_h" = xyes &&
1004 test x"$ac_has_langinfo_h" = xyes &&
1005 test x"$ac_XPG2funcs" = xyes; then
1010 AC_MSG_RESULT($ac_XPG2_wchar_t)
1012 dnl At the moment, only enable wchar_t specializations if all the
1013 dnl above support is present.
1014 if test x"$ac_isoC99_wchar_t" = xyes &&
1015 test x"$ac_XPG2_wchar_t" = xyes; then
1016 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
1020 AC_MSG_CHECKING([for enabled wchar_t specializations])
1021 AC_MSG_RESULT($enable_wchar_t)
1026 dnl Check to see if debugging libraries are to be built.
1028 dnl GLIBCPP_ENABLE_DEBUG
1031 dnl builds a separate set of debugging libraries in addition to the
1032 dnl normal (shared, static) libstdc++ binaries.
1035 dnl builds only one (non-debug) version of libstdc++.
1037 dnl --enable-debug-flags=FLAGS
1038 dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
1040 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
1041 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1042 dnl defaults to `no'.
1043 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
1044 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
1045 AC_ARG_ENABLE(debug,
1046 changequote(<<, >>)dnl
1047 << --enable-debug build extra debug library [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
1048 changequote([, ])dnl
1049 [case "${enableval}" in
1050 yes) enable_debug=yes ;;
1051 no) enable_debug=no ;;
1052 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
1054 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
1055 AC_MSG_CHECKING([for additional debug build])
1056 AC_MSG_RESULT($enable_debug)
1057 AM_CONDITIONAL(GLIBCPP_BUILD_DEBUG, test "$enable_debug" = yes)
1061 dnl Check for explicit debug flags.
1063 dnl GLIBCPP_ENABLE_DEBUG_FLAGS
1065 dnl --enable-debug-flags='-O1'
1066 dnl is a general method for passing flags to be used when
1067 dnl building debug libraries with --enable-debug.
1069 dnl --disable-debug-flags does nothing.
1070 dnl + Usage: GLIBCPP_ENABLE_DEBUG_FLAGS(default flags)
1071 dnl If "default flags" is an empty string (or "none"), the effect is
1072 dnl the same as --disable or --enable=no.
1073 AC_DEFUN(GLIBCPP_ENABLE_DEBUG_FLAGS, [dnl
1074 define([GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1075 AC_ARG_ENABLE(debug_flags,
1076 changequote(<<, >>)dnl
1077 << --enable-debug-flags=FLAGS pass compiler FLAGS when building debug
1078 library;[default=>>GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT],
1079 changequote([, ])dnl
1080 [case "${enableval}" in
1082 -*) enable_debug_flags="${enableval}" ;;
1083 *) AC_MSG_ERROR([Unknown argument to extra debugging flags]) ;;
1085 enable_debug_flags=GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT)dnl
1087 dnl Option parsed, now set things appropriately
1088 case x"$enable_debug" in
1090 case "$enable_debug_flags" in
1092 DEBUG_FLAGS="-g3 -O0";;
1094 DEBUG_FLAGS="${enableval}"
1101 AC_SUBST(DEBUG_FLAGS)
1103 AC_MSG_CHECKING([for debug build flags])
1104 AC_MSG_RESULT($DEBUG_FLAGS)
1109 dnl Check for "unusual" flags to pass to the compiler while building.
1111 dnl GLIBCPP_ENABLE_CXX_FLAGS
1112 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
1113 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
1114 dnl Somehow this same set of flags must be passed when [re]building
1116 dnl --disable-cxx-flags passes nothing.
1117 dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
1118 dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
1119 dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
1120 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
1121 dnl If "default flags" is an empty string (or "none"), the effect is
1122 dnl the same as --disable or --enable=no.
1123 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
1124 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1125 AC_MSG_CHECKING([for extra compiler flags for building])
1126 AC_ARG_ENABLE(cxx_flags,
1127 changequote(<<, >>)dnl
1128 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
1129 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
1130 changequote([, ])dnl
1131 [case "x$enable_cxx_flags" in
1133 AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
1135 enable_cxx_flags='' ;;
1137 enable_cxx_flags="$enableval" ;;
1139 enable_cxx_flags=GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT)
1141 dnl Run through flags (either default or command-line) and set anything
1142 dnl extra (e.g., #defines) that must accompany particular g++ options.
1143 if test -n "$enable_cxx_flags"; then
1144 for f in $enable_cxx_flags; do
1148 *) # and we're trying to pass /what/ exactly?
1149 AC_MSG_ERROR([compiler flags start with a -]) ;;
1153 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1154 AC_MSG_RESULT($EXTRA_CXX_FLAGS)
1155 AC_SUBST(EXTRA_CXX_FLAGS)
1160 dnl Check for which locale library to use: gnu or generic.
1162 dnl GLIBCPP_ENABLE_CLOCALE
1163 dnl --enable-clocale=gnu sets config/locale/c_locale_gnu.cc and friends
1164 dnl --enable-clocale=generic sets config/locale/c_locale_generic.cc and friends
1166 dnl default is generic
1168 AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
1169 AC_MSG_CHECKING([for clocale to use])
1170 AC_ARG_ENABLE(clocale,
1171 [ --enable-clocale enable model for target locale package.
1172 --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
1174 if test x$enable_clocale = xno; then
1179 enable_clocale_flag=$enable_clocale
1181 dnl Probe for locale support if no specific model is specified.
1182 dnl Default to "generic"
1183 if test x$enable_clocale_flag = xno; then
1184 case x${target_os} in
1186 AC_EGREP_CPP([_GLIBCPP_ok], [
1187 #include <features.h>
1188 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1191 ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
1193 # Test for bugs early in glibc-2.2.x series
1194 if test x$enable_clocale_flag = xgnu; then
1196 #define _GNU_SOURCE 1
1199 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
1200 extern __typeof(newlocale) __newlocale;
1201 extern __typeof(duplocale) __duplocale;
1202 extern __typeof(strcoll_l) __strcoll_l;
1206 const char __one[] = "Äuglein Augmen";
1207 const char __two[] = "Äuglein";
1212 loc = __newlocale(1 << LC_ALL, "de_DE", 0);
1213 loc_dup = __duplocale(loc);
1214 i = __strcoll_l(__one, __two, loc);
1215 j = __strcoll_l(__one, __two, loc_dup);
1219 [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
1220 [enable_clocale_flag=generic])
1223 # ... at some point put __strxfrm_l tests in as well.
1226 enable_clocale_flag=generic
1231 dnl Deal with gettext issues.
1233 [ --enable-nls use Native Language Support (default)],
1237 dnl Set configure bits for specified locale package
1238 case x${enable_clocale_flag} in
1240 AC_MSG_RESULT(generic)
1242 CLOCALE_H=config/locale/generic/c_locale.h
1243 CLOCALE_CC=config/locale/generic/c_locale.cc
1244 CCODECVT_H=config/locale/generic/codecvt_specializations.h
1245 CCODECVT_CC=config/locale/generic/codecvt_members.cc
1246 CCOLLATE_CC=config/locale/generic/collate_members.cc
1247 CCTYPE_CC=config/locale/generic/ctype_members.cc
1248 CMESSAGES_H=config/locale/generic/messages_members.h
1249 CMESSAGES_CC=config/locale/generic/messages_members.cc
1250 CMONEY_CC=config/locale/generic/monetary_members.cc
1251 CNUMERIC_CC=config/locale/generic/numeric_members.cc
1252 CTIME_H=config/locale/generic/time_members.h
1253 CTIME_CC=config/locale/generic/time_members.cc
1254 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
1259 # Declare intention to use gettext, and add support for specific
1261 # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
1264 # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
1265 AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
1266 if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
1269 # Export the build objects.
1270 for ling in $ALL_LINGUAS; do \
1271 glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
1272 glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
1274 AC_SUBST(glibcpp_MOFILES)
1275 AC_SUBST(glibcpp_POFILES)
1277 CLOCALE_H=config/locale/gnu/c_locale.h
1278 CLOCALE_CC=config/locale/gnu/c_locale.cc
1279 CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
1280 CCODECVT_CC=config/locale/gnu/codecvt_members.cc
1281 CCOLLATE_CC=config/locale/gnu/collate_members.cc
1282 CCTYPE_CC=config/locale/gnu/ctype_members.cc
1283 CMESSAGES_H=config/locale/gnu/messages_members.h
1284 CMESSAGES_CC=config/locale/gnu/messages_members.cc
1285 CMONEY_CC=config/locale/gnu/monetary_members.cc
1286 CNUMERIC_CC=config/locale/gnu/numeric_members.cc
1287 CTIME_H=config/locale/gnu/time_members.h
1288 CTIME_CC=config/locale/gnu/time_members.cc
1289 CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
1292 AC_MSG_RESULT(IEEE 1003.1)
1294 CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
1295 CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc
1296 CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
1297 CCODECVT_CC=config/locale/generic/codecvt_members.cc
1298 CCOLLATE_CC=config/locale/generic/collate_members.cc
1299 CCTYPE_CC=config/locale/generic/ctype_members.cc
1300 CMESSAGES_H=config/locale/ieee_1003.1-2001/messages_members.h
1301 CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc
1302 CMONEY_CC=config/locale/generic/monetary_members.cc
1303 CNUMERIC_CC=config/locale/generic/numeric_members.cc
1304 CTIME_H=config/locale/generic/time_members.h
1305 CTIME_CC=config/locale/generic/time_members.cc
1306 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
1309 echo "$enable_clocale is an unknown locale package" 1>&2
1314 # This is where the testsuite looks for locale catalogs, using the
1315 # -DLOCALEDIR define during testsuite compilation.
1316 glibcpp_localedir=${glibcpp_builddir}/po/share/locale
1317 AC_SUBST(glibcpp_localedir)
1319 # A standalone libintl (e.g., GNU libintl) may be in use.
1320 if test $USE_NLS = yes; then
1321 AC_CHECK_HEADERS([libintl.h], [], USE_NLS=no)
1322 AC_SEARCH_LIBS(gettext, intl, [], USE_NLS=no)
1324 if test $USE_NLS = yes; then
1325 AC_DEFINE(_GLIBCPP_USE_NLS)
1330 AC_SUBST(CCODECVT_H)
1331 AC_SUBST(CMESSAGES_H)
1332 AC_SUBST(CCODECVT_CC)
1333 AC_SUBST(CCOLLATE_CC)
1335 AC_SUBST(CMESSAGES_CC)
1337 AC_SUBST(CNUMERIC_CC)
1340 AC_SUBST(CLOCALE_CC)
1341 AC_SUBST(CLOCALE_INTERNAL_H)
1346 dnl Check for which I/O library to use: libio, or something specific.
1348 dnl GLIBCPP_ENABLE_CSTDIO
1349 dnl --enable-cstdio=libio sets config/io/c_io_libio.h and friends
1351 dnl default is stdio
1353 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
1354 AC_MSG_CHECKING([for cstdio to use])
1355 AC_ARG_ENABLE(cstdio,
1356 [ --enable-cstdio enable stdio for target io package.
1357 --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
1359 if test x$enable_cstdio = xno; then
1362 enable_cstdio=stdio)
1364 enable_cstdio_flag=$enable_cstdio
1366 dnl Check if a valid I/O package
1367 case x${enable_cstdio_flag} in
1369 CSTDIO_H=config/io/c_io_libio.h
1370 BASIC_FILE_H=config/io/basic_file_libio.h
1371 BASIC_FILE_CC=config/io/basic_file_libio.cc
1372 AC_MSG_RESULT(libio)
1374 # see if we are on a system with libio native (ie, linux)
1375 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
1377 # Need to check and see what version of glibc is being used. If
1378 # it's not glibc-2.2 or higher, then we'll need to go ahead and
1379 # compile most of libio for linux systems.
1380 if test x$has_libio = x"yes"; then
1383 AC_MSG_CHECKING([for glibc version >= 2.2])
1384 AC_EGREP_CPP([ok], [
1385 #include <features.h>
1386 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1389 ], glibc_satisfactory=yes, glibc_satisfactory=no)
1390 AC_MSG_RESULT($glibc_satisfactory)
1394 # XXX at the moment, admit defeat and force the recompilation
1395 # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
1396 glibc_satisfactory=no
1398 if test x$glibc_satisfactory = x"yes"; then
1403 # bkoz XXX need to add checks to enable this
1404 # pme XXX here's a first pass at such a check
1405 if test x$enable_c_mbchar != xno; then
1413 # Using libio, but <libio.h> doesn't exist on the target system. . .
1415 # bkoz XXX need to add checks to enable this
1416 # pme XXX here's a first pass at such a check
1417 if test x$enable_c_mbchar != xno; then
1424 xstdio | x | xno | xnone | xyes)
1426 CSTDIO_H=config/io/c_io_stdio.h
1427 BASIC_FILE_H=config/io/basic_file_stdio.h
1428 BASIC_FILE_CC=config/io/basic_file_stdio.cc
1429 AC_MSG_RESULT(stdio)
1431 # We're not using stdio.
1436 echo "$enable_cstdio is an unknown io package" 1>&2
1441 AC_SUBST(BASIC_FILE_H)
1442 AC_SUBST(BASIC_FILE_CC)
1444 # 2000-08-04 bkoz hack
1445 CCODECVT_C=config/io/c_io_libio_codecvt.c
1446 AC_SUBST(CCODECVT_C)
1447 # 2000-08-04 bkoz hack
1449 AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
1450 test "$need_libio" = yes || test "$need_wlibio" = yes)
1451 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
1452 AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
1453 if test "$need_libio" = yes || test "$need_wlibio" = yes; then
1454 libio_la=../libio/libio.la
1463 dnl Check to see if building and using a C++ precompiled header can be done.
1465 dnl GLIBCPP_CHECK_PCH
1467 dnl If it looks like it may work, flip bits on in include/Makefile.am
1469 AC_DEFUN(GLIBCPP_CHECK_PCH, [
1470 ac_test_CXXFLAGS="${CXXFLAGS+set}"
1471 ac_save_CXXFLAGS="$CXXFLAGS"
1472 CXXFLAGS='-Werror -Winvalid-pch -Wno-deprecated -x c++-header'
1474 AC_MSG_CHECKING([for compiler that seems to compile .gch files])
1475 if test x${glibcpp_pch_comp+set} != xset; then
1476 AC_CACHE_VAL(glibcpp_pch_comp, [
1479 AC_TRY_COMPILE([#include <math.h>
1482 [glibcpp_pch_comp=yes], [glibcpp_pch_comp=no])
1486 AC_MSG_RESULT([$glibcpp_pch_comp])
1488 CXXFLAGS="$ac_save_CXXFLAGS"
1489 AM_CONDITIONAL(GLIBCPP_BUILD_PCH, test "$glibcpp_pch_comp" = yes)
1490 if test "$glibcpp_pch_comp" = yes; then
1491 glibcpp_PCHFLAGS="-include bits/stdc++.h"
1495 AC_SUBST(glibcpp_PCHFLAGS)
1499 dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
1500 dnl We must stage the required headers so that they will be installed
1501 dnl with the library (unlike libgcc, the STL implementation is provided
1502 dnl solely within headers). Since we must not inject random user-space
1503 dnl macro names into user-provided C++ code, we first stage into <file>-in
1504 dnl and process to <file> with an output command. The reason for a two-
1505 dnl stage process here is to correctly handle $srcdir!=$objdir without
1506 dnl having to write complex code (the sed commands to clean the macro
1507 dnl namespace are complex and fragile enough as it is). We must also
1508 dnl add a relative path so that -I- is supported properly.
1510 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
1511 AC_MSG_CHECKING([for thread model used by GCC])
1512 target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
1513 AC_MSG_RESULT([$target_thread_file])
1515 if test $target_thread_file != single; then
1516 AC_DEFINE(HAVE_GTHR_DEFAULT)
1517 AC_DEFINE(_GLIBCPP_SUPPORTS_WEAK, __GXX_WEAK__)
1520 glibcpp_thread_h=gthr-$target_thread_file.h
1521 AC_SUBST(glibcpp_thread_h)
1526 dnl Check for exception handling support. If an explicit enable/disable
1527 dnl sjlj exceptions is given, we don't have to detect. Otherwise the
1528 dnl target may or may not support call frame exceptions.
1530 dnl GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
1531 dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
1532 dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
1534 dnl Define _GLIBCPP_SJLJ_EXCEPTIONS if the compiler is configured for it.
1536 AC_DEFUN(GLIBCPP_ENABLE_SJLJ_EXCEPTIONS, [
1537 AC_MSG_CHECKING([for exception model to use])
1540 AC_ARG_ENABLE(sjlj-exceptions,
1541 [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
1543 [dnl Botheration. Now we've got to detect the exception model.
1544 dnl Link tests against libgcc.a are problematic since -- at least
1545 dnl as of this writing -- we've not been given proper -L bits for
1546 dnl single-tree newlib and libgloss.
1548 dnl This is what AC_TRY_COMPILE would do if it didn't delete the
1549 dnl conftest files before we got a change to grep them first.
1550 cat > conftest.$ac_ext << EOF
1551 [#]line __oline__ "configure"
1560 old_CXXFLAGS="$CXXFLAGS"
1562 if AC_TRY_EVAL(ac_compile); then
1563 if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
1564 enable_sjlj_exceptions=yes
1565 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
1566 enable_sjlj_exceptions=no
1569 CXXFLAGS="$old_CXXFLAGS"
1571 if test x$enable_sjlj_exceptions = xyes; then
1572 AC_DEFINE(_GLIBCPP_SJLJ_EXCEPTIONS, 1,
1573 [Define if the compiler is configured for setjmp/longjmp exceptions.])
1574 ac_exception_model_name=sjlj
1575 elif test x$enable_sjlj_exceptions = xno; then
1576 ac_exception_model_name="call frame"
1578 AC_MSG_ERROR([unable to detect exception model])
1581 AC_MSG_RESULT($ac_exception_model_name)
1586 dnl Check for libunwind exception handling support. If enabled then
1587 dnl we assume that the _Unwind_* functions that make up the Unwind ABI
1588 dnl (_Unwind_RaiseException, _Unwind_Resume, etc.) are defined by
1589 dnl libunwind instead of libgcc and that libstdc++ has a dependency
1590 dnl on libunwind as well as libgcc.
1592 dnl GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
1593 dnl --enable-libunwind-exceptions forces the use of libunwind.
1594 dnl --disable-libunwind-exceptions assumes there is no libunwind.
1596 dnl Define _GLIBCPP_LIBUNWIND_EXCEPTIONS if requested.
1598 AC_DEFUN(GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS, [
1599 AC_MSG_CHECKING([for use of libunwind])
1600 AC_ARG_ENABLE(libunwind-exceptions,
1601 [ --enable-libunwind-exceptions force use of libunwind for exceptions],
1602 use_libunwind_exceptions=$enableval,
1603 use_libunwind_exceptions=no)
1604 AC_MSG_RESULT($use_libunwind_exceptions)
1605 dnl Option parsed, now set things appropriately
1606 if test x"$use_libunwind_exceptions" = xyes; then
1607 LIBUNWIND_FLAG="-lunwind"
1611 AC_SUBST(LIBUNWIND_FLAG)
1615 dnl Check for ISO/IEC 9899:1999 "C99" support.
1617 dnl GLIBCPP_ENABLE_C99
1618 dnl --enable-c99 defines _GLIBCPP_USE_C99
1619 dnl --disable-c99 leaves _GLIBCPP_USE_C99 undefined
1620 dnl + Usage: GLIBCPP_ENABLE_C99[(DEFAULT)]
1621 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1622 dnl defaults to `no'.
1623 dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
1625 dnl GLIBCPP_ENABLE_C99
1626 AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
1627 define([GLIBCPP_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
1630 changequote(<<, >>)dnl
1631 <<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCPP_ENABLE_C99_DEFAULT],
1632 changequote([, ])dnl
1633 [case "$enableval" in
1634 yes) enable_c99=yes ;;
1635 no) enable_c99=no ;;
1636 *) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
1638 enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
1643 # Check for the existence of <math.h> functions used if C99 is enabled.
1645 AC_MSG_CHECKING([for ISO C99 support in <math.h>])
1646 AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
1647 AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
1648 AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
1649 AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
1650 AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
1651 AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
1652 AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
1653 AC_TRY_COMPILE([#include <math.h>],
1654 [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
1655 AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
1656 AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
1657 AC_TRY_COMPILE([#include <math.h>],
1658 [islessgreater(0.0,0.0);],, [ac_c99_math=no])
1659 AC_TRY_COMPILE([#include <math.h>],
1660 [isunordered(0.0,0.0);],, [ac_c99_math=no])
1661 AC_MSG_RESULT($ac_c99_math)
1663 # Check for the existence in <stdio.h> of vscanf, et. al.
1665 AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
1666 AC_TRY_COMPILE([#include <stdio.h>],
1667 [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
1668 AC_TRY_COMPILE([#include <stdio.h>
1670 void foo(char* fmt, ...)
1671 {va_list args; va_start(args, fmt);
1672 vfscanf(stderr, "%i", args);}],
1673 [],, [ac_c99_stdio=no])
1674 AC_TRY_COMPILE([#include <stdio.h>
1676 void foo(char* fmt, ...)
1677 {va_list args; va_start(args, fmt);
1678 vscanf("%i", args);}],
1679 [],, [ac_c99_stdio=no])
1680 AC_TRY_COMPILE([#include <stdio.h>
1682 void foo(char* fmt, ...)
1683 {va_list args; va_start(args, fmt);
1684 vsnprintf(fmt, 0, "%i", args);}],
1685 [],, [ac_c99_stdio=no])
1686 AC_TRY_COMPILE([#include <stdio.h>
1688 void foo(char* fmt, ...)
1689 {va_list args; va_start(args, fmt);
1690 vsscanf(fmt, "%i", args);}],
1691 [],, [ac_c99_stdio=no])
1692 AC_MSG_RESULT($ac_c99_stdio)
1694 # Check for the existence in <stdlib.h> of lldiv_t, et. al.
1696 AC_MSG_CHECKING([for lldiv_t declaration])
1697 AC_CACHE_VAL(ac_c99_lldiv_t, [
1698 AC_TRY_COMPILE([#include <stdlib.h>],
1700 [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
1702 AC_MSG_RESULT($ac_c99_lldiv_t)
1704 AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
1705 AC_TRY_COMPILE([#include <stdlib.h>],
1706 [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
1707 AC_TRY_COMPILE([#include <stdlib.h>],
1708 [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
1709 AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
1710 AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
1711 AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
1712 AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
1713 if test x"$ac_c99_lldiv_t" = x"no"; then
1716 AC_MSG_RESULT($ac_c99_stdlib)
1718 # Check for the existence of <wchar.h> functions used if C99 is enabled.
1719 # XXX the wchar.h checks should be rolled into the general C99 bits.
1721 AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
1722 AC_TRY_COMPILE([#include <wchar.h>],
1723 [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
1724 AC_TRY_COMPILE([#include <wchar.h>],
1725 [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
1726 AC_TRY_COMPILE([#include <wchar.h>],
1727 [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
1728 AC_MSG_RESULT($ac_c99_wchar)
1730 AC_MSG_CHECKING([for enabled ISO C99 support])
1731 if test x"$ac_c99_math" = x"no" ||
1732 test x"$ac_c99_stdio" = x"no" ||
1733 test x"$ac_c99_stdlib" = x"no" ||
1734 test x"$ac_c99_wchar" = x"no"; then
1737 AC_MSG_RESULT($enable_c99)
1739 # Option parsed, now set things appropriately
1740 if test x"$enable_c99" = x"yes"; then
1741 AC_DEFINE(_GLIBCPP_USE_C99)
1749 dnl Check for template specializations for the 'long long' type extension.
1750 dnl The result determines only whether 'long long' I/O is enabled; things
1751 dnl like numeric_limits<> specializations are always available.
1753 dnl GLIBCPP_ENABLE_LONG_LONG
1754 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
1755 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
1756 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
1757 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1758 dnl defaults to `no'.
1759 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1761 dnl GLIBCPP_ENABLE_LONG_LONG
1762 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
1763 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
1765 AC_ARG_ENABLE(long-long,
1766 changequote(<<, >>)dnl
1767 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
1768 changequote([, ])dnl
1769 [case "$enableval" in
1770 yes) enable_long_long=yes ;;
1771 no) enable_long_long=no ;;
1772 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1774 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1779 AC_MSG_CHECKING([for enabled long long I/O support])
1780 # iostreams require strtoll, strtoull to compile
1781 AC_TRY_COMPILE([#include <stdlib.h>],
1782 [char* tmp; strtoll("gnu", &tmp, 10);],,[enable_long_long=no])
1783 AC_TRY_COMPILE([#include <stdlib.h>],
1784 [char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
1786 # Option parsed, now set things appropriately
1787 if test x"$enable_long_long" = xyes; then
1788 AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1790 AC_MSG_RESULT($enable_long_long)
1797 dnl Check for what type of C headers to use.
1799 dnl GLIBCPP_ENABLE_CHEADERS
1800 dnl --enable-cheaders= [does stuff].
1801 dnl --disable-cheaders [does not do anything, really].
1802 dnl + Usage: GLIBCPP_ENABLE_CHEADERS[(DEFAULT)]
1803 dnl Where DEFAULT is either `c' or `c_std'.
1804 dnl If ommitted, it defaults to `c_std'.
1805 AC_DEFUN(GLIBCPP_ENABLE_CHEADERS, [dnl
1806 define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
1807 AC_MSG_CHECKING([for c header strategy to use])
1808 AC_ARG_ENABLE(cheaders,
1809 changequote(<<, >>)dnl
1810 << --enable-cheaders=MODEL construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
1812 [case "$enableval" in
1817 enable_cheaders=c_std
1819 *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
1822 enable_cheaders=GLIBCPP_ENABLE_CHEADERS_DEFAULT)
1823 AC_MSG_RESULT($enable_cheaders)
1825 dnl Option parsed, now set things appropriately
1826 case "$enable_cheaders" in
1828 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
1831 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
1835 AC_SUBST(C_INCLUDE_DIR)
1836 AM_CONDITIONAL(GLIBCPP_C_HEADERS_C, test "$enable_cheaders" = c)
1837 AM_CONDITIONAL(GLIBCPP_C_HEADERS_C_STD, test "$enable_cheaders" = c_std)
1838 AM_CONDITIONAL(GLIBCPP_C_HEADERS_COMPATIBILITY, test "$c_compatibility" = yes)
1843 dnl Check for wide character support. Has the same effect as the option
1844 dnl in gcc's configure, but in a form that autoconf can mess with.
1846 dnl GLIBCPP_ENABLE_C_MBCHAR
1847 dnl --enable-c-mbchar requests all the wchar_t stuff.
1848 dnl --disable-c-mbchar doesn't.
1849 dnl + Usage: GLIBCPP_ENABLE_C_MBCHAR[(DEFAULT)]
1850 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1851 dnl defaults to `no'.
1852 AC_DEFUN(GLIBCPP_ENABLE_C_MBCHAR, [dnl
1853 define([GLIBCPP_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
1854 AC_ARG_ENABLE(c-mbchar,
1855 changequote(<<, >>)dnl
1856 << --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCPP_ENABLE_C_MBCHAR_DEFAULT],
1857 changequote([, ])dnl
1858 [case "$enableval" in
1859 yes) enable_c_mbchar=yes ;;
1860 no) enable_c_mbchar=no ;;
1861 *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
1863 enable_c_mbchar=GLIBCPP_ENABLE_C_MBCHAR_DEFAULT)dnl
1864 dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
1869 dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
1871 dnl TOPLEVEL_INCLUDES
1872 dnl LIBMATH_INCLUDES
1873 dnl LIBSUPCXX_INCLUDES
1876 dnl GLIBCPP_EXPORT_INCLUDES
1877 AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
1878 # Root level of the build directory include sources.
1879 GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
1881 # Passed down for canadian crosses.
1882 if test x"$CANADIAN" = xyes; then
1883 TOPLEVEL_INCLUDES='-I$(includedir)'
1886 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1888 LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
1890 if test x"$need_libio" = xyes; then
1891 LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
1892 AC_SUBST(LIBIO_INCLUDES)
1895 # Now, export this to all the little Makefiles....
1896 AC_SUBST(GLIBCPP_INCLUDES)
1897 AC_SUBST(TOPLEVEL_INCLUDES)
1898 AC_SUBST(LIBMATH_INCLUDES)
1899 AC_SUBST(LIBSUPCXX_INCLUDES)
1904 dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
1906 AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
1907 # Optimization flags that are probably a good idea for thrill-seekers. Just
1908 # uncomment the lines below and make, everything else is ready to go...
1909 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
1911 AC_SUBST(OPTIMIZE_CXXFLAGS)
1913 WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings'
1914 AC_SUBST(WARN_FLAGS)
1918 dnl GLIBCPP_EXPORT_INSTALL_INFO
1919 dnl calculates gxx_install_dir
1920 dnl exports glibcpp_toolexecdir
1921 dnl exports glibcpp_toolexeclibdir
1922 dnl exports glibcpp_prefixdir
1924 dnl Assumes cross_compiling bits already done, and with_cross_host in
1927 dnl GLIBCPP_EXPORT_INSTALL_INFO
1928 AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
1929 # Assumes glibcpp_builddir, glibcpp_srcdir are alreay set up and
1930 # exported correctly in GLIBCPP_CONFIGURE.
1931 glibcpp_toolexecdir=no
1932 glibcpp_toolexeclibdir=no
1933 glibcpp_prefixdir=${prefix}
1935 # Process the option --with-gxx-include-dir=<path to include-files directory>
1936 AC_MSG_CHECKING([for --with-gxx-include-dir])
1937 AC_ARG_WITH(gxx-include-dir,
1938 [ --with-gxx-include-dir the installation directory for include files],
1939 [case "${withval}" in
1941 AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
1948 gxx_include_dir=${withval}
1950 esac], [gxx_include_dir=no])
1951 AC_MSG_RESULT($gxx_include_dir)
1953 # Process the option "--enable-version-specific-runtime-libs"
1954 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
1955 AC_ARG_ENABLE(version-specific-runtime-libs,
1956 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
1957 [case "$enableval" in
1958 yes) version_specific_libs=yes ;;
1959 no) version_specific_libs=no ;;
1960 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
1962 version_specific_libs=no)dnl
1963 # Option set, now we can test it.
1964 AC_MSG_RESULT($version_specific_libs)
1966 # Default case for install directory for include files.
1967 if test $version_specific_libs = no && test $gxx_include_dir = no; then
1968 gxx_include_dir='$(prefix)'/include/c++/${gcc_version}
1971 # Version-specific runtime libs processing.
1972 if test $version_specific_libs = yes; then
1973 # Need the gcc compiler version to know where to install libraries
1974 # and header files if --enable-version-specific-runtime-libs option
1976 if test x"$gxx_include_dir" = x"no"; then
1977 gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/c++
1979 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1980 glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
1983 # Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
1984 # Install a library built with a cross compiler in tooldir, not libdir.
1985 if test x"$glibcpp_toolexecdir" = x"no"; then
1986 if test -n "$with_cross_host" &&
1987 test x"$with_cross_host" != x"no"; then
1988 glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
1989 glibcpp_toolexeclibdir='$(toolexecdir)/lib'
1991 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1992 glibcpp_toolexeclibdir='$(libdir)'
1994 multi_os_directory=`$CC -print-multi-os-directory`
1995 case $multi_os_directory in
1996 .) ;; # Avoid trailing /.
1997 *) glibcpp_toolexeclibdir=$glibcpp_toolexeclibdir/$multi_os_directory ;;
2001 AC_MSG_CHECKING([for install location])
2002 AC_MSG_RESULT($gxx_include_dir)
2004 AC_SUBST(glibcpp_prefixdir)
2005 AC_SUBST(gxx_include_dir)
2006 AC_SUBST(glibcpp_toolexecdir)
2007 AC_SUBST(glibcpp_toolexeclibdir)
2011 # Check for functions in math library.
2012 # Ulrich Drepper <drepper@cygnus.com>, 1998.
2014 # This file can be copied and used freely without restrictions. It can
2015 # be used in projects which are not available under the GNU Public License
2016 # but which still want to provide support for the GNU gettext functionality.
2017 # Please note that the actual code is *not* freely available.
2021 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
2022 AC_DEFUN(AC_REPLACE_MATHFUNCS,
2023 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])])
2026 dnl This macro searches for a GNU version of make. If a match is found, the
2027 dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
2028 dnl set to "#". This is useful for including a special features in a Makefile,
2029 dnl which cannot be handled by other versions of make. The variable
2030 dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
2031 dnl the empty string otherwise.
2033 dnl Here is an example of its use:
2035 dnl Makefile.in might contain:
2037 dnl # A failsafe way of putting a dependency rule into a makefile
2039 dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
2041 dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
2042 dnl @ifGNUmake@ include $(DEPEND)
2043 dnl @ifGNUmake@ endif
2045 dnl Then configure.in would normally contain:
2047 dnl CHECK_GNU_MAKE()
2048 dnl AC_OUTPUT(Makefile)
2050 dnl Then perhaps to cause gnu make to override any other make, we could do
2051 dnl something like this (note that GNU make always looks for GNUmakefile first):
2053 dnl if ! test x$_cv_gnu_make_command = x ; then
2054 dnl mv Makefile GNUmakefile
2055 dnl echo .DEFAULT: > Makefile ;
2056 dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
2059 dnl Then, if any (well almost any) other make is called, and GNU make also
2060 dnl exists, then the other make wraps the GNU make.
2062 dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
2063 dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
2065 dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
2066 dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
2067 dnl #### conditional's subshell (" --version" is not a command), using a
2068 dnl #### different option to grep(1).
2070 dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
2071 dnl #### ${MAKE:-make}).
2074 GLIBCPP_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
2075 _cv_gnu_make_command='' ;
2076 dnl Search all the common names for GNU make
2077 for a in "${MAKE-make}" make gmake gnumake ; do
2078 if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
2080 _cv_gnu_make_command=$a ;
2085 dnl If there was a GNU version, then set @ifGNUmake@ to the empty
2086 dnl string, '#' otherwise
2087 if test "x$_cv_gnu_make_command" != "x" ; then
2096 dnl Check for headers for, and arguments to, the setrlimit() function.
2097 dnl Used only in testsuite_hooks.h.
2098 AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT_ancilliary, [
2099 AC_TRY_COMPILE([#include <unistd.h>
2100 #include <sys/time.h>
2101 #include <sys/resource.h>
2102 ], [ int f = RLIMIT_$1 ; ],
2103 [glibcpp_mresult=1], [glibcpp_mresult=0])
2104 AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcpp_mresult,
2105 [Only used in build directory testsuite_hooks.h.])
2107 AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
2108 setrlimit_have_headers=yes
2109 AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
2111 setrlimit_have_headers=no)
2112 # If don't have the headers, then we can't run the tests now, and we
2113 # won't be seeing any of these during testsuite compilation.
2114 if test $setrlimit_have_headers = yes; then
2115 # Can't do these in a loop, else the resulting syntax is wrong.
2116 GLIBCPP_CHECK_SETRLIMIT_ancilliary(DATA)
2117 GLIBCPP_CHECK_SETRLIMIT_ancilliary(RSS)
2118 GLIBCPP_CHECK_SETRLIMIT_ancilliary(VMEM)
2119 GLIBCPP_CHECK_SETRLIMIT_ancilliary(AS)
2121 # Check for rlimit, setrlimit.
2122 AC_CACHE_VAL(ac_setrlimit, [
2123 AC_TRY_COMPILE([#include <unistd.h>
2124 #include <sys/time.h>
2125 #include <sys/resource.h>
2127 [ struct rlimit r; setrlimit(0, &r);],
2128 [ac_setrlimit=yes], [ac_setrlimit=no])
2132 AC_MSG_CHECKING([for testsuite memory limit support])
2133 if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
2135 AC_DEFINE(_GLIBCPP_MEM_LIMITS)
2139 AC_MSG_RESULT($ac_mem_limits)
2144 dnl Does any necessary configuration of the testsuite directory. Generates
2145 dnl the testsuite_hooks.h header.
2147 dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
2148 AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
2149 GLIBCPP_CHECK_SETRLIMIT
2151 # Look for setenv, so that extended locale tests can be performed.
2152 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
2154 # Export file names for ABI checking.
2155 baseline_file="${glibcpp_srcdir}/config/abi/${abi_baseline_triplet}/baseline_symbols.txt"
2156 AC_SUBST(baseline_file)
2158 dnl XXX move to configure.host?
2160 *-*-cygwin* ) enable_abi_check=no ;;
2161 * ) enable_abi_check=yes ;;
2166 sinclude(../libtool.m4)
2167 dnl The lines below arrange for aclocal not to bring an installed
2168 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
2169 dnl add a definition of LIBTOOL to Makefile.in.
2170 ifelse(,,,[AC_SUBST(LIBTOOL)
2171 AC_DEFUN([AM_PROG_LIBTOOL])
2172 AC_DEFUN([AC_LIBTOOL_DLOPEN])
2173 AC_DEFUN([AC_PROG_LD])
2177 dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
2180 AC_DEFUN(GLIBCPP_CHECK_S_ISREG_OR_S_IFREG, [
2181 AC_CACHE_VAL(glibcpp_cv_S_ISREG, [
2182 AC_TRY_LINK([#include <sys/stat.h>],
2183 [struct stat buffer; fstat(0, &buffer); S_ISREG(buffer.st_mode); ],
2184 [glibcpp_cv_S_ISREG=yes],
2185 [glibcpp_cv_S_ISREG=no])
2187 AC_CACHE_VAL(glibcpp_cv_S_IFREG, [
2188 AC_TRY_LINK([#include <sys/stat.h>],
2189 [struct stat buffer; fstat(0, &buffer); S_IFREG & buffer.st_mode; ],
2190 [glibcpp_cv_S_IFREG=yes],
2191 [glibcpp_cv_S_IFREG=no])
2193 if test x$glibcpp_cv_S_ISREG = xyes; then
2194 AC_DEFINE(HAVE_S_ISREG)
2195 elif test x$glibcpp_cv_S_IFREG = xyes; then
2196 AC_DEFINE(HAVE_S_IFREG)
2201 dnl Check whether poll is available in <poll.h>.
2204 AC_DEFUN(GLIBCPP_CHECK_POLL, [
2205 AC_CACHE_VAL(glibcpp_cv_POLL, [
2206 AC_TRY_COMPILE([#include <poll.h>],
2207 [struct pollfd pfd[1]; pfd[0].events = POLLIN; poll(pfd, 1, 0); ],
2208 [glibcpp_cv_POLL=yes],
2209 [glibcpp_cv_POLL=no])
2211 if test x$glibcpp_cv_POLL = xyes; then
2212 AC_DEFINE(HAVE_POLL)
2216 # Check whether LC_MESSAGES is available in <locale.h>.
2217 # Ulrich Drepper <drepper@cygnus.com>, 1995.
2219 # This file file be copied and used freely without restrictions. It can
2220 # be used in projects which are not available under the GNU Public License
2221 # but which still want to provide support for the GNU gettext functionality.
2222 # Please note that the actual code is *not* freely available.
2226 AC_DEFUN(AC_LC_MESSAGES, [
2227 AC_CHECK_HEADER(locale.h, [
2228 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
2229 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2230 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
2231 if test $ac_cv_val_LC_MESSAGES = yes; then
2232 AC_DEFINE(HAVE_LC_MESSAGES)
2239 dnl Check for whether the Boost-derived checks should be turned on.
2241 dnl GLIBCPP_ENABLE_CONCEPT_CHECKS
2242 dnl --enable-concept-checks turns them on.
2243 dnl --disable-concept-checks leaves them off.
2244 dnl + Usage: GLIBCPP_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
2245 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
2246 dnl defaults to `no'.
2247 AC_DEFUN(GLIBCPP_ENABLE_CONCEPT_CHECKS, [dnl
2248 define([GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT], ifelse($1, yes, yes, no))dnl
2249 AC_ARG_ENABLE(concept-checks,
2250 changequote(<<, >>)dnl
2251 << --enable-concept-checks use Boost-derived template checks [default=>>GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT],
2252 changequote([, ])dnl
2253 [case "$enableval" in
2254 yes) enable_concept_checks=yes ;;
2255 no) enable_concept_checks=no ;;
2256 *) AC_MSG_ERROR([Unknown argument to enable/disable concept checks]) ;;
2258 enable_concept_checks=GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT)dnl
2259 dnl Option parsed, now set things appropriately
2260 if test x"$enable_concept_checks" = xyes; then
2261 AC_DEFINE(_GLIBCPP_CONCEPT_CHECKS)
2267 dnl Add version tags to symbols in shared library (or not), additionally
2268 dnl marking other symbols as private/local (or not).
2270 dnl GLIBCPP_ENABLE_SYMVERS
2271 dnl --enable-symvers=style adds a version script to the linker call when
2272 dnl creating the shared library. The choice of version script is
2273 dnl controlled by 'style'.
2274 dnl --disable-symvers does not.
2275 dnl + Usage: GLIBCPP_ENABLE_SYMVERS[(DEFAULT)]
2276 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
2277 dnl defaults to `no'. Passing `yes' tries to choose a default style
2278 dnl based on linker characteristics. Passing 'no' disables versioning.
2279 AC_DEFUN(GLIBCPP_ENABLE_SYMVERS, [dnl
2280 define([GLIBCPP_ENABLE_SYMVERS_DEFAULT], ifelse($1, yes, yes, no))dnl
2281 AC_ARG_ENABLE(symvers,
2282 changequote(<<, >>)dnl
2283 << --enable-symvers=style enables symbol versioning of the shared library [default=>>GLIBCPP_ENABLE_SYMVERS_DEFAULT],
2284 changequote([, ])dnl
2285 [case "$enableval" in
2286 yes) enable_symvers=yes ;;
2287 no) enable_symvers=no ;;
2288 # other names here, just as sanity checks
2289 #gnu|sun|etcetera) enable_symvers=$enableval ;;
2290 gnu) enable_symvers=$enableval ;;
2291 *) AC_MSG_ERROR([Unknown argument to enable/disable symvers]) ;;
2293 enable_symvers=GLIBCPP_ENABLE_SYMVERS_DEFAULT)dnl
2295 # If we never went through the GLIBCPP_CHECK_LINKER_FEATURES macro, then we
2296 # don't know enough about $LD to do tricks...
2297 if test x$enable_shared = xno ||
2299 test x$glibcpp_gnu_ld_version = x; then
2303 # Check to see if libgcc_s exists, indicating that shared libgcc is possible.
2304 if test $enable_symvers != no; then
2305 AC_MSG_CHECKING([for shared libgcc])
2306 ac_save_CFLAGS="$CFLAGS"
2308 AC_TRY_LINK(, [return 0], glibcpp_shared_libgcc=yes, glibcpp_shared_libgcc=no)
2309 CFLAGS="$ac_save_CFLAGS"
2310 AC_MSG_RESULT($glibcpp_shared_libgcc)
2313 # For GNU ld, we need at least this version. It's 2.12 in the same format
2314 # as the tested-for version. See GLIBCPP_CHECK_LINKER_FEATURES for more.
2315 glibcpp_min_gnu_ld_version=21200
2317 # Check to see if unspecified "yes" value can win, given results
2319 if test $enable_symvers = yes ; then
2320 if test $with_gnu_ld = yes &&
2321 test $glibcpp_shared_libgcc = yes ;
2323 if test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version ; then
2326 ac_test_CFLAGS="${CFLAGS+set}"
2327 ac_save_CFLAGS="$CFLAGS"
2328 CFLAGS='-shared -Wl,--version-script,conftest.map'
2331 echo 'FOO { global: f[a-z]o; local: *; };' > conftest.map
2333 AC_TRY_LINK([int foo;],, enable_symvers=gnu)
2334 if test "$ac_test_CFLAGS" = set; then
2335 CFLAGS="$ac_save_CFLAGS"
2337 # this is the suspicious part
2348 dnl Everything parsed; figure out what file to use.
2349 case $enable_symvers in
2351 SYMVER_MAP=config/linker-map.dummy
2354 SYMVER_MAP=config/linker-map.gnu
2355 AC_DEFINE(_GLIBCPP_SYMVER)
2359 AC_SUBST(SYMVER_MAP)
2360 AM_CONDITIONAL(GLIBCPP_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
2361 AC_MSG_CHECKING([versioning on shared library symbols])
2362 AC_MSG_RESULT($enable_symvers)
2366 # isc-posix.m4 serial 2 (gettext-0.11.2)
2367 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2368 dnl This file is free software, distributed under the terms of the GNU
2369 dnl General Public License. As a special exception to the GNU General
2370 dnl Public License, this file may be distributed as part of a program
2371 dnl that contains a configuration script generated by Autoconf, under
2372 dnl the same distribution terms as the rest of that program.
2374 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
2376 # This test replaces the one in autoconf.
2377 # Currently this macro should have the same name as the autoconf macro
2378 # because gettext's gettext.m4 (distributed in the automake package)
2379 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
2380 # give these diagnostics:
2381 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
2382 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
2384 undefine([AC_ISC_POSIX])
2386 AC_DEFUN([AC_ISC_POSIX],
2388 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
2389 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
2393 # Add --enable-maintainer-mode option to configure.
2398 AC_DEFUN([AM_MAINTAINER_MODE],
2399 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
2400 dnl maintainer-mode is disabled by default
2401 AC_ARG_ENABLE(maintainer-mode,
2402 [ --enable-maintainer-mode enable make rules and dependencies not useful
2403 (and sometimes confusing) to the casual installer],
2404 USE_MAINTAINER_MODE=$enableval,
2405 USE_MAINTAINER_MODE=no)
2406 AC_MSG_RESULT($USE_MAINTAINER_MODE)
2407 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
2408 MAINT=$MAINTAINER_MODE_TRUE
2413 # Define a conditional.
2415 AC_DEFUN([AM_CONDITIONAL],
2426 # Do all the work for Automake. This macro actually does too much --
2427 # some checks are only needed if your package does certain things.
2428 # But this isn't really a big deal.
2433 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
2435 AC_DEFUN([AM_INIT_AUTOMAKE],
2436 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
2437 AC_REQUIRE([AC_PROG_INSTALL])
2442 dnl test to see if srcdir already configured
2443 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
2444 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2447 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
2448 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
2449 AC_REQUIRE([AM_SANITY_CHECK])
2450 AC_REQUIRE([AC_ARG_PROGRAM])
2451 dnl FIXME This is truly gross.
2452 missing_dir=`cd $ac_aux_dir && pwd`
2453 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
2454 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
2455 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
2456 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
2457 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
2458 AC_REQUIRE([AC_PROG_MAKE_SET])])
2460 # Copyright 2002 Free Software Foundation, Inc.
2462 # This program is free software; you can redistribute it and/or modify
2463 # it under the terms of the GNU General Public License as published by
2464 # the Free Software Foundation; either version 2, or (at your option)
2465 # any later version.
2467 # This program is distributed in the hope that it will be useful,
2468 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2469 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2470 # GNU General Public License for more details.
2472 # You should have received a copy of the GNU General Public License
2473 # along with this program; if not, write to the Free Software
2474 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2476 # AM_AUTOMAKE_VERSION(VERSION)
2477 # ----------------------------
2478 # Automake X.Y traces this macro to ensure aclocal.m4 has been
2479 # generated from the m4 files accompanying Automake X.Y.
2480 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
2482 # AM_SET_CURRENT_AUTOMAKE_VERSION
2483 # -------------------------------
2484 # Call AM_AUTOMAKE_VERSION so it can be traced.
2485 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
2486 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
2487 [AM_AUTOMAKE_VERSION([1.4-p6])])
2490 # Check to make sure that the build environment is sane.
2493 AC_DEFUN([AM_SANITY_CHECK],
2494 [AC_MSG_CHECKING([whether build environment is sane])
2497 echo timestamp > conftestfile
2498 # Do `set' in a subshell so we don't clobber the current shell's
2499 # arguments. Must try -L first in case configure is actually a
2500 # symlink; some systems play weird games with the mod time of symlinks
2501 # (eg FreeBSD returns the mod time of the symlink's containing
2504 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
2505 if test "[$]*" = "X"; then
2507 set X `ls -t $srcdir/configure conftestfile`
2509 if test "[$]*" != "X $srcdir/configure conftestfile" \
2510 && test "[$]*" != "X conftestfile $srcdir/configure"; then
2512 # If neither matched, then we have a broken ls. This can happen
2513 # if, for instance, CONFIG_SHELL is bash and it inherits a
2514 # broken ls alias from the environment. This has actually
2515 # happened. Such a system could not be considered "sane".
2516 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
2517 alias in your environment])
2520 test "[$]2" = conftestfile
2526 AC_MSG_ERROR([newly created file is older than distributed files!
2527 Check your system clock])
2530 AC_MSG_RESULT(yes)])
2532 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
2533 dnl The program must properly implement --version.
2534 AC_DEFUN([AM_MISSING_PROG],
2535 [AC_MSG_CHECKING(for working $2)
2536 # Run test in a subshell; some versions of sh will print an error if
2537 # an executable is not found, even if stderr is redirected.
2538 # Redirect stdin to placate older versions of autoconf. Sigh.
2539 if ($2 --version) < /dev/null > /dev/null 2>&1; then
2541 AC_MSG_RESULT(found)
2544 AC_MSG_RESULT(missing)
2548 # Like AC_CONFIG_HEADER, but automatically create stamp file.
2550 AC_DEFUN([AM_CONFIG_HEADER],
2552 AC_CONFIG_HEADER([$1])
2553 dnl When config.status generates a header, we must update the stamp-h file.
2554 dnl This file resides in the same directory as the config header
2555 dnl that is generated. We must strip everything past the first ":",
2556 dnl and everything past the last "/".
2557 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
2558 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
2559 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
2561 for am_file in <<$1>>; do
2562 case " <<$>>CONFIG_HEADERS " in
2563 *" <<$>>am_file "*<<)>>
2564 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
2567 am_indx=`expr "<<$>>am_indx" + 1`