1 dnl aclocal.m4 generated automatically by aclocal 1.4-p5
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
14 dnl Initialize configure bits.
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 cant create executables. So we include AC_EXEEXT to keep
189 # automake happy, but we dont execute it, since we dont 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...
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_sectionLFflags=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'
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'
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_fsqrt
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_fsqrt)
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_FSQRT)
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 AC_CHECK_FUNCS(drand48)
678 CXXFLAGS="$ac_save_CXXFLAGS"
683 dnl Check to see what the underlying c library or math library is like.
684 dnl These checks need to do two things:
685 dnl 1) make sure the name is declared when using the c++ compiler
686 dnl 2) make sure the name has "C" linkage
687 dnl This might seem like overkill but experience has shown that it's not...
689 dnl Define HAVE_CARGF etc if "cargf" is found.
691 dnl GLIBCPP_CHECK_MATH_SUPPORT
692 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
693 ac_test_CXXFLAGS="${CXXFLAGS+set}"
694 ac_save_CXXFLAGS="$CXXFLAGS"
695 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
698 AC_CHECK_LIB(m, sin, libm="-lm")
702 dnl Check to see if certain C math functions exist.
703 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
704 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
705 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
706 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
707 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
708 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
709 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
710 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypot)
712 dnl Check to see if basic C math functions have float versions.
713 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
718 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
721 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
722 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
723 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
724 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
725 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
726 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
727 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf)
728 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
729 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
730 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
731 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
732 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
733 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
734 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
735 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
737 dnl Check to see if basic C math functions have long double versions.
738 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
743 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
746 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
747 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
748 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
749 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
750 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
751 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
752 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
753 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
754 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl)
755 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
756 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
757 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
758 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
759 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
760 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
761 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
762 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
764 dnl Some runtimes have these functions with a preceding underscore. Please
765 dnl keep this sync'd with the one above. And if you add any new symbol,
766 dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
767 dnl Check to see if certain C math functions exist.
769 dnl Check to see if basic C math functions have float versions.
770 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
772 _acosf _asinf _atanf \
774 _coshf _sinhf _tanhf)
775 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
779 dnl Check to see if basic C math functions have long double versions.
780 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
782 _acosl _asinl _atanl \
784 _coshl _sinhl _tanhl)
785 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
790 CXXFLAGS="$ac_save_CXXFLAGS"
795 dnl Check to see if there is native support for complex
797 dnl Don't compile bits in math/* if native support exits.
799 dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
801 dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
802 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
803 dnl Check for complex versions of math functions of platform.
804 AC_CHECK_LIB(m, main)
805 AC_REPLACE_MATHFUNCS(nan copysignf)
807 dnl Compile the long double complex functions only if the function
808 dnl provides the non-complex long double functions that are needed.
809 dnl Currently this includes copysignl, which should be
810 dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
811 USE_COMPLEX_LONG_DOUBLE=no
812 if test x$ac_cv_func_copysignl = x"yes"; then
813 USE_COMPLEX_LONG_DOUBLE=yes
814 AC_REPLACE_MATHFUNCS(signbitl)
817 AC_SUBST(USE_COMPLEX_LONG_DOUBLE)
821 dnl Check to see what architecture and operating system we are compiling
822 dnl for. Also, if architecture- or OS-specific flags are required for
823 dnl compilation, pick them up here.
825 dnl GLIBCPP_CHECK_TARGET
826 AC_DEFUN(GLIBCPP_CHECK_TARGET, [
827 . [$]{glibcpp_basedir}/configure.target
828 AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
829 AC_MSG_RESULT(OS config directory is $os_include_dir)
834 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
835 dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
836 dnl must have been previously checked.)
838 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
839 dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
841 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
842 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
844 dnl Test wchar.h for mbstate_t, which is needed for char_traits and
845 dnl others even if wchar_t support is not on.
846 AC_MSG_CHECKING([for mbstate_t])
847 AC_TRY_COMPILE([#include <wchar.h>],
848 [mbstate_t teststate;],
849 have_mbstate_t=yes, have_mbstate_t=no)
850 AC_MSG_RESULT($have_mbstate_t)
851 if test x"$have_mbstate_t" = xyes; then
852 AC_DEFINE(HAVE_MBSTATE_T)
855 dnl Sanity check for existence of ISO C99 headers for extended encoding.
856 AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
857 AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
859 dnl Only continue checking if the ISO C99 headers exist and support is on.
860 if test x"$ac_has_wchar_h" = xyes &&
861 test x"$ac_has_wctype_h" = xyes &&
862 test x"$enable_c_mbchar" != xno; then
864 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
865 dnl numeric_limits can instantiate type_traits<wchar_t>
866 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
867 AC_TRY_COMPILE([#include <wchar.h>],
868 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
869 has_wchar_minmax=yes, has_wchar_minmax=no)
870 AC_MSG_RESULT($has_wchar_minmax)
872 dnl Test wchar.h for WEOF, which is what we use to determine whether
873 dnl to specialize for char_traits<wchar_t> or not.
874 AC_MSG_CHECKING([for WEOF])
877 #include <stddef.h>],
879 has_weof=yes, has_weof=no)
880 AC_MSG_RESULT($has_weof)
882 dnl Tests for wide character functions used in char_traits<wchar_t>.
884 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
887 dnl Checks for names injected into std:: by the c_std headers.
888 AC_CHECK_FUNCS(btowc wctob fgetwc fgetwc fgetws fputwc fputws fwide \
889 fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
890 vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
891 mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
892 wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
893 wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr,, \
896 AC_MSG_CHECKING([for ISO C99 wchar_t support])
897 if test x"$has_weof" = xyes &&
898 test x"$has_wchar_minmax" = xyes &&
899 test x"$ac_wfuncs" = xyes; then
900 ac_isoC99_wchar_t=yes
904 AC_MSG_RESULT($ac_isoC99_wchar_t)
906 dnl Use iconv for wchar_t to char conversions. As such, check for
907 dnl X/Open Portability Guide, version 2 features (XPG2).
908 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
909 AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
911 dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
912 AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
914 LIBS="$LIBS $libiconv"
916 AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
917 ac_XPG2funcs=yes, ac_XPG2funcs=no)
921 AC_MSG_CHECKING([for XPG2 wchar_t support])
922 if test x"$ac_has_iconv_h" = xyes &&
923 test x"$ac_has_langinfo_h" = xyes &&
924 test x"$ac_XPG2funcs" = xyes; then
929 AC_MSG_RESULT($ac_XPG2_wchar_t)
931 dnl At the moment, only enable wchar_t specializations if all the
932 dnl above support is present.
933 AC_MSG_CHECKING([for enabled wchar_t specializations])
934 if test x"$ac_isoC99_wchar_t" = xyes &&
935 test x"$ac_XPG2_wchar_t" = xyes; then
936 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
942 dnl Wide characters disabled by the user.
943 AC_MSG_WARN([wchar_t support disabled.])
949 dnl Check for special debugging mode; not for production use.
951 dnl GLIBCPP_ENABLE_DEBUG
952 dnl --enable-debug sets '-ggdb3 -O0'.
953 dnl --disable-debug sets '-g' and whatever optimization options the
954 dnl compiler can handle.
955 dnl + --enable-maintainer-mode automatically defaults this to on.
956 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
957 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
958 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
959 dnl defaults to `no'.
960 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
961 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
963 changequote(<<, >>)dnl
964 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
966 [case "${enableval}" in
967 yes) enable_debug=yes ;;
968 no) enable_debug=no ;;
969 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
971 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
973 dnl Option parsed, now set things appropriately
974 case "${enable_debug}" in
976 DEBUG_FLAGS='-O0 -ggdb3'
982 AC_SUBST(DEBUG_FLAGS)
987 dnl Check for "unusual" flags to pass to the compiler while building.
989 dnl GLIBCPP_ENABLE_CXX_FLAGS
990 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
991 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
992 dnl Somehow this same set of flags must be passed when [re]building
994 dnl --disable-cxx-flags passes nothing.
995 dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
996 dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
997 dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
998 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
999 dnl If "default flags" is an empty string (or "none"), the effect is
1000 dnl the same as --disable or --enable=no.
1001 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
1002 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1003 AC_ARG_ENABLE(cxx-flags,
1004 changequote(<<, >>)dnl
1005 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
1006 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
1007 changequote([, ])dnl
1008 [case "x$enableval" in
1010 AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
1012 enable_cxx_flags='' ;;
1014 enable_cxx_flags="$enableval" ;;
1016 enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
1018 dnl Thinko on my part during design. This kludge is the workaround.
1019 if test "$enable_cxx_flags" = "none"; then
1020 enable_cxx_flags='';
1023 dnl Run through flags (either default or command-line) and set anything
1024 dnl extra (e.g., #defines) that must accompany particular g++ options.
1025 if test -n "$enable_cxx_flags"; then
1026 for f in $enable_cxx_flags; do
1030 *) # and we're trying to pass /what/ exactly?
1031 AC_MSG_ERROR([compiler flags start with a -]) ;;
1035 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1036 AC_SUBST(EXTRA_CXX_FLAGS)
1041 dnl Check for which locale library to use: gnu or generic.
1043 dnl GLIBCPP_ENABLE_CLOCALE
1044 dnl --enable-clocale=gnu sets config/locale/c_locale_gnu.cc and friends
1045 dnl --enable-clocale=generic sets config/locale/c_locale_generic.cc and friends
1047 dnl default is generic
1049 AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
1050 AC_MSG_CHECKING([for clocale to use])
1051 AC_ARG_ENABLE(clocale,
1052 [ --enable-clocale enable model for target locale package.
1053 --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
1055 if test x$enable_clocale = xno; then
1056 enable_clocale=generic
1058 enable_clocale=generic)
1060 enable_clocale_flag=$enable_clocale
1062 dnl Check if a valid locale package
1063 case x${enable_clocale_flag} in
1065 AC_MSG_RESULT(generic)
1067 # Don't use gettext.
1070 CLOCALE_H=config/locale/c_locale_generic.h
1071 CLOCALE_CC=config/locale/c_locale_generic.cc
1072 CCODECVT_H=config/locale/codecvt_specializations_generic.h
1073 CCOLLATE_CC=config/locale/collate_members_generic.cc
1074 CMESSAGES_H=config/locale/messages_members_generic.h
1075 CMESSAGES_CC=config/locale/messages_members_generic.cc
1076 CMONEY_CC=config/locale/moneypunct_members_generic.cc
1077 CNUMERIC_CC=config/locale/numpunct_members_generic.cc
1078 CTIME_H=config/locale/time_members_generic.h
1079 CTIME_CC=config/locale/time_members_generic.cc
1084 # Declare intention to use gettext, and add support for specific
1086 # For some reason, ALL_LINGUAS has to be before AM_GNU_GETTEXT
1088 # Don't call AM_GNU_GETTEXT here. Instead, assume glibc.
1089 # Need to deal with MSGFMT, USE_NLS, and glibcpp_[P,M]OFILES
1092 # Export the build objects.
1093 for ling in $ALL_LINGUAS; do \
1094 glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
1095 glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
1097 AC_SUBST(glibcpp_MOFILES)
1098 AC_SUBST(glibcpp_POFILES)
1100 CLOCALE_H=config/locale/c_locale_gnu.h
1101 CLOCALE_CC=config/locale/c_locale_gnu.cc
1102 CCODECVT_H=config/locale/codecvt_specializations_ieee_1003.1-200x.h
1103 CCOLLATE_CC=config/locale/collate_members_gnu.cc
1104 CMESSAGES_H=config/locale/messages_members_gnu.h
1105 CMESSAGES_CC=config/locale/messages_members_gnu.cc
1106 CMONEY_CC=config/locale/moneypunct_members_gnu.cc
1107 CNUMERIC_CC=config/locale/numpunct_members_gnu.cc
1108 CTIME_H=config/locale/time_members_gnu.h
1109 CTIME_CC=config/locale/time_members_gnu.cc
1112 AC_MSG_RESULT(generic)
1114 # Don't use gettext.
1117 CLOCALE_H=config/locale/c_locale_ieee_1003.1-200x.h
1118 CLOCALE_CC=config/locale/c_locale_ieee_1003.1-200x.cc
1119 CCODECVT_H=config/locale/codecvt_specializations_ieee_1003.1-200x.h
1120 CCOLLATE_CC=config/locale/collate_members_generic.cc
1121 CMESSAGES_H=config/locale/messages_members_ieee_1003.1-200x.h
1122 CMESSAGES_CC=config/locale/messages_members_ieee_1003.1-200x.cc
1123 CMONEY_CC=config/locale/moneypunct_members_generic.cc
1124 CNUMERIC_CC=config/locale/numpunct_members_generic.cc
1125 CTIME_H=config/locale/time_members_generic.h
1126 CTIME_CC=config/locale/time_members_generic.cc
1129 echo "$enable_clocale is an unknown locale package" 1>&2
1134 # This is where the testsuite looks for locale catalogs, using the
1135 # -DLOCALEDIR define during testsuite compilation.
1136 glibcpp_localedir=${glibcpp_builddir}/po/share/locale
1137 AC_SUBST(glibcpp_localedir)
1141 AC_SUBST(CCODECVT_H)
1142 AC_SUBST(CMESSAGES_H)
1144 AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
1145 AC_LINK_FILES($CCOLLATE_CC, src/collate.cc)
1146 AC_LINK_FILES($CMESSAGES_CC, src/messages.cc)
1147 AC_LINK_FILES($CMONEY_CC, src/moneypunct.cc)
1148 AC_LINK_FILES($CNUMERIC_CC, src/numpunct.cc)
1149 AC_LINK_FILES($CTIME_CC, src/time.cc)
1154 dnl Check for which I/O library to use: libio, or something specific.
1156 dnl GLIBCPP_ENABLE_CSTDIO
1157 dnl --enable-cstdio=libio sets config/io/c_io_libio.h and friends
1159 dnl default is stdio
1161 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
1162 AC_MSG_CHECKING([for cstdio to use])
1163 AC_ARG_ENABLE(cstdio,
1164 [ --enable-cstdio enable stdio for target io package.
1165 --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
1167 if test x$enable_cstdio = xno; then
1170 enable_cstdio=stdio)
1172 enable_cstdio_flag=$enable_cstdio
1174 dnl Check if a valid I/O package
1175 case x${enable_cstdio_flag} in
1177 CSTDIO_H=config/io/c_io_libio.h
1178 BASIC_FILE_H=config/io/basic_file_libio.h
1179 BASIC_FILE_CC=config/io/basic_file_libio.cc
1180 AC_MSG_RESULT(libio)
1182 # see if we are on a system with libio native (ie, linux)
1183 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
1185 # Need to check and see what version of glibc is being used. If
1186 # it's not glibc-2.2 or higher, then we'll need to go ahead and
1187 # compile most of libio for linux systems.
1188 if test x$has_libio = x"yes"; then
1191 AC_MSG_CHECKING([for glibc version >= 2.2])
1192 AC_EGREP_CPP([ok], [
1193 #include <features.h>
1194 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1197 ], glibc_satisfactory=yes, glibc_satisfactory=no)
1198 AC_MSG_RESULT($glibc_satisfactory)
1202 # XXX at the moment, admit defeat and force the recompilation
1203 # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
1204 glibc_satisfactory=no
1206 if test x$glibc_satisfactory = x"yes"; then
1211 # bkoz XXX need to add checks to enable this
1212 # pme XXX here's a first pass at such a check
1213 if test x$enable_c_mbchar != xno; then
1221 # Using libio, but <libio.h> doesn't exist on the target system. . .
1223 # bkoz XXX need to add checks to enable this
1224 # pme XXX here's a first pass at such a check
1225 if test x$enable_c_mbchar != xno; then
1232 xstdio | x | xno | xnone | xyes)
1234 CSTDIO_H=config/io/c_io_stdio.h
1235 BASIC_FILE_H=config/io/basic_file_stdio.h
1236 BASIC_FILE_CC=config/io/basic_file_stdio.cc
1237 AC_MSG_RESULT(stdio)
1239 # We're not using stdio.
1244 echo "$enable_cstdio is an unknown io package" 1>&2
1249 AC_SUBST(BASIC_FILE_H)
1250 AC_LINK_FILES($BASIC_FILE_CC, src/basic_file.cc)
1252 # 2000-08-04 bkoz hack
1253 CCODECVT_C=config/io/c_io_libio_codecvt.c
1254 AC_SUBST(CCODECVT_C)
1255 # 2000-08-04 bkoz hack
1257 AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
1258 test "$need_libio" = yes || test "$need_wlibio" = yes)
1259 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
1260 AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
1261 if test "$need_libio" = yes || test "$need_wlibio" = yes; then
1262 libio_la=../libio/libio.la
1271 dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
1272 dnl We must stage the required headers so that they will be installed
1273 dnl with the library (unlike libgcc, the STL implementation is provided
1274 dnl solely within headers). Since we must not inject random user-space
1275 dnl macro names into user-provided C++ code, we first stage into <file>-in
1276 dnl and process to <file> with an output command. The reason for a two-
1277 dnl stage process here is to correctly handle $srcdir!=$objdir without
1278 dnl having to write complex code (the sed commands to clean the macro
1279 dnl namespace are complex and fragile enough as it is). We must also
1280 dnl add a relative path so that -I- is supported properly.
1282 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
1283 AC_MSG_CHECKING([for thread model used by GCC])
1284 target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
1285 AC_MSG_RESULT([$target_thread_file])
1287 if test $target_thread_file != single; then
1288 AC_DEFINE(HAVE_GTHR_DEFAULT)
1289 AC_DEFINE(_GLIBCPP_SUPPORTS_WEAK, __GXX_WEAK__)
1292 glibcpp_thread_h=gthr-$target_thread_file.h
1293 AC_SUBST(glibcpp_thread_h)
1298 dnl Check for exception handling support. If an explicit enable/disable
1299 dnl sjlj exceptions is given, we don't have to detect. Otherwise the
1300 dnl target may or may not support call frame exceptions.
1302 dnl GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
1303 dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
1304 dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
1306 dnl Define _GLIBCPP_SJLJ_EXCEPTIONS if the compiler is configured for it.
1308 AC_DEFUN(GLIBCPP_ENABLE_SJLJ_EXCEPTIONS, [
1309 AC_MSG_CHECKING([for exception model to use])
1312 AC_ARG_ENABLE(sjlj-exceptions,
1313 [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
1315 [dnl Botheration. Now we've got to detect the exception model.
1316 dnl Link tests against libgcc.a are problematic since -- at least
1317 dnl as of this writing -- we've not been given proper -L bits for
1318 dnl single-tree newlib and libgloss.
1320 dnl This is what AC_TRY_COMPILE would do if it didn't delete the
1321 dnl conftest files before we got a change to grep them first.
1322 cat > conftest.$ac_ext << EOF
1323 [#]line __oline__ "configure"
1332 old_CXXFLAGS="$CXXFLAGS"
1334 if AC_TRY_EVAL(ac_compile); then
1335 if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
1336 enable_sjlj_exceptions=yes
1337 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
1338 enable_sjlj_exceptions=no
1341 CXXFLAGS="$old_CXXFLAGS"
1343 if test x$enable_sjlj_exceptions = xyes; then
1344 AC_DEFINE(_GLIBCPP_SJLJ_EXCEPTIONS, 1,
1345 [Define if the compiler is configured for setjmp/longjmp exceptions.])
1346 ac_exception_model_name=sjlj
1347 elif test x$enable_sjlj_exceptions = xno; then
1348 ac_exception_model_name="call frame"
1350 AC_MSG_ERROR([unable to detect exception model])
1353 AC_MSG_RESULT($ac_exception_model_name)
1358 dnl Check for ISO/IEC 9899:1999 "C99" support.
1360 dnl GLIBCPP_ENABLE_C99
1361 dnl --enable-c99 defines _GLIBCPP_USE_C99
1362 dnl --disable-c99 leaves _GLIBCPP_USE_C99 undefined
1363 dnl + Usage: GLIBCPP_ENABLE_C99[(DEFAULT)]
1364 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1365 dnl defaults to `no'.
1366 dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
1368 dnl GLIBCPP_ENABLE_C99
1369 AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
1370 define([GLIBCPP_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
1373 changequote(<<, >>)dnl
1374 <<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCPP_ENABLE_C99_DEFAULT],
1375 changequote([, ])dnl
1376 [case "$enableval" in
1377 yes) enable_c99=yes ;;
1378 no) enable_c99=no ;;
1379 *) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
1381 enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
1386 # Check for the existence of <math.h> functions used if C99 is enabled.
1388 AC_MSG_CHECKING([for ISO C99 support in <math.h>])
1389 AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
1390 AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
1391 AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
1392 AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
1393 AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
1394 AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
1395 AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
1396 AC_TRY_COMPILE([#include <math.h>],
1397 [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
1398 AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
1399 AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
1400 AC_TRY_COMPILE([#include <math.h>],
1401 [islessgreater(0.0,0.0);],, [ac_c99_math=no])
1402 AC_TRY_COMPILE([#include <math.h>],
1403 [isunordered(0.0,0.0);],, [ac_c99_math=no])
1404 AC_MSG_RESULT($ac_c99_math)
1406 # Check for the existence in <stdio.h> of vscanf, et. al.
1408 AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
1409 AC_TRY_COMPILE([#include <stdio.h>],
1410 [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
1411 AC_TRY_COMPILE([#include <stdio.h>
1413 void foo(char* fmt, ...)
1414 {va_list args; va_start(args, fmt);
1415 vfscanf(stderr, "%i", args);}],
1416 [],, [ac_c99_stdio=no])
1417 AC_TRY_COMPILE([#include <stdio.h>
1419 void foo(char* fmt, ...)
1420 {va_list args; va_start(args, fmt);
1421 vscanf("%i", args);}],
1422 [],, [ac_c99_stdio=no])
1423 AC_TRY_COMPILE([#include <stdio.h>
1425 void foo(char* fmt, ...)
1426 {va_list args; va_start(args, fmt);
1427 vsnprintf(fmt, 0, "%i", args);}],
1428 [],, [ac_c99_stdio=no])
1429 AC_TRY_COMPILE([#include <stdio.h>
1431 void foo(char* fmt, ...)
1432 {va_list args; va_start(args, fmt);
1433 vsscanf(fmt, "%i", args);}],
1434 [],, [ac_c99_stdio=no])
1435 AC_MSG_RESULT($ac_c99_stdio)
1437 # Check for the existence in <stdlib.h> of lldiv_t, et. al.
1439 AC_MSG_CHECKING([for lldiv_t declaration])
1440 AC_CACHE_VAL(ac_c99_lldiv_t, [
1441 AC_TRY_COMPILE([#include <stdlib.h>],
1443 [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
1445 AC_MSG_RESULT($ac_c99_lldiv_t)
1447 AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
1448 AC_TRY_COMPILE([#include <stdlib.h>],
1449 [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
1450 AC_TRY_COMPILE([#include <stdlib.h>],
1451 [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
1452 AC_TRY_COMPILE([#include <stdlib.h>],
1453 [char* tmp; strtoll("gnu", &tmp, 10);],, [ac_c99_stdlib=no])
1454 AC_TRY_COMPILE([#include <stdlib.h>],
1455 [char* tmp; strtoull("gnu", &tmp, 10);],, [ac_c99_stdlib=no])
1456 AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
1457 AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
1458 AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
1459 AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
1460 if test x"$ac_c99_lldiv_t" = x"no"; then
1463 AC_MSG_RESULT($ac_c99_stdlib)
1465 # Check for the existence of <wchar.h> functions used if C99 is enabled.
1466 # XXX the wchar.h checks should be rolled into the general C99 bits.
1468 AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
1469 AC_TRY_COMPILE([#include <wchar.h>],
1470 [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
1471 AC_TRY_COMPILE([#include <wchar.h>],
1472 [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
1473 AC_TRY_COMPILE([#include <wchar.h>],
1474 [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
1475 AC_MSG_RESULT($ac_c99_wchar)
1477 AC_MSG_CHECKING([for enabled ISO C99 support])
1478 if test x"$ac_c99_math" = x"no" ||
1479 test x"$ac_c99_stdio" = x"no" ||
1480 test x"$ac_c99_stdlib" = x"no" ||
1481 test x"$ac_c99_wchar" = x"no"; then
1484 AC_MSG_RESULT($enable_c99)
1486 # Option parsed, now set things appropriately
1487 if test x"$enable_c99" = x"yes"; then
1488 AC_DEFINE(_GLIBCPP_USE_C99)
1496 dnl Check for template specializations for the 'long long' type extension.
1497 dnl NB: Must check for C99 support before calling _GLIBCPP_ENABLE_LONG_LONG
1499 dnl GLIBCPP_ENABLE_LONG_LONG
1500 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
1501 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
1502 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
1503 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1504 dnl defaults to `no'.
1505 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1507 dnl GLIBCPP_ENABLE_LONG_LONG
1508 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
1509 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
1511 AC_ARG_ENABLE(long-long,
1512 changequote(<<, >>)dnl
1513 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
1514 changequote([, ])dnl
1515 [case "$enableval" in
1516 yes) enable_long_long=yes ;;
1517 no) enable_long_long=no ;;
1518 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1520 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1522 # iostreams require strtoll, strtoull to compile. If the
1523 # GLIBCPP_ENABLE_C99 tests found these, and if C99 support is enabled,
1524 # go ahead and allow long long to be used.
1525 if test x"$enable_c99" = x"no"; then
1526 enable_long_long=no;
1529 # Option parsed, now set things appropriately
1530 AC_MSG_CHECKING([for enabled long long support])
1531 if test x"$enable_long_long" = xyes; then
1532 AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1534 AC_MSG_RESULT($enable_long_long)
1539 dnl Check for what kind of C headers to use.
1541 dnl GLIBCPP_ENABLE_CHEADERS
1542 dnl --enable-cheaders= [does stuff].
1543 dnl --disable-cheaders [does not do anything, really].
1544 dnl + This will eventually need to be 'c_shadow' by default.
1545 dnl + Usage: GLIBCPP_ENABLE_CHEADERS[(DEFAULT)]
1546 dnl Where DEFAULT is either `c' or `c_std' or 'c_shadow'.
1547 dnl If ommitted, it defaults to `c_std'.
1548 AC_DEFUN(GLIBCPP_ENABLE_CHEADERS, [dnl
1549 define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
1550 AC_MSG_CHECKING([for c header strategy to use])
1551 AC_ARG_ENABLE(cheaders,
1552 changequote(<<, >>)dnl
1553 << --enable-cheaders construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
1555 [case "$enableval" in
1560 enable_cheaders=c_std
1563 enable_cheaders=c_shadow
1565 *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
1568 enable_cheaders=GLIBCPP_ENABLE_CHEADERS_DEFAULT)
1569 AC_MSG_RESULT($enable_cheaders)
1571 dnl Option parsed, now set things appropriately
1572 case "$enable_cheaders" in
1574 CSHADOW_FLAGS="-fno-builtin"
1575 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_shadow'
1576 AC_DEFINE(_GLIBCPP_USE_SHADOW_HEADERS)
1580 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
1584 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
1588 AC_SUBST(CSHADOW_FLAGS)
1589 AC_SUBST(C_INCLUDE_DIR)
1590 AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cheaders" = c_shadow)
1595 dnl Check for wide character support. Has the same effect as the option
1596 dnl in gcc's configure, but in a form that autoconf can mess with.
1598 dnl GLIBCPP_ENABLE_C_MBCHAR
1599 dnl --enable-c-mbchar requests all the wchar_t stuff.
1600 dnl --disable-c-mbchar doesn't.
1601 dnl + Usage: GLIBCPP_ENABLE_C_MBCHAR[(DEFAULT)]
1602 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1603 dnl defaults to `no'.
1604 AC_DEFUN(GLIBCPP_ENABLE_C_MBCHAR, [dnl
1605 define([GLIBCPP_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
1606 AC_ARG_ENABLE(c-mbchar,
1607 changequote(<<, >>)dnl
1608 << --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCPP_ENABLE_C_MBCHAR_DEFAULT],
1609 changequote([, ])dnl
1610 [case "$enableval" in
1611 yes) enable_c_mbchar=yes ;;
1612 no) enable_c_mbchar=no ;;
1613 *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
1615 enable_c_mbchar=GLIBCPP_ENABLE_C_MBCHAR_DEFAULT)dnl
1616 dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
1621 dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
1623 dnl TOPLEVEL_INCLUDES
1624 dnl LIBMATH_INCLUDES
1625 dnl LIBSUPCXX_INCLUDES
1627 dnl CSHADOW_INCLUDES
1629 dnl GLIBCPP_EXPORT_INCLUDES
1630 AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
1631 # Root level of the build directory include sources.
1632 GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
1634 # Passed down for canadian crosses.
1635 if test x"$CANADIAN" = xyes; then
1636 TOPLEVEL_INCLUDES='-I$(includedir)'
1639 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1641 LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
1643 if test x"$need_libio" = xyes; then
1644 LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
1645 AC_SUBST(LIBIO_INCLUDES)
1648 # Now, export this to all the little Makefiles....
1649 AC_SUBST(GLIBCPP_INCLUDES)
1650 AC_SUBST(TOPLEVEL_INCLUDES)
1651 AC_SUBST(LIBMATH_INCLUDES)
1652 AC_SUBST(LIBSUPCXX_INCLUDES)
1657 dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
1659 AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
1660 # Optimization flags that are probably a good idea for thrill-seekers. Just
1661 # uncomment the lines below and make, everything else is ready to go...
1662 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
1664 AC_SUBST(OPTIMIZE_CXXFLAGS)
1666 WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings -Winline'
1667 AC_SUBST(WARN_FLAGS)
1671 dnl GLIBCPP_EXPORT_INSTALL_INFO
1672 dnl calculates gxx_install_dir
1673 dnl exports glibcpp_toolexecdir
1674 dnl exports glibcpp_toolexeclibdir
1675 dnl exports glibcpp_prefixdir
1677 dnl Assumes cross_compiling bits already done, and with_cross_host in
1680 dnl GLIBCPP_EXPORT_INSTALL_INFO
1681 AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
1682 # Assumes glibcpp_builddir, glibcpp_srcdir are alreay set up and
1683 # exported correctly in GLIBCPP_CONFIGURE.
1684 glibcpp_toolexecdir=no
1685 glibcpp_toolexeclibdir=no
1686 glibcpp_prefixdir=${prefix}
1688 AC_MSG_CHECKING([for interface version number])
1689 libstdcxx_interface=$INTERFACE
1690 AC_MSG_RESULT($libstdcxx_interface)
1692 # Process the option --with-gxx-include-dir=<path to include-files directory>
1693 AC_MSG_CHECKING([for --with-gxx-include-dir])
1694 AC_ARG_WITH(gxx-include-dir,
1695 [ --with-gxx-include-dir the installation directory for include files],
1696 [case "${withval}" in
1698 AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
1705 gxx_include_dir=${withval}
1707 esac], [gxx_include_dir=no])
1708 AC_MSG_RESULT($gxx_include_dir)
1710 # Process the option "--enable-version-specific-runtime-libs"
1711 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
1712 AC_ARG_ENABLE(version-specific-runtime-libs,
1713 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
1714 [case "$enableval" in
1715 yes) version_specific_libs=yes ;;
1716 no) version_specific_libs=no ;;
1717 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
1719 version_specific_libs=no)dnl
1720 # Option set, now we can test it.
1721 AC_MSG_RESULT($version_specific_libs)
1723 if test $version_specific_libs = yes; then
1724 # Need the gcc compiler version to know where to install libraries
1725 # and header files if --enable-version-specific-runtime-libs option
1728 gcc_version_trigger=${srcdir}/../gcc/version.c
1729 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
1730 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
1731 gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
1732 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1733 glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
1737 # Default case for install directory for include files.
1738 if test $version_specific_libs = no &&
1739 test $gxx_include_dir = no; then
1740 gxx_include_dir='$(prefix)'/include/g++-${libstdcxx_interface}
1743 # Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
1744 # Install a library built with a cross compiler in tooldir, not libdir.
1745 if test x"$glibcpp_toolexecdir" = x"no"; then
1746 if test -n "$with_cross_host" &&
1747 test x"$with_cross_host" != x"no"; then
1748 glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
1749 glibcpp_toolexeclibdir='$(toolexecdir)/lib$(MULTISUBDIR)'
1751 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1752 glibcpp_toolexeclibdir='$(libdir)$(MULTISUBDIR)'
1756 AC_MSG_CHECKING([for install location])
1757 AC_MSG_RESULT($gxx_include_dir)
1759 AC_SUBST(glibcpp_prefixdir)
1760 AC_SUBST(gxx_include_dir)
1761 AC_SUBST(glibcpp_toolexecdir)
1762 AC_SUBST(glibcpp_toolexeclibdir)
1766 # Check for functions in math library.
1767 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1769 # This file can be copied and used freely without restrictions. It can
1770 # be used in projects which are not available under the GNU Public License
1771 # but which still want to provide support for the GNU gettext functionality.
1772 # Please note that the actual code is *not* freely available.
1776 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1777 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1778 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])
1779 AC_SUBST(LIBMATHOBJS)dnl
1784 dnl This macro searches for a GNU version of make. If a match is found, the
1785 dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
1786 dnl set to "#". This is useful for including a special features in a Makefile,
1787 dnl which cannot be handled by other versions of make. The variable
1788 dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
1789 dnl the empty string otherwise.
1791 dnl Here is an example of its use:
1793 dnl Makefile.in might contain:
1795 dnl # A failsafe way of putting a dependency rule into a makefile
1797 dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
1799 dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
1800 dnl @ifGNUmake@ include $(DEPEND)
1801 dnl @ifGNUmake@ endif
1803 dnl Then configure.in would normally contain:
1805 dnl CHECK_GNU_MAKE()
1806 dnl AC_OUTPUT(Makefile)
1808 dnl Then perhaps to cause gnu make to override any other make, we could do
1809 dnl something like this (note that GNU make always looks for GNUmakefile first):
1811 dnl if ! test x$_cv_gnu_make_command = x ; then
1812 dnl mv Makefile GNUmakefile
1813 dnl echo .DEFAULT: > Makefile ;
1814 dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
1817 dnl Then, if any (well almost any) other make is called, and GNU make also
1818 dnl exists, then the other make wraps the GNU make.
1820 dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
1821 dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
1823 dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
1824 dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
1825 dnl #### conditional's subshell (" --version" is not a command), using a
1826 dnl #### different option to grep(1).
1828 dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
1829 dnl #### ${MAKE:-make}).
1832 GLIBCPP_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
1833 _cv_gnu_make_command='' ;
1834 dnl Search all the common names for GNU make
1835 for a in "${MAKE-make}" make gmake gnumake ; do
1836 if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
1838 _cv_gnu_make_command=$a ;
1843 dnl If there was a GNU version, then set @ifGNUmake@ to the empty
1844 dnl string, '#' otherwise
1845 if test "x$_cv_gnu_make_command" != "x" ; then
1854 dnl Check for headers for, and arguments to, the setrlimit() function.
1855 dnl Used only in testsuite_hooks.h.
1856 AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT_ancilliary, [
1857 AC_TRY_COMPILE([#include <sys/resource.h>
1859 ], [ int f = RLIMIT_$1 ; ],
1860 [glibcpp_mresult=1], [glibcpp_mresult=0])
1861 AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcpp_mresult,
1862 [Only used in build directory testsuite_hooks.h.])
1864 AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
1865 setrlimit_have_headers=yes
1866 AC_CHECK_HEADERS(sys/resource.h unistd.h,
1868 setrlimit_have_headers=no)
1869 # If don't have the headers, then we can't run the tests now, and we
1870 # won't be seeing any of these during testsuite compilation.
1871 if test $setrlimit_have_headers = yes; then
1872 # Can't do these in a loop, else the resulting syntax is wrong.
1873 GLIBCPP_CHECK_SETRLIMIT_ancilliary(DATA)
1874 GLIBCPP_CHECK_SETRLIMIT_ancilliary(RSS)
1875 GLIBCPP_CHECK_SETRLIMIT_ancilliary(VMEM)
1876 GLIBCPP_CHECK_SETRLIMIT_ancilliary(AS)
1878 # Check for rlimit, setrlimit.
1879 AC_CACHE_VAL(ac_setrlimit, [
1880 AC_TRY_COMPILE([#include <sys/resource.h>
1883 [ struct rlimit r; setrlimit(0, &r);],
1884 [ac_setrlimit=yes], [ac_setrlimit=no])
1888 AC_MSG_CHECKING([for testsuite memory limit support])
1889 if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
1891 AC_DEFINE(_GLIBCPP_MEM_LIMITS)
1895 AC_MSG_RESULT($ac_mem_limits)
1900 dnl Does any necessary configuration of the testsuite directory. Generates
1901 dnl the testsuite_hooks.h header.
1903 dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
1904 AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
1905 GLIBCPP_CHECK_SETRLIMIT
1909 sinclude(../libtool.m4)
1910 dnl The lines below arrange for aclocal not to bring an installed
1911 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
1912 dnl add a definition of LIBTOOL to Makefile.in.
1913 ifelse(,,,[AC_SUBST(LIBTOOL)
1914 AC_DEFUN([AM_PROG_LIBTOOL])
1915 AC_DEFUN([AC_LIBTOOL_DLOPEN])
1916 AC_DEFUN([AC_PROG_LD])
1920 # Check whether LC_MESSAGES is available in <locale.h>.
1921 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1923 # This file file be copied and used freely without restrictions. It can
1924 # be used in projects which are not available under the GNU Public License
1925 # but which still want to provide support for the GNU gettext functionality.
1926 # Please note that the actual code is *not* freely available.
1930 AC_DEFUN(AC_LC_MESSAGES, [
1931 AC_CHECK_HEADER(locale.h, [
1932 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1933 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1934 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1935 if test $ac_cv_val_LC_MESSAGES = yes; then
1936 AC_DEFINE(HAVE_LC_MESSAGES)
1943 # This test replaces the one in autoconf.
1944 # Currently this macro should have the same name as the autoconf macro
1945 # because gettext's gettext.m4 (distributed in the automake package)
1946 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
1947 # give these diagnostics:
1948 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1949 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1951 undefine([AC_ISC_POSIX])
1953 AC_DEFUN([AC_ISC_POSIX],
1955 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1956 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1960 # Add --enable-maintainer-mode option to configure.
1965 AC_DEFUN([AM_MAINTAINER_MODE],
1966 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1967 dnl maintainer-mode is disabled by default
1968 AC_ARG_ENABLE(maintainer-mode,
1969 [ --enable-maintainer-mode enable make rules and dependencies not useful
1970 (and sometimes confusing) to the casual installer],
1971 USE_MAINTAINER_MODE=$enableval,
1972 USE_MAINTAINER_MODE=no)
1973 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1974 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1975 MAINT=$MAINTAINER_MODE_TRUE
1980 # Define a conditional.
1982 AC_DEFUN([AM_CONDITIONAL],
1993 # Macro to add for using GNU gettext.
1994 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1996 # This file can be copied and used freely without restrictions. It can
1997 # be used in projects which are not available under the GNU Public License
1998 # but which still want to provide support for the GNU gettext functionality.
1999 # Please note that the actual code is *not* freely available.
2003 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
2004 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
2005 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
2006 dnl depending on --{enable,disable}-{shared,static} and on the presence of
2007 dnl AM-DISABLE-SHARED). Otherwise, a static library
2008 dnl $(top_builddir)/intl/libintl.a will be created.
2009 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
2010 dnl implementations (in libc or libintl) without the ngettext() function
2011 dnl will be ignored.
2012 dnl LIBDIR is used to find the intl libraries. If empty,
2013 dnl the value `$(top_builddir)/intl/' is used.
2015 dnl The result of the configuration is one of three cases:
2016 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
2018 dnl Catalog format: GNU --> install in $(datadir)
2019 dnl Catalog extension: .mo after installation, .gmo in source tree
2020 dnl 2) GNU gettext has been found in the system's C library.
2021 dnl Catalog format: GNU --> install in $(datadir)
2022 dnl Catalog extension: .mo after installation, .gmo in source tree
2023 dnl 3) No internationalization, always use English msgid.
2024 dnl Catalog format: none
2025 dnl Catalog extension: none
2026 dnl The use of .gmo is historical (it was needed to avoid overwriting the
2027 dnl GNU format catalogs when building on a platform with an X/Open gettext),
2028 dnl but we keep it in order not to force irrelevant filename changes on the
2031 AC_DEFUN([AM_WITH_NLS],
2032 [AC_MSG_CHECKING([whether NLS is requested])
2033 dnl Default is enabled NLS
2035 [ --disable-nls do not use Native Language Support],
2036 USE_NLS=$enableval, USE_NLS=yes)
2037 AC_MSG_RESULT($USE_NLS)
2040 BUILD_INCLUDED_LIBINTL=no
2041 USE_INCLUDED_LIBINTL=no
2044 dnl If we use NLS figure out what method
2045 if test "$USE_NLS" = "yes"; then
2046 AC_DEFINE(ENABLE_NLS, 1,
2047 [Define to 1 if translation of program messages to the user's native language
2049 AC_MSG_CHECKING([whether included gettext is requested])
2050 AC_ARG_WITH(included-gettext,
2051 [ --with-included-gettext use the GNU gettext library included here],
2052 nls_cv_force_use_gnu_gettext=$withval,
2053 nls_cv_force_use_gnu_gettext=no)
2054 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
2056 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
2057 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
2058 dnl User does not insist on using GNU NLS library. Figure out what
2059 dnl to use. If GNU gettext is available we use this. Else we have
2060 dnl to fall back to GNU NLS library.
2063 dnl Add a version number to the cache macros.
2064 define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
2065 define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
2067 AC_CHECK_HEADER(libintl.h,
2068 [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
2069 [AC_TRY_LINK([#include <libintl.h>
2070 extern int _nl_msg_cat_cntr;],
2071 [bindtextdomain ("", "");
2072 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
2073 gt_cv_func_gnugettext_libc=yes,
2074 gt_cv_func_gnugettext_libc=no)])
2076 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
2077 AC_CACHE_CHECK([for GNU gettext in libintl],
2078 gt_cv_func_gnugettext_libintl,
2079 [gt_save_LIBS="$LIBS"
2080 LIBS="$LIBS -lintl $LIBICONV"
2081 AC_TRY_LINK([#include <libintl.h>
2082 extern int _nl_msg_cat_cntr;],
2083 [bindtextdomain ("", "");
2084 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
2085 gt_cv_func_gnugettext_libintl=yes,
2086 gt_cv_func_gnugettext_libintl=no)
2087 LIBS="$gt_save_LIBS"])
2090 dnl If an already present or preinstalled GNU gettext() is found,
2091 dnl use it. But if this macro is used in GNU gettext, and GNU
2092 dnl gettext is already preinstalled in libintl, we update this
2093 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
2094 if test "$gt_cv_func_gnugettext_libc" = "yes" \
2095 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
2096 && test "$PACKAGE" != gettext; }; then
2097 AC_DEFINE(HAVE_GETTEXT, 1,
2098 [Define if the GNU gettext() function is already present or preinstalled.])
2100 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
2101 dnl If iconv() is in a separate libiconv library, then anyone
2102 dnl linking with libintl{.a,.so} also needs to link with
2104 INTLLIBS="-lintl $LIBICONV"
2107 gt_save_LIBS="$LIBS"
2108 LIBS="$LIBS $INTLLIBS"
2109 AC_CHECK_FUNCS(dcgettext)
2110 LIBS="$gt_save_LIBS"
2112 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2113 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
2114 if test "$MSGFMT" != "no"; then
2115 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2118 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2119 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
2125 if test "$CATOBJEXT" = "NONE"; then
2126 dnl GNU gettext is not found in the C library.
2127 dnl Fall back on GNU gettext library.
2128 nls_cv_use_gnu_gettext=yes
2132 if test "$nls_cv_use_gnu_gettext" = "yes"; then
2133 dnl Mark actions used to generate GNU NLS library.
2134 INTLOBJS="\$(GETTOBJS)"
2135 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2136 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
2137 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2138 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2139 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
2141 BUILD_INCLUDED_LIBINTL=yes
2142 USE_INCLUDED_LIBINTL=yes
2144 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
2145 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
2148 dnl Test whether we really found GNU xgettext.
2149 if test "$XGETTEXT" != ":"; then
2150 dnl If it is no GNU xgettext we define it as : so that the
2151 dnl Makefiles still can work.
2152 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
2156 [found xgettext program is not GNU xgettext; ignore it])
2161 dnl We need to process the po/ directory.
2165 [for ac_file in $CONFIG_FILES; do
2166 # Support "outfile[:infile[:infile...]]"
2168 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2170 # PO directories have a Makefile.in generated from Makefile.in.in.
2171 case "$ac_file" in */Makefile.in)
2172 # Adjust a relative srcdir.
2173 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2174 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2175 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2176 case "$ac_given_srcdir" in
2177 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2178 /*) top_srcdir="$ac_given_srcdir" ;;
2179 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2181 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
2182 rm -f "$ac_dir/POTFILES"
2183 echo creating "$ac_dir/POTFILES"
2184 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
2185 echo creating "$ac_dir/Makefile"
2186 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
2193 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
2194 dnl to 'yes' because some of the testsuite requires it.
2195 if test "$PACKAGE" = gettext; then
2196 BUILD_INCLUDED_LIBINTL=yes
2199 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
2200 dnl because plural.y uses bison specific features. It requires at least
2201 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
2203 dnl bison is only needed for the maintainer (who touches plural.y). But in
2204 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
2205 dnl the rule in general Makefile. Now, some people carelessly touch the
2206 dnl files or have a broken "make" program, hence the plural.c rule will
2207 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
2208 dnl present or too old.
2209 AC_CHECK_PROGS([INTLBISON], [bison])
2210 if test -z "$INTLBISON"; then
2213 dnl Found it, now check the version.
2214 AC_MSG_CHECKING([version of bison])
2215 changequote(<<,>>)dnl
2216 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'`
2217 case $ac_prog_version in
2218 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
2219 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
2221 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
2222 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
2224 AC_MSG_RESULT([$ac_prog_version])
2226 if test $ac_verc_fail = yes; then
2230 dnl These rules are solely for the distribution goal. While doing this
2231 dnl we only have to keep exactly one list of the available catalogs
2232 dnl in configure.in.
2233 for lang in $ALL_LINGUAS; do
2234 GMOFILES="$GMOFILES $lang.gmo"
2235 POFILES="$POFILES $lang.po"
2238 dnl Make all variables we use known to autoconf.
2239 AC_SUBST(BUILD_INCLUDED_LIBINTL)
2240 AC_SUBST(USE_INCLUDED_LIBINTL)
2249 dnl For backward compatibility. Some configure.ins may be using this.
2251 nls_cv_header_libgt=
2253 dnl For backward compatibility. Some Makefiles may be using this.
2255 AC_SUBST(DATADIRNAME)
2257 dnl For backward compatibility. Some Makefiles may be using this.
2259 AC_SUBST(INSTOBJEXT)
2261 dnl For backward compatibility. Some Makefiles may be using this.
2266 dnl Usage: Just like AM_WITH_NLS, which see.
2267 AC_DEFUN([AM_GNU_GETTEXT],
2268 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2269 AC_REQUIRE([AC_PROG_CC])dnl
2270 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2271 AC_REQUIRE([AC_PROG_RANLIB])dnl
2272 AC_REQUIRE([AC_ISC_POSIX])dnl
2273 AC_REQUIRE([AC_HEADER_STDC])dnl
2274 AC_REQUIRE([AC_C_CONST])dnl
2275 AC_REQUIRE([AC_C_INLINE])dnl
2276 AC_REQUIRE([AC_TYPE_OFF_T])dnl
2277 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
2278 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
2279 AC_REQUIRE([AC_FUNC_MMAP])dnl
2280 AC_REQUIRE([jm_GLIBC21])dnl
2282 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
2283 stdlib.h string.h unistd.h sys/param.h])
2284 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
2285 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
2286 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
2291 AM_WITH_NLS([$1],[$2],[$3])
2293 if test "x$CATOBJEXT" != "x"; then
2294 if test "x$ALL_LINGUAS" = "x"; then
2297 AC_MSG_CHECKING(for catalogs to be installed)
2299 for presentlang in $ALL_LINGUAS; do
2301 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
2302 # Use the presentlang catalog if desiredlang is
2303 # a. equal to presentlang, or
2304 # b. a variant of presentlang (because in this case,
2305 # presentlang can be used as a fallback for messages
2306 # which are not translated in the desiredlang catalog).
2307 case "$desiredlang" in
2308 "$presentlang"*) useit=yes;;
2311 if test $useit = yes; then
2312 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
2315 LINGUAS=$NEW_LINGUAS
2316 AC_MSG_RESULT($LINGUAS)
2319 dnl Construct list of names of catalog files to be constructed.
2320 if test -n "$LINGUAS"; then
2321 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
2325 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
2326 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
2327 dnl Try to locate is.
2329 if test -n "$ac_aux_dir"; then
2330 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
2332 if test -z "$MKINSTALLDIRS"; then
2333 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
2335 AC_SUBST(MKINSTALLDIRS)
2337 dnl Enable libtool support if the surrounding package wishes it.
2338 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
2339 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
2342 # Search path for a program which passes the given test.
2343 # Ulrich Drepper <drepper@cygnus.com>, 1996.
2345 # This file can be copied and used freely without restrictions. It can
2346 # be used in projects which are not available under the GNU Public License
2347 # but which still want to provide support for the GNU gettext functionality.
2348 # Please note that the actual code is *not* freely available.
2352 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2353 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2354 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2355 [# Extract the first word of "$2", so it can be a program name with args.
2356 set dummy $2; ac_word=[$]2
2357 AC_MSG_CHECKING([for $ac_word])
2358 AC_CACHE_VAL(ac_cv_path_$1,
2361 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2364 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2365 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2366 test -z "$ac_dir" && ac_dir=.
2367 if test -f $ac_dir/$ac_word; then
2369 ac_cv_path_$1="$ac_dir/$ac_word"
2375 dnl If no 4th arg is given, leave the cache variable unset,
2376 dnl so AC_PATH_PROGS will keep looking.
2377 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2382 if test -n "[$]$1"; then
2383 AC_MSG_RESULT([$]$1)
2392 # Test for the GNU C Library, version 2.1 or newer.
2393 # From Bruno Haible.
2395 AC_DEFUN([jm_GLIBC21],
2397 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
2398 ac_cv_gnu_library_2_1,
2399 [AC_EGREP_CPP([Lucky GNU user],
2401 #include <features.h>
2402 #ifdef __GNU_LIBRARY__
2403 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
2408 ac_cv_gnu_library_2_1=yes,
2409 ac_cv_gnu_library_2_1=no)
2413 GLIBC21="$ac_cv_gnu_library_2_1"
2419 dnl From Bruno Haible.
2421 AC_DEFUN([AM_ICONV],
2423 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2424 dnl those with the standalone portable GNU libiconv installed).
2426 AC_ARG_WITH([libiconv-prefix],
2427 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
2428 for dir in `echo "$withval" | tr : ' '`; do
2429 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
2430 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
2434 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2435 am_cv_func_iconv="no, consider installing GNU libiconv"
2437 AC_TRY_LINK([#include <stdlib.h>
2438 #include <iconv.h>],
2439 [iconv_t cd = iconv_open("","");
2440 iconv(cd,NULL,NULL,NULL,NULL);
2442 am_cv_func_iconv=yes)
2443 if test "$am_cv_func_iconv" != yes; then
2444 am_save_LIBS="$LIBS"
2445 LIBS="$LIBS -liconv"
2446 AC_TRY_LINK([#include <stdlib.h>
2447 #include <iconv.h>],
2448 [iconv_t cd = iconv_open("","");
2449 iconv(cd,NULL,NULL,NULL,NULL);
2452 am_cv_func_iconv=yes)
2453 LIBS="$am_save_LIBS"
2456 if test "$am_cv_func_iconv" = yes; then
2457 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2458 AC_MSG_CHECKING([for iconv declaration])
2459 AC_CACHE_VAL(am_cv_proto_iconv, [
2467 #if defined(__STDC__) || defined(__cplusplus)
2468 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2472 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2473 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
2474 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2475 AC_MSG_RESULT([$]{ac_t:-
2476 }[$]am_cv_proto_iconv)
2477 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2478 [Define as const if the declaration of iconv() needs const.])
2481 if test "$am_cv_lib_iconv" = yes; then
2489 dnl From Bruno Haible.
2491 AC_DEFUN([AM_LANGINFO_CODESET],
2493 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
2494 [AC_TRY_LINK([#include <langinfo.h>],
2495 [char* cs = nl_langinfo(CODESET);],
2496 am_cv_langinfo_codeset=yes,
2497 am_cv_langinfo_codeset=no)
2499 if test $am_cv_langinfo_codeset = yes; then
2500 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2501 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2505 # Check whether LC_MESSAGES is available in <locale.h>.
2506 # Ulrich Drepper <drepper@cygnus.com>, 1995.
2508 # This file can be copied and used freely without restrictions. It can
2509 # be used in projects which are not available under the GNU Public License
2510 # but which still want to provide support for the GNU gettext functionality.
2511 # Please note that the actual code is *not* freely available.
2515 AC_DEFUN([AM_LC_MESSAGES],
2516 [if test $ac_cv_header_locale_h = yes; then
2517 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2518 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2519 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2520 if test $am_cv_val_LC_MESSAGES = yes; then
2521 AC_DEFINE(HAVE_LC_MESSAGES, 1,
2522 [Define if your <locale.h> file defines LC_MESSAGES.])
2526 # Do all the work for Automake. This macro actually does too much --
2527 # some checks are only needed if your package does certain things.
2528 # But this isn't really a big deal.
2533 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
2535 AC_DEFUN([AM_INIT_AUTOMAKE],
2536 [AC_REQUIRE([AC_PROG_INSTALL])
2541 dnl test to see if srcdir already configured
2542 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
2543 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2546 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
2547 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
2548 AC_REQUIRE([AM_SANITY_CHECK])
2549 AC_REQUIRE([AC_ARG_PROGRAM])
2550 dnl FIXME This is truly gross.
2551 missing_dir=`cd $ac_aux_dir && pwd`
2552 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
2553 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
2554 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
2555 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
2556 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
2557 AC_REQUIRE([AC_PROG_MAKE_SET])])
2560 # Check to make sure that the build environment is sane.
2563 AC_DEFUN([AM_SANITY_CHECK],
2564 [AC_MSG_CHECKING([whether build environment is sane])
2567 echo timestamp > conftestfile
2568 # Do `set' in a subshell so we don't clobber the current shell's
2569 # arguments. Must try -L first in case configure is actually a
2570 # symlink; some systems play weird games with the mod time of symlinks
2571 # (eg FreeBSD returns the mod time of the symlink's containing
2574 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
2575 if test "[$]*" = "X"; then
2577 set X `ls -t $srcdir/configure conftestfile`
2579 if test "[$]*" != "X $srcdir/configure conftestfile" \
2580 && test "[$]*" != "X conftestfile $srcdir/configure"; then
2582 # If neither matched, then we have a broken ls. This can happen
2583 # if, for instance, CONFIG_SHELL is bash and it inherits a
2584 # broken ls alias from the environment. This has actually
2585 # happened. Such a system could not be considered "sane".
2586 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
2587 alias in your environment])
2590 test "[$]2" = conftestfile
2596 AC_MSG_ERROR([newly created file is older than distributed files!
2597 Check your system clock])
2600 AC_MSG_RESULT(yes)])
2602 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
2603 dnl The program must properly implement --version.
2604 AC_DEFUN([AM_MISSING_PROG],
2605 [AC_MSG_CHECKING(for working $2)
2606 # Run test in a subshell; some versions of sh will print an error if
2607 # an executable is not found, even if stderr is redirected.
2608 # Redirect stdin to placate older versions of autoconf. Sigh.
2609 if ($2 --version) < /dev/null > /dev/null 2>&1; then
2611 AC_MSG_RESULT(found)
2614 AC_MSG_RESULT(missing)
2618 # Like AC_CONFIG_HEADER, but automatically create stamp file.
2620 AC_DEFUN([AM_CONFIG_HEADER],
2622 AC_CONFIG_HEADER([$1])
2623 dnl When config.status generates a header, we must update the stamp-h file.
2624 dnl This file resides in the same directory as the config header
2625 dnl that is generated. We must strip everything past the first ":",
2626 dnl and everything past the last "/".
2627 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
2628 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
2629 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
2631 for am_file in <<$1>>; do
2632 case " <<$>>CONFIG_HEADERS " in
2633 *" <<$>>am_file "*<<)>>
2634 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
2637 am_indx=`expr "<<$>>am_indx" + 1`