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(..)])
65 # Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.50+, can also
66 # be 'cp -p' if linking isn't available.
67 #ac_cv_prog_LN_S='cp -p'
70 # We use these options to decide which functions to include.
71 AC_ARG_WITH(target-subdir,
72 [ --with-target-subdir=SUBDIR
73 configuring in a subdirectory])
74 AC_ARG_WITH(cross-host,
75 [ --with-cross-host=HOST configuring with a cross compiler])
77 glibcpp_basedir=$srcdir/$toprel/$1/libstdc++-v3
78 AC_SUBST(glibcpp_basedir)
80 # Never versions of autoconf add an underscore to these functions.
81 # Prevent future problems ...
82 ifdef([AC_PROG_CC_G],[],[define([AC_PROG_CC_G],defn([_AC_PROG_CC_G]))])
83 ifdef([AC_PROG_CC_GNU],[],[define([AC_PROG_CC_GNU],defn([_AC_PROG_CC_GNU]))])
84 ifdef([AC_PROG_CXX_G],[],[define([AC_PROG_CXX_G],defn([_AC_PROG_CXX_G]))])
85 ifdef([AC_PROG_CXX_GNU],[],[define([AC_PROG_CXX_GNU],defn([_AC_PROG_CXX_GNU]))])
89 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
90 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
91 # are probably using a cross compiler, which will not be able to fully
92 # link an executable. This should really be fixed in autoconf
95 AC_DEFUN(LIB_AC_PROG_CC,
96 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
97 dnl Fool anybody using AC_PROG_CC.
98 AC_PROVIDE([AC_PROG_CC])
99 AC_CHECK_PROG(CC, gcc, gcc)
100 if test -z "$CC"; then
101 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
102 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
107 if test $ac_cv_prog_gcc = yes; then
109 dnl Check whether -g works, even if CFLAGS is set, in case the package
110 dnl plays around with CFLAGS (such as to build both debugging and
111 dnl normal versions of a library), tasteless as that idea is.
112 ac_test_CFLAGS="${CFLAGS+set}"
113 ac_save_CFLAGS="$CFLAGS"
116 if test "$ac_test_CFLAGS" = set; then
117 CFLAGS="$ac_save_CFLAGS"
118 elif test $ac_cv_prog_cc_g = yes; then
125 test "${CFLAGS+set}" = set || CFLAGS="-g"
131 # Can't just call these here as g++ requires libstc++ to be built....
134 # Likewise for AC_PROG_CXX.
135 AC_DEFUN(LIB_AC_PROG_CXX,
136 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
137 dnl Fool anybody using AC_PROG_CXX.
138 AC_PROVIDE([AC_PROG_CXX])
139 # Use glibcpp_CXX so that we do not cause CXX to be cached with the
140 # flags that come in CXX while configuring libstdc++. They're different
141 # from those used for all other target libraries. If CXX is set in
142 # the environment, respect that here.
144 AC_CHECK_PROGS(glibcpp_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
145 AC_SUBST(glibcpp_CXX)
147 test -z "$glibcpp_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
151 if test $ac_cv_prog_gxx = yes; then
153 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
154 dnl plays around with CXXFLAGS (such as to build both debugging and
155 dnl normal versions of a library), tasteless as that idea is.
156 ac_test_CXXFLAGS="${CXXFLAGS+set}"
157 ac_save_CXXFLAGS="$CXXFLAGS"
160 if test "$ac_test_CXXFLAGS" = set; then
161 CXXFLAGS="$ac_save_CXXFLAGS"
162 elif test $ac_cv_prog_cxx_g = yes; then
169 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
175 # For some reason, gettext needs this.
178 AC_CHECK_TOOL(AS, as)
179 AC_CHECK_TOOL(AR, ar)
180 AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
185 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
186 # at least currently, we never actually build a program, so we never
187 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
188 # fails, because we are probably configuring with a cross compiler
189 # which can't create executables. So we include AC_EXEEXT to keep
190 # automake happy, but we don't execute it, since we don't care about
193 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
194 # to nothing, so nothing would remain between `then' and `fi' if it
195 # were not for the `:' below.
200 . [$]{glibcpp_basedir}/configure.host
202 case [$]{glibcpp_basedir} in
203 /* | [A-Za-z]:[\\/]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
204 *) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
207 # This does for the target what configure.host does for the host. In
208 # addition to possibly modifying the same flags, it also sets up symlinks.
216 dnl Check to see if g++ can compile this library, and if so, if any version-
217 dnl specific precautions need to be taken.
219 dnl GLIBCPP_CHECK_COMPILER_VERSION
220 AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
221 if test ! -f stamp-sanity-compiler; then
222 AC_MSG_CHECKING([for g++ that will successfully compile libstdc++-v3])
229 ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to GCC 3.0 or above]))
231 AC_MSG_RESULT($gpp_satisfactory)
232 touch stamp-sanity-compiler
238 dnl Tests for newer compiler features, or features that are present in newer
239 dnl compiler versions but not older compiler versions still in use, should
242 dnl Define WERROR='-Werror' if requested and possible; g++'s that lack the
243 dnl new inlining code or the new system_header pragma will die on -Werror.
244 dnl Leave it out by default and use maint-mode to use it.
246 dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
247 dnl compiler supports it and the user has not requested debug mode.
249 dnl GLIBCPP_CHECK_COMPILER_FEATURES
250 AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
251 # All these tests are for C++; save the language and the compiler flags.
252 # The CXXFLAGS thing is suspicious, but based on similar bits previously
253 # found in GLIBCPP_CONFIGURE.
256 ac_test_CXXFLAGS="${CXXFLAGS+set}"
257 ac_save_CXXFLAGS="$CXXFLAGS"
259 # Check for maintainer-mode bits.
260 if test x"$USE_MAINTAINER_MODE" = xno; then
266 # Check for -ffunction-sections -fdata-sections
267 AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
268 CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
269 AC_TRY_COMPILE(, [int foo;
270 ], [ac_fdsections=yes], [ac_fdsections=no])
271 if test "$ac_test_CXXFLAGS" = set; then
272 CXXFLAGS="$ac_save_CXXFLAGS"
274 # this is the suspicious part
277 if test x"$ac_fdsections" = x"yes" &&
278 test x"$enable_debug" = x"no"; then
279 SECTION_FLAGS='-ffunction-sections -fdata-sections'
281 AC_MSG_RESULT($ac_fdsections)
285 AC_SUBST(SECTION_FLAGS)
290 dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
291 dnl the native linker is in use, all variables will be defined to something
292 dnl safe (like an empty string).
294 dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible.
295 dnl Define OPT_LDFLAGS='-Wl,-O1' if possible.
296 dnl Define LD, with_gnu_ld, and (possibly) glibcpp_gnu_ld_version as
297 dnl side-effects of testing.
299 dnl GLIBCPP_CHECK_LINKER_FEATURES
300 AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
301 # If we're not using GNU ld, then there's no point in even trying these
302 # tests. Check for that first. We should have already tested for gld
303 # by now (in libtool), but require it now just to be safe...
304 test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
305 test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
306 AC_REQUIRE([AC_PROG_LD])
308 # The name set by libtool depends on the version of libtool. Shame on us
309 # for depending on an impl detail, but c'est la vie. Older versions used
310 # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
311 # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
312 # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
313 # set (hence we're using an older libtool), then set it.
314 if test x${with_gnu_ld+set} != xset; then
315 if test x${ac_cv_prog_gnu_ld+set} != xset; then
316 # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
319 with_gnu_ld=$ac_cv_prog_gnu_ld
323 # Start by getting the version number. I think the libtool test already
324 # does some of this, but throws away the result.
326 ldver=`$LD --version 2>/dev/null | head -1 | \
327 sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
329 glibcpp_gnu_ld_version=`echo $ldver | \
330 $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
333 if test "$with_gnu_ld" = "notbroken"; then
334 # GNU ld it is! Joy and bunny rabbits!
336 # All these tests are for C++; save the language and the compiler flags.
337 # Need to do this so that g++ won't try to link in libstdc++
338 ac_test_CFLAGS="${CFLAGS+set}"
339 ac_save_CFLAGS="$CFLAGS"
340 CFLAGS='-x c++ -Wl,--gc-sections'
342 # Check for -Wl,--gc-sections
343 # XXX This test is broken at the moment, as symbols required for
344 # linking are now in libsupc++ (not built yet.....). In addition,
345 # this test has cored on solaris in the past. In addition,
346 # --gc-sections doesn't really work at the moment (keeps on discarding
347 # used sections, first .eh_frame and now some of the glibc sections for
348 # iconv). Bzzzzt. Thanks for playing, maybe next time.
349 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
357 ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
358 if test "$ac_test_CFLAGS" = set; then
359 CFLAGS="$ac_save_CFLAGS"
361 # this is the suspicious part
364 if test "$ac_sectionLDflags" = "yes"; then
365 SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
367 AC_MSG_RESULT($ac_sectionLDflags)
370 # Set linker optimization flags.
371 if test x"$with_gnu_ld" = x"yes" &&
372 test x"$enable_debug" = x"no"; then
373 OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
376 AC_SUBST(SECTION_LDFLAGS)
377 AC_SUBST(OPT_LDFLAGS)
382 dnl Check to see if the (math function) argument passed is
383 dnl declared when using the c++ compiler
384 dnl ASSUMES argument is a math function with ONE parameter
386 dnl GLIBCPP_CHECK_MATH_DECL_1
387 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_1, [
388 AC_MSG_CHECKING([for $1 declaration])
389 if test x${glibcpp_cv_func_$1_use+set} != xset; then
390 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
393 AC_TRY_COMPILE([#include <math.h>
399 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
403 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
407 dnl Check to see if the (math function) argument passed is
408 dnl 1) declared when using the c++ compiler
409 dnl 2) has "C" linkage
410 dnl 3) if not, see if 1) and 2) for argument prepended with '_'
412 dnl Define HAVE_CARGF etc if "cargf" is declared and links
414 dnl argument 1 is name of function to check
416 dnl ASSUMES argument is a math function with ONE parameter
418 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1
419 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
420 GLIBCPP_CHECK_MATH_DECL_1($1)
421 if test x$glibcpp_cv_func_$1_use = x"yes"; then
424 GLIBCPP_CHECK_MATH_DECL_1(_$1)
425 if test x$glibcpp_cv_func__$1_use = x"yes"; then
433 dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
434 dnl of functions at once. It's an all-or-nothing check -- either
435 dnl HAVE_XYZ is defined for each of the functions, or for none of them.
436 dnl Doing it this way saves significant configure time.
437 AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
438 AC_MSG_CHECKING([for $1 functions])
439 AC_CACHE_VAL(glibcpp_cv_func_$2_use, [
442 AC_TRY_COMPILE([#include <math.h>],
443 [ `for x in $3; do echo "$x (0);"; done` ],
444 [glibcpp_cv_func_$2_use=yes],
445 [glibcpp_cv_func_$2_use=no])
447 AC_MSG_RESULT($glibcpp_cv_func_$2_use)
448 if test x$glibcpp_cv_func_$2_use = x"yes"; then
454 dnl Check to see if the (math function) argument passed is
455 dnl declared when using the c++ compiler
456 dnl ASSUMES argument is a math function with TWO parameters
458 dnl GLIBCPP_CHECK_MATH_DECL_2
459 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_2, [
460 AC_MSG_CHECKING([for $1 declaration])
461 if test x${glibcpp_cv_func_$1_use+set} != xset; then
462 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
465 AC_TRY_COMPILE([#include <math.h>],
467 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
471 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
475 dnl Check to see if the (math function) argument passed is
476 dnl 1) declared when using the c++ compiler
477 dnl 2) has "C" linkage
479 dnl Define HAVE_CARGF etc if "cargf" is declared and links
481 dnl argument 1 is name of function to check
483 dnl ASSUMES argument is a math function with TWO parameters
485 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2
486 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
487 GLIBCPP_CHECK_MATH_DECL_2($1)
488 if test x$glibcpp_cv_func_$1_use = x"yes"; then
491 GLIBCPP_CHECK_MATH_DECL_2(_$1)
492 if test x$glibcpp_cv_func__$1_use = x"yes"; then
500 dnl Check to see if the (math function) argument passed is
501 dnl declared when using the c++ compiler
502 dnl ASSUMES argument is a math function with THREE parameters
504 dnl GLIBCPP_CHECK_MATH_DECL_3
505 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_3, [
506 AC_MSG_CHECKING([for $1 declaration])
507 if test x${glibcpp_cv_func_$1_use+set} != xset; then
508 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
511 AC_TRY_COMPILE([#include <math.h>],
513 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
517 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
521 dnl Check to see if the (math function) argument passed is
522 dnl 1) declared when using the c++ compiler
523 dnl 2) has "C" linkage
525 dnl Define HAVE_CARGF etc if "cargf" is declared and links
527 dnl argument 1 is name of function to check
529 dnl ASSUMES argument is a math function with THREE parameters
531 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3
532 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
533 GLIBCPP_CHECK_MATH_DECL_3($1)
534 if test x$glibcpp_cv_func_$1_use = x"yes"; then
537 GLIBCPP_CHECK_MATH_DECL_3(_$1)
538 if test x$glibcpp_cv_func__$1_use = x"yes"; then
546 dnl Check to see if the (stdlib function) argument passed is
547 dnl 1) declared when using the c++ compiler
548 dnl 2) has "C" linkage
550 dnl argument 1 is name of function to check
552 dnl ASSUMES argument is a math function with TWO parameters
554 dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2
555 AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
556 AC_MSG_CHECKING([for $1 declaration])
557 if test x${glibcpp_cv_func_$1_use+set} != xset; then
558 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
561 AC_TRY_COMPILE([#include <stdlib.h>],
563 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
567 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
568 if test x$glibcpp_cv_func_$1_use = x"yes"; then
575 dnl Because the builtins are picky picky picky about the arguments they take,
576 dnl do an explict linkage tests here.
577 dnl Check to see if the (math function) argument passed is
578 dnl 1) declared when using the c++ compiler
579 dnl 2) has "C" linkage
581 dnl Define HAVE_CARGF etc if "cargf" is declared and links
583 dnl argument 1 is name of function to check
585 dnl ASSUMES argument is a math function with ONE parameter
587 dnl GLIBCPP_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
588 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
589 AC_MSG_CHECKING([for $1 declaration])
590 if test x${glibcpp_cv_func_$1_use+set} != xset; then
591 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
594 AC_TRY_COMPILE([#include <math.h>],
596 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
600 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
601 if test x$glibcpp_cv_func_$1_use = x"yes"; then
602 AC_MSG_CHECKING([for $1 linkage])
603 if test x${glibcpp_cv_func_$1_link+set} != xset; then
604 AC_CACHE_VAL(glibcpp_cv_func_$1_link, [
605 AC_TRY_LINK([#include <math.h>],
607 [glibcpp_cv_func_$1_link=yes], [glibcpp_cv_func_$1_link=no])
610 AC_MSG_RESULT($glibcpp_cv_func_$1_link)
611 if test x$glibcpp_cv_func_$1_link = x"yes"; then
612 ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
613 AC_DEFINE_UNQUOTED(${ac_tr_func})
620 dnl Check to see what builtin math functions are supported
622 dnl check for __builtin_abs
623 dnl check for __builtin_fabsf
624 dnl check for __builtin_fabs
625 dnl check for __builtin_fabl
626 dnl check for __builtin_labs
627 dnl check for __builtin_sqrtf
628 dnl check for __builtin_sqrtl
629 dnl check for __builtin_sqrt
630 dnl check for __builtin_sinf
631 dnl check for __builtin_sin
632 dnl check for __builtin_sinl
633 dnl check for __builtin_cosf
634 dnl check for __builtin_cos
635 dnl check for __builtin_cosl
637 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
638 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
639 dnl Test for builtin math functions.
640 dnl These are made in gcc/c-common.c
641 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
642 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
643 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
644 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
645 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
647 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
648 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt)
649 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
651 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
652 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
653 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
655 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
656 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
657 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
659 dnl There is, without a doubt, a more elegant way to have these
660 dnl names exported so that they won't be stripped out of acconfig.h by
661 dnl autoheader. I leave this as an exercise to somebody less frustrated
662 dnl than I.... please email the libstdc++ list if you can figure out a
663 dnl more elegant approach (see autoconf/acgen.m4 and specifically
664 dnl AC_CHECK_FUNC for things to steal.)
666 if test x$dummyvar = x"yes"; then
667 AC_DEFINE(HAVE___BUILTIN_ABS)
668 AC_DEFINE(HAVE___BUILTIN_LABS)
669 AC_DEFINE(HAVE___BUILTIN_COS)
670 AC_DEFINE(HAVE___BUILTIN_COSF)
671 AC_DEFINE(HAVE___BUILTIN_COSL)
672 AC_DEFINE(HAVE___BUILTIN_FABS)
673 AC_DEFINE(HAVE___BUILTIN_FABSF)
674 AC_DEFINE(HAVE___BUILTIN_FABSL)
675 AC_DEFINE(HAVE___BUILTIN_SIN)
676 AC_DEFINE(HAVE___BUILTIN_SINF)
677 AC_DEFINE(HAVE___BUILTIN_SINL)
678 AC_DEFINE(HAVE___BUILTIN_SQRT)
679 AC_DEFINE(HAVE___BUILTIN_SQRTF)
680 AC_DEFINE(HAVE___BUILTIN_SQRTL)
686 dnl Check to see what the underlying c library
687 dnl These checks need to do two things:
688 dnl 1) make sure the name is declared when using the c++ compiler
689 dnl 2) make sure the name has "C" linkage
690 dnl This might seem like overkill but experience has shown that it's not...
692 dnl Define HAVE_STRTOLD if "strtold" is declared and links
693 dnl Define HAVE_STRTOF if "strtof" is declared and links
694 dnl Define HAVE_DRAND48 if "drand48" is declared and links
696 dnl GLIBCPP_CHECK_STDLIB_SUPPORT
697 AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
698 ac_test_CXXFLAGS="${CXXFLAGS+set}"
699 ac_save_CXXFLAGS="$CXXFLAGS"
700 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
702 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
703 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)
704 AC_CHECK_FUNCS(drand48)
706 CXXFLAGS="$ac_save_CXXFLAGS"
711 dnl Check to see what the underlying c library or math library is like.
712 dnl These checks need to do two things:
713 dnl 1) make sure the name is declared when using the c++ compiler
714 dnl 2) make sure the name has "C" linkage
715 dnl This might seem like overkill but experience has shown that it's not...
717 dnl Define HAVE_CARGF etc if "cargf" is found.
719 dnl GLIBCPP_CHECK_MATH_SUPPORT
720 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
721 ac_test_CXXFLAGS="${CXXFLAGS+set}"
722 ac_save_CXXFLAGS="$CXXFLAGS"
723 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
726 AC_CHECK_LIB(m, sin, libm="-lm")
730 dnl Check to see if certain C math functions exist.
731 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
732 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
733 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
734 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
735 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
736 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
737 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
738 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypot)
740 dnl Check to see if basic C math functions have float versions.
741 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
746 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
749 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
750 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
751 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
752 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
753 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
754 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
755 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf)
756 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
757 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
758 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
759 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
760 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
761 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
762 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
763 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
765 dnl Check to see if basic C math functions have long double versions.
766 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
771 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
774 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
775 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
776 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
777 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
778 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
779 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
780 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
781 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
782 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl)
783 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
784 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
785 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
786 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
787 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
788 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
789 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
790 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
792 dnl Some runtimes have these functions with a preceding underscore. Please
793 dnl keep this sync'd with the one above. And if you add any new symbol,
794 dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
795 dnl Check to see if certain C math functions exist.
797 dnl Check to see if basic C math functions have float versions.
798 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
800 _acosf _asinf _atanf \
802 _coshf _sinhf _tanhf)
803 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
807 dnl Check to see if basic C math functions have long double versions.
808 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
810 _acosl _asinl _atanl \
812 _coshl _sinhl _tanhl)
813 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
818 CXXFLAGS="$ac_save_CXXFLAGS"
823 dnl Check to see if there is native support for complex
825 dnl Don't compile bits in math/* if native support exits.
827 dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
829 dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
830 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
831 dnl Check for complex versions of math functions of platform.
832 AC_CHECK_LIB(m, main)
833 AC_REPLACE_MATHFUNCS(nan copysignf)
835 dnl Compile the long double complex functions only if the function
836 dnl provides the non-complex long double functions that are needed.
837 dnl Currently this includes copysignl, which should be
838 dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
839 USE_COMPLEX_LONG_DOUBLE=no
840 if test x$ac_cv_func_copysignl = x"yes"; then
841 USE_COMPLEX_LONG_DOUBLE=yes
842 AC_REPLACE_MATHFUNCS(signbitl)
845 AC_SUBST(USE_COMPLEX_LONG_DOUBLE)
849 dnl Check to see what architecture and operating system we are compiling
850 dnl for. Also, if architecture- or OS-specific flags are required for
851 dnl compilation, pick them up here.
853 dnl GLIBCPP_CHECK_TARGET
854 AC_DEFUN(GLIBCPP_CHECK_TARGET, [
855 . [$]{glibcpp_basedir}/configure.target
856 AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
857 AC_MSG_RESULT(OS config directory is $os_include_dir)
862 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
863 dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
864 dnl must have been previously checked.)
866 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
867 dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
869 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
870 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
872 dnl Test wchar.h for mbstate_t, which is needed for char_traits and
873 dnl others even if wchar_t support is not on.
874 AC_MSG_CHECKING([for mbstate_t])
875 AC_TRY_COMPILE([#include <wchar.h>],
876 [mbstate_t teststate;],
877 have_mbstate_t=yes, have_mbstate_t=no)
878 AC_MSG_RESULT($have_mbstate_t)
879 if test x"$have_mbstate_t" = xyes; then
880 AC_DEFINE(HAVE_MBSTATE_T)
883 dnl Sanity check for existence of ISO C99 headers for extended encoding.
884 AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
885 AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
887 dnl Only continue checking if the ISO C99 headers exist and support is on.
888 if test x"$ac_has_wchar_h" = xyes &&
889 test x"$ac_has_wctype_h" = xyes &&
890 test x"$enable_c_mbchar" != xno; then
892 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
893 dnl numeric_limits can instantiate type_traits<wchar_t>
894 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
895 AC_TRY_COMPILE([#include <wchar.h>],
896 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
897 has_wchar_minmax=yes, has_wchar_minmax=no)
898 AC_MSG_RESULT($has_wchar_minmax)
900 dnl Test wchar.h for WEOF, which is what we use to determine whether
901 dnl to specialize for char_traits<wchar_t> or not.
902 AC_MSG_CHECKING([for WEOF])
905 #include <stddef.h>],
907 has_weof=yes, has_weof=no)
908 AC_MSG_RESULT($has_weof)
910 dnl Tests for wide character functions used in char_traits<wchar_t>.
912 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
915 dnl Checks for names injected into std:: by the c_std headers.
916 AC_CHECK_FUNCS(btowc wctob fgetwc fgetwc fgetws fputwc fputws fwide \
917 fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
918 vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
919 mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
920 wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
921 wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr,, \
924 AC_MSG_CHECKING([for ISO C99 wchar_t support])
925 if test x"$has_weof" = xyes &&
926 test x"$has_wchar_minmax" = xyes &&
927 test x"$ac_wfuncs" = xyes; then
928 ac_isoC99_wchar_t=yes
932 AC_MSG_RESULT($ac_isoC99_wchar_t)
934 dnl Use iconv for wchar_t to char conversions. As such, check for
935 dnl X/Open Portability Guide, version 2 features (XPG2).
936 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
937 AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
939 dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
940 AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
942 LIBS="$LIBS $libiconv"
944 AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
945 ac_XPG2funcs=yes, ac_XPG2funcs=no)
949 AC_MSG_CHECKING([for XPG2 wchar_t support])
950 if test x"$ac_has_iconv_h" = xyes &&
951 test x"$ac_has_langinfo_h" = xyes &&
952 test x"$ac_XPG2funcs" = xyes; then
957 AC_MSG_RESULT($ac_XPG2_wchar_t)
959 dnl At the moment, only enable wchar_t specializations if all the
960 dnl above support is present.
961 AC_MSG_CHECKING([for enabled wchar_t specializations])
962 if test x"$ac_isoC99_wchar_t" = xyes &&
963 test x"$ac_XPG2_wchar_t" = xyes; then
964 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
970 dnl Wide characters disabled by the user.
971 AC_MSG_WARN([wchar_t support disabled.])
977 dnl Check for special debugging mode; not for production use.
979 dnl GLIBCPP_ENABLE_DEBUG
980 dnl --enable-debug sets '-ggdb3 -O0'.
981 dnl --disable-debug sets '-g' and whatever optimization options the
982 dnl compiler can handle.
983 dnl + --enable-maintainer-mode automatically defaults this to on.
984 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
985 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
986 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
987 dnl defaults to `no'.
988 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
989 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
991 changequote(<<, >>)dnl
992 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
994 [case "${enableval}" in
995 yes) enable_debug=yes ;;
996 no) enable_debug=no ;;
997 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
999 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
1001 dnl Option parsed, now set things appropriately
1002 case "${enable_debug}" in
1004 DEBUG_FLAGS='-O0 -ggdb3'
1010 AC_SUBST(DEBUG_FLAGS)
1015 dnl Check for "unusual" flags to pass to the compiler while building.
1017 dnl GLIBCPP_ENABLE_CXX_FLAGS
1018 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
1019 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
1020 dnl Somehow this same set of flags must be passed when [re]building
1022 dnl --disable-cxx-flags passes nothing.
1023 dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
1024 dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
1025 dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
1026 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
1027 dnl If "default flags" is an empty string (or "none"), the effect is
1028 dnl the same as --disable or --enable=no.
1029 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
1030 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1031 AC_ARG_ENABLE(cxx-flags,
1032 changequote(<<, >>)dnl
1033 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
1034 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
1035 changequote([, ])dnl
1036 [case "x$enableval" in
1038 AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
1040 enable_cxx_flags='' ;;
1042 enable_cxx_flags="$enableval" ;;
1044 enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
1046 dnl Thinko on my part during design. This kludge is the workaround.
1047 if test "$enable_cxx_flags" = "none"; then
1048 enable_cxx_flags='';
1051 dnl Run through flags (either default or command-line) and set anything
1052 dnl extra (e.g., #defines) that must accompany particular g++ options.
1053 if test -n "$enable_cxx_flags"; then
1054 for f in $enable_cxx_flags; do
1058 *) # and we're trying to pass /what/ exactly?
1059 AC_MSG_ERROR([compiler flags start with a -]) ;;
1063 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1064 AC_SUBST(EXTRA_CXX_FLAGS)
1069 dnl Check for which locale library to use: gnu or generic.
1071 dnl GLIBCPP_ENABLE_CLOCALE
1072 dnl --enable-clocale=gnu sets config/locale/c_locale_gnu.cc and friends
1073 dnl --enable-clocale=generic sets config/locale/c_locale_generic.cc and friends
1075 dnl default is generic
1077 AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
1078 AC_MSG_CHECKING([for clocale to use])
1079 AC_ARG_ENABLE(clocale,
1080 [ --enable-clocale enable model for target locale package.
1081 --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
1083 if test x$enable_clocale = xno; then
1088 enable_clocale_flag=$enable_clocale
1090 dnl Probe for locale support if no specific model is specified.
1091 dnl Default to "generic"
1092 if test x$enable_clocale_flag = xno; then
1093 case x${target_os} in
1095 AC_EGREP_CPP([_GLIBCPP_ok], [
1096 #include <features.h>
1097 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1100 ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
1102 # Test for bugs early in glibc-2.2.x series
1103 if test x$enable_clocale_flag = xgnu; then
1105 #define _GNU_SOURCE 1
1109 const char __one[] = "Äuglein Augmen";
1110 const char __two[] = "Äuglein";
1115 loc = __newlocale(1 << LC_ALL, "de_DE", 0);
1116 loc_dup = __duplocale(loc);
1117 i = __strcoll_l(__one, __two, loc);
1118 j = __strcoll_l(__one, __two, loc_dup);
1122 [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
1123 [enable_clocale_flag=generic])
1126 # ... at some point put __strxfrm_l tests in as well.
1129 enable_clocale_flag=generic
1134 dnl Set configure bits for specified locale package
1135 case x${enable_clocale_flag} in
1137 AC_MSG_RESULT(generic)
1139 # Don't use gettext.
1142 CLOCALE_H=config/locale/c_locale_generic.h
1143 CLOCALE_CC=config/locale/c_locale_generic.cc
1144 CCODECVT_H=config/locale/codecvt_specializations_generic.h
1145 CCOLLATE_CC=config/locale/collate_members_generic.cc
1146 CCTYPE_CC=config/locale/ctype_members_generic.cc
1147 CMESSAGES_H=config/locale/messages_members_generic.h
1148 CMESSAGES_CC=config/locale/messages_members_generic.cc
1149 CMONEY_CC=config/locale/moneypunct_members_generic.cc
1150 CNUMERIC_CC=config/locale/numpunct_members_generic.cc
1151 CTIME_CC=config/locale/time_members_generic.cc
1156 # Declare intention to use gettext, and add support for specific
1158 # For some reason, ALL_LINGUAS has to be before AM_GNU_GETTEXT
1160 # Don't call AM_GNU_GETTEXT here. Instead, assume glibc.
1161 # Need to deal with MSGFMT, USE_NLS, and glibcpp_[P,M]OFILES
1164 # Export the build objects.
1165 for ling in $ALL_LINGUAS; do \
1166 glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
1167 glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
1169 AC_SUBST(glibcpp_MOFILES)
1170 AC_SUBST(glibcpp_POFILES)
1172 CLOCALE_H=config/locale/c_locale_gnu.h
1173 CLOCALE_CC=config/locale/c_locale_gnu.cc
1174 CCODECVT_H=config/locale/codecvt_specializations_ieee_1003.1-200x.h
1175 CCOLLATE_CC=config/locale/collate_members_gnu.cc
1176 CCTYPE_CC=config/locale/ctype_members_gnu.cc
1177 CMESSAGES_H=config/locale/messages_members_gnu.h
1178 CMESSAGES_CC=config/locale/messages_members_gnu.cc
1179 CMONEY_CC=config/locale/moneypunct_members_gnu.cc
1180 CNUMERIC_CC=config/locale/numpunct_members_gnu.cc
1181 CTIME_CC=config/locale/time_members_gnu.cc
1184 AC_MSG_RESULT(generic)
1186 # Don't use gettext.
1189 CLOCALE_H=config/locale/c_locale_ieee_1003.1-200x.h
1190 CLOCALE_CC=config/locale/c_locale_ieee_1003.1-200x.cc
1191 CCODECVT_H=config/locale/codecvt_specializations_ieee_1003.1-200x.h
1192 CCOLLATE_CC=config/locale/collate_members_generic.cc
1193 CCTYPE_CC=config/locale/ctype_members_generic.cc
1194 CMESSAGES_H=config/locale/messages_members_ieee_1003.1-200x.h
1195 CMESSAGES_CC=config/locale/messages_members_ieee_1003.1-200x.cc
1196 CMONEY_CC=config/locale/moneypunct_members_generic.cc
1197 CNUMERIC_CC=config/locale/numpunct_members_generic.cc
1198 CTIME_CC=config/locale/time_members_generic.cc
1201 echo "$enable_clocale is an unknown locale package" 1>&2
1206 # This is where the testsuite looks for locale catalogs, using the
1207 # -DLOCALEDIR define during testsuite compilation.
1208 glibcpp_localedir=${glibcpp_builddir}/po/share/locale
1209 AC_SUBST(glibcpp_localedir)
1213 AC_SUBST(CCODECVT_H)
1214 AC_SUBST(CMESSAGES_H)
1215 AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
1216 AC_LINK_FILES($CCOLLATE_CC, src/collate.cc)
1217 AC_LINK_FILES($CCTYPE_CC, src/ctype.cc)
1218 AC_LINK_FILES($CMESSAGES_CC, src/messages.cc)
1219 AC_LINK_FILES($CMONEY_CC, src/moneypunct.cc)
1220 AC_LINK_FILES($CNUMERIC_CC, src/numpunct.cc)
1221 AC_LINK_FILES($CTIME_CC, src/time.cc)
1226 dnl Check for which I/O library to use: libio, or something specific.
1228 dnl GLIBCPP_ENABLE_CSTDIO
1229 dnl --enable-cstdio=libio sets config/io/c_io_libio.h and friends
1231 dnl default is stdio
1233 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
1234 AC_MSG_CHECKING([for cstdio to use])
1235 AC_ARG_ENABLE(cstdio,
1236 [ --enable-cstdio enable stdio for target io package.
1237 --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
1239 if test x$enable_cstdio = xno; then
1242 enable_cstdio=stdio)
1244 enable_cstdio_flag=$enable_cstdio
1246 dnl Check if a valid I/O package
1247 case x${enable_cstdio_flag} in
1249 CSTDIO_H=config/io/c_io_libio.h
1250 BASIC_FILE_H=config/io/basic_file_libio.h
1251 BASIC_FILE_CC=config/io/basic_file_libio.cc
1252 AC_MSG_RESULT(libio)
1254 # see if we are on a system with libio native (ie, linux)
1255 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
1257 # Need to check and see what version of glibc is being used. If
1258 # it's not glibc-2.2 or higher, then we'll need to go ahead and
1259 # compile most of libio for linux systems.
1260 if test x$has_libio = x"yes"; then
1263 AC_MSG_CHECKING([for glibc version >= 2.2])
1264 AC_EGREP_CPP([ok], [
1265 #include <features.h>
1266 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1269 ], glibc_satisfactory=yes, glibc_satisfactory=no)
1270 AC_MSG_RESULT($glibc_satisfactory)
1274 # XXX at the moment, admit defeat and force the recompilation
1275 # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
1276 glibc_satisfactory=no
1278 if test x$glibc_satisfactory = x"yes"; then
1283 # bkoz XXX need to add checks to enable this
1284 # pme XXX here's a first pass at such a check
1285 if test x$enable_c_mbchar != xno; then
1293 # Using libio, but <libio.h> doesn't exist on the target system. . .
1295 # bkoz XXX need to add checks to enable this
1296 # pme XXX here's a first pass at such a check
1297 if test x$enable_c_mbchar != xno; then
1304 xstdio | x | xno | xnone | xyes)
1306 CSTDIO_H=config/io/c_io_stdio.h
1307 BASIC_FILE_H=config/io/basic_file_stdio.h
1308 BASIC_FILE_CC=config/io/basic_file_stdio.cc
1309 AC_MSG_RESULT(stdio)
1311 # We're not using stdio.
1316 echo "$enable_cstdio is an unknown io package" 1>&2
1321 AC_SUBST(BASIC_FILE_H)
1322 AC_LINK_FILES($BASIC_FILE_CC, src/basic_file.cc)
1324 # 2000-08-04 bkoz hack
1325 CCODECVT_C=config/io/c_io_libio_codecvt.c
1326 AC_SUBST(CCODECVT_C)
1327 # 2000-08-04 bkoz hack
1329 AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
1330 test "$need_libio" = yes || test "$need_wlibio" = yes)
1331 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
1332 AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
1333 if test "$need_libio" = yes || test "$need_wlibio" = yes; then
1334 libio_la=../libio/libio.la
1343 dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
1344 dnl We must stage the required headers so that they will be installed
1345 dnl with the library (unlike libgcc, the STL implementation is provided
1346 dnl solely within headers). Since we must not inject random user-space
1347 dnl macro names into user-provided C++ code, we first stage into <file>-in
1348 dnl and process to <file> with an output command. The reason for a two-
1349 dnl stage process here is to correctly handle $srcdir!=$objdir without
1350 dnl having to write complex code (the sed commands to clean the macro
1351 dnl namespace are complex and fragile enough as it is). We must also
1352 dnl add a relative path so that -I- is supported properly.
1354 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
1355 AC_MSG_CHECKING([for thread model used by GCC])
1356 target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
1357 AC_MSG_RESULT([$target_thread_file])
1359 if test $target_thread_file != single; then
1360 AC_DEFINE(HAVE_GTHR_DEFAULT)
1361 AC_DEFINE(_GLIBCPP_SUPPORTS_WEAK, __GXX_WEAK__)
1364 glibcpp_thread_h=gthr-$target_thread_file.h
1365 AC_SUBST(glibcpp_thread_h)
1370 dnl Check for exception handling support. If an explicit enable/disable
1371 dnl sjlj exceptions is given, we don't have to detect. Otherwise the
1372 dnl target may or may not support call frame exceptions.
1374 dnl GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
1375 dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
1376 dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
1378 dnl Define _GLIBCPP_SJLJ_EXCEPTIONS if the compiler is configured for it.
1380 AC_DEFUN(GLIBCPP_ENABLE_SJLJ_EXCEPTIONS, [
1381 AC_MSG_CHECKING([for exception model to use])
1384 AC_ARG_ENABLE(sjlj-exceptions,
1385 [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
1387 [dnl Botheration. Now we've got to detect the exception model.
1388 dnl Link tests against libgcc.a are problematic since -- at least
1389 dnl as of this writing -- we've not been given proper -L bits for
1390 dnl single-tree newlib and libgloss.
1392 dnl This is what AC_TRY_COMPILE would do if it didn't delete the
1393 dnl conftest files before we got a change to grep them first.
1394 cat > conftest.$ac_ext << EOF
1395 [#]line __oline__ "configure"
1404 old_CXXFLAGS="$CXXFLAGS"
1406 if AC_TRY_EVAL(ac_compile); then
1407 if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
1408 enable_sjlj_exceptions=yes
1409 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
1410 enable_sjlj_exceptions=no
1413 CXXFLAGS="$old_CXXFLAGS"
1415 if test x$enable_sjlj_exceptions = xyes; then
1416 AC_DEFINE(_GLIBCPP_SJLJ_EXCEPTIONS, 1,
1417 [Define if the compiler is configured for setjmp/longjmp exceptions.])
1418 ac_exception_model_name=sjlj
1419 elif test x$enable_sjlj_exceptions = xno; then
1420 ac_exception_model_name="call frame"
1422 AC_MSG_ERROR([unable to detect exception model])
1425 AC_MSG_RESULT($ac_exception_model_name)
1430 dnl Check for ISO/IEC 9899:1999 "C99" support.
1432 dnl GLIBCPP_ENABLE_C99
1433 dnl --enable-c99 defines _GLIBCPP_USE_C99
1434 dnl --disable-c99 leaves _GLIBCPP_USE_C99 undefined
1435 dnl + Usage: GLIBCPP_ENABLE_C99[(DEFAULT)]
1436 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1437 dnl defaults to `no'.
1438 dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
1440 dnl GLIBCPP_ENABLE_C99
1441 AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
1442 define([GLIBCPP_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
1445 changequote(<<, >>)dnl
1446 <<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCPP_ENABLE_C99_DEFAULT],
1447 changequote([, ])dnl
1448 [case "$enableval" in
1449 yes) enable_c99=yes ;;
1450 no) enable_c99=no ;;
1451 *) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
1453 enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
1458 # Check for the existence of <math.h> functions used if C99 is enabled.
1460 AC_MSG_CHECKING([for ISO C99 support in <math.h>])
1461 AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
1462 AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
1463 AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
1464 AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
1465 AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
1466 AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
1467 AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
1468 AC_TRY_COMPILE([#include <math.h>],
1469 [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
1470 AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
1471 AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
1472 AC_TRY_COMPILE([#include <math.h>],
1473 [islessgreater(0.0,0.0);],, [ac_c99_math=no])
1474 AC_TRY_COMPILE([#include <math.h>],
1475 [isunordered(0.0,0.0);],, [ac_c99_math=no])
1476 AC_MSG_RESULT($ac_c99_math)
1478 # Check for the existence in <stdio.h> of vscanf, et. al.
1480 AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
1481 AC_TRY_COMPILE([#include <stdio.h>],
1482 [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
1483 AC_TRY_COMPILE([#include <stdio.h>
1485 void foo(char* fmt, ...)
1486 {va_list args; va_start(args, fmt);
1487 vfscanf(stderr, "%i", args);}],
1488 [],, [ac_c99_stdio=no])
1489 AC_TRY_COMPILE([#include <stdio.h>
1491 void foo(char* fmt, ...)
1492 {va_list args; va_start(args, fmt);
1493 vscanf("%i", args);}],
1494 [],, [ac_c99_stdio=no])
1495 AC_TRY_COMPILE([#include <stdio.h>
1497 void foo(char* fmt, ...)
1498 {va_list args; va_start(args, fmt);
1499 vsnprintf(fmt, 0, "%i", args);}],
1500 [],, [ac_c99_stdio=no])
1501 AC_TRY_COMPILE([#include <stdio.h>
1503 void foo(char* fmt, ...)
1504 {va_list args; va_start(args, fmt);
1505 vsscanf(fmt, "%i", args);}],
1506 [],, [ac_c99_stdio=no])
1507 AC_MSG_RESULT($ac_c99_stdio)
1509 # Check for the existence in <stdlib.h> of lldiv_t, et. al.
1511 AC_MSG_CHECKING([for lldiv_t declaration])
1512 AC_CACHE_VAL(ac_c99_lldiv_t, [
1513 AC_TRY_COMPILE([#include <stdlib.h>],
1515 [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
1517 AC_MSG_RESULT($ac_c99_lldiv_t)
1519 AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
1520 AC_TRY_COMPILE([#include <stdlib.h>],
1521 [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
1522 AC_TRY_COMPILE([#include <stdlib.h>],
1523 [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
1524 AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
1525 AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
1526 AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
1527 AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
1528 if test x"$ac_c99_lldiv_t" = x"no"; then
1531 AC_MSG_RESULT($ac_c99_stdlib)
1533 # Check for the existence of <wchar.h> functions used if C99 is enabled.
1534 # XXX the wchar.h checks should be rolled into the general C99 bits.
1536 AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
1537 AC_TRY_COMPILE([#include <wchar.h>],
1538 [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
1539 AC_TRY_COMPILE([#include <wchar.h>],
1540 [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
1541 AC_TRY_COMPILE([#include <wchar.h>],
1542 [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
1543 AC_MSG_RESULT($ac_c99_wchar)
1545 AC_MSG_CHECKING([for enabled ISO C99 support])
1546 if test x"$ac_c99_math" = x"no" ||
1547 test x"$ac_c99_stdio" = x"no" ||
1548 test x"$ac_c99_stdlib" = x"no" ||
1549 test x"$ac_c99_wchar" = x"no"; then
1552 AC_MSG_RESULT($enable_c99)
1554 # Option parsed, now set things appropriately
1555 if test x"$enable_c99" = x"yes"; then
1556 AC_DEFINE(_GLIBCPP_USE_C99)
1564 dnl Check for template specializations for the 'long long' type extension.
1565 dnl The result determines only whether 'long long' I/O is enabled; things
1566 dnl like numeric_limits<> specializations are always available.
1568 dnl GLIBCPP_ENABLE_LONG_LONG
1569 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
1570 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
1571 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
1572 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1573 dnl defaults to `no'.
1574 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1576 dnl GLIBCPP_ENABLE_LONG_LONG
1577 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
1578 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
1580 AC_ARG_ENABLE(long-long,
1581 changequote(<<, >>)dnl
1582 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
1583 changequote([, ])dnl
1584 [case "$enableval" in
1585 yes) enable_long_long=yes ;;
1586 no) enable_long_long=no ;;
1587 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1589 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1594 AC_MSG_CHECKING([for enabled long long I/O support])
1595 # iostreams require strtoll, strtoull to compile
1596 AC_TRY_COMPILE([#include <stdlib.h>],
1597 [char* tmp; strtoll("gnu", &tmp, 10);],,[enable_long_long=no])
1598 AC_TRY_COMPILE([#include <stdlib.h>],
1599 [char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
1601 # Option parsed, now set things appropriately
1602 if test x"$enable_long_long" = xyes; then
1603 AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1605 AC_MSG_RESULT($enable_long_long)
1612 dnl Check for what kind of C headers to use.
1614 dnl GLIBCPP_ENABLE_CHEADERS
1615 dnl --enable-cheaders= [does stuff].
1616 dnl --disable-cheaders [does not do anything, really].
1617 dnl + This will eventually need to be 'c_shadow' by default.
1618 dnl + Usage: GLIBCPP_ENABLE_CHEADERS[(DEFAULT)]
1619 dnl Where DEFAULT is either `c' or `c_std' or 'c_shadow'.
1620 dnl If ommitted, it defaults to `c_std'.
1621 AC_DEFUN(GLIBCPP_ENABLE_CHEADERS, [dnl
1622 define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
1623 AC_MSG_CHECKING([for c header strategy to use])
1624 AC_ARG_ENABLE(cheaders,
1625 changequote(<<, >>)dnl
1626 << --enable-cheaders construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
1628 [case "$enableval" in
1633 enable_cheaders=c_std
1636 enable_cheaders=c_shadow
1638 *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
1641 enable_cheaders=GLIBCPP_ENABLE_CHEADERS_DEFAULT)
1642 AC_MSG_RESULT($enable_cheaders)
1644 dnl Option parsed, now set things appropriately
1645 case "$enable_cheaders" in
1647 CSHADOW_FLAGS="-fno-builtin"
1648 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_shadow'
1649 AC_DEFINE(_GLIBCPP_USE_SHADOW_HEADERS)
1653 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
1657 C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
1661 AC_SUBST(CSHADOW_FLAGS)
1662 AC_SUBST(C_INCLUDE_DIR)
1663 AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cheaders" = c_shadow)
1668 dnl Check for wide character support. Has the same effect as the option
1669 dnl in gcc's configure, but in a form that autoconf can mess with.
1671 dnl GLIBCPP_ENABLE_C_MBCHAR
1672 dnl --enable-c-mbchar requests all the wchar_t stuff.
1673 dnl --disable-c-mbchar doesn't.
1674 dnl + Usage: GLIBCPP_ENABLE_C_MBCHAR[(DEFAULT)]
1675 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1676 dnl defaults to `no'.
1677 AC_DEFUN(GLIBCPP_ENABLE_C_MBCHAR, [dnl
1678 define([GLIBCPP_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
1679 AC_ARG_ENABLE(c-mbchar,
1680 changequote(<<, >>)dnl
1681 << --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCPP_ENABLE_C_MBCHAR_DEFAULT],
1682 changequote([, ])dnl
1683 [case "$enableval" in
1684 yes) enable_c_mbchar=yes ;;
1685 no) enable_c_mbchar=no ;;
1686 *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
1688 enable_c_mbchar=GLIBCPP_ENABLE_C_MBCHAR_DEFAULT)dnl
1689 dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
1694 dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
1696 dnl TOPLEVEL_INCLUDES
1697 dnl LIBMATH_INCLUDES
1698 dnl LIBSUPCXX_INCLUDES
1700 dnl CSHADOW_INCLUDES
1702 dnl GLIBCPP_EXPORT_INCLUDES
1703 AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
1704 # Root level of the build directory include sources.
1705 GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
1707 # Passed down for canadian crosses.
1708 if test x"$CANADIAN" = xyes; then
1709 TOPLEVEL_INCLUDES='-I$(includedir)'
1712 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1714 LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
1716 if test x"$need_libio" = xyes; then
1717 LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
1718 AC_SUBST(LIBIO_INCLUDES)
1721 # Now, export this to all the little Makefiles....
1722 AC_SUBST(GLIBCPP_INCLUDES)
1723 AC_SUBST(TOPLEVEL_INCLUDES)
1724 AC_SUBST(LIBMATH_INCLUDES)
1725 AC_SUBST(LIBSUPCXX_INCLUDES)
1730 dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
1732 AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
1733 # Optimization flags that are probably a good idea for thrill-seekers. Just
1734 # uncomment the lines below and make, everything else is ready to go...
1735 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
1737 AC_SUBST(OPTIMIZE_CXXFLAGS)
1739 WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings -Winline'
1740 AC_SUBST(WARN_FLAGS)
1744 dnl GLIBCPP_EXPORT_INSTALL_INFO
1745 dnl calculates gxx_install_dir
1746 dnl exports glibcpp_toolexecdir
1747 dnl exports glibcpp_toolexeclibdir
1748 dnl exports glibcpp_prefixdir
1750 dnl Assumes cross_compiling bits already done, and with_cross_host in
1753 dnl GLIBCPP_EXPORT_INSTALL_INFO
1754 AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
1755 # Assumes glibcpp_builddir, glibcpp_srcdir are alreay set up and
1756 # exported correctly in GLIBCPP_CONFIGURE.
1757 glibcpp_toolexecdir=no
1758 glibcpp_toolexeclibdir=no
1759 glibcpp_prefixdir=${prefix}
1761 AC_MSG_CHECKING([for interface version number])
1762 libstdcxx_interface=$INTERFACE
1763 AC_MSG_RESULT($libstdcxx_interface)
1765 # Process the option --with-gxx-include-dir=<path to include-files directory>
1766 AC_MSG_CHECKING([for --with-gxx-include-dir])
1767 AC_ARG_WITH(gxx-include-dir,
1768 [ --with-gxx-include-dir the installation directory for include files],
1769 [case "${withval}" in
1771 AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
1778 gxx_include_dir=${withval}
1780 esac], [gxx_include_dir=no])
1781 AC_MSG_RESULT($gxx_include_dir)
1783 # Process the option "--enable-version-specific-runtime-libs"
1784 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
1785 AC_ARG_ENABLE(version-specific-runtime-libs,
1786 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
1787 [case "$enableval" in
1788 yes) version_specific_libs=yes ;;
1789 no) version_specific_libs=no ;;
1790 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
1792 version_specific_libs=no)dnl
1793 # Option set, now we can test it.
1794 AC_MSG_RESULT($version_specific_libs)
1796 if test $version_specific_libs = yes; then
1797 # Need the gcc compiler version to know where to install libraries
1798 # and header files if --enable-version-specific-runtime-libs option
1801 gcc_version_trigger=${srcdir}/../gcc/version.c
1802 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
1803 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
1804 gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
1805 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1806 glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
1810 # Default case for install directory for include files.
1811 if test $version_specific_libs = no &&
1812 test $gxx_include_dir = no; then
1813 gxx_include_dir='$(prefix)'/include/g++-${libstdcxx_interface}
1816 # Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
1817 # Install a library built with a cross compiler in tooldir, not libdir.
1818 if test x"$glibcpp_toolexecdir" = x"no"; then
1819 if test -n "$with_cross_host" &&
1820 test x"$with_cross_host" != x"no"; then
1821 glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
1822 glibcpp_toolexeclibdir='$(toolexecdir)/lib$(MULTISUBDIR)'
1824 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1825 glibcpp_toolexeclibdir='$(libdir)$(MULTISUBDIR)'
1829 AC_MSG_CHECKING([for install location])
1830 AC_MSG_RESULT($gxx_include_dir)
1832 AC_SUBST(glibcpp_prefixdir)
1833 AC_SUBST(gxx_include_dir)
1834 AC_SUBST(glibcpp_toolexecdir)
1835 AC_SUBST(glibcpp_toolexeclibdir)
1839 # Check for functions in math library.
1840 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1842 # This file can be copied and used freely without restrictions. It can
1843 # be used in projects which are not available under the GNU Public License
1844 # but which still want to provide support for the GNU gettext functionality.
1845 # Please note that the actual code is *not* freely available.
1849 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1850 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1851 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])
1852 AC_SUBST(LIBMATHOBJS)dnl
1857 dnl This macro searches for a GNU version of make. If a match is found, the
1858 dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
1859 dnl set to "#". This is useful for including a special features in a Makefile,
1860 dnl which cannot be handled by other versions of make. The variable
1861 dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
1862 dnl the empty string otherwise.
1864 dnl Here is an example of its use:
1866 dnl Makefile.in might contain:
1868 dnl # A failsafe way of putting a dependency rule into a makefile
1870 dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
1872 dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
1873 dnl @ifGNUmake@ include $(DEPEND)
1874 dnl @ifGNUmake@ endif
1876 dnl Then configure.in would normally contain:
1878 dnl CHECK_GNU_MAKE()
1879 dnl AC_OUTPUT(Makefile)
1881 dnl Then perhaps to cause gnu make to override any other make, we could do
1882 dnl something like this (note that GNU make always looks for GNUmakefile first):
1884 dnl if ! test x$_cv_gnu_make_command = x ; then
1885 dnl mv Makefile GNUmakefile
1886 dnl echo .DEFAULT: > Makefile ;
1887 dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
1890 dnl Then, if any (well almost any) other make is called, and GNU make also
1891 dnl exists, then the other make wraps the GNU make.
1893 dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
1894 dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
1896 dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
1897 dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
1898 dnl #### conditional's subshell (" --version" is not a command), using a
1899 dnl #### different option to grep(1).
1901 dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
1902 dnl #### ${MAKE:-make}).
1905 GLIBCPP_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
1906 _cv_gnu_make_command='' ;
1907 dnl Search all the common names for GNU make
1908 for a in "${MAKE-make}" make gmake gnumake ; do
1909 if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
1911 _cv_gnu_make_command=$a ;
1916 dnl If there was a GNU version, then set @ifGNUmake@ to the empty
1917 dnl string, '#' otherwise
1918 if test "x$_cv_gnu_make_command" != "x" ; then
1927 dnl Check for headers for, and arguments to, the setrlimit() function.
1928 dnl Used only in testsuite_hooks.h.
1929 AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT_ancilliary, [
1930 AC_TRY_COMPILE([#include <sys/resource.h>
1932 ], [ int f = RLIMIT_$1 ; ],
1933 [glibcpp_mresult=1], [glibcpp_mresult=0])
1934 AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcpp_mresult,
1935 [Only used in build directory testsuite_hooks.h.])
1937 AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
1938 setrlimit_have_headers=yes
1939 AC_CHECK_HEADERS(sys/resource.h unistd.h,
1941 setrlimit_have_headers=no)
1942 # If don't have the headers, then we can't run the tests now, and we
1943 # won't be seeing any of these during testsuite compilation.
1944 if test $setrlimit_have_headers = yes; then
1945 # Can't do these in a loop, else the resulting syntax is wrong.
1946 GLIBCPP_CHECK_SETRLIMIT_ancilliary(DATA)
1947 GLIBCPP_CHECK_SETRLIMIT_ancilliary(RSS)
1948 GLIBCPP_CHECK_SETRLIMIT_ancilliary(VMEM)
1949 GLIBCPP_CHECK_SETRLIMIT_ancilliary(AS)
1951 # Check for rlimit, setrlimit.
1952 AC_CACHE_VAL(ac_setrlimit, [
1953 AC_TRY_COMPILE([#include <sys/resource.h>
1956 [ struct rlimit r; setrlimit(0, &r);],
1957 [ac_setrlimit=yes], [ac_setrlimit=no])
1961 AC_MSG_CHECKING([for testsuite memory limit support])
1962 if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
1964 AC_DEFINE(_GLIBCPP_MEM_LIMITS)
1968 AC_MSG_RESULT($ac_mem_limits)
1973 dnl Does any necessary configuration of the testsuite directory. Generates
1974 dnl the testsuite_hooks.h header.
1976 dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
1977 AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
1978 GLIBCPP_CHECK_SETRLIMIT
1980 # Look for setenv, so that extended locale tests can be performed.
1981 AC_CHECK_FUNCS(setenv)
1985 sinclude(../libtool.m4)
1986 dnl The lines below arrange for aclocal not to bring an installed
1987 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
1988 dnl add a definition of LIBTOOL to Makefile.in.
1989 ifelse(,,,[AC_SUBST(LIBTOOL)
1990 AC_DEFUN([AM_PROG_LIBTOOL])
1991 AC_DEFUN([AC_LIBTOOL_DLOPEN])
1992 AC_DEFUN([AC_PROG_LD])
1996 # Check whether LC_MESSAGES is available in <locale.h>.
1997 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1999 # This file file be copied and used freely without restrictions. It can
2000 # be used in projects which are not available under the GNU Public License
2001 # but which still want to provide support for the GNU gettext functionality.
2002 # Please note that the actual code is *not* freely available.
2006 AC_DEFUN(AC_LC_MESSAGES, [
2007 AC_CHECK_HEADER(locale.h, [
2008 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
2009 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2010 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
2011 if test $ac_cv_val_LC_MESSAGES = yes; then
2012 AC_DEFINE(HAVE_LC_MESSAGES)
2019 dnl Check for whether the Boost-derived checks should be turned on.
2021 dnl GLIBCPP_ENABLE_CONCEPT_CHECKS
2022 dnl --enable-concept-checks turns them on.
2023 dnl --disable-concept-checks leaves them off.
2024 dnl + Usage: GLIBCPP_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
2025 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
2026 dnl defaults to `no'.
2027 AC_DEFUN(GLIBCPP_ENABLE_CONCEPT_CHECKS, [dnl
2028 define([GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT], ifelse($1, yes, yes, no))dnl
2029 AC_ARG_ENABLE(concept-checks,
2030 changequote(<<, >>)dnl
2031 << --enable-concept-checks use Boost-derived template checks [default=>>GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT],
2032 changequote([, ])dnl
2033 [case "$enableval" in
2034 yes) enable_concept_checks=yes ;;
2035 no) enable_concept_checks=no ;;
2036 *) AC_MSG_ERROR([Unknown argument to enable/disable concept checks]) ;;
2038 enable_concept_checks=GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT)dnl
2039 dnl Option parsed, now set things appropriately
2040 if test x"$enable_concept_checks" = xyes; then
2041 AC_DEFINE(_GLIBCPP_CONCEPT_CHECKS)
2047 dnl Add version tags to symbols in shared library (or not), additionally
2048 dnl marking other symbols as private/local (or not).
2050 dnl GLIBCPP_ENABLE_SYMVERS
2051 dnl --enable-symvers=style adds a version script to the linker call when
2052 dnl creating the shared library. The choice of version script is
2053 dnl controlled by 'style'.
2054 dnl --disable-symvers does not.
2055 dnl + Usage: GLIBCPP_ENABLE_SYMVERS[(DEFAULT)]
2056 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
2057 dnl defaults to `no'. Passing `yes' tries to choose a default style
2058 dnl based on linker characteristics.
2059 AC_DEFUN(GLIBCPP_ENABLE_SYMVERS, [dnl
2060 define([GLIBCPP_ENABLE_SYMVERS_DEFAULT], ifelse($1, yes, yes, no))dnl
2061 AC_ARG_ENABLE(symvers,
2062 changequote(<<, >>)dnl
2063 << --enable-symvers=style enables symbol versioning of the shared library [default=>>GLIBCPP_ENABLE_SYMVERS_DEFAULT],
2064 changequote([, ])dnl
2065 [case "$enableval" in
2066 yes) enable_symvers=default ;;
2067 no) enable_symvers=no ;;
2068 # other names here, just as sanity checks
2069 #gnu|sun|etcetera) enable_symvers=$enableval ;;
2070 gnu) enable_symvers=$enableval ;;
2071 *) AC_MSG_ERROR([Unknown argument to enable/disable symvers]) ;;
2073 enable_symvers=GLIBCPP_ENABLE_SYMVERS_DEFAULT)dnl
2075 # If we never went through the GLIBCPP_CHECK_LINKER_FEATURES macro, then we
2076 # don't know enough about $LD... I think.
2077 AC_MSG_CHECKING([whether to version shared lib symbols])
2078 if test $enable_shared = no || test x$LD = x ; then
2079 enable_symvers=irrelevant
2082 # For GNU ld, we need at least this version. It's 2.12 in the same format
2083 # as the tested-for version. See GLIBCPP_CHECK_LINKER_FEATURES for more.
2084 glibcpp_min_gnu_ld_version=21200
2086 dnl Everything parsed; figure out the actions.
2087 LINKER_MAP=config/linker-map.dummy
2088 case $enable_symvers in
2092 LINKER_MAP=config/linker-map.gnu
2095 dnl LINKER_MAP=config/linker-map....?
2097 default) # not specified by user, try to figure it out
2098 if test $with_gnu_ld = yes &&
2099 test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version ;
2101 LINKER_MAP=config/linker-map.gnu
2109 AC_LINK_FILES($LINKER_MAP, src/linker.map)
2110 AM_CONDITIONAL(GLIBCPP_BUILD_VERSIONED_SHLIB,
2111 test $enable_symvers != no && test $enable_symvers != irrelevant)
2112 AC_MSG_RESULT($enable_symvers)
2117 # Add --enable-maintainer-mode option to configure.
2122 AC_DEFUN(AM_MAINTAINER_MODE,
2123 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
2124 dnl maintainer-mode is disabled by default
2125 AC_ARG_ENABLE(maintainer-mode,
2126 [ --enable-maintainer-mode enable make rules and dependencies not useful
2127 (and sometimes confusing) to the casual installer],
2128 USE_MAINTAINER_MODE=$enableval,
2129 USE_MAINTAINER_MODE=no)
2130 AC_MSG_RESULT($USE_MAINTAINER_MODE)
2131 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
2132 MAINT=$MAINTAINER_MODE_TRUE
2137 # Define a conditional.
2139 AC_DEFUN(AM_CONDITIONAL,
2150 # Macro to add for using GNU gettext.
2151 # Ulrich Drepper <drepper@cygnus.com>, 1995.
2153 # This file file be copied and used freely without restrictions. It can
2154 # be used in projects which are not available under the GNU Public License
2155 # but which still want to provide support for the GNU gettext functionality.
2156 # Please note that the actual code is *not* freely available.
2160 AC_DEFUN(AM_WITH_NLS,
2161 [AC_MSG_CHECKING([whether NLS is requested])
2162 dnl Default is enabled NLS
2164 [ --disable-nls do not use Native Language Support],
2165 USE_NLS=$enableval, USE_NLS=yes)
2166 AC_MSG_RESULT($USE_NLS)
2169 USE_INCLUDED_LIBINTL=no
2171 dnl If we use NLS figure out what method
2172 if test "$USE_NLS" = "yes"; then
2173 AC_DEFINE(ENABLE_NLS)
2174 AC_MSG_CHECKING([whether included gettext is requested])
2175 AC_ARG_WITH(included-gettext,
2176 [ --with-included-gettext use the GNU gettext library included here],
2177 nls_cv_force_use_gnu_gettext=$withval,
2178 nls_cv_force_use_gnu_gettext=no)
2179 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
2181 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
2182 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
2183 dnl User does not insist on using GNU NLS library. Figure out what
2184 dnl to use. If gettext or catgets are available (in this order) we
2185 dnl use this. Else we have to fall back to GNU NLS library.
2186 dnl catgets is only used if permitted by option --with-catgets.
2188 nls_cv_header_libgt=
2191 AC_CHECK_HEADER(libintl.h,
2192 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
2193 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
2194 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
2196 if test "$gt_cv_func_gettext_libc" != "yes"; then
2197 AC_CHECK_LIB(intl, bindtextdomain,
2198 [AC_CACHE_CHECK([for gettext in libintl],
2199 gt_cv_func_gettext_libintl,
2200 [AC_TRY_LINK([], [return (int) gettext ("")],
2201 gt_cv_func_gettext_libintl=yes,
2202 gt_cv_func_gettext_libintl=no)])])
2205 if test "$gt_cv_func_gettext_libc" = "yes" \
2206 || test "$gt_cv_func_gettext_libintl" = "yes"; then
2207 AC_DEFINE(HAVE_GETTEXT)
2208 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2209 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
2210 if test "$MSGFMT" != "no"; then
2211 AC_CHECK_FUNCS(dcgettext)
2212 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2213 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2214 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
2215 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
2216 return _nl_msg_cat_cntr],
2226 if test "$CATOBJEXT" = "NONE"; then
2227 AC_MSG_CHECKING([whether catgets can be used])
2228 AC_ARG_WITH(catgets,
2229 [ --with-catgets use catgets functions if available],
2230 nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
2231 AC_MSG_RESULT($nls_cv_use_catgets)
2233 if test "$nls_cv_use_catgets" = "yes"; then
2234 dnl No gettext in C library. Try catgets next.
2235 AC_CHECK_LIB(i, main)
2236 AC_CHECK_FUNC(catgets,
2237 [AC_DEFINE(HAVE_CATGETS)
2238 INTLOBJS="\$(CATOBJS)"
2239 AC_PATH_PROG(GENCAT, gencat, no)dnl
2240 if test "$GENCAT" != "no"; then
2241 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
2242 if test "$GMSGFMT" = "no"; then
2243 AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
2244 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
2246 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2247 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
2248 USE_INCLUDED_LIBINTL=yes
2252 INTLDEPS='$(top_builddir)/intl/libintl.a'
2254 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
2255 nls_cv_header_intl=intl/libintl.h
2256 nls_cv_header_libgt=intl/libgettext.h
2261 if test "$CATOBJEXT" = "NONE"; then
2262 dnl Neither gettext nor catgets in included in the C library.
2263 dnl Fall back on GNU gettext library.
2264 nls_cv_use_gnu_gettext=yes
2268 if test "$nls_cv_use_gnu_gettext" = "yes"; then
2269 dnl Mark actions used to generate GNU NLS library.
2270 INTLOBJS="\$(GETTOBJS)"
2271 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2272 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
2273 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2274 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2275 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
2277 USE_INCLUDED_LIBINTL=yes
2281 INTLDEPS='$(top_builddir)/intl/libintl.a'
2283 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
2284 nls_cv_header_intl=intl/libintl.h
2285 nls_cv_header_libgt=intl/libgettext.h
2288 dnl Test whether we really found GNU xgettext.
2289 if test "$XGETTEXT" != ":"; then
2290 dnl If it is no GNU xgettext we define it as : so that the
2291 dnl Makefiles still can work.
2292 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
2296 [found xgettext programs is not GNU xgettext; ignore it])
2301 # We need to process the po/ directory.
2305 nls_cv_header_intl=intl/libintl.h
2306 nls_cv_header_libgt=intl/libgettext.h
2309 # If this is used in GNU gettext we have to set USE_NLS to `yes'
2310 # because some of the sources are only built for this goal.
2311 if test "$PACKAGE" = gettext; then
2313 USE_INCLUDED_LIBINTL=yes
2316 dnl These rules are solely for the distribution goal. While doing this
2317 dnl we only have to keep exactly one list of the available catalogs
2318 dnl in configure.in.
2319 for lang in $ALL_LINGUAS; do
2320 GMOFILES="$GMOFILES $lang.gmo"
2321 POFILES="$POFILES $lang.po"
2324 dnl Make all variables we use known to autoconf.
2325 AC_SUBST(USE_INCLUDED_LIBINTL)
2328 AC_SUBST(DATADIRNAME)
2330 AC_SUBST(INSTOBJEXT)
2338 AC_DEFUN(AM_GNU_GETTEXT,
2339 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2340 AC_REQUIRE([AC_PROG_CC])dnl
2341 AC_REQUIRE([AC_PROG_RANLIB])dnl
2342 AC_REQUIRE([AC_ISC_POSIX])dnl
2343 AC_REQUIRE([AC_HEADER_STDC])dnl
2344 AC_REQUIRE([AC_C_CONST])dnl
2345 AC_REQUIRE([AC_C_INLINE])dnl
2346 AC_REQUIRE([AC_TYPE_OFF_T])dnl
2347 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
2348 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
2349 AC_REQUIRE([AC_FUNC_MMAP])dnl
2351 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
2352 unistd.h values.h sys/param.h])
2353 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
2354 __argz_count __argz_stringify __argz_next])
2356 if test "${ac_cv_func_stpcpy+set}" != "set"; then
2357 AC_CHECK_FUNCS(stpcpy)
2359 if test "${ac_cv_func_stpcpy}" = "yes"; then
2360 AC_DEFINE(HAVE_STPCPY)
2366 if test "x$CATOBJEXT" != "x"; then
2367 if test "x$ALL_LINGUAS" = "x"; then
2370 AC_MSG_CHECKING(for catalogs to be installed)
2372 for lang in ${LINGUAS=$ALL_LINGUAS}; do
2373 case "$ALL_LINGUAS" in
2374 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
2377 LINGUAS=$NEW_LINGUAS
2378 AC_MSG_RESULT($LINGUAS)
2381 dnl Construct list of names of catalog files to be constructed.
2382 if test -n "$LINGUAS"; then
2383 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
2387 dnl The reference to <locale.h> in the installed <libintl.h> file
2388 dnl must be resolved because we cannot expect the users of this
2389 dnl to define HAVE_LOCALE_H.
2390 if test $ac_cv_header_locale_h = yes; then
2391 INCLUDE_LOCALE_H="#include <locale.h>"
2394 /* The system does not provide the header <locale.h>. Take care yourself. */"
2396 AC_SUBST(INCLUDE_LOCALE_H)
2398 dnl Determine which catalog format we have (if any is needed)
2399 dnl For now we know about two different formats:
2400 dnl Linux libc-5 and the normal X/Open format
2401 test -d intl || mkdir intl
2402 if test "$CATOBJEXT" = ".cat"; then
2403 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
2405 dnl Transform the SED scripts while copying because some dumb SEDs
2406 dnl cannot handle comments.
2407 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
2409 dnl po2tbl.sed is always needed.
2410 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
2411 $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
2413 dnl In the intl/Makefile.in we have a special dependency which makes
2414 dnl only sense for gettext. We comment this out for non-gettext
2416 if test "$PACKAGE" = "gettext"; then
2426 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
2427 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
2428 dnl Try to locate is.
2430 if test -n "$ac_aux_dir"; then
2431 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
2433 if test -z "$MKINSTALLDIRS"; then
2434 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
2436 AC_SUBST(MKINSTALLDIRS)
2438 dnl *** For now the libtool support in intl/Makefile is not for real.
2442 dnl Generate list of files to be processed by xgettext which will
2443 dnl be included in po/Makefile.
2444 test -d po || mkdir po
2445 if test "x$srcdir" != "x."; then
2446 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
2447 posrcprefix="$srcdir/"
2449 posrcprefix="../$srcdir/"
2455 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
2456 < $srcdir/po/POTFILES.in > po/POTFILES
2459 # Search path for a program which passes the given test.
2460 # Ulrich Drepper <drepper@cygnus.com>, 1996.
2462 # This file file be copied and used freely without restrictions. It can
2463 # be used in projects which are not available under the GNU Public License
2464 # but which still want to provide support for the GNU gettext functionality.
2465 # Please note that the actual code is *not* freely available.
2469 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2470 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2471 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
2472 [# Extract the first word of "$2", so it can be a program name with args.
2473 set dummy $2; ac_word=[$]2
2474 AC_MSG_CHECKING([for $ac_word])
2475 AC_CACHE_VAL(ac_cv_path_$1,
2478 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2481 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2482 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2483 test -z "$ac_dir" && ac_dir=.
2484 if test -f $ac_dir/$ac_word; then
2486 ac_cv_path_$1="$ac_dir/$ac_word"
2492 dnl If no 4th arg is given, leave the cache variable unset,
2493 dnl so AC_PATH_PROGS will keep looking.
2494 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2499 if test -n "[$]$1"; then
2500 AC_MSG_RESULT([$]$1)
2507 # Check whether LC_MESSAGES is available in <locale.h>.
2508 # Ulrich Drepper <drepper@cygnus.com>, 1995.
2510 # This file file be copied and used freely without restrictions. It can
2511 # be used in projects which are not available under the GNU Public License
2512 # but which still want to provide support for the GNU gettext functionality.
2513 # Please note that the actual code is *not* freely available.
2517 AC_DEFUN(AM_LC_MESSAGES,
2518 [if test $ac_cv_header_locale_h = yes; then
2519 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2520 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2521 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2522 if test $am_cv_val_LC_MESSAGES = yes; then
2523 AC_DEFINE(HAVE_LC_MESSAGES, 1,
2524 [Define if your locale.h file contains LC_MESSAGES.])
2528 # Do all the work for Automake. This macro actually does too much --
2529 # some checks are only needed if your package does certain things.
2530 # But this isn't really a big deal.
2535 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
2537 AC_DEFUN(AM_INIT_AUTOMAKE,
2538 [AC_REQUIRE([AC_PROG_INSTALL])
2543 dnl test to see if srcdir already configured
2544 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
2545 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2548 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
2549 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
2550 AC_REQUIRE([AM_SANITY_CHECK])
2551 AC_REQUIRE([AC_ARG_PROGRAM])
2552 dnl FIXME This is truly gross.
2553 missing_dir=`cd $ac_aux_dir && pwd`
2554 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
2555 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
2556 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
2557 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
2558 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
2559 AC_REQUIRE([AC_PROG_MAKE_SET])])
2562 # Check to make sure that the build environment is sane.
2565 AC_DEFUN(AM_SANITY_CHECK,
2566 [AC_MSG_CHECKING([whether build environment is sane])
2569 echo timestamp > conftestfile
2570 # Do `set' in a subshell so we don't clobber the current shell's
2571 # arguments. Must try -L first in case configure is actually a
2572 # symlink; some systems play weird games with the mod time of symlinks
2573 # (eg FreeBSD returns the mod time of the symlink's containing
2576 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
2577 if test "[$]*" = "X"; then
2579 set X `ls -t $srcdir/configure conftestfile`
2581 if test "[$]*" != "X $srcdir/configure conftestfile" \
2582 && test "[$]*" != "X conftestfile $srcdir/configure"; then
2584 # If neither matched, then we have a broken ls. This can happen
2585 # if, for instance, CONFIG_SHELL is bash and it inherits a
2586 # broken ls alias from the environment. This has actually
2587 # happened. Such a system could not be considered "sane".
2588 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
2589 alias in your environment])
2592 test "[$]2" = conftestfile
2598 AC_MSG_ERROR([newly created file is older than distributed files!
2599 Check your system clock])
2602 AC_MSG_RESULT(yes)])
2604 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
2605 dnl The program must properly implement --version.
2606 AC_DEFUN(AM_MISSING_PROG,
2607 [AC_MSG_CHECKING(for working $2)
2608 # Run test in a subshell; some versions of sh will print an error if
2609 # an executable is not found, even if stderr is redirected.
2610 # Redirect stdin to placate older versions of autoconf. Sigh.
2611 if ($2 --version) < /dev/null > /dev/null 2>&1; then
2613 AC_MSG_RESULT(found)
2616 AC_MSG_RESULT(missing)
2620 # Like AC_CONFIG_HEADER, but automatically create stamp file.
2622 AC_DEFUN(AM_CONFIG_HEADER,
2624 AC_CONFIG_HEADER([$1])
2625 dnl When config.status generates a header, we must update the stamp-h file.
2626 dnl This file resides in the same directory as the config header
2627 dnl that is generated. We must strip everything past the first ":",
2628 dnl and everything past the last "/".
2629 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
2630 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
2631 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
2633 for am_file in <<$1>>; do
2634 case " <<$>>CONFIG_HEADERS " in
2635 *" <<$>>am_file "*<<)>>
2636 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
2639 am_indx=`expr "<<$>>am_indx" + 1`