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.
16 dnl Define OPTLEVEL='-O2' if new inlining code present.
19 AC_DEFUN(GLIBCPP_CONFIGURE, [
20 dnl Default to --enable-multilib
21 AC_ARG_ENABLE(multilib,
22 [ --enable-multilib build hella library versions (default)],
23 [case "${enableval}" in
26 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
27 esac], [multilib=yes])dnl
29 glibcpp_basedir=$auxdir/$1/libstdc++-v3
30 AC_SUBST(glibcpp_basedir)
32 AM_INIT_AUTOMAKE(libstdc++, 2.90.8)
34 # Never versions of autoconf add an underscore to these functions.
35 # Prevent future problems ...
36 ifdef([AC_PROG_CC_G],[],[define([AC_PROG_CC_G],defn([_AC_PROG_CC_G]))])
37 ifdef([AC_PROG_CC_GNU],[],[define([AC_PROG_CC_GNU],defn([_AC_PROG_CC_GNU]))])
38 ifdef([AC_PROG_CXX_G],[],[define([AC_PROG_CXX_G],defn([_AC_PROG_CXX_G]))])
39 ifdef([AC_PROG_CXX_GNU],[],[define([AC_PROG_CXX_GNU],defn([_AC_PROG_CXX_GNU]))])
43 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
44 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
45 # are probably using a cross compiler, which will not be able to fully
46 # link an executable. This should really be fixed in autoconf
49 AC_DEFUN(LIB_AC_PROG_CC,
50 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
51 dnl Fool anybody using AC_PROG_CC.
52 AC_PROVIDE([AC_PROG_CC])
53 AC_CHECK_PROG(CC, gcc, gcc)
54 if test -z "$CC"; then
55 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
56 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
61 if test $ac_cv_prog_gcc = yes; then
63 dnl Check whether -g works, even if CFLAGS is set, in case the package
64 dnl plays around with CFLAGS (such as to build both debugging and
65 dnl normal versions of a library), tasteless as that idea is.
66 ac_test_CFLAGS="${CFLAGS+set}"
67 ac_save_CFLAGS="$CFLAGS"
70 if test "$ac_test_CFLAGS" = set; then
71 CFLAGS="$ac_save_CFLAGS"
72 elif test $ac_cv_prog_cc_g = yes; then
79 test "${CFLAGS+set}" = set || CFLAGS="-g"
85 # Can't just call these here as g++ requires libstc++ to be built....
88 # Likewise for AC_PROG_CXX.
89 AC_DEFUN(LIB_AC_PROG_CXX,
90 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
91 dnl Fool anybody using AC_PROG_CXX.
92 AC_PROVIDE([AC_PROG_CXX])
93 # Use CXX_libstdcxx so that we do not cause CXX to be cached with the
94 # flags that come in CXX while configuring libstdc++. They're different
95 # from those used for all other target libraries. If CXX is set in
96 # the environment, respect that here.
98 AC_CHECK_PROGS(CXX_libstdcxx, $CCC c++ g++ gcc CC cxx cc++, gcc)
101 test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
105 if test $ac_cv_prog_gxx = yes; then
107 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
108 dnl plays around with CXXFLAGS (such as to build both debugging and
109 dnl normal versions of a library), tasteless as that idea is.
110 ac_test_CXXFLAGS="${CXXFLAGS+set}"
111 ac_save_CXXFLAGS="$CXXFLAGS"
114 if test "$ac_test_CXXFLAGS" = set; then
115 CXXFLAGS="$ac_save_CXXFLAGS"
116 elif test $ac_cv_prog_cxx_g = yes; then
123 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
129 AC_CHECK_TOOL(AS, as)
130 AC_CHECK_TOOL(AR, ar)
131 AC_CHECK_TOOL(RANLIB, ranlib, :)
137 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
138 # at least currently, we never actually build a program, so we never
139 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
140 # fails, because we are probably configuring with a cross compiler
141 # which cant create executables. So we include AC_EXEEXT to keep
142 # automake happy, but we dont execute it, since we dont care about
148 # configure.host sets the following important variables
149 # glibcpp_cflags - host specific C compiler flags
150 # glibcpp_cxxflags - host specific C++ compiler flags
154 . [$]{glibcpp_basedir}/configure.host
156 case [$]{glibcpp_basedir} in
157 /* | [A-Za-z]:[\\/]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
158 *) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
161 # This does for the target what configure.host does for the host. In
162 # addition to modifying the same flags, it also sets up symlinks.
165 GLIBCPP_CFLAGS="[$]{glibcpp_cflags}"
166 GLIBCPP_CXXFLAGS="[$]{glibcpp_cxxflags}"
167 AC_SUBST(GLIBCPP_CFLAGS)
168 AC_SUBST(GLIBCPP_CXXFLAGS)
173 dnl Check to see if g++ can compile this library, and if so, if any version-
174 dnl specific precautions need to be taken.
176 dnl GLIBCPP_CHECK_COMPILER_VERSION
177 AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
178 if test ! -f stamp-sanity-compiler; then
179 AC_MSG_CHECKING([for g++ that will successfully compile libstdc++-v3])
183 #if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
186 ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to gcc-2.95 or above]))
188 AC_MSG_RESULT($gpp_satisfactory)
189 touch stamp-sanity-compiler
195 dnl Test for newer compiler features, or features that are present in newer
196 dnl compiler version but not older compiler versions should be placed
199 dnl Define WFMT_FLAGS='-fdiagnostics-show-location=once' if possible
201 dnl Define WERROR='-Werror' if requested and possible; g++'s that lack the
202 dnl new inlining code or the new system_header pragma will die on -Werror.
203 dnl Leave it out by default and use maint-mode to use it.
205 dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
206 dnl compiler supports it.
207 dnl GLIBCPP_CHECK_COMPILER_FEATURES
208 AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
209 # All these tests are for C++; save the language and the compiler flags.
210 # The CXXFLAGS thing is suspicious, but based on similar bits
211 # found in GLIBCPP_CONFIGURE.
214 ac_test_CXXFLAGS="${CXXFLAGS+set}"
215 ac_save_CXXFLAGS="$CXXFLAGS"
217 # Check for maintainer-mode bits.
218 if test x"$USE_MAINTAINER_MODE" = xno; then
224 # Check for more sophisticated diagnostic control.
225 AC_MSG_CHECKING([for g++ that supports -fdiagnostics-show-location=once])
226 CXXFLAGS='-Werror -fdiagnostics-show-location=once'
227 AC_TRY_COMPILE(, [int foo;
228 ], [ac_gabydiags=yes], [ac_gabydiags=no])
229 if test "$ac_test_CXXFLAGS" = set; then
230 CXXFLAGS="$ac_save_CXXFLAGS"
232 # this is the suspicious part
235 if test x"$ac_gabydiags" = x"yes"; then
236 WFMT_FLAGS='-fdiagnostics-show-location=once'
238 AC_MSG_RESULT($ac_gabydiags)
240 # Check for -ffunction-sections -fdata-sections
241 AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
242 CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
243 AC_TRY_COMPILE(, [int foo;
244 ], [ac_fdsections=yes], [ac_fdsections=no])
245 if test "$ac_test_CXXFLAGS" = set; then
246 CXXFLAGS="$ac_save_CXXFLAGS"
248 # this is the suspicious part
251 if test x"$ac_fdsections" = x"yes" && test x"$enable_debug" = x"no"; then
252 SECTION_FLAGS='-ffunction-sections -fdata-sections'
254 AC_MSG_RESULT($ac_fdsections)
259 AC_SUBST(SECTION_FLAGS)
264 dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
265 dnl the native linker is in use, all variables will be defined to something
266 dnl safe (like an empty string).
268 dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible.
269 dnl Define OPT_LDFLAGS='-Wl,-O1' if possible.
271 dnl GLIBCPP_CHECK_LINKER_FEATURES
272 AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
273 # If we're not using GNU ld, then there's no point in even trying these
274 # tests. Check for that first. We should have already tested for gld
275 # by now (in libtool), but require it now just to be safe...
278 AC_REQUIRE([AC_PROG_LD])
281 if test "$ac_cv_prog_gnu_ld" = "notbroken"; then
282 # GNU ld it is! Joy and bunny rabbits!
284 # All these tests are for C++; save the language and the compiler flags.
285 # Need to do this so that g++ won't try to link in libstdc++
286 ac_test_CFLAGS="${CFLAGS+set}"
287 ac_save_CFLAGS="$CFLAGS"
288 CFLAGS='-x c++ -Wl,--gc-sections'
290 # Check for -Wl,--gc-sections
291 # XXX This test is broken at the moment, as symbols required for
292 # linking are now in libsupc++ (not built yet.....). In addition,
293 # this test has cored on solaris in the past. In addition,
294 # --gc-sections doesn't really work at the moment (keeps on discarding
295 # used sections, first .eh_frame and now some of the glibc sections for
296 # iconv). Bzzzzt. Thanks for playing, maybe next time.
297 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
305 ], [ac_sectionLDflags=yes],[ac_sectionLFflags=no], [ac_sectionLDflags=yes])
306 if test "$ac_test_CFLAGS" = set; then
307 CFLAGS="$ac_save_CFLAGS"
309 # this is the suspicious part
312 if test "$ac_sectionLDflags" = "yes"; then
313 SECTION_LDFLAGS='-Wl,--gc-sections'
315 AC_MSG_RESULT($ac_sectionLDflags)
318 # Set linker optimization flags.
319 if test x"$ac_cv_prog_gnu_ld" = x"yes" && test x"$enable_debug" = x"no"; then
320 OPT_LDFLAGS='-Wl,-O1'
323 AC_SUBST(SECTION_LDFLAGS)
324 AC_SUBST(OPT_LDFLAGS)
329 dnl Check to see if the (math function) argument passed is
330 dnl 1) declared when using the c++ compiler
331 dnl 2) has "C" linkage
333 dnl Define HAVE_CARGF etc if "cargf" is declared and links
335 dnl argument 1 is name of function to check
337 dnl ASSUMES argument is a math function with ONE parameter
339 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1
340 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
341 AC_MSG_CHECKING([for $1 declaration])
342 if test x${glibcpp_cv_func_$1_use+set} != xset; then
343 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
346 AC_TRY_COMPILE([#include <math.h>],
348 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
352 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
353 if test x$glibcpp_cv_func_$1_use = x"yes"; then
359 dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
360 dnl of functions at once. It's an all-or-nothing check -- either
361 dnl HAVE_XYZ is defined for each of the functions, or for none of them.
362 dnl Doing it this way saves significant configure time.
363 AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
364 AC_MSG_CHECKING([for $1 functions])
365 AC_CACHE_VAL(glibcpp_cv_func_$2_use, [
368 AC_TRY_COMPILE([#include <math.h>],
369 [ `for x in $3; do echo "$x (0);"; done` ],
370 [glibcpp_cv_func_$2_use=yes],
371 [glibcpp_cv_func_$2_use=no])
373 AC_MSG_RESULT($glibcpp_cv_func_$2_use)
374 if test x$glibcpp_cv_func_$2_use = x"yes"; then
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
384 dnl Define HAVE_CARGF etc if "cargf" is declared and links
386 dnl argument 1 is name of function to check
388 dnl ASSUMES argument is a math function with TWO parameters
390 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2
391 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
392 AC_MSG_CHECKING([for $1 declaration])
393 if test x${glibcpp_cv_func_$1_use+set} != xset; then
394 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
397 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)
404 if test x$glibcpp_cv_func_$1_use = x"yes"; then
411 dnl Check to see if the (math function) argument passed is
412 dnl 1) declared when using the c++ compiler
413 dnl 2) has "C" linkage
415 dnl Define HAVE_CARGF etc if "cargf" is declared and links
417 dnl argument 1 is name of function to check
419 dnl ASSUMES argument is a math function with THREE parameters
421 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3
422 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
423 AC_MSG_CHECKING([for $1 declaration])
424 if test x${glibcpp_cv_func_$1_use+set} != xset; then
425 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
428 AC_TRY_COMPILE([#include <math.h>],
430 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
434 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
435 if test x$glibcpp_cv_func_$1_use = x"yes"; then
442 dnl Check to see if the (stdlib function) argument passed is
443 dnl 1) declared when using the c++ compiler
444 dnl 2) has "C" linkage
446 dnl Define HAVE_STRTOLD if "strtold" is declared and links
447 dnl Define HAVE_STRTOF if "strtof" is declared and links
449 dnl argument 1 is name of function to check
451 dnl ASSUMES argument is a math function with TWO parameters
453 dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2
454 AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
455 AC_MSG_CHECKING([for $1 declaration])
456 if test x${glibcpp_cv_func_$1_use+set} != xset; then
457 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
460 AC_TRY_COMPILE([#include <stdlib.h>],
462 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
466 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
467 if test x$glibcpp_cv_func_$1_use = x"yes"; then
474 dnl Because the builtins are picky picky picky about the arguments they take,
475 dnl do an explict linkage tests here.
476 dnl Check to see if the (math function) argument passed is
477 dnl 1) declared when using the c++ compiler
478 dnl 2) has "C" linkage
480 dnl Define HAVE_CARGF etc if "cargf" is declared and links
482 dnl argument 1 is name of function to check
484 dnl ASSUMES argument is a math function with ONE parameter
486 dnl GLIBCPP_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
487 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
488 AC_MSG_CHECKING([for $1 declaration])
489 if test x${glibcpp_cv_func_$1_use+set} != xset; then
490 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
493 AC_TRY_COMPILE([#include <math.h>],
495 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
499 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
500 if test x$glibcpp_cv_func_$1_use = x"yes"; then
501 AC_MSG_CHECKING([for $1 linkage])
502 if test x${glibcpp_cv_func_$1_link+set} != xset; then
503 AC_CACHE_VAL(glibcpp_cv_func_$1_link, [
504 AC_TRY_LINK([#include <math.h>],
506 [glibcpp_cv_func_$1_link=yes], [glibcpp_cv_func_$1_link=no])
509 AC_MSG_RESULT($glibcpp_cv_func_$1_link)
510 if test x$glibcpp_cv_func_$1_link = x"yes"; then
511 ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
512 AC_DEFINE_UNQUOTED(${ac_tr_func})
519 dnl Check to see what builtin math functions are supported
521 dnl check for __builtin_abs
522 dnl check for __builtin_fabsf
523 dnl check for __builtin_fabs
524 dnl check for __builtin_fabl
525 dnl check for __builtin_labs
526 dnl check for __builtin_sqrtf
527 dnl check for __builtin_sqrtl
528 dnl check for __builtin_fsqrt
529 dnl check for __builtin_sinf
530 dnl check for __builtin_sin
531 dnl check for __builtin_sinl
532 dnl check for __builtin_cosf
533 dnl check for __builtin_cos
534 dnl check for __builtin_cosl
536 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
537 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
538 dnl Test for builtin math functions.
539 dnl These are made in gcc/c-common.c
540 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
541 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
542 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
543 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
544 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
546 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
547 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fsqrt)
548 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
550 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
551 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
552 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
554 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
555 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
556 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
558 dnl There is, without a doubt, a more elegant way to have these
559 dnl names exported so that they won't be stripped out of acconfig.h by
560 dnl autoheader. I leave this as an exercise to somebody less frustrated
561 dnl than I.... please email the libstdc++ list if you can figure out a
562 dnl more elegant approach (see autoconf/acgen.m4 and specifically
563 dnl AC_CHECK_FUNC for things to steal.)
565 if test x$dummyvar = x"yes"; then
566 AC_DEFINE(HAVE___BUILTIN_ABS)
567 AC_DEFINE(HAVE___BUILTIN_LABS)
568 AC_DEFINE(HAVE___BUILTIN_COS)
569 AC_DEFINE(HAVE___BUILTIN_COSF)
570 AC_DEFINE(HAVE___BUILTIN_COSL)
571 AC_DEFINE(HAVE___BUILTIN_FABS)
572 AC_DEFINE(HAVE___BUILTIN_FABSF)
573 AC_DEFINE(HAVE___BUILTIN_FABSL)
574 AC_DEFINE(HAVE___BUILTIN_SIN)
575 AC_DEFINE(HAVE___BUILTIN_SINF)
576 AC_DEFINE(HAVE___BUILTIN_SINL)
577 AC_DEFINE(HAVE___BUILTIN_FSQRT)
578 AC_DEFINE(HAVE___BUILTIN_SQRTF)
579 AC_DEFINE(HAVE___BUILTIN_SQRTL)
585 dnl Check to see what the underlying c library
586 dnl These checks need to do two things:
587 dnl 1) make sure the name is declared when using the c++ compiler
588 dnl 2) make sure the name has "C" linkage
589 dnl This might seem like overkill but experience has shown that it's not...
591 dnl Define HAVE_STRTOF etc if "strtof" is found.
592 dnl Define HAVE_STRTOLD etc if "strtold" is found.
594 dnl GLIBCPP_CHECK_STDLIB_SUPPORT
595 AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
596 ac_test_CXXFLAGS="${CXXFLAGS+set}"
597 ac_save_CXXFLAGS="$CXXFLAGS"
598 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
600 AC_CHECK_FUNCS(strtof)
601 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
603 CXXFLAGS="$ac_save_CXXFLAGS"
608 dnl Check to see what the underlying c library or math library is like.
609 dnl These checks need to do two things:
610 dnl 1) make sure the name is declared when using the c++ compiler
611 dnl 2) make sure the name has "C" linkage
612 dnl This might seem like overkill but experience has shown that it's not...
614 dnl Define HAVE_CARGF etc if "cargf" is found.
616 dnl GLIBCPP_CHECK_MATH_SUPPORT
617 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
618 ac_test_CXXFLAGS="${CXXFLAGS+set}"
619 ac_save_CXXFLAGS="$CXXFLAGS"
620 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
623 AC_CHECK_LIB(m, sin, libm="-lm")
627 dnl Check to see if certain C math functions exist.
628 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
629 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
630 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
631 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
632 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
633 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
634 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
636 dnl Check to see if basic C math functions have float versions.
637 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
642 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
645 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
646 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
647 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
648 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
649 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
650 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
651 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
652 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
653 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
654 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
655 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
656 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
657 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
659 dnl Check to see if basic C math functions have long double versions.
660 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
665 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
668 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
669 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
670 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
671 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
672 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
673 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
674 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
675 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
676 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
677 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
678 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
679 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
680 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
681 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
682 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
683 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
685 dnl Some runtimes have these functions with a preceding underscore. Please
686 dnl keep this sync'd with the one above. And if you add any new symbol,
687 dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
688 dnl Check to see if certain C math functions exist.
689 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinf)
690 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnan)
691 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_finite)
692 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_copysign)
693 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(_sincos)
694 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_fpclass)
695 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_qfpclass)
697 dnl Check to see if basic C math functions have float versions.
698 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
700 _acosf _asinf _atanf \
702 _coshf _sinhf _tanhf)
703 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
706 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnanf)
707 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinff)
708 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_fabsf)
709 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_fmodf)
710 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_frexpf)
711 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_ldexpf)
712 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_logf)
713 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_log10f)
714 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_modff)
715 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_powf)
716 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_sqrtf)
717 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(_sincosf)
718 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_finitef)
720 dnl Check to see if basic C math functions have long double versions.
721 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
723 _acosl _asinl _atanl \
725 _coshl _sinhl _tanhl)
726 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
729 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnanl)
730 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinfl)
731 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_copysignl)
732 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_atan2l)
733 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_expl)
734 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_fabsl)
735 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_fmodl)
736 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_frexpl)
737 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_ldexpl)
738 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_logl)
739 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_log10l)
740 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_modfl)
741 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_powl)
742 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_sqrtl)
743 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(_sincosl)
744 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_finitel)
747 CXXFLAGS="$ac_save_CXXFLAGS"
752 dnl Check to see if there is native support for complex
754 dnl Don't compile bits in math/* if native support exits.
756 dnl Define USE_COMPLEX_LONG_DOUBLE etc if "atan2l/copysignl" is found.
758 dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
759 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
760 dnl Check for complex versions of math functions of platform.
761 AC_CHECK_LIB(m, main)
762 AC_REPLACE_MATHFUNCS(nan hypot hypotf atan2f expf copysignf)
764 dnl Compile the long double complex functions only if the function
765 dnl provides the non-complex long double functions that are needed.
766 dnl Currently this includes copysignl and atan2l, which should be
767 dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
768 USE_COMPLEX_LONG_DOUBLE=no
769 if test x$ac_cv_func_atan2l = x"yes" \
770 && test x$ac_cv_func_copysignl = x"yes"; then
771 USE_COMPLEX_LONG_DOUBLE=yes
772 AC_REPLACE_MATHFUNCS(hypotl signbitl)
775 AC_SUBST(USE_COMPLEX_LONG_DOUBLE)
779 dnl Check to see what architecture and operating system we are compiling
780 dnl for. Also, if architecture- or OS-specific flags are required for
781 dnl compilation, pick them up here.
783 dnl GLIBCPP_CHECK_TARGET
784 AC_DEFUN(GLIBCPP_CHECK_TARGET, [
785 . [$]{glibcpp_basedir}/configure.target
786 AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
787 AC_MSG_RESULT(OS config directory is $os_include_dir)
788 AC_LINK_FILES($os_include_dir/bits/os_defines.h, include/bits/os_defines.h)
793 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
794 dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
795 dnl must have been previously checked.)
797 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
798 dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
800 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
801 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
803 dnl Test wchar.h for mbstate_t, which is needed for char_traits and
804 dnl others even if wchar_t support is not on.
805 AC_MSG_CHECKING([for mbstate_t])
806 AC_TRY_COMPILE([#include <wchar.h>],
807 [mbstate_t teststate;],
808 have_mbstate_t=yes, have_mbstate_t=no)
809 AC_MSG_RESULT($have_mbstate_t)
810 if test x"$have_mbstate_t" = xyes; then
811 AC_DEFINE(HAVE_MBSTATE_T)
814 dnl Sanity check for existence of ISO C99 headers for extended encoding.
815 AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
816 AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
818 dnl Only continue checking if the ISO C99 headers exist and support is on.
819 if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes \
820 && test x"$enable_c_mbchar" != xno; then
822 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
823 dnl numeric_limits can instantiate type_traits<wchar_t>
824 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
825 AC_TRY_COMPILE([#include <wchar.h>],
826 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
827 has_wchar_minmax=yes, has_wchar_minmax=no)
828 AC_MSG_RESULT($has_wchar_minmax)
830 dnl Test wchar.h for WEOF, which is what we use to determine whether
831 dnl to specialize for char_traits<wchar_t> or not.
832 AC_MSG_CHECKING([for WEOF])
835 #include <stddef.h>],
837 has_weof=yes, has_weof=no)
838 AC_MSG_RESULT($has_weof)
840 dnl Tests for wide character functions used in char_traits<wchar_t>.
841 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset \
842 wcsrtombs mbsrtowcs, ac_wfuncs=yes, ac_wfuncs=no)
844 AC_MSG_CHECKING([for ISO C99 wchar_t support])
845 if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes \
846 && test x"$ac_wfuncs" = xyes; then
847 ac_isoC99_wchar_t=yes
851 AC_MSG_RESULT($ac_isoC99_wchar_t)
853 dnl Use iconv for wchar_t to char conversions. As such, check for
854 dnl X/Open Portability Guide, version 2 features (XPG2).
855 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
856 AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
858 dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
859 AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
861 LIBS="$LIBS $libiconv"
863 AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
864 ac_XPG2funcs=yes, ac_XPG2funcs=no)
868 AC_MSG_CHECKING([for XPG2 wchar_t support])
869 if test x"$ac_has_iconv_h" = xyes && test x"$ac_has_langinfo_h" = xyes \
870 && test x"$ac_XPG2funcs" = xyes; then
875 AC_MSG_RESULT($ac_XPG2_wchar_t)
877 dnl At the moment, only enable wchar_t specializations if all the
878 dnl above support is present.
879 AC_MSG_CHECKING([for enabled wchar_t specializations])
880 if test x"$ac_isoC99_wchar_t" = xyes \
881 && test x"$ac_XPG2_wchar_t" = xyes; then
882 libinst_wstring_la="libinst-wstring.la"
883 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
886 libinst_wstring_la=""
889 AC_SUBST(libinst_wstring_la)
892 dnl Wide characters disabled by the user.
893 AC_MSG_WARN([wchar_t support disabled.])
899 dnl Check to see if this version of GNU C++ is afflicted by bugs in
900 dnl __complex__ float support.
902 dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy.
904 dnl Check to see if this version of GNU C++ is afflicted by bugs in
905 dnl __complex__ support.Check for buggy __complex__ that will cause ICE in
906 dnl gcc-2.95.x when using the library, unless we define the default copy
907 dnl ctor in the specializations of complex<>.
909 dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy.
910 dnl GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
911 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT, [
912 AC_REQUIRE([AC_PROG_CXX])
914 AC_MSG_CHECKING([for GNU C++ __complex__ support])
915 AC_CACHE_VAL(glibcpp_cv_complex, [
918 AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
919 dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
920 [ dcomplex x; f(x); ],
921 glibcpp_cv_complex=ok,
922 glibcpp_cv_complex=buggy
926 AC_MSG_RESULT($glibcpp_cv_complex)
927 if test $glibcpp_cv_complex = buggy; then
928 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
931 AC_MSG_CHECKING([for GNU C++ __complex__ float support])
932 AC_CACHE_VAL(glibcpp_cv_float_complex, [
936 cat > conftest.h <<EOB
938 // Check for buggy __complex__ that causes ICE in most versions of egcs
939 // and gcc-2.95.x on certain platforms (eg., x86-win32).
941 // See http://gcc.gnu.org/ml/gcc-bugs/1999-07n/msg00845.html for
942 // more info on the bug itself.
947 __complex__ float m_value;
948 float_complex (float = 0.0f, float = 0.0f);
949 float_complex (__complex__ float val) : m_value (val) {}
950 float_complex foo (const float_complex &val)
951 { return float_complex (~val.m_value); }
954 AC_TRY_COMPILE([#include "conftest.h"], ,
955 glibcpp_cv_float_complex=ok,
956 glibcpp_cv_float_complex=buggy
960 AC_MSG_RESULT($glibcpp_cv_float_complex)
961 if test $glibcpp_cv_float_complex = buggy; then
962 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
968 dnl Check for special debugging mode; not for production use.
970 dnl GLIBCPP_ENABLE_DEBUG
971 dnl --enable-debug sets '-ggdb3 -O0'.
972 dnl --disable-debug sets '-g' and whatever optimization options the
973 dnl compiler can handle.
974 dnl + --enable-maintainer-mode automatically defaults this to on.
975 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
976 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
977 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
978 dnl defaults to `no'.
979 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
980 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
982 changequote(<<, >>)dnl
983 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
985 [case "${enableval}" in
986 yes) enable_debug=yes ;;
987 no) enable_debug=no ;;
988 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
990 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
992 dnl Option parsed, now set things appropriately
993 case "${enable_debug}" in
995 DEBUG_FLAGS='-O0 -ggdb3'
1001 AC_SUBST(DEBUG_FLAGS)
1006 dnl Check for "unusual" flags to pass to the compiler while building.
1008 dnl GLIBCPP_ENABLE_CXX_FLAGS
1009 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
1010 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
1011 dnl Somehow this same set of flags must be passed when [re]building
1013 dnl --disable-cxx-flags passes nothing.
1014 dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
1015 dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
1016 dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
1017 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
1018 dnl If "default flags" is an empty string (or "none"), the effect is
1019 dnl the same as --disable or --enable=no.
1020 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
1021 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1022 AC_ARG_ENABLE(cxx-flags,
1023 changequote(<<, >>)dnl
1024 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
1025 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
1026 changequote([, ])dnl
1027 [case "x$enableval" in
1029 AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
1031 enable_cxx_flags='' ;;
1033 enable_cxx_flags="$enableval" ;;
1035 enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
1037 dnl Thinko on my part during design. This kludge is the workaround.
1038 if test "$enable_cxx_flags" = "none"; then
1039 enable_cxx_flags='';
1042 dnl Run through flags (either default or command-line) and set anything
1043 dnl extra (e.g., #defines) that must accompany particular g++ options.
1044 if test -n "$enable_cxx_flags"; then
1045 for f in $enable_cxx_flags; do
1049 *) # and we're trying to pass /what/ exactly?
1050 AC_MSG_ERROR([compiler flags start with a -]) ;;
1054 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1055 AC_SUBST(EXTRA_CXX_FLAGS)
1060 dnl Check for which locale library to use: gnu or generic.
1062 dnl GLIBCPP_ENABLE_CLOCALE
1063 dnl --enable-clocale=gnu sets config/c_locale_gnu.cc and friends
1064 dnl --enable-clocale=generic sets config/c_locale_generic.cc and friends
1066 dnl default is generic
1068 AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
1069 AC_MSG_CHECKING([for clocale to use])
1070 AC_ARG_ENABLE(clocale,
1071 [ --enable-clocale enable model for target locale package.
1072 --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
1074 if test x$enable_clocale = xno; then
1075 enable_clocale=generic
1077 enable_clocale=generic)
1079 enable_clocale_flag=$enable_clocale
1081 dnl Check if a valid locale package
1082 case x${enable_clocale_flag} in
1084 CLOCALE_H=config/c_locale_gnu.h
1085 CLOCALE_CC=config/c_locale_gnu.cc
1089 CLOCALE_H=config/c_locale_generic.h
1090 CLOCALE_CC=config/c_locale_generic.cc
1091 AC_MSG_RESULT(generic)
1094 echo "$enable_clocale is an unknown locale package" 1>&2
1099 AC_LINK_FILES($CLOCALE_H, include/bits/c++locale.h)
1100 AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
1105 dnl Check for which I/O library to use: libio, or something specific.
1107 dnl GLIBCPP_ENABLE_CSTDIO
1108 dnl --enable-cstdio=libio sets config/c_io_libio.h and friends
1110 dnl default is stdio
1112 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
1113 AC_MSG_CHECKING([for cstdio to use])
1114 AC_ARG_ENABLE(cstdio,
1115 [ --enable-cstdio enable stdio for target io package.
1116 --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
1118 if test x$enable_cstdio = xno; then
1121 enable_cstdio=stdio)
1123 enable_cstdio_flag=$enable_cstdio
1125 dnl Check if a valid I/O package
1126 case x${enable_cstdio_flag} in
1128 CSTDIO_H=config/c_io_libio.h
1129 CSTDIO_CC=config/c_io_libio.cc
1130 AC_MSG_RESULT(libio)
1132 # see if we are on a system with libio native (ie, linux)
1133 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
1135 # Need to check and see what version of glibc is being used. If
1136 # it's not glibc-2.2 or higher, then we'll need to go ahead and
1137 # compile most of libio for linux systems.
1138 if test x$has_libio = x"yes"; then
1141 AC_MSG_CHECKING([for glibc version >= 2.2])
1142 AC_EGREP_CPP([ok], [
1143 #include <features.h>
1144 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1147 ], glibc_satisfactory=yes, glibc_satisfactory=no)
1148 AC_MSG_RESULT($glibc_satisfactory)
1152 # XXX at the moment, admit defeat and force the recompilation
1153 # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
1154 glibc_satisfactory=no
1156 if test x$glibc_satisfactory = x"yes"; then
1161 # bkoz XXX need to add checks to enable this
1162 # pme XXX here's a first pass at such a check
1163 if test x$enable_c_mbchar != xno; then
1171 # Using libio, but <libio.h> doesn't exist on the target system. . .
1173 # bkoz XXX need to add checks to enable this
1174 # pme XXX here's a first pass at such a check
1175 if test x$enable_c_mbchar != xno; then
1182 xstdio | x | xno | xnone | xyes)
1184 CSTDIO_H=config/c_io_stdio.h
1185 CSTDIO_CC=config/c_io_stdio.cc
1186 AC_MSG_RESULT(stdio)
1188 # We're not using stdio.
1191 # Wide characters are not supported with this package.
1195 echo "$enable_cstdio is an unknown io package" 1>&2
1199 AC_LINK_FILES($CSTDIO_H, include/bits/c++io.h)
1200 AC_LINK_FILES($CSTDIO_CC, src/c++io.cc)
1202 # 2000-08-04 bkoz hack
1203 CCODECVT_C=config/c_io_libio_codecvt.c
1204 AC_LINK_FILES($CCODECVT_C, libio/c_codecvt.c)
1205 # 2000-08-04 bkoz hack
1207 AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
1208 test "$need_libio" = yes || test "$need_wlibio" = yes)
1209 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
1210 AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
1211 if test "$need_libio" = yes || test "$need_wlibio" = yes; then
1212 libio_la=../libio/libio.la
1221 dnl Check for which threading library to use.
1223 dnl GLIBCPP_ENABLE_THREADS
1224 dnl --enable-threads=posix sets config/threads-posix.h et. al.
1226 dnl Default is no threads, which also disables _IO_MTSAFE_IO in
1227 dnl libio. Any actual thread package will enable it.
1229 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
1230 dnl Note this comes from the gcc/config.in and libjava/config.in
1231 dnl Efforts should be made to keep this in sync.
1232 AC_MSG_CHECKING([for threads package to use])
1233 AC_ARG_ENABLE(threads,
1234 [ --enable-threads enable thread usage for target GCC.
1235 --enable-threads=LIB use LIB thread package for target GCC. [default=no]
1237 if test x$enable_threads = xno; then
1242 enable_threads_flag=$enable_threads
1244 dnl Check if a valid thread package
1245 case x${enable_threads_flag} in
1248 target_thread_file='single'
1252 target_thread_file='posix'
1254 xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
1255 xsolaris | xwin32 | xdce | xvxworks)
1256 target_thread_file=$enable_threads_flag
1259 echo "$enable_threads is an unknown thread package" 1>&2
1264 dnl Check for thread package actually supported in libstdc++
1266 case "$target_thread_file" in
1268 THREADH=threads-no.h
1271 THREADH=threads-posix.h
1273 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
1274 AC_MSG_ERROR(thread package $THREADS not yet supported)
1277 AC_MSG_ERROR($THREADS is an unsupported/unknown thread package)
1280 AC_MSG_RESULT($THREADH)
1282 AC_LINK_FILES(config/$THREADH, include/bits/c++threads.h)
1283 if test $THREADH != threads-no.h; then
1284 AC_DEFINE(_GLIBCPP_USE_THREADS)
1290 dnl Check for template specializations for the 'long long' type extension.
1292 dnl GLIBCPP_ENABLE_LONG_LONG
1293 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
1294 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
1295 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
1296 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1297 dnl defaults to `no'.
1298 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1300 dnl GLIBCPP_ENABLE_LONG_LONG
1301 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
1302 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
1304 AC_ARG_ENABLE(long-long,
1305 changequote(<<, >>)dnl
1306 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
1307 changequote([, ])dnl
1308 [case "$enableval" in
1309 yes) enable_long_long=yes ;;
1310 no) enable_long_long=no ;;
1311 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1313 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1315 # Allow use of os-dependent settings, so that macros that turn on
1316 # C99 capabilities can be defined and used in a consistent way.
1317 OS_INC_PATH=${srcdir}/$os_include_dir
1318 ac_test_CFLAGS="${CFLAGS+set}"
1319 ac_save_CFLAGS="$CFLAGS"
1320 CFLAGS="-I$OS_INC_PATH"
1322 # Check for the existence of functions used if long long is enabled.
1323 AC_CHECK_FUNC(strtoll,,ac_strtoll=no)
1324 AC_CHECK_FUNC(strtoull,,ac_strtoull=no)
1326 # Check for lldiv_t, et. al.
1327 AC_MSG_CHECKING([for lldiv_t declaration])
1328 AC_CACHE_VAL(glibcpp_lldiv_t_use, [
1329 AC_TRY_COMPILE([#include <bits/os_defines.h>
1330 #include <stdlib.h>],
1332 [glibcpp_lldiv_t_use=yes], [glibcpp_lldiv_t_use=no])
1334 AC_MSG_RESULT($glibcpp_lldiv_t_use)
1335 if test x$glibcpp_lldiv_t_use = x"yes"; then
1336 AC_DEFINE(HAVE_LLDIV_T)
1339 AC_MSG_CHECKING([for enabled long long])
1340 if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then
1341 enable_long_long=no;
1343 AC_MSG_RESULT($enable_long_long)
1345 # Option parsed, now set things appropriately
1346 if test x"$enable_long_long" = xyes; then
1347 AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1351 CFLAGS="$ac_save_CFLAGS"
1356 dnl Check for what kind of C headers to use.
1358 dnl GLIBCPP_ENABLE_CHEADERS
1359 dnl --enable-cheaders= [does stuff].
1360 dnl --disable-cheaders [does not do anything, really].
1361 dnl + This will eventually need to be 'c_shadow' by default.
1362 dnl + Usage: GLIBCPP_ENABLE_CHEADERS[(DEFAULT)]
1363 dnl Where DEFAULT is either `c' or `c_std' or 'c_shadow'.
1364 dnl If ommitted, it defaults to `c_std'.
1365 AC_DEFUN(GLIBCPP_ENABLE_CHEADERS, [dnl
1366 define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
1367 AC_MSG_CHECKING([for c header strategy to use])
1368 AC_ARG_ENABLE(cheaders,
1369 changequote(<<, >>)dnl
1370 << --enable-cheaders construct "C" header files for
1371 g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
1373 [case "$enableval" in
1378 enable_cheaders=c_std
1381 enable_cheaders=c_shadow
1383 *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
1386 enable_cheaders=GLIBCPP_ENABLE_CHEADERS_DEFAULT)
1387 AC_MSG_RESULT($enable_cheaders)
1389 dnl Option parsed, now set things appropriately
1390 case "$enable_cheaders" in
1392 CSHADOW_FLAGS="-fno-builtin"
1393 C_INCLUDE_DIR='${top_srcdir}/include/c_shadow'
1394 AC_DEFINE(_GLIBCPP_USE_SHADOW_HEADERS)
1398 C_INCLUDE_DIR='${top_srcdir}/include/c_std'
1402 C_INCLUDE_DIR='${top_srcdir}/include/c'
1406 AC_SUBST(CSHADOW_FLAGS)
1407 AC_SUBST(C_INCLUDE_DIR)
1408 AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cheaders" = c_shadow)
1413 dnl Check for wide character support. Has the same effect as the option
1414 dnl in gcc's configure, but in a form that autoconf can mess with.
1416 dnl GLIBCPP_ENABLE_C_MBCHAR
1417 dnl --enable-c-mbchar requests all the wchar_t stuff.
1418 dnl --disable-c-mbchar doesn't.
1419 dnl + Usage: GLIBCPP_ENABLE_C_MBCHAR[(DEFAULT)]
1420 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1421 dnl defaults to `no'.
1422 AC_DEFUN(GLIBCPP_ENABLE_C_MBCHAR, [dnl
1423 define([GLIBCPP_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
1424 AC_ARG_ENABLE(c-mbchar,
1425 changequote(<<, >>)dnl
1426 << --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCPP_ENABLE_C_MBCHAR_DEFAULT],
1427 changequote([, ])dnl
1428 [case "$enableval" in
1429 yes) enable_c_mbchar=yes ;;
1430 no) enable_c_mbchar=no ;;
1431 *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
1433 enable_c_mbchar=GLIBCPP_ENABLE_C_MBCHAR_DEFAULT)dnl
1434 dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
1439 dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
1441 dnl GLIBCPP_INCLUDE_DIR
1443 dnl TOPLEVEL_INCLUDES
1444 dnl LIBMATH_INCLUDES
1445 dnl LIBSUPCXX_INCLUDES
1447 dnl CSHADOW_INCLUDES
1449 dnl GLIBCPP_EXPORT_INCLUDE
1450 AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
1451 # Root level of the include sources.
1452 GLIBCPP_INCLUDE_DIR='$(top_srcdir)/include'
1454 # Can either use include/c or include/c_std to grab "C" headers. This
1455 # variable is set to the include directory currently in use.
1456 # set with C_INCLUDE_DIR in GLIBCPP_ENABLE_CHEADERS
1458 # Passed down for canadian crosses.
1459 if test x"$CANADIAN" = xyes; then
1460 TOPLEVEL_INCLUDES='-I$(includedir)'
1463 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1465 LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
1467 #if GLIBCPP_NEED_LIBIO
1468 LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
1470 #LIBIO_INCLUDES='-I$(top_srcdir)/libio'
1473 #if GLIBCPP_USE_CSHADOW
1474 # CSHADOW_INCLUDES='-I$(GLIBCPP_INCLUDE_DIR)/std -I$(C_INCLUDE_DIR) \
1475 # -I$(top_blddir)/cshadow'
1477 CSTD_INCLUDES='-I$(GLIBCPP_INCLUDE_DIR)/std -I$(C_INCLUDE_DIR)'
1480 # Now, export this to all the little Makefiles....
1481 AC_SUBST(GLIBCPP_INCLUDE_DIR)
1482 AC_SUBST(TOPLEVEL_INCLUDES)
1483 AC_SUBST(LIBMATH_INCLUDES)
1484 AC_SUBST(LIBSUPCXX_INCLUDES)
1485 AC_SUBST(LIBIO_INCLUDES)
1486 AC_SUBST(CSTD_INCLUDES)
1491 dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
1493 AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
1494 # Optimization flags that are probably a good idea for thrill-seekers. Just
1495 # uncomment the lines below and make, everything else is ready to go...
1496 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
1498 AC_SUBST(OPTIMIZE_CXXFLAGS)
1500 WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings -Winline'
1501 AC_SUBST(WARN_FLAGS)
1505 dnl GLIBCPP_EXPORT_INSTALL_INFO
1506 dnl calculates gxx_install_dir
1508 AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
1510 AC_MSG_CHECKING([for interface version number])
1511 libstdcxx_interface=$INTERFACE
1512 AC_MSG_RESULT($libstdcxx_interface)
1514 # Process the option --with-gxx-include-dir=<path to include-files directory>
1515 AC_MSG_CHECKING([for --with-gxx-include-dir])
1516 AC_ARG_WITH(gxx-include-dir,
1517 [ --with-gxx-include-dir the installation directory for include files],
1518 [case "${withval}" in
1520 AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
1527 gxx_include_dir=${withval}
1529 esac], [gxx_include_dir=no])
1530 AC_MSG_RESULT($gxx_include_dir)
1532 # Process the option "--enable-version-specific-runtime-libs"
1533 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
1534 AC_ARG_ENABLE(version-specific-runtime-libs,
1535 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
1536 [ version_specific_libs=yes
1537 # Need the gcc compiler version to know where to install libraries
1538 # and header files if --enable-version-specific-runtime-libs option
1541 gcc_tmp=`grep version_string ${srcdir}/../gcc/version.c | awk '{print $6}'`
1542 gcc_num=`echo ${gcc_tmp} | sed 's/\"//g'`
1543 #gcc_date=`grep version_string ${srcdir}/../gcc/version.c | awk '{print $7}'`
1544 #gcc_version=$gcc_num-$gcc_date
1545 gcc_version=$gcc_num
1546 gxx_include_dir=$(libdir)/gcc-lib/$(target_alias)/$(gcc_version)/include/g++
1548 AC_SUBST(gcc_version)
1549 AM_CONDITIONAL(VERSION_SPECIFIC_LIBS, test x"$version_specific_libs" = x"yes")
1550 ],version_specific_libs=no)
1551 AC_MSG_RESULT($version_specific_libs)
1553 AC_MSG_CHECKING([for install location])
1554 if test x"$version_specific_libs" = x"no" \
1555 && test x"$gxx_include_dir"=x"no"; then
1556 gxx_include_dir=${prefix}/include/g++-${libstdcxx_interface}
1558 AC_MSG_RESULT($gxx_include_dir)
1559 AC_SUBST(gxx_include_dir)
1563 # Check whether LC_MESSAGES is available in <locale.h>.
1564 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1566 # This file file be copied and used freely without restrictions. It can
1567 # be used in projects which are not available under the GNU Public License
1568 # but which still want to provide support for the GNU gettext functionality.
1569 # Please note that the actual code is *not* freely available.
1573 AC_DEFUN(AC_LC_MESSAGES, [
1574 AC_CHECK_HEADER(locale.h, [
1575 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1576 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1577 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1578 if test $ac_cv_val_LC_MESSAGES = yes; then
1579 AC_DEFINE(HAVE_LC_MESSAGES)
1585 # Check for functions in math library.
1586 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1588 # This file can be copied and used freely without restrictions. It can
1589 # be used in projects which are not available under the GNU Public License
1590 # but which still want to provide support for the GNU gettext functionality.
1591 # Please note that the actual code is *not* freely available.
1595 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1596 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1597 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])
1598 AC_SUBST(LIBMATHOBJS)dnl
1602 # Check for string functions.
1603 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1605 # This file can be copied and used freely without restrictions. It can
1606 # be used in projects which are not available under the GNU Public License
1607 # but which still want to provide support for the GNU gettext functionality.
1608 # Please note that the actual code is *not* freely available.
1612 dnl AC_REPLACE_STRINGFUNCS(FUNCTION...)
1613 AC_DEFUN(AC_REPLACE_STRINGFUNCS,
1614 [AC_CHECK_FUNCS([$1], , [LIBSTRINGOBJS="$LIBSTRINGOBJS ${ac_func}.lo"])
1615 AC_SUBST(LIBSTRINGOBJS)dnl
1619 dnl This macro searches for a GNU version of make. If a match is found, the
1620 dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
1621 dnl set to "#". This is useful for including a special features in a Makefile,
1622 dnl which cannot be handled by other versions of make. The variable
1623 dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
1624 dnl the empty string otherwise.
1626 dnl Here is an example of its use:
1628 dnl Makefile.in might contain:
1630 dnl # A failsafe way of putting a dependency rule into a makefile
1632 dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
1634 dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
1635 dnl @ifGNUmake@ include $(DEPEND)
1636 dnl @ifGNUmake@ endif
1638 dnl Then configure.in would normally contain:
1640 dnl CHECK_GNU_MAKE()
1641 dnl AC_OUTPUT(Makefile)
1643 dnl Then perhaps to cause gnu make to override any other make, we could do
1644 dnl something like this (note that GNU make always looks for GNUmakefile first):
1646 dnl if ! test x$_cv_gnu_make_command = x ; then
1647 dnl mv Makefile GNUmakefile
1648 dnl echo .DEFAULT: > Makefile ;
1649 dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
1652 dnl Then, if any (well almost any) other make is called, and GNU make also
1653 dnl exists, then the other make wraps the GNU make.
1655 dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
1656 dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
1658 dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
1659 dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
1660 dnl #### conditional's subshell (" --version" is not a command), using a
1661 dnl #### different option to grep(1).
1663 dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
1664 dnl #### ${MAKE:-make}).
1667 GLIBCPP_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
1668 _cv_gnu_make_command='' ;
1669 dnl Search all the common names for GNU make
1670 for a in "${MAKE-make}" make gmake gnumake ; do
1671 if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
1673 _cv_gnu_make_command=$a ;
1678 dnl If there was a GNU version, then set @ifGNUmake@ to the empty
1679 dnl string, '#' otherwise
1680 if test "x$_cv_gnu_make_command" != "x" ; then
1688 sinclude(../libtool.m4)
1689 dnl The lines below arrange for aclocal not to bring an installed
1690 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
1691 dnl add a definition of LIBTOOL to Makefile.in.
1692 ifelse(,,,[AC_SUBST(LIBTOOL)
1693 AC_DEFUN([AM_PROG_LIBTOOL])
1694 AC_DEFUN([AC_LIBTOOL_DLOPEN])
1695 AC_DEFUN([AC_PROG_LD])
1699 # Do all the work for Automake. This macro actually does too much --
1700 # some checks are only needed if your package does certain things.
1701 # But this isn't really a big deal.
1706 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
1708 AC_DEFUN(AM_INIT_AUTOMAKE,
1709 [AC_REQUIRE([AC_PROG_INSTALL])
1714 dnl test to see if srcdir already configured
1715 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1716 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1719 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1720 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
1721 AC_REQUIRE([AM_SANITY_CHECK])
1722 AC_REQUIRE([AC_ARG_PROGRAM])
1723 dnl FIXME This is truly gross.
1724 missing_dir=`cd $ac_aux_dir && pwd`
1725 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
1726 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
1727 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
1728 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
1729 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
1730 AC_REQUIRE([AC_PROG_MAKE_SET])])
1733 # Check to make sure that the build environment is sane.
1736 AC_DEFUN(AM_SANITY_CHECK,
1737 [AC_MSG_CHECKING([whether build environment is sane])
1740 echo timestamp > conftestfile
1741 # Do `set' in a subshell so we don't clobber the current shell's
1742 # arguments. Must try -L first in case configure is actually a
1743 # symlink; some systems play weird games with the mod time of symlinks
1744 # (eg FreeBSD returns the mod time of the symlink's containing
1747 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1748 if test "[$]*" = "X"; then
1750 set X `ls -t $srcdir/configure conftestfile`
1752 if test "[$]*" != "X $srcdir/configure conftestfile" \
1753 && test "[$]*" != "X conftestfile $srcdir/configure"; then
1755 # If neither matched, then we have a broken ls. This can happen
1756 # if, for instance, CONFIG_SHELL is bash and it inherits a
1757 # broken ls alias from the environment. This has actually
1758 # happened. Such a system could not be considered "sane".
1759 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1760 alias in your environment])
1763 test "[$]2" = conftestfile
1769 AC_MSG_ERROR([newly created file is older than distributed files!
1770 Check your system clock])
1773 AC_MSG_RESULT(yes)])
1775 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1776 dnl The program must properly implement --version.
1777 AC_DEFUN(AM_MISSING_PROG,
1778 [AC_MSG_CHECKING(for working $2)
1779 # Run test in a subshell; some versions of sh will print an error if
1780 # an executable is not found, even if stderr is redirected.
1781 # Redirect stdin to placate older versions of autoconf. Sigh.
1782 if ($2 --version) < /dev/null > /dev/null 2>&1; then
1784 AC_MSG_RESULT(found)
1787 AC_MSG_RESULT(missing)
1791 # Add --enable-maintainer-mode option to configure.
1796 AC_DEFUN(AM_MAINTAINER_MODE,
1797 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1798 dnl maintainer-mode is disabled by default
1799 AC_ARG_ENABLE(maintainer-mode,
1800 [ --enable-maintainer-mode enable make rules and dependencies not useful
1801 (and sometimes confusing) to the casual installer],
1802 USE_MAINTAINER_MODE=$enableval,
1803 USE_MAINTAINER_MODE=no)
1804 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1805 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1806 MAINT=$MAINTAINER_MODE_TRUE
1811 # Define a conditional.
1813 AC_DEFUN(AM_CONDITIONAL,
1824 # Like AC_CONFIG_HEADER, but automatically create stamp file.
1826 AC_DEFUN(AM_CONFIG_HEADER,
1828 AC_CONFIG_HEADER([$1])
1829 dnl When config.status generates a header, we must update the stamp-h file.
1830 dnl This file resides in the same directory as the config header
1831 dnl that is generated. We must strip everything past the first ":",
1832 dnl and everything past the last "/".
1833 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1834 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1835 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1837 for am_file in <<$1>>; do
1838 case " <<$>>CONFIG_HEADERS " in
1839 *" <<$>>am_file "*<<)>>
1840 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1843 am_indx=`expr "<<$>>am_indx" + 1`