1 dnl aclocal.m4 generated automatically by aclocal 1.4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
14 dnl Initialize configure bits.
17 AC_DEFUN(GLIBCPP_CONFIGURE, [
18 dnl Default to --enable-multilib
19 AC_ARG_ENABLE(multilib,
20 [ --enable-multilib build hella library versions (default)],
21 [case "${enableval}" in
24 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
25 esac], [multilib=yes])dnl
27 # When building with srcdir == objdir, links to the source files will
28 # be created in directories within the target_subdir. We have to
29 # adjust toplevel_srcdir accordingly, so that configure finds
30 # install-sh and other auxiliary files that live in the top-level
32 if test "${srcdir}" = "."; then
33 if test -z "${with_target_subdir}"; then
36 if test "${with_target_subdir}" != "."; then
37 toprel="${with_multisrctop}../.."
39 toprel="${with_multisrctop}.."
45 AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
46 toplevel_srcdir=\${top_srcdir}/$toprel
47 AC_SUBST(toplevel_srcdir)
49 # Export build and source directories.
50 # These need to be absolute paths, yet at the same time need to
51 # canonicalize only relative paths, because then amd will not unmount
52 # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
53 glibcpp_builddir=`pwd`
55 [\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;;
56 *) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
58 AC_SUBST(glibcpp_builddir)
59 AC_SUBST(glibcpp_srcdir)
61 dnl This is here just to satisfy automake.
62 ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
64 # Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.50+, can also
65 # be 'cp -p' if linking isn't available.
66 #ac_cv_prog_LN_S='cp -p'
69 # We use these options to decide which functions to include.
70 AC_ARG_WITH(target-subdir,
71 [ --with-target-subdir=SUBDIR
72 configuring in a subdirectory])
73 AC_ARG_WITH(cross-host,
74 [ --with-cross-host=HOST configuring with a cross compiler])
76 glibcpp_basedir=$srcdir/$toprel/$1/libstdc++-v3
77 AC_SUBST(glibcpp_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]))])
88 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
89 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
90 # are probably using a cross compiler, which will not be able to fully
91 # link an executable. This should really be fixed in autoconf
94 AC_DEFUN(LIB_AC_PROG_CC,
95 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
96 dnl Fool anybody using AC_PROG_CC.
97 AC_PROVIDE([AC_PROG_CC])
98 AC_CHECK_PROG(CC, gcc, gcc)
99 if test -z "$CC"; then
100 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
101 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
106 if test $ac_cv_prog_gcc = yes; then
108 dnl Check whether -g works, even if CFLAGS is set, in case the package
109 dnl plays around with CFLAGS (such as to build both debugging and
110 dnl normal versions of a library), tasteless as that idea is.
111 ac_test_CFLAGS="${CFLAGS+set}"
112 ac_save_CFLAGS="$CFLAGS"
115 if test "$ac_test_CFLAGS" = set; then
116 CFLAGS="$ac_save_CFLAGS"
117 elif test $ac_cv_prog_cc_g = yes; then
124 test "${CFLAGS+set}" = set || CFLAGS="-g"
130 # Can't just call these here as g++ requires libstc++ to be built....
133 # Likewise for AC_PROG_CXX.
134 AC_DEFUN(LIB_AC_PROG_CXX,
135 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
136 dnl Fool anybody using AC_PROG_CXX.
137 AC_PROVIDE([AC_PROG_CXX])
138 # Use glibcpp_CXX so that we do not cause CXX to be cached with the
139 # flags that come in CXX while configuring libstdc++. They're different
140 # from those used for all other target libraries. If CXX is set in
141 # the environment, respect that here.
143 AC_CHECK_PROGS(glibcpp_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
144 AC_SUBST(glibcpp_CXX)
146 test -z "$glibcpp_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
150 if test $ac_cv_prog_gxx = yes; then
152 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
153 dnl plays around with CXXFLAGS (such as to build both debugging and
154 dnl normal versions of a library), tasteless as that idea is.
155 ac_test_CXXFLAGS="${CXXFLAGS+set}"
156 ac_save_CXXFLAGS="$CXXFLAGS"
159 if test "$ac_test_CXXFLAGS" = set; then
160 CXXFLAGS="$ac_save_CXXFLAGS"
161 elif test $ac_cv_prog_cxx_g = yes; then
168 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
174 # For some reason, gettext needs this.
177 AC_CHECK_TOOL(AS, as)
178 AC_CHECK_TOOL(AR, ar)
179 AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
184 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
185 # at least currently, we never actually build a program, so we never
186 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
187 # fails, because we are probably configuring with a cross compiler
188 # which can't create executables. So we include AC_EXEEXT to keep
189 # automake happy, but we don't execute it, since we don't care about
192 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
193 # to nothing, so nothing would remain between `then' and `fi' if it
194 # were not for the `:' below.
199 . [$]{glibcpp_basedir}/configure.host
201 case [$]{glibcpp_basedir} in
202 /* | [A-Za-z]:[\\/]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
203 *) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
206 # This does for the target what configure.host does for the host. In
207 # addition to possibly modifying the same flags, it also sets up symlinks.
215 dnl Check to see if g++ can compile this library, and if so, if any version-
216 dnl specific precautions need to be taken.
218 dnl GLIBCPP_CHECK_COMPILER_VERSION
219 AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
220 if test ! -f stamp-sanity-compiler; then
221 AC_MSG_CHECKING([for g++ that will successfully compile libstdc++-v3])
228 ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to GCC 3.0 or above]))
230 AC_MSG_RESULT($gpp_satisfactory)
231 touch stamp-sanity-compiler
237 dnl Tests for newer compiler features, or features that are present in newer
238 dnl compiler versions but not older compiler versions still in use, should
241 dnl Define WERROR='-Werror' if requested and possible; g++'s that lack the
242 dnl new inlining code or the new system_header pragma will die on -Werror.
243 dnl Leave it out by default and use maint-mode to use it.
245 dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
246 dnl compiler supports it and the user has not requested debug mode.
248 dnl GLIBCPP_CHECK_COMPILER_FEATURES
249 AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
250 # All these tests are for C++; save the language and the compiler flags.
251 # The CXXFLAGS thing is suspicious, but based on similar bits previously
252 # found in GLIBCPP_CONFIGURE.
255 ac_test_CXXFLAGS="${CXXFLAGS+set}"
256 ac_save_CXXFLAGS="$CXXFLAGS"
258 # Check for maintainer-mode bits.
259 if test x"$USE_MAINTAINER_MODE" = xno; then
265 # Check for -ffunction-sections -fdata-sections
266 AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
267 CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
268 AC_TRY_COMPILE(, [int foo;
269 ], [ac_fdsections=yes], [ac_fdsections=no])
270 if test "$ac_test_CXXFLAGS" = set; then
271 CXXFLAGS="$ac_save_CXXFLAGS"
273 # this is the suspicious part
276 if test x"$ac_fdsections" = x"yes" &&
277 test x"$enable_debug" = x"no"; then
278 SECTION_FLAGS='-ffunction-sections -fdata-sections'
280 AC_MSG_RESULT($ac_fdsections)
284 AC_SUBST(SECTION_FLAGS)
289 dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
290 dnl the native linker is in use, all variables will be defined to something
291 dnl safe (like an empty string).
293 dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible.
294 dnl Define OPT_LDFLAGS='-Wl,-O1' if possible.
296 dnl GLIBCPP_CHECK_LINKER_FEATURES
297 AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
298 # If we're not using GNU ld, then there's no point in even trying these
299 # tests. Check for that first. We should have already tested for gld
300 # by now (in libtool), but require it now just to be safe...
301 test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
302 test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
303 AC_REQUIRE([AC_PROG_LD])
306 if test "$ac_cv_prog_gnu_ld" = "notbroken"; then
307 # GNU ld it is! Joy and bunny rabbits!
309 # All these tests are for C++; save the language and the compiler flags.
310 # Need to do this so that g++ won't try to link in libstdc++
311 ac_test_CFLAGS="${CFLAGS+set}"
312 ac_save_CFLAGS="$CFLAGS"
313 CFLAGS='-x c++ -Wl,--gc-sections'
315 # Check for -Wl,--gc-sections
316 # XXX This test is broken at the moment, as symbols required for
317 # linking are now in libsupc++ (not built yet.....). In addition,
318 # this test has cored on solaris in the past. In addition,
319 # --gc-sections doesn't really work at the moment (keeps on discarding
320 # used sections, first .eh_frame and now some of the glibc sections for
321 # iconv). Bzzzzt. Thanks for playing, maybe next time.
322 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
330 ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
331 if test "$ac_test_CFLAGS" = set; then
332 CFLAGS="$ac_save_CFLAGS"
334 # this is the suspicious part
337 if test "$ac_sectionLDflags" = "yes"; then
338 SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
340 AC_MSG_RESULT($ac_sectionLDflags)
343 # Set linker optimization flags.
344 if test x"$ac_cv_prog_gnu_ld" = x"yes" &&
345 test x"$enable_debug" = x"no"; then
346 OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
349 AC_SUBST(SECTION_LDFLAGS)
350 AC_SUBST(OPT_LDFLAGS)
355 dnl Check to see if the (math function) argument passed is
356 dnl declared when using the c++ compiler
357 dnl ASSUMES argument is a math function with ONE parameter
359 dnl GLIBCPP_CHECK_MATH_DECL_1
360 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_1, [
361 AC_MSG_CHECKING([for $1 declaration])
362 if test x${glibcpp_cv_func_$1_use+set} != xset; then
363 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
366 AC_TRY_COMPILE([#include <math.h>
372 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
376 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
380 dnl Check to see if the (math function) argument passed is
381 dnl 1) declared when using the c++ compiler
382 dnl 2) has "C" linkage
383 dnl 3) if not, see if 1) and 2) for argument prepended with '_'
385 dnl Define HAVE_CARGF etc if "cargf" is declared and links
387 dnl argument 1 is name of function to check
389 dnl ASSUMES argument is a math function with ONE parameter
391 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1
392 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
393 GLIBCPP_CHECK_MATH_DECL_1($1)
394 if test x$glibcpp_cv_func_$1_use = x"yes"; then
397 GLIBCPP_CHECK_MATH_DECL_1(_$1)
398 if test x$glibcpp_cv_func__$1_use = x"yes"; then
406 dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
407 dnl of functions at once. It's an all-or-nothing check -- either
408 dnl HAVE_XYZ is defined for each of the functions, or for none of them.
409 dnl Doing it this way saves significant configure time.
410 AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
411 AC_MSG_CHECKING([for $1 functions])
412 AC_CACHE_VAL(glibcpp_cv_func_$2_use, [
415 AC_TRY_COMPILE([#include <math.h>],
416 [ `for x in $3; do echo "$x (0);"; done` ],
417 [glibcpp_cv_func_$2_use=yes],
418 [glibcpp_cv_func_$2_use=no])
420 AC_MSG_RESULT($glibcpp_cv_func_$2_use)
421 if test x$glibcpp_cv_func_$2_use = x"yes"; then
427 dnl Check to see if the (math function) argument passed is
428 dnl declared when using the c++ compiler
429 dnl ASSUMES argument is a math function with TWO parameters
431 dnl GLIBCPP_CHECK_MATH_DECL_2
432 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_2, [
433 AC_MSG_CHECKING([for $1 declaration])
434 if test x${glibcpp_cv_func_$1_use+set} != xset; then
435 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
438 AC_TRY_COMPILE([#include <math.h>],
440 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
444 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
448 dnl Check to see if the (math function) argument passed is
449 dnl 1) declared when using the c++ compiler
450 dnl 2) has "C" linkage
452 dnl Define HAVE_CARGF etc if "cargf" is declared and links
454 dnl argument 1 is name of function to check
456 dnl ASSUMES argument is a math function with TWO parameters
458 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2
459 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
460 GLIBCPP_CHECK_MATH_DECL_2($1)
461 if test x$glibcpp_cv_func_$1_use = x"yes"; then
464 GLIBCPP_CHECK_MATH_DECL_2(_$1)
465 if test x$glibcpp_cv_func__$1_use = x"yes"; then
473 dnl Check to see if the (math function) argument passed is
474 dnl declared when using the c++ compiler
475 dnl ASSUMES argument is a math function with THREE parameters
477 dnl GLIBCPP_CHECK_MATH_DECL_3
478 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_3, [
479 AC_MSG_CHECKING([for $1 declaration])
480 if test x${glibcpp_cv_func_$1_use+set} != xset; then
481 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
484 AC_TRY_COMPILE([#include <math.h>],
486 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
490 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
494 dnl Check to see if the (math function) argument passed is
495 dnl 1) declared when using the c++ compiler
496 dnl 2) has "C" linkage
498 dnl Define HAVE_CARGF etc if "cargf" is declared and links
500 dnl argument 1 is name of function to check
502 dnl ASSUMES argument is a math function with THREE parameters
504 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3
505 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
506 GLIBCPP_CHECK_MATH_DECL_3($1)
507 if test x$glibcpp_cv_func_$1_use = x"yes"; then
510 GLIBCPP_CHECK_MATH_DECL_3(_$1)
511 if test x$glibcpp_cv_func__$1_use = x"yes"; then
519 dnl Check to see if the (stdlib function) argument passed is
520 dnl 1) declared when using the c++ compiler
521 dnl 2) has "C" linkage
523 dnl argument 1 is name of function to check
525 dnl ASSUMES argument is a math function with TWO parameters
527 dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2
528 AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
529 AC_MSG_CHECKING([for $1 declaration])
530 if test x${glibcpp_cv_func_$1_use+set} != xset; then
531 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
534 AC_TRY_COMPILE([#include <stdlib.h>],
536 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
540 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
541 if test x$glibcpp_cv_func_$1_use = x"yes"; then
548 dnl Because the builtins are picky picky picky about the arguments they take,
549 dnl do an explict linkage tests here.
550 dnl Check to see if the (math function) argument passed is
551 dnl 1) declared when using the c++ compiler
552 dnl 2) has "C" linkage
554 dnl Define HAVE_CARGF etc if "cargf" is declared and links
556 dnl argument 1 is name of function to check
558 dnl ASSUMES argument is a math function with ONE parameter
560 dnl GLIBCPP_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
561 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
562 AC_MSG_CHECKING([for $1 declaration])
563 if test x${glibcpp_cv_func_$1_use+set} != xset; then
564 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
567 AC_TRY_COMPILE([#include <math.h>],
569 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
573 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
574 if test x$glibcpp_cv_func_$1_use = x"yes"; then
575 AC_MSG_CHECKING([for $1 linkage])
576 if test x${glibcpp_cv_func_$1_link+set} != xset; then
577 AC_CACHE_VAL(glibcpp_cv_func_$1_link, [
578 AC_TRY_LINK([#include <math.h>],
580 [glibcpp_cv_func_$1_link=yes], [glibcpp_cv_func_$1_link=no])
583 AC_MSG_RESULT($glibcpp_cv_func_$1_link)
584 if test x$glibcpp_cv_func_$1_link = x"yes"; then
585 ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
586 AC_DEFINE_UNQUOTED(${ac_tr_func})
593 dnl Check to see what builtin math functions are supported
595 dnl check for __builtin_abs
596 dnl check for __builtin_fabsf
597 dnl check for __builtin_fabs
598 dnl check for __builtin_fabl
599 dnl check for __builtin_labs
600 dnl check for __builtin_sqrtf
601 dnl check for __builtin_sqrtl
602 dnl check for __builtin_sqrt
603 dnl check for __builtin_sinf
604 dnl check for __builtin_sin
605 dnl check for __builtin_sinl
606 dnl check for __builtin_cosf
607 dnl check for __builtin_cos
608 dnl check for __builtin_cosl
610 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
611 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
612 dnl Test for builtin math functions.
613 dnl These are made in gcc/c-common.c
614 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
615 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
616 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
617 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
618 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
620 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
621 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt)
622 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
624 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
625 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
626 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
628 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
629 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
630 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
632 dnl There is, without a doubt, a more elegant way to have these
633 dnl names exported so that they won't be stripped out of acconfig.h by
634 dnl autoheader. I leave this as an exercise to somebody less frustrated
635 dnl than I.... please email the libstdc++ list if you can figure out a
636 dnl more elegant approach (see autoconf/acgen.m4 and specifically
637 dnl AC_CHECK_FUNC for things to steal.)
639 if test x$dummyvar = x"yes"; then
640 AC_DEFINE(HAVE___BUILTIN_ABS)
641 AC_DEFINE(HAVE___BUILTIN_LABS)
642 AC_DEFINE(HAVE___BUILTIN_COS)
643 AC_DEFINE(HAVE___BUILTIN_COSF)
644 AC_DEFINE(HAVE___BUILTIN_COSL)
645 AC_DEFINE(HAVE___BUILTIN_FABS)
646 AC_DEFINE(HAVE___BUILTIN_FABSF)
647 AC_DEFINE(HAVE___BUILTIN_FABSL)
648 AC_DEFINE(HAVE___BUILTIN_SIN)
649 AC_DEFINE(HAVE___BUILTIN_SINF)
650 AC_DEFINE(HAVE___BUILTIN_SINL)
651 AC_DEFINE(HAVE___BUILTIN_SQRT)
652 AC_DEFINE(HAVE___BUILTIN_SQRTF)
653 AC_DEFINE(HAVE___BUILTIN_SQRTL)
659 dnl Check to see what the underlying c library
660 dnl These checks need to do two things:
661 dnl 1) make sure the name is declared when using the c++ compiler
662 dnl 2) make sure the name has "C" linkage
663 dnl This might seem like overkill but experience has shown that it's not...
665 dnl Define HAVE_STRTOLD if "strtold" is declared and links
666 dnl Define HAVE_STRTOF if "strtof" is declared and links
667 dnl Define HAVE_DRAND48 if "drand48" is declared and links
669 dnl GLIBCPP_CHECK_STDLIB_SUPPORT
670 AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
671 ac_test_CXXFLAGS="${CXXFLAGS+set}"
672 ac_save_CXXFLAGS="$CXXFLAGS"
673 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
675 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
676 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)
677 AC_CHECK_FUNCS(drand48)
679 CXXFLAGS="$ac_save_CXXFLAGS"
684 dnl Check to see what the underlying c library or math library is like.
685 dnl These checks need to do two things:
686 dnl 1) make sure the name is declared when using the c++ compiler
687 dnl 2) make sure the name has "C" linkage
688 dnl This might seem like overkill but experience has shown that it's not...
690 dnl Define HAVE_CARGF etc if "cargf" is found.
692 dnl GLIBCPP_CHECK_MATH_SUPPORT
693 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
694 ac_test_CXXFLAGS="${CXXFLAGS+set}"
695 ac_save_CXXFLAGS="$CXXFLAGS"
696 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
699 AC_CHECK_LIB(m, sin, libm="-lm")
703 dnl Check to see if certain C math functions exist.
704 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
705 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
706 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
707 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
708 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
709 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
710 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
711 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypot)
713 dnl Check to see if basic C math functions have float versions.
714 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
719 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
722 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
723 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
724 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
725 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
726 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
727 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
728 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf)
729 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
730 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
731 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
732 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
733 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
734 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
735 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
736 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
738 dnl Check to see if basic C math functions have long double versions.
739 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
744 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
747 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
748 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
749 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
750 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
751 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
752 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
753 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
754 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
755 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl)
756 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
757 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
758 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
759 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
760 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
761 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
762 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
763 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
765 dnl Some runtimes have these functions with a preceding underscore. Please
766 dnl keep this sync'd with the one above. And if you add any new symbol,
767 dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
768 dnl Check to see if certain C math functions exist.
770 dnl Check to see if basic C math functions have float versions.
771 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
773 _acosf _asinf _atanf \
775 _coshf _sinhf _tanhf)
776 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
780 dnl Check to see if basic C math functions have long double versions.
781 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
783 _acosl _asinl _atanl \
785 _coshl _sinhl _tanhl)
786 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
791 CXXFLAGS="$ac_save_CXXFLAGS"
796 dnl Check to see if there is native support for complex
798 dnl Don't compile bits in math/* if native support exits.
800 dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
802 dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
803 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
804 dnl Check for complex versions of math functions of platform.
805 AC_CHECK_LIB(m, main)
806 AC_REPLACE_MATHFUNCS(nan copysignf)
808 dnl Compile the long double complex functions only if the function
809 dnl provides the non-complex long double functions that are needed.
810 dnl Currently this includes copysignl, which should be
811 dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
812 USE_COMPLEX_LONG_DOUBLE=no
813 if test x$ac_cv_func_copysignl = x"yes"; then
814 USE_COMPLEX_LONG_DOUBLE=yes
815 AC_REPLACE_MATHFUNCS(signbitl)
818 AC_SUBST(USE_COMPLEX_LONG_DOUBLE)
822 dnl Check to see what architecture and operating system we are compiling
823 dnl for. Also, if architecture- or OS-specific flags are required for
824 dnl compilation, pick them up here.
826 dnl GLIBCPP_CHECK_TARGET
827 AC_DEFUN(GLIBCPP_CHECK_TARGET, [
828 . [$]{glibcpp_basedir}/configure.target
829 AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
830 AC_MSG_RESULT(OS config directory is $os_include_dir)
835 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
836 dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
837 dnl must have been previously checked.)
839 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
840 dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
842 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
843 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
845 dnl Test wchar.h for mbstate_t, which is needed for char_traits and
846 dnl others even if wchar_t support is not on.
847 AC_MSG_CHECKING([for mbstate_t])
848 AC_TRY_COMPILE([#include <wchar.h>],
849 [mbstate_t teststate;],
850 have_mbstate_t=yes, have_mbstate_t=no)
851 AC_MSG_RESULT($have_mbstate_t)
852 if test x"$have_mbstate_t" = xyes; then
853 AC_DEFINE(HAVE_MBSTATE_T)
856 dnl Sanity check for existence of ISO C99 headers for extended encoding.
857 AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
858 AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
860 dnl Only continue checking if the ISO C99 headers exist and support is on.
861 if test x"$ac_has_wchar_h" = xyes &&
862 test x"$ac_has_wctype_h" = xyes &&
863 test x"$enable_c_mbchar" != xno; then
865 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
866 dnl numeric_limits can instantiate type_traits<wchar_t>
867 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
868 AC_TRY_COMPILE([#include <wchar.h>],
869 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
870 has_wchar_minmax=yes, has_wchar_minmax=no)
871 AC_MSG_RESULT($has_wchar_minmax)
873 dnl Test wchar.h for WEOF, which is what we use to determine whether
874 dnl to specialize for char_traits<wchar_t> or not.
875 AC_MSG_CHECKING([for WEOF])
878 #include <stddef.h>],
880 has_weof=yes, has_weof=no)
881 AC_MSG_RESULT($has_weof)
883 dnl Tests for wide character functions used in char_traits<wchar_t>.
885 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
888 dnl Checks for names injected into std:: by the c_std headers.
889 AC_CHECK_FUNCS(btowc wctob fgetwc fgetwc fgetws fputwc fputws fwide \
890 fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
891 vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
892 mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
893 wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
894 wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr,, \
897 AC_MSG_CHECKING([for ISO C99 wchar_t support])
898 if test x"$has_weof" = xyes &&
899 test x"$has_wchar_minmax" = xyes &&
900 test x"$ac_wfuncs" = xyes; then
901 ac_isoC99_wchar_t=yes
905 AC_MSG_RESULT($ac_isoC99_wchar_t)
907 dnl Use iconv for wchar_t to char conversions. As such, check for
908 dnl X/Open Portability Guide, version 2 features (XPG2).
909 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
910 AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
912 dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
913 AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
915 LIBS="$LIBS $libiconv"
917 AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
918 ac_XPG2funcs=yes, ac_XPG2funcs=no)
922 AC_MSG_CHECKING([for XPG2 wchar_t support])
923 if test x"$ac_has_iconv_h" = xyes &&
924 test x"$ac_has_langinfo_h" = xyes &&
925 test x"$ac_XPG2funcs" = xyes; then
930 AC_MSG_RESULT($ac_XPG2_wchar_t)
932 dnl At the moment, only enable wchar_t specializations if all the
933 dnl above support is present.
934 AC_MSG_CHECKING([for enabled wchar_t specializations])
935 if test x"$ac_isoC99_wchar_t" = xyes &&
936 test x"$ac_XPG2_wchar_t" = xyes; then
937 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
943 dnl Wide characters disabled by the user.
944 AC_MSG_WARN([wchar_t support disabled.])
950 dnl Check for special debugging mode; not for production use.
952 dnl GLIBCPP_ENABLE_DEBUG
953 dnl --enable-debug sets '-ggdb3 -O0'.
954 dnl --disable-debug sets '-g' and whatever optimization options the
955 dnl compiler can handle.
956 dnl + --enable-maintainer-mode automatically defaults this to on.
957 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
958 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
959 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
960 dnl defaults to `no'.
961 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
962 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
964 changequote(<<, >>)dnl
965 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
967 [case "${enableval}" in
968 yes) enable_debug=yes ;;
969 no) enable_debug=no ;;
970 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
972 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
974 dnl Option parsed, now set things appropriately
975 case "${enable_debug}" in
977 DEBUG_FLAGS='-O0 -ggdb3'
983 AC_SUBST(DEBUG_FLAGS)
988 dnl Check for "unusual" flags to pass to the compiler while building.
990 dnl GLIBCPP_ENABLE_CXX_FLAGS
991 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
992 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
993 dnl Somehow this same set of flags must be passed when [re]building
995 dnl --disable-cxx-flags passes nothing.
996 dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
997 dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
998 dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
999 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
1000 dnl If "default flags" is an empty string (or "none"), the effect is
1001 dnl the same as --disable or --enable=no.
1002 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
1003 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1004 AC_ARG_ENABLE(cxx-flags,
1005 changequote(<<, >>)dnl
1006 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
1007 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
1008 changequote([, ])dnl
1009 [case "x$enableval" in
1011 AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
1013 enable_cxx_flags='' ;;
1015 enable_cxx_flags="$enableval" ;;
1017 enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
1019 dnl Thinko on my part during design. This kludge is the workaround.
1020 if test "$enable_cxx_flags" = "none"; then
1021 enable_cxx_flags='';
1024 dnl Run through flags (either default or command-line) and set anything
1025 dnl extra (e.g., #defines) that must accompany particular g++ options.
1026 if test -n "$enable_cxx_flags"; then
1027 for f in $enable_cxx_flags; do
1031 *) # and we're trying to pass /what/ exactly?
1032 AC_MSG_ERROR([compiler flags start with a -]) ;;
1036 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1037 AC_SUBST(EXTRA_CXX_FLAGS)
1042 dnl Check for which locale library to use: gnu or generic.
1044 dnl GLIBCPP_ENABLE_CLOCALE
1045 dnl --enable-clocale=gnu sets config/locale/c_locale_gnu.cc and friends
1046 dnl --enable-clocale=generic sets config/locale/c_locale_generic.cc and friends
1048 dnl default is generic
1050 AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
1051 AC_MSG_CHECKING([for clocale to use])
1052 AC_ARG_ENABLE(clocale,
1053 [ --enable-clocale enable model for target locale package.
1054 --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
1056 if test x$enable_clocale = xno; then
1061 enable_clocale_flag=$enable_clocale
1063 dnl Probe for locale support if no specific model is specified.
1064 dnl Default to "generic"
1065 if test x$enable_clocale_flag = xno; then
1066 case x${target_os} in
1068 AC_EGREP_CPP([_GLIBCPP_ok], [
1069 #include <features.h>
1070 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1073 ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
1075 # Test for bugs early in glibc-2.2.x series
1076 if test x$enable_clocale_flag = xgnu; then
1078 #define _GNU_SOURCE 1
1082 const char __one[] = "Äuglein Augmen";
1083 const char __two[] = "Äuglein";
1088 loc = __newlocale(1 << LC_ALL, "de_DE", 0);
1089 loc_dup = __duplocale(loc);
1090 i = __strcoll_l(__one, __two, loc);
1091 j = __strcoll_l(__one, __two, loc_dup);
1095 [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
1096 [enable_clocale_flag=generic])
1099 # ... at some point put __strxfrm_l tests in as well.
1102 enable_clocale_flag=generic
1107 dnl Set configure bits for specified locale package
1108 case x${enable_clocale_flag} in
1110 AC_MSG_RESULT(generic)
1112 # Don't use gettext.
1115 CLOCALE_H=config/locale/c_locale_generic.h
1116 CLOCALE_CC=config/locale/c_locale_generic.cc
1117 CCODECVT_H=config/locale/codecvt_specializations_generic.h
1118 CCOLLATE_CC=config/locale/collate_members_generic.cc
1119 CCTYPE_CC=config/locale/ctype_members_generic.cc
1120 CMESSAGES_H=config/locale/messages_members_generic.h
1121 CMESSAGES_CC=config/locale/messages_members_generic.cc
1122 CMONEY_CC=config/locale/moneypunct_members_generic.cc
1123 CNUMERIC_CC=config/locale/numpunct_members_generic.cc
1124 CTIME_CC=config/locale/time_members_generic.cc
1129 # Declare intention to use gettext, and add support for specific
1131 # For some reason, ALL_LINGUAS has to be before AM_GNU_GETTEXT
1133 # Don't call AM_GNU_GETTEXT here. Instead, assume glibc.
1134 # Need to deal with MSGFMT, USE_NLS, and glibcpp_[P,M]OFILES
1137 # Export the build objects.
1138 for ling in $ALL_LINGUAS; do \
1139 glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
1140 glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
1142 AC_SUBST(glibcpp_MOFILES)
1143 AC_SUBST(glibcpp_POFILES)
1145 CLOCALE_H=config/locale/c_locale_gnu.h
1146 CLOCALE_CC=config/locale/c_locale_gnu.cc
1147 CCODECVT_H=config/locale/codecvt_specializations_ieee_1003.1-200x.h
1148 CCOLLATE_CC=config/locale/collate_members_gnu.cc
1149 CCTYPE_CC=config/locale/ctype_members_gnu.cc
1150 CMESSAGES_H=config/locale/messages_members_gnu.h
1151 CMESSAGES_CC=config/locale/messages_members_gnu.cc
1152 CMONEY_CC=config/locale/moneypunct_members_gnu.cc
1153 CNUMERIC_CC=config/locale/numpunct_members_gnu.cc
1154 CTIME_CC=config/locale/time_members_gnu.cc
1157 AC_MSG_RESULT(generic)
1159 # Don't use gettext.
1162 CLOCALE_H=config/locale/c_locale_ieee_1003.1-200x.h
1163 CLOCALE_CC=config/locale/c_locale_ieee_1003.1-200x.cc
1164 CCODECVT_H=config/locale/codecvt_specializations_ieee_1003.1-200x.h
1165 CCOLLATE_CC=config/locale/collate_members_generic.cc
1166 CCTYPE_CC=config/locale/ctype_members_generic.cc
1167 CMESSAGES_H=config/locale/messages_members_ieee_1003.1-200x.h
1168 CMESSAGES_CC=config/locale/messages_members_ieee_1003.1-200x.cc
1169 CMONEY_CC=config/locale/moneypunct_members_generic.cc
1170 CNUMERIC_CC=config/locale/numpunct_members_generic.cc
1171 CTIME_CC=config/locale/time_members_generic.cc
1174 echo "$enable_clocale is an unknown locale package" 1>&2
1179 # This is where the testsuite looks for locale catalogs, using the
1180 # -DLOCALEDIR define during testsuite compilation.
1181 glibcpp_localedir=${glibcpp_builddir}/po/share/locale
1182 AC_SUBST(glibcpp_localedir)
1186 AC_SUBST(CCODECVT_H)
1187 AC_SUBST(CMESSAGES_H)
1188 AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
1189 AC_LINK_FILES($CCOLLATE_CC, src/collate.cc)
1190 AC_LINK_FILES($CCTYPE_CC, src/ctype.cc)
1191 AC_LINK_FILES($CMESSAGES_CC, src/messages.cc)
1192 AC_LINK_FILES($CMONEY_CC, src/moneypunct.cc)
1193 AC_LINK_FILES($CNUMERIC_CC, src/numpunct.cc)
1194 AC_LINK_FILES($CTIME_CC, src/time.cc)
1199 dnl Check for which I/O library to use: libio, or something specific.
1201 dnl GLIBCPP_ENABLE_CSTDIO
1202 dnl --enable-cstdio=libio sets config/io/c_io_libio.h and friends
1204 dnl default is stdio
1206 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
1207 AC_MSG_CHECKING([for cstdio to use])
1208 AC_ARG_ENABLE(cstdio,
1209 [ --enable-cstdio enable stdio for target io package.
1210 --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
1212 if test x$enable_cstdio = xno; then
1215 enable_cstdio=stdio)
1217 enable_cstdio_flag=$enable_cstdio
1219 dnl Check if a valid I/O package
1220 case x${enable_cstdio_flag} in
1222 CSTDIO_H=config/io/c_io_libio.h
1223 BASIC_FILE_H=config/io/basic_file_libio.h
1224 BASIC_FILE_CC=config/io/basic_file_libio.cc
1225 AC_MSG_RESULT(libio)
1227 # see if we are on a system with libio native (ie, linux)
1228 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
1230 # Need to check and see what version of glibc is being used. If
1231 # it's not glibc-2.2 or higher, then we'll need to go ahead and
1232 # compile most of libio for linux systems.
1233 if test x$has_libio = x"yes"; then
1236 AC_MSG_CHECKING([for glibc version >= 2.2])
1237 AC_EGREP_CPP([ok], [
1238 #include <features.h>
1239 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1242 ], glibc_satisfactory=yes, glibc_satisfactory=no)
1243 AC_MSG_RESULT($glibc_satisfactory)
1247 # XXX at the moment, admit defeat and force the recompilation
1248 # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
1249 glibc_satisfactory=no
1251 if test x$glibc_satisfactory = x"yes"; then
1256 # bkoz XXX need to add checks to enable this
1257 # pme XXX here's a first pass at such a check
1258 if test x$enable_c_mbchar != xno; then
1266 # Using libio, but <libio.h> doesn't exist on the target system. . .
1268 # bkoz XXX need to add checks to enable this
1269 # pme XXX here's a first pass at such a check
1270 if test x$enable_c_mbchar != xno; then
1277 xstdio | x | xno | xnone | xyes)
1279 CSTDIO_H=config/io/c_io_stdio.h
1280 BASIC_FILE_H=config/io/basic_file_stdio.h
1281 BASIC_FILE_CC=config/io/basic_file_stdio.cc
1282 AC_MSG_RESULT(stdio)
1284 # We're not using stdio.
1289 echo "$enable_cstdio is an unknown io package" 1>&2
1294 AC_SUBST(BASIC_FILE_H)
1295 AC_LINK_FILES($BASIC_FILE_CC, src/basic_file.cc)
1297 # 2000-08-04 bkoz hack
1298 CCODECVT_C=config/io/c_io_libio_codecvt.c
1299 AC_SUBST(CCODECVT_C)
1300 # 2000-08-04 bkoz hack
1302 AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
1303 test "$need_libio" = yes || test "$need_wlibio" = yes)
1304 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
1305 AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
1306 if test "$need_libio" = yes || test "$need_wlibio" = yes; then
1307 libio_la=../libio/libio.la
1316 dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
1317 dnl We must stage the required headers so that they will be installed
1318 dnl with the library (unlike libgcc, the STL implementation is provided
1319 dnl solely within headers). Since we must not inject random user-space
1320 dnl macro names into user-provided C++ code, we first stage into <file>-in
1321 dnl and process to <file> with an output command. The reason for a two-
1322 dnl stage process here is to correctly handle $srcdir!=$objdir without
1323 dnl having to write complex code (the sed commands to clean the macro
1324 dnl namespace are complex and fragile enough as it is). We must also
1325 dnl add a relative path so that -I- is supported properly.
1327 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
1328 AC_MSG_CHECKING([for thread model used by GCC])
1329 target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
1330 AC_MSG_RESULT([$target_thread_file])
1332 if test $target_thread_file != single; then
1333 AC_DEFINE(HAVE_GTHR_DEFAULT)
1334 AC_DEFINE(_GLIBCPP_SUPPORTS_WEAK, __GXX_WEAK__)
1337 glibcpp_thread_h=gthr-$target_thread_file.h
1338 AC_SUBST(glibcpp_thread_h)
1343 dnl Check for exception handling support. If an explicit enable/disable
1344 dnl sjlj exceptions is given, we don't have to detect. Otherwise the
1345 dnl target may or may not support call frame exceptions.
1347 dnl GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
1348 dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
1349 dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
1351 dnl Define _GLIBCPP_SJLJ_EXCEPTIONS if the compiler is configured for it.
1353 AC_DEFUN(GLIBCPP_ENABLE_SJLJ_EXCEPTIONS, [
1354 AC_MSG_CHECKING([for exception model to use])
1357 AC_ARG_ENABLE(sjlj-exceptions,
1358 [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
1360 [dnl Botheration. Now we've got to detect the exception model.
1361 dnl Link tests against libgcc.a are problematic since -- at least
1362 dnl as of this writing -- we've not been given proper -L bits for
1363 dnl single-tree newlib and libgloss.
1365 dnl This is what AC_TRY_COMPILE would do if it didn't delete the
1366 dnl conftest files before we got a change to grep them first.
1367 cat > conftest.$ac_ext << EOF
1368 [#]line __oline__ "configure"
1377 old_CXXFLAGS="$CXXFLAGS"
1379 if AC_TRY_EVAL(ac_compile); then
1380 if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
1381 enable_sjlj_exceptions=yes
1382 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
1383 enable_sjlj_exceptions=no
1386 CXXFLAGS="$old_CXXFLAGS"
1388 if test x$enable_sjlj_exceptions = xyes; then
1389 AC_DEFINE(_GLIBCPP_SJLJ_EXCEPTIONS, 1,
1390 [Define if the compiler is configured for setjmp/longjmp exceptions.])
1391 ac_exception_model_name=sjlj
1392 elif test x$enable_sjlj_exceptions = xno; then
1393 ac_exception_model_name="call frame"
1395 AC_MSG_ERROR([unable to detect exception model])
1398 AC_MSG_RESULT($ac_exception_model_name)
1403 dnl Check for ISO/IEC 9899:1999 "C99" support.
1405 dnl GLIBCPP_ENABLE_C99
1406 dnl --enable-c99 defines _GLIBCPP_USE_C99
1407 dnl --disable-c99 leaves _GLIBCPP_USE_C99 undefined
1408 dnl + Usage: GLIBCPP_ENABLE_C99[(DEFAULT)]
1409 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1410 dnl defaults to `no'.
1411 dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
1413 dnl GLIBCPP_ENABLE_C99
1414 AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
1415 define([GLIBCPP_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
1418 changequote(<<, >>)dnl
1419 <<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCPP_ENABLE_C99_DEFAULT],
1420 changequote([, ])dnl
1421 [case "$enableval" in
1422 yes) enable_c99=yes ;;
1423 no) enable_c99=no ;;
1424 *) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
1426 enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
1431 # Check for the existence of <math.h> functions used if C99 is enabled.
1433 AC_MSG_CHECKING([for ISO C99 support in <math.h>])
1434 AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
1435 AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
1436 AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
1437 AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
1438 AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
1439 AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
1440 AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
1441 AC_TRY_COMPILE([#include <math.h>],
1442 [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
1443 AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
1444 AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
1445 AC_TRY_COMPILE([#include <math.h>],
1446 [islessgreater(0.0,0.0);],, [ac_c99_math=no])
1447 AC_TRY_COMPILE([#include <math.h>],
1448 [isunordered(0.0,0.0);],, [ac_c99_math=no])
1449 AC_MSG_RESULT($ac_c99_math)
1451 # Check for the existence in <stdio.h> of vscanf, et. al.
1453 AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
1454 AC_TRY_COMPILE([#include <stdio.h>],
1455 [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
1456 AC_TRY_COMPILE([#include <stdio.h>
1458 void foo(char* fmt, ...)
1459 {va_list args; va_start(args, fmt);
1460 vfscanf(stderr, "%i", args);}],
1461 [],, [ac_c99_stdio=no])
1462 AC_TRY_COMPILE([#include <stdio.h>
1464 void foo(char* fmt, ...)
1465 {va_list args; va_start(args, fmt);
1466 vscanf("%i", args);}],
1467 [],, [ac_c99_stdio=no])
1468 AC_TRY_COMPILE([#include <stdio.h>
1470 void foo(char* fmt, ...)
1471 {va_list args; va_start(args, fmt);
1472 vsnprintf(fmt, 0, "%i", args);}],
1473 [],, [ac_c99_stdio=no])
1474 AC_TRY_COMPILE([#include <stdio.h>
1476 void foo(char* fmt, ...)
1477 {va_list args; va_start(args, fmt);
1478 vsscanf(fmt, "%i", args);}],
1479 [],, [ac_c99_stdio=no])
1480 AC_MSG_RESULT($ac_c99_stdio)
1482 # Check for the existence in <stdlib.h> of lldiv_t, et. al.
1484 AC_MSG_CHECKING([for lldiv_t declaration])
1485 AC_CACHE_VAL(ac_c99_lldiv_t, [
1486 AC_TRY_COMPILE([#include <stdlib.h>],
1488 [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
1490 AC_MSG_RESULT($ac_c99_lldiv_t)
1492 AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
1493 AC_TRY_COMPILE([#include <stdlib.h>],
1494 [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
1495 AC_TRY_COMPILE([#include <stdlib.h>],
1496 [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
1497 AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
1498 AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
1499 AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
1500 AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
1501 if test x"$ac_c99_lldiv_t" = x"no"; then
1504 AC_MSG_RESULT($ac_c99_stdlib)
1506 # Check for the existence of <wchar.h> functions used if C99 is enabled.
1507 # XXX the wchar.h checks should be rolled into the general C99 bits.
1509 AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
1510 AC_TRY_COMPILE([#include <wchar.h>],
1511 [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
1512 AC_TRY_COMPILE([#include <wchar.h>],
1513 [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
1514 AC_TRY_COMPILE([#include <wchar.h>],
1515 [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
1516 AC_MSG_RESULT($ac_c99_wchar)
1518 AC_MSG_CHECKING([for enabled ISO C99 support])
1519 if test x"$ac_c99_math" = x"no" ||
1520 test x"$ac_c99_stdio" = x"no" ||
1521 test x"$ac_c99_stdlib" = x"no" ||
1522 test x"$ac_c99_wchar" = x"no"; then
1525 AC_MSG_RESULT($enable_c99)
1527 # Option parsed, now set things appropriately
1528 if test x"$enable_c99" = x"yes"; then
1529 AC_DEFINE(_GLIBCPP_USE_C99)
1537 dnl Check for template specializations for the 'long long' type extension.
1538 dnl The result determines only whether 'long long' I/O is enabled; things
1539 dnl like numeric_limits<> specializations are always available.
1541 dnl GLIBCPP_ENABLE_LONG_LONG
1542 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
1543 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
1544 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
1545 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1546 dnl defaults to `no'.
1547 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1549 dnl GLIBCPP_ENABLE_LONG_LONG
1550 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
1551 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
1553 AC_ARG_ENABLE(long-long,
1554 changequote(<<, >>)dnl
1555 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
1556 changequote([, ])dnl
1557 [case "$enableval" in
1558 yes) enable_long_long=yes ;;
1559 no) enable_long_long=no ;;
1560 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1562 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1567 AC_MSG_CHECKING([for enabled long long I/O support])
1568 # iostreams require strtoll, strtoull to compile
1569 AC_TRY_COMPILE([#include <stdlib.h>],
1570 [char* tmp; strtoll("gnu", &tmp, 10);],,[enable_long_long=no])
1571 AC_TRY_COMPILE([#include <stdlib.h>],
1572 [char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
1574 # Option parsed, now set things appropriately
1575 if test x"$enable_long_long" = xyes; then
1576 AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1578 AC_MSG_RESULT($enable_long_long)
1585 dnl Check for what kind of C headers to use.
1587 dnl GLIBCPP_ENABLE_CHEADERS
1588 dnl --enable-cheaders= [does stuff].
1589 dnl --disable-cheaders [does not do anything, really].
1590 dnl + This will eventually need to be 'c_shadow' by default.
1591 dnl + Usage: GLIBCPP_ENABLE_CHEADERS[(DEFAULT)]
1592 dnl Where DEFAULT is either `c' or `c_std' or 'c_shadow'.
1593 dnl If ommitted, it defaults to `c_std'.
1594 AC_DEFUN(GLIBCPP_ENABLE_CHEADERS, [dnl
1595 define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
1596 AC_MSG_CHECKING([for c header strategy to use])
1597 AC_ARG_ENABLE(cheaders,
1598 changequote(<<, >>)dnl
1599 << --enable-cheaders construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
1601 [case "$enableval" in
1606 enable_cheaders=c_std
1609 enable_cheaders=c_shadow
1611 *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
1614 enable_cheaders=GLIBCPP_ENABLE_CHEADERS_DEFAULT)
1615 AC_MSG_RESULT($enable_cheaders)
1617 dnl Option parsed, now set things appropriately
1618 case "$enable_cheaders" in
1620 CSHADOW_FLAGS="-fno-builtin"
1621 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_shadow'
1622 AC_DEFINE(_GLIBCPP_USE_SHADOW_HEADERS)
1626 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
1630 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
1634 AC_SUBST(CSHADOW_FLAGS)
1635 AC_SUBST(C_INCLUDE_DIR)
1636 AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cheaders" = c_shadow)
1641 dnl Check for wide character support. Has the same effect as the option
1642 dnl in gcc's configure, but in a form that autoconf can mess with.
1644 dnl GLIBCPP_ENABLE_C_MBCHAR
1645 dnl --enable-c-mbchar requests all the wchar_t stuff.
1646 dnl --disable-c-mbchar doesn't.
1647 dnl + Usage: GLIBCPP_ENABLE_C_MBCHAR[(DEFAULT)]
1648 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1649 dnl defaults to `no'.
1650 AC_DEFUN(GLIBCPP_ENABLE_C_MBCHAR, [dnl
1651 define([GLIBCPP_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
1652 AC_ARG_ENABLE(c-mbchar,
1653 changequote(<<, >>)dnl
1654 << --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCPP_ENABLE_C_MBCHAR_DEFAULT],
1655 changequote([, ])dnl
1656 [case "$enableval" in
1657 yes) enable_c_mbchar=yes ;;
1658 no) enable_c_mbchar=no ;;
1659 *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
1661 enable_c_mbchar=GLIBCPP_ENABLE_C_MBCHAR_DEFAULT)dnl
1662 dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
1667 dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
1669 dnl TOPLEVEL_INCLUDES
1670 dnl LIBMATH_INCLUDES
1671 dnl LIBSUPCXX_INCLUDES
1673 dnl CSHADOW_INCLUDES
1675 dnl GLIBCPP_EXPORT_INCLUDES
1676 AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
1677 # Root level of the build directory include sources.
1678 GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
1680 # Passed down for canadian crosses.
1681 if test x"$CANADIAN" = xyes; then
1682 TOPLEVEL_INCLUDES='-I$(includedir)'
1685 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1687 LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
1689 if test x"$need_libio" = xyes; then
1690 LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
1691 AC_SUBST(LIBIO_INCLUDES)
1694 # Now, export this to all the little Makefiles....
1695 AC_SUBST(GLIBCPP_INCLUDES)
1696 AC_SUBST(TOPLEVEL_INCLUDES)
1697 AC_SUBST(LIBMATH_INCLUDES)
1698 AC_SUBST(LIBSUPCXX_INCLUDES)
1703 dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
1705 AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
1706 # Optimization flags that are probably a good idea for thrill-seekers. Just
1707 # uncomment the lines below and make, everything else is ready to go...
1708 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
1710 AC_SUBST(OPTIMIZE_CXXFLAGS)
1712 WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings -Winline'
1713 AC_SUBST(WARN_FLAGS)
1717 dnl GLIBCPP_EXPORT_INSTALL_INFO
1718 dnl calculates gxx_install_dir
1719 dnl exports glibcpp_toolexecdir
1720 dnl exports glibcpp_toolexeclibdir
1721 dnl exports glibcpp_prefixdir
1723 dnl Assumes cross_compiling bits already done, and with_cross_host in
1726 dnl GLIBCPP_EXPORT_INSTALL_INFO
1727 AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
1728 # Assumes glibcpp_builddir, glibcpp_srcdir are alreay set up and
1729 # exported correctly in GLIBCPP_CONFIGURE.
1730 glibcpp_toolexecdir=no
1731 glibcpp_toolexeclibdir=no
1732 glibcpp_prefixdir=${prefix}
1734 AC_MSG_CHECKING([for interface version number])
1735 libstdcxx_interface=$INTERFACE
1736 AC_MSG_RESULT($libstdcxx_interface)
1738 # Process the option --with-gxx-include-dir=<path to include-files directory>
1739 AC_MSG_CHECKING([for --with-gxx-include-dir])
1740 AC_ARG_WITH(gxx-include-dir,
1741 [ --with-gxx-include-dir the installation directory for include files],
1742 [case "${withval}" in
1744 AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
1751 gxx_include_dir=${withval}
1753 esac], [gxx_include_dir=no])
1754 AC_MSG_RESULT($gxx_include_dir)
1756 # Process the option "--enable-version-specific-runtime-libs"
1757 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
1758 AC_ARG_ENABLE(version-specific-runtime-libs,
1759 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
1760 [case "$enableval" in
1761 yes) version_specific_libs=yes ;;
1762 no) version_specific_libs=no ;;
1763 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
1765 version_specific_libs=no)dnl
1766 # Option set, now we can test it.
1767 AC_MSG_RESULT($version_specific_libs)
1769 if test $version_specific_libs = yes; then
1770 # Need the gcc compiler version to know where to install libraries
1771 # and header files if --enable-version-specific-runtime-libs option
1774 gcc_version_trigger=${srcdir}/../gcc/version.c
1775 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
1776 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
1777 gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
1778 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1779 glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
1783 # Default case for install directory for include files.
1784 if test $version_specific_libs = no &&
1785 test $gxx_include_dir = no; then
1786 gxx_include_dir='$(prefix)'/include/g++-${libstdcxx_interface}
1789 # Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
1790 # Install a library built with a cross compiler in tooldir, not libdir.
1791 if test x"$glibcpp_toolexecdir" = x"no"; then
1792 if test -n "$with_cross_host" &&
1793 test x"$with_cross_host" != x"no"; then
1794 glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
1795 glibcpp_toolexeclibdir='$(toolexecdir)/lib$(MULTISUBDIR)'
1797 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1798 glibcpp_toolexeclibdir='$(libdir)$(MULTISUBDIR)'
1802 AC_MSG_CHECKING([for install location])
1803 AC_MSG_RESULT($gxx_include_dir)
1805 AC_SUBST(glibcpp_prefixdir)
1806 AC_SUBST(gxx_include_dir)
1807 AC_SUBST(glibcpp_toolexecdir)
1808 AC_SUBST(glibcpp_toolexeclibdir)
1812 # Check for functions in math library.
1813 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1815 # This file can be copied and used freely without restrictions. It can
1816 # be used in projects which are not available under the GNU Public License
1817 # but which still want to provide support for the GNU gettext functionality.
1818 # Please note that the actual code is *not* freely available.
1822 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1823 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1824 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])
1825 AC_SUBST(LIBMATHOBJS)dnl
1830 dnl This macro searches for a GNU version of make. If a match is found, the
1831 dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
1832 dnl set to "#". This is useful for including a special features in a Makefile,
1833 dnl which cannot be handled by other versions of make. The variable
1834 dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
1835 dnl the empty string otherwise.
1837 dnl Here is an example of its use:
1839 dnl Makefile.in might contain:
1841 dnl # A failsafe way of putting a dependency rule into a makefile
1843 dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
1845 dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
1846 dnl @ifGNUmake@ include $(DEPEND)
1847 dnl @ifGNUmake@ endif
1849 dnl Then configure.in would normally contain:
1851 dnl CHECK_GNU_MAKE()
1852 dnl AC_OUTPUT(Makefile)
1854 dnl Then perhaps to cause gnu make to override any other make, we could do
1855 dnl something like this (note that GNU make always looks for GNUmakefile first):
1857 dnl if ! test x$_cv_gnu_make_command = x ; then
1858 dnl mv Makefile GNUmakefile
1859 dnl echo .DEFAULT: > Makefile ;
1860 dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
1863 dnl Then, if any (well almost any) other make is called, and GNU make also
1864 dnl exists, then the other make wraps the GNU make.
1866 dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
1867 dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
1869 dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
1870 dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
1871 dnl #### conditional's subshell (" --version" is not a command), using a
1872 dnl #### different option to grep(1).
1874 dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
1875 dnl #### ${MAKE:-make}).
1878 GLIBCPP_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
1879 _cv_gnu_make_command='' ;
1880 dnl Search all the common names for GNU make
1881 for a in "${MAKE-make}" make gmake gnumake ; do
1882 if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
1884 _cv_gnu_make_command=$a ;
1889 dnl If there was a GNU version, then set @ifGNUmake@ to the empty
1890 dnl string, '#' otherwise
1891 if test "x$_cv_gnu_make_command" != "x" ; then
1900 dnl Check for headers for, and arguments to, the setrlimit() function.
1901 dnl Used only in testsuite_hooks.h.
1902 AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT_ancilliary, [
1903 AC_TRY_COMPILE([#include <sys/resource.h>
1905 ], [ int f = RLIMIT_$1 ; ],
1906 [glibcpp_mresult=1], [glibcpp_mresult=0])
1907 AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcpp_mresult,
1908 [Only used in build directory testsuite_hooks.h.])
1910 AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
1911 setrlimit_have_headers=yes
1912 AC_CHECK_HEADERS(sys/resource.h unistd.h,
1914 setrlimit_have_headers=no)
1915 # If don't have the headers, then we can't run the tests now, and we
1916 # won't be seeing any of these during testsuite compilation.
1917 if test $setrlimit_have_headers = yes; then
1918 # Can't do these in a loop, else the resulting syntax is wrong.
1919 GLIBCPP_CHECK_SETRLIMIT_ancilliary(DATA)
1920 GLIBCPP_CHECK_SETRLIMIT_ancilliary(RSS)
1921 GLIBCPP_CHECK_SETRLIMIT_ancilliary(VMEM)
1922 GLIBCPP_CHECK_SETRLIMIT_ancilliary(AS)
1924 # Check for rlimit, setrlimit.
1925 AC_CACHE_VAL(ac_setrlimit, [
1926 AC_TRY_COMPILE([#include <sys/resource.h>
1929 [ struct rlimit r; setrlimit(0, &r);],
1930 [ac_setrlimit=yes], [ac_setrlimit=no])
1934 AC_MSG_CHECKING([for testsuite memory limit support])
1935 if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
1937 AC_DEFINE(_GLIBCPP_MEM_LIMITS)
1941 AC_MSG_RESULT($ac_mem_limits)
1946 dnl Does any necessary configuration of the testsuite directory. Generates
1947 dnl the testsuite_hooks.h header.
1949 dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
1950 AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
1951 GLIBCPP_CHECK_SETRLIMIT
1953 # Look for setenv, so that extended locale tests can be performed.
1954 AC_CHECK_FUNCS(setenv)
1958 sinclude(../libtool.m4)
1959 dnl The lines below arrange for aclocal not to bring an installed
1960 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
1961 dnl add a definition of LIBTOOL to Makefile.in.
1962 ifelse(,,,[AC_SUBST(LIBTOOL)
1963 AC_DEFUN([AM_PROG_LIBTOOL])
1964 AC_DEFUN([AC_LIBTOOL_DLOPEN])
1965 AC_DEFUN([AC_PROG_LD])
1969 # Check whether LC_MESSAGES is available in <locale.h>.
1970 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1972 # This file file be copied and used freely without restrictions. It can
1973 # be used in projects which are not available under the GNU Public License
1974 # but which still want to provide support for the GNU gettext functionality.
1975 # Please note that the actual code is *not* freely available.
1979 AC_DEFUN(AC_LC_MESSAGES, [
1980 AC_CHECK_HEADER(locale.h, [
1981 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1982 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1983 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1984 if test $ac_cv_val_LC_MESSAGES = yes; then
1985 AC_DEFINE(HAVE_LC_MESSAGES)
1992 dnl Check for whether the Boost-derived checks should be turned on.
1994 dnl GLIBCPP_ENABLE_CONCEPT_CHECKS
1995 dnl --enable-concept-checks turns them on.
1996 dnl --disable-concept-checks leaves them off.
1997 dnl + Usage: GLIBCPP_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
1998 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1999 dnl defaults to `no'.
2000 AC_DEFUN(GLIBCPP_ENABLE_CONCEPT_CHECKS, [dnl
2001 define([GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT], ifelse($1, yes, yes, no))dnl
2002 AC_ARG_ENABLE(concept-checks,
2003 changequote(<<, >>)dnl
2004 << --enable-concept-checks use Boost-derived template checks [default=>>GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT],
2005 changequote([, ])dnl
2006 [case "$enableval" in
2007 yes) enable_concept_checks=yes ;;
2008 no) enable_concept_checks=no ;;
2009 *) AC_MSG_ERROR([Unknown argument to enable/disable concept checks]) ;;
2011 enable_concept_checks=GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT)dnl
2012 dnl Option parsed, now set things appropriately
2013 if test x"$enable_concept_checks" = xyes; then
2014 AC_DEFINE(_GLIBCPP_CONCEPT_CHECKS)
2020 dnl Add version tags to symbols in shared library (or not), additionally
2021 dnl marking other symbols as private/local (or not).
2023 dnl GLIBCPP_ENABLE_SYMVERS
2024 dnl --enable-symvers adds a version script to the linker call when creating
2025 dnl the shared library.
2026 dnl --disable-symvers does not.
2027 dnl + Usage: GLIBCPP_ENABLE_SYMVERS[(DEFAULT)]
2028 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
2029 dnl defaults to `no'.
2030 AC_DEFUN(GLIBCPP_ENABLE_SYMVERS, [dnl
2031 AC_REQUIRE([AC_PROG_LD])
2032 define([GLIBCPP_ENABLE_SYMVERS_DEFAULT], ifelse($1, yes, yes, no))dnl
2033 AC_ARG_ENABLE(symvers,
2034 changequote(<<, >>)dnl
2035 << --enable-symvers enables symbol versioning of the shared library [default=>>GLIBCPP_ENABLE_SYMVERS_DEFAULT],
2036 changequote([, ])dnl
2037 [case "$enableval" in
2038 yes) enable_symvers=yes ;;
2039 no) enable_symvers=no ;;
2040 *) AC_MSG_ERROR([Unknown argument to enable/disable symvers]) ;;
2042 enable_symvers=GLIBCPP_ENABLE_SYMVERS_DEFAULT)dnl
2043 dnl Option parsed, now set things appropriately
2044 AC_MSG_CHECKING([whether to version shared lib symbols])
2045 if test $enable_shared = no; then
2046 enable_symvers=irrelevant
2048 # placeholder -- maybe have a fallback later
2049 LINKER_MAP=config/linker-map.gnu
2050 # symvers variable may evolve into holding the type of linker map someday
2051 if test $enable_symvers = yes; then
2052 # flat-out assume a whole bunch of things right now
2054 # The name of this variable changed between autoconf versions (our problem
2055 # for depending on an impl detail, tsk tsk). It used to be
2056 # ac_cv_prog_gnu_ld but is now lt_cv_prog_gnu_ld, and is copied back into
2057 # with_gnu_ld which can also be user-settable. Let's use that one.
2058 if test $with_gnu_ld = yes; then
2059 # we also assume that the gnu ld in question has phil's patches... can't
2060 # think today of an easy way to programatically test for that; revisit
2061 LINKER_MAP=config/linker-map.gnu
2063 # placeholder -- maybe have a fallback later
2064 LINKER_MAP=config/linker-map.gnu
2068 AC_LINK_FILES($LINKER_MAP, src/linker.map)
2069 AM_CONDITIONAL(GLIBCPP_BUILD_VERSIONED_SHLIB, test "$enable_symvers" = yes)
2070 AC_MSG_RESULT($enable_symvers)
2075 # Add --enable-maintainer-mode option to configure.
2080 AC_DEFUN(AM_MAINTAINER_MODE,
2081 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
2082 dnl maintainer-mode is disabled by default
2083 AC_ARG_ENABLE(maintainer-mode,
2084 [ --enable-maintainer-mode enable make rules and dependencies not useful
2085 (and sometimes confusing) to the casual installer],
2086 USE_MAINTAINER_MODE=$enableval,
2087 USE_MAINTAINER_MODE=no)
2088 AC_MSG_RESULT($USE_MAINTAINER_MODE)
2089 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
2090 MAINT=$MAINTAINER_MODE_TRUE
2095 # Define a conditional.
2097 AC_DEFUN(AM_CONDITIONAL,
2108 # Macro to add for using GNU gettext.
2109 # Ulrich Drepper <drepper@cygnus.com>, 1995.
2111 # This file file be copied and used freely without restrictions. It can
2112 # be used in projects which are not available under the GNU Public License
2113 # but which still want to provide support for the GNU gettext functionality.
2114 # Please note that the actual code is *not* freely available.
2118 AC_DEFUN(AM_WITH_NLS,
2119 [AC_MSG_CHECKING([whether NLS is requested])
2120 dnl Default is enabled NLS
2122 [ --disable-nls do not use Native Language Support],
2123 USE_NLS=$enableval, USE_NLS=yes)
2124 AC_MSG_RESULT($USE_NLS)
2127 USE_INCLUDED_LIBINTL=no
2129 dnl If we use NLS figure out what method
2130 if test "$USE_NLS" = "yes"; then
2131 AC_DEFINE(ENABLE_NLS)
2132 AC_MSG_CHECKING([whether included gettext is requested])
2133 AC_ARG_WITH(included-gettext,
2134 [ --with-included-gettext use the GNU gettext library included here],
2135 nls_cv_force_use_gnu_gettext=$withval,
2136 nls_cv_force_use_gnu_gettext=no)
2137 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
2139 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
2140 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
2141 dnl User does not insist on using GNU NLS library. Figure out what
2142 dnl to use. If gettext or catgets are available (in this order) we
2143 dnl use this. Else we have to fall back to GNU NLS library.
2144 dnl catgets is only used if permitted by option --with-catgets.
2146 nls_cv_header_libgt=
2149 AC_CHECK_HEADER(libintl.h,
2150 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
2151 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
2152 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
2154 if test "$gt_cv_func_gettext_libc" != "yes"; then
2155 AC_CHECK_LIB(intl, bindtextdomain,
2156 [AC_CACHE_CHECK([for gettext in libintl],
2157 gt_cv_func_gettext_libintl,
2158 [AC_TRY_LINK([], [return (int) gettext ("")],
2159 gt_cv_func_gettext_libintl=yes,
2160 gt_cv_func_gettext_libintl=no)])])
2163 if test "$gt_cv_func_gettext_libc" = "yes" \
2164 || test "$gt_cv_func_gettext_libintl" = "yes"; then
2165 AC_DEFINE(HAVE_GETTEXT)
2166 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2167 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
2168 if test "$MSGFMT" != "no"; then
2169 AC_CHECK_FUNCS(dcgettext)
2170 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2171 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2172 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
2173 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
2174 return _nl_msg_cat_cntr],
2184 if test "$CATOBJEXT" = "NONE"; then
2185 AC_MSG_CHECKING([whether catgets can be used])
2186 AC_ARG_WITH(catgets,
2187 [ --with-catgets use catgets functions if available],
2188 nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
2189 AC_MSG_RESULT($nls_cv_use_catgets)
2191 if test "$nls_cv_use_catgets" = "yes"; then
2192 dnl No gettext in C library. Try catgets next.
2193 AC_CHECK_LIB(i, main)
2194 AC_CHECK_FUNC(catgets,
2195 [AC_DEFINE(HAVE_CATGETS)
2196 INTLOBJS="\$(CATOBJS)"
2197 AC_PATH_PROG(GENCAT, gencat, no)dnl
2198 if test "$GENCAT" != "no"; then
2199 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
2200 if test "$GMSGFMT" = "no"; then
2201 AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
2202 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
2204 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2205 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
2206 USE_INCLUDED_LIBINTL=yes
2210 INTLDEPS='$(top_builddir)/intl/libintl.a'
2212 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
2213 nls_cv_header_intl=intl/libintl.h
2214 nls_cv_header_libgt=intl/libgettext.h
2219 if test "$CATOBJEXT" = "NONE"; then
2220 dnl Neither gettext nor catgets in included in the C library.
2221 dnl Fall back on GNU gettext library.
2222 nls_cv_use_gnu_gettext=yes
2226 if test "$nls_cv_use_gnu_gettext" = "yes"; then
2227 dnl Mark actions used to generate GNU NLS library.
2228 INTLOBJS="\$(GETTOBJS)"
2229 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2230 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
2231 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2232 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2233 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
2235 USE_INCLUDED_LIBINTL=yes
2239 INTLDEPS='$(top_builddir)/intl/libintl.a'
2241 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
2242 nls_cv_header_intl=intl/libintl.h
2243 nls_cv_header_libgt=intl/libgettext.h
2246 dnl Test whether we really found GNU xgettext.
2247 if test "$XGETTEXT" != ":"; then
2248 dnl If it is no GNU xgettext we define it as : so that the
2249 dnl Makefiles still can work.
2250 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
2254 [found xgettext programs is not GNU xgettext; ignore it])
2259 # We need to process the po/ directory.
2263 nls_cv_header_intl=intl/libintl.h
2264 nls_cv_header_libgt=intl/libgettext.h
2267 # If this is used in GNU gettext we have to set USE_NLS to `yes'
2268 # because some of the sources are only built for this goal.
2269 if test "$PACKAGE" = gettext; then
2271 USE_INCLUDED_LIBINTL=yes
2274 dnl These rules are solely for the distribution goal. While doing this
2275 dnl we only have to keep exactly one list of the available catalogs
2276 dnl in configure.in.
2277 for lang in $ALL_LINGUAS; do
2278 GMOFILES="$GMOFILES $lang.gmo"
2279 POFILES="$POFILES $lang.po"
2282 dnl Make all variables we use known to autoconf.
2283 AC_SUBST(USE_INCLUDED_LIBINTL)
2286 AC_SUBST(DATADIRNAME)
2288 AC_SUBST(INSTOBJEXT)
2296 AC_DEFUN(AM_GNU_GETTEXT,
2297 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2298 AC_REQUIRE([AC_PROG_CC])dnl
2299 AC_REQUIRE([AC_PROG_RANLIB])dnl
2300 AC_REQUIRE([AC_ISC_POSIX])dnl
2301 AC_REQUIRE([AC_HEADER_STDC])dnl
2302 AC_REQUIRE([AC_C_CONST])dnl
2303 AC_REQUIRE([AC_C_INLINE])dnl
2304 AC_REQUIRE([AC_TYPE_OFF_T])dnl
2305 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
2306 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
2307 AC_REQUIRE([AC_FUNC_MMAP])dnl
2309 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
2310 unistd.h values.h sys/param.h])
2311 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
2312 __argz_count __argz_stringify __argz_next])
2314 if test "${ac_cv_func_stpcpy+set}" != "set"; then
2315 AC_CHECK_FUNCS(stpcpy)
2317 if test "${ac_cv_func_stpcpy}" = "yes"; then
2318 AC_DEFINE(HAVE_STPCPY)
2324 if test "x$CATOBJEXT" != "x"; then
2325 if test "x$ALL_LINGUAS" = "x"; then
2328 AC_MSG_CHECKING(for catalogs to be installed)
2330 for lang in ${LINGUAS=$ALL_LINGUAS}; do
2331 case "$ALL_LINGUAS" in
2332 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
2335 LINGUAS=$NEW_LINGUAS
2336 AC_MSG_RESULT($LINGUAS)
2339 dnl Construct list of names of catalog files to be constructed.
2340 if test -n "$LINGUAS"; then
2341 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
2345 dnl The reference to <locale.h> in the installed <libintl.h> file
2346 dnl must be resolved because we cannot expect the users of this
2347 dnl to define HAVE_LOCALE_H.
2348 if test $ac_cv_header_locale_h = yes; then
2349 INCLUDE_LOCALE_H="#include <locale.h>"
2352 /* The system does not provide the header <locale.h>. Take care yourself. */"
2354 AC_SUBST(INCLUDE_LOCALE_H)
2356 dnl Determine which catalog format we have (if any is needed)
2357 dnl For now we know about two different formats:
2358 dnl Linux libc-5 and the normal X/Open format
2359 test -d intl || mkdir intl
2360 if test "$CATOBJEXT" = ".cat"; then
2361 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
2363 dnl Transform the SED scripts while copying because some dumb SEDs
2364 dnl cannot handle comments.
2365 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
2367 dnl po2tbl.sed is always needed.
2368 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
2369 $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
2371 dnl In the intl/Makefile.in we have a special dependency which makes
2372 dnl only sense for gettext. We comment this out for non-gettext
2374 if test "$PACKAGE" = "gettext"; then
2384 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
2385 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
2386 dnl Try to locate is.
2388 if test -n "$ac_aux_dir"; then
2389 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
2391 if test -z "$MKINSTALLDIRS"; then
2392 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
2394 AC_SUBST(MKINSTALLDIRS)
2396 dnl *** For now the libtool support in intl/Makefile is not for real.
2400 dnl Generate list of files to be processed by xgettext which will
2401 dnl be included in po/Makefile.
2402 test -d po || mkdir po
2403 if test "x$srcdir" != "x."; then
2404 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
2405 posrcprefix="$srcdir/"
2407 posrcprefix="../$srcdir/"
2413 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
2414 < $srcdir/po/POTFILES.in > po/POTFILES
2417 # Search path for a program which passes the given test.
2418 # Ulrich Drepper <drepper@cygnus.com>, 1996.
2420 # This file file be copied and used freely without restrictions. It can
2421 # be used in projects which are not available under the GNU Public License
2422 # but which still want to provide support for the GNU gettext functionality.
2423 # Please note that the actual code is *not* freely available.
2427 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2428 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2429 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
2430 [# Extract the first word of "$2", so it can be a program name with args.
2431 set dummy $2; ac_word=[$]2
2432 AC_MSG_CHECKING([for $ac_word])
2433 AC_CACHE_VAL(ac_cv_path_$1,
2436 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2439 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2440 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2441 test -z "$ac_dir" && ac_dir=.
2442 if test -f $ac_dir/$ac_word; then
2444 ac_cv_path_$1="$ac_dir/$ac_word"
2450 dnl If no 4th arg is given, leave the cache variable unset,
2451 dnl so AC_PATH_PROGS will keep looking.
2452 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2457 if test -n "[$]$1"; then
2458 AC_MSG_RESULT([$]$1)
2465 # Check whether LC_MESSAGES is available in <locale.h>.
2466 # Ulrich Drepper <drepper@cygnus.com>, 1995.
2468 # This file file be copied and used freely without restrictions. It can
2469 # be used in projects which are not available under the GNU Public License
2470 # but which still want to provide support for the GNU gettext functionality.
2471 # Please note that the actual code is *not* freely available.
2475 AC_DEFUN(AM_LC_MESSAGES,
2476 [if test $ac_cv_header_locale_h = yes; then
2477 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2478 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2479 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2480 if test $am_cv_val_LC_MESSAGES = yes; then
2481 AC_DEFINE(HAVE_LC_MESSAGES, 1,
2482 [Define if your locale.h file contains LC_MESSAGES.])
2486 # Do all the work for Automake. This macro actually does too much --
2487 # some checks are only needed if your package does certain things.
2488 # But this isn't really a big deal.
2493 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
2495 AC_DEFUN(AM_INIT_AUTOMAKE,
2496 [AC_REQUIRE([AC_PROG_INSTALL])
2501 dnl test to see if srcdir already configured
2502 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
2503 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2506 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
2507 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
2508 AC_REQUIRE([AM_SANITY_CHECK])
2509 AC_REQUIRE([AC_ARG_PROGRAM])
2510 dnl FIXME This is truly gross.
2511 missing_dir=`cd $ac_aux_dir && pwd`
2512 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
2513 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
2514 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
2515 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
2516 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
2517 AC_REQUIRE([AC_PROG_MAKE_SET])])
2520 # Check to make sure that the build environment is sane.
2523 AC_DEFUN(AM_SANITY_CHECK,
2524 [AC_MSG_CHECKING([whether build environment is sane])
2527 echo timestamp > conftestfile
2528 # Do `set' in a subshell so we don't clobber the current shell's
2529 # arguments. Must try -L first in case configure is actually a
2530 # symlink; some systems play weird games with the mod time of symlinks
2531 # (eg FreeBSD returns the mod time of the symlink's containing
2534 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
2535 if test "[$]*" = "X"; then
2537 set X `ls -t $srcdir/configure conftestfile`
2539 if test "[$]*" != "X $srcdir/configure conftestfile" \
2540 && test "[$]*" != "X conftestfile $srcdir/configure"; then
2542 # If neither matched, then we have a broken ls. This can happen
2543 # if, for instance, CONFIG_SHELL is bash and it inherits a
2544 # broken ls alias from the environment. This has actually
2545 # happened. Such a system could not be considered "sane".
2546 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
2547 alias in your environment])
2550 test "[$]2" = conftestfile
2556 AC_MSG_ERROR([newly created file is older than distributed files!
2557 Check your system clock])
2560 AC_MSG_RESULT(yes)])
2562 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
2563 dnl The program must properly implement --version.
2564 AC_DEFUN(AM_MISSING_PROG,
2565 [AC_MSG_CHECKING(for working $2)
2566 # Run test in a subshell; some versions of sh will print an error if
2567 # an executable is not found, even if stderr is redirected.
2568 # Redirect stdin to placate older versions of autoconf. Sigh.
2569 if ($2 --version) < /dev/null > /dev/null 2>&1; then
2571 AC_MSG_RESULT(found)
2574 AC_MSG_RESULT(missing)
2578 # Like AC_CONFIG_HEADER, but automatically create stamp file.
2580 AC_DEFUN(AM_CONFIG_HEADER,
2582 AC_CONFIG_HEADER([$1])
2583 dnl When config.status generates a header, we must update the stamp-h file.
2584 dnl This file resides in the same directory as the config header
2585 dnl that is generated. We must strip everything past the first ":",
2586 dnl and everything past the last "/".
2587 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
2588 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
2589 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
2591 for am_file in <<$1>>; do
2592 case " <<$>>CONFIG_HEADERS " in
2593 *" <<$>>am_file "*<<)>>
2594 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
2597 am_indx=`expr "<<$>>am_indx" + 1`