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 declared when using the c++ compiler
331 dnl ASSUMES argument is a math function with ONE parameter
333 dnl GLIBCPP_CHECK_MATH_DECL_1
334 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_1, [
335 AC_MSG_CHECKING([for $1 declaration])
336 if test x${glibcpp_cv_func_$1_use+set} != xset; then
337 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
340 AC_TRY_COMPILE([#include <math.h>
346 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
350 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
354 dnl Check to see if the (math function) argument passed is
355 dnl 1) declared when using the c++ compiler
356 dnl 2) has "C" linkage
357 dnl 3) if not, see if 1) and 2) for argument prepended with '_'
359 dnl Define HAVE_CARGF etc if "cargf" is declared and links
361 dnl argument 1 is name of function to check
363 dnl ASSUMES argument is a math function with ONE parameter
365 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1
366 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
367 GLIBCPP_CHECK_MATH_DECL_1($1)
368 if test x$glibcpp_cv_func_$1_use = x"yes"; then
371 GLIBCPP_CHECK_MATH_DECL_1(_$1)
372 if test x$glibcpp_cv_func__$1_use = x"yes"; then
380 dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
381 dnl of functions at once. It's an all-or-nothing check -- either
382 dnl HAVE_XYZ is defined for each of the functions, or for none of them.
383 dnl Doing it this way saves significant configure time.
384 AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
385 AC_MSG_CHECKING([for $1 functions])
386 AC_CACHE_VAL(glibcpp_cv_func_$2_use, [
389 AC_TRY_COMPILE([#include <math.h>],
390 [ `for x in $3; do echo "$x (0);"; done` ],
391 [glibcpp_cv_func_$2_use=yes],
392 [glibcpp_cv_func_$2_use=no])
394 AC_MSG_RESULT($glibcpp_cv_func_$2_use)
395 if test x$glibcpp_cv_func_$2_use = x"yes"; then
401 dnl Check to see if the (math function) argument passed is
402 dnl declared when using the c++ compiler
403 dnl ASSUMES argument is a math function with ONE parameter
405 dnl GLIBCPP_CHECK_MATH_DECL_2
406 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_2, [
407 AC_MSG_CHECKING([for $1 declaration])
408 if test x${glibcpp_cv_func_$1_use+set} != xset; then
409 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
412 AC_TRY_COMPILE([#include <math.h>],
414 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
418 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
422 dnl Check to see if the (math function) argument passed is
423 dnl 1) declared when using the c++ compiler
424 dnl 2) has "C" linkage
426 dnl Define HAVE_CARGF etc if "cargf" is declared and links
428 dnl argument 1 is name of function to check
430 dnl ASSUMES argument is a math function with TWO parameters
432 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2
433 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
434 GLIBCPP_CHECK_MATH_DECL_2($1)
435 if test x$glibcpp_cv_func_$1_use = x"yes"; then
438 GLIBCPP_CHECK_MATH_DECL_2(_$1)
439 if test x$glibcpp_cv_func__$1_use = x"yes"; then
447 dnl Check to see if the (math function) argument passed is
448 dnl declared when using the c++ compiler
449 dnl ASSUMES argument is a math function with ONE parameter
451 dnl GLIBCPP_CHECK_MATH_DECL_3
452 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_3, [
453 AC_MSG_CHECKING([for $1 declaration])
454 if test x${glibcpp_cv_func_$1_use+set} != xset; then
455 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
458 AC_TRY_COMPILE([#include <math.h>],
460 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
464 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
468 dnl Check to see if the (math function) argument passed is
469 dnl 1) declared when using the c++ compiler
470 dnl 2) has "C" linkage
472 dnl Define HAVE_CARGF etc if "cargf" is declared and links
474 dnl argument 1 is name of function to check
476 dnl ASSUMES argument is a math function with THREE parameters
478 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3
479 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
480 GLIBCPP_CHECK_MATH_DECL_3($1)
481 if test x$glibcpp_cv_func_$1_use = x"yes"; then
484 GLIBCPP_CHECK_MATH_DECL_3(_$1)
485 if test x$glibcpp_cv_func__$1_use = x"yes"; then
493 dnl Check to see if the (stdlib function) argument passed is
494 dnl 1) declared when using the c++ compiler
495 dnl 2) has "C" linkage
497 dnl Define HAVE_STRTOLD if "strtold" is declared and links
498 dnl Define HAVE_STRTOF if "strtof" is declared and links
500 dnl argument 1 is name of function to check
502 dnl ASSUMES argument is a math function with TWO parameters
504 dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2
505 AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
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 <stdlib.h>],
513 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
517 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
518 if test x$glibcpp_cv_func_$1_use = x"yes"; then
525 dnl Because the builtins are picky picky picky about the arguments they take,
526 dnl do an explict linkage tests here.
527 dnl Check to see if the (math function) argument passed is
528 dnl 1) declared when using the c++ compiler
529 dnl 2) has "C" linkage
531 dnl Define HAVE_CARGF etc if "cargf" is declared and links
533 dnl argument 1 is name of function to check
535 dnl ASSUMES argument is a math function with ONE parameter
537 dnl GLIBCPP_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
538 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
539 AC_MSG_CHECKING([for $1 declaration])
540 if test x${glibcpp_cv_func_$1_use+set} != xset; then
541 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
544 AC_TRY_COMPILE([#include <math.h>],
546 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
550 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
551 if test x$glibcpp_cv_func_$1_use = x"yes"; then
552 AC_MSG_CHECKING([for $1 linkage])
553 if test x${glibcpp_cv_func_$1_link+set} != xset; then
554 AC_CACHE_VAL(glibcpp_cv_func_$1_link, [
555 AC_TRY_LINK([#include <math.h>],
557 [glibcpp_cv_func_$1_link=yes], [glibcpp_cv_func_$1_link=no])
560 AC_MSG_RESULT($glibcpp_cv_func_$1_link)
561 if test x$glibcpp_cv_func_$1_link = x"yes"; then
562 ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
563 AC_DEFINE_UNQUOTED(${ac_tr_func})
570 dnl Check to see what builtin math functions are supported
572 dnl check for __builtin_abs
573 dnl check for __builtin_fabsf
574 dnl check for __builtin_fabs
575 dnl check for __builtin_fabl
576 dnl check for __builtin_labs
577 dnl check for __builtin_sqrtf
578 dnl check for __builtin_sqrtl
579 dnl check for __builtin_fsqrt
580 dnl check for __builtin_sinf
581 dnl check for __builtin_sin
582 dnl check for __builtin_sinl
583 dnl check for __builtin_cosf
584 dnl check for __builtin_cos
585 dnl check for __builtin_cosl
587 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
588 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
589 dnl Test for builtin math functions.
590 dnl These are made in gcc/c-common.c
591 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
592 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
593 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
594 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
595 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
597 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
598 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fsqrt)
599 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
601 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
602 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
603 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
605 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
606 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
607 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
609 dnl There is, without a doubt, a more elegant way to have these
610 dnl names exported so that they won't be stripped out of acconfig.h by
611 dnl autoheader. I leave this as an exercise to somebody less frustrated
612 dnl than I.... please email the libstdc++ list if you can figure out a
613 dnl more elegant approach (see autoconf/acgen.m4 and specifically
614 dnl AC_CHECK_FUNC for things to steal.)
616 if test x$dummyvar = x"yes"; then
617 AC_DEFINE(HAVE___BUILTIN_ABS)
618 AC_DEFINE(HAVE___BUILTIN_LABS)
619 AC_DEFINE(HAVE___BUILTIN_COS)
620 AC_DEFINE(HAVE___BUILTIN_COSF)
621 AC_DEFINE(HAVE___BUILTIN_COSL)
622 AC_DEFINE(HAVE___BUILTIN_FABS)
623 AC_DEFINE(HAVE___BUILTIN_FABSF)
624 AC_DEFINE(HAVE___BUILTIN_FABSL)
625 AC_DEFINE(HAVE___BUILTIN_SIN)
626 AC_DEFINE(HAVE___BUILTIN_SINF)
627 AC_DEFINE(HAVE___BUILTIN_SINL)
628 AC_DEFINE(HAVE___BUILTIN_FSQRT)
629 AC_DEFINE(HAVE___BUILTIN_SQRTF)
630 AC_DEFINE(HAVE___BUILTIN_SQRTL)
636 dnl Check to see what the underlying c library
637 dnl These checks need to do two things:
638 dnl 1) make sure the name is declared when using the c++ compiler
639 dnl 2) make sure the name has "C" linkage
640 dnl This might seem like overkill but experience has shown that it's not...
642 dnl Define HAVE_STRTOF etc if "strtof" is found.
643 dnl Define HAVE_STRTOLD etc if "strtold" is found.
645 dnl GLIBCPP_CHECK_STDLIB_SUPPORT
646 AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
647 ac_test_CXXFLAGS="${CXXFLAGS+set}"
648 ac_save_CXXFLAGS="$CXXFLAGS"
649 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
651 AC_CHECK_FUNCS(strtof)
652 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
654 CXXFLAGS="$ac_save_CXXFLAGS"
659 dnl Check to see what the underlying c library or math library is like.
660 dnl These checks need to do two things:
661 dnl 1) make sure the name is declared when using the c++ compiler
662 dnl 2) make sure the name has "C" linkage
663 dnl This might seem like overkill but experience has shown that it's not...
665 dnl Define HAVE_CARGF etc if "cargf" is found.
667 dnl GLIBCPP_CHECK_MATH_SUPPORT
668 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
669 ac_test_CXXFLAGS="${CXXFLAGS+set}"
670 ac_save_CXXFLAGS="$CXXFLAGS"
671 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
674 AC_CHECK_LIB(m, sin, libm="-lm")
678 dnl Check to see if certain C math functions exist.
679 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
680 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
681 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
682 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
683 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
684 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
685 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
687 dnl Check to see if basic C math functions have float versions.
688 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
693 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
696 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
697 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
698 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
699 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
700 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
701 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
702 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
703 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
704 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
705 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
706 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
707 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
708 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
710 dnl Check to see if basic C math functions have long double versions.
711 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
716 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
719 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
720 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
721 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
722 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
723 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
724 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
725 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
726 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
727 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
728 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
729 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
730 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
731 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
732 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
733 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
734 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
736 dnl Some runtimes have these functions with a preceding underscore. Please
737 dnl keep this sync'd with the one above. And if you add any new symbol,
738 dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
739 dnl Check to see if certain C math functions exist.
741 dnl Check to see if basic C math functions have float versions.
742 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
744 _acosf _asinf _atanf \
746 _coshf _sinhf _tanhf)
747 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
751 dnl Check to see if basic C math functions have long double versions.
752 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
754 _acosl _asinl _atanl \
756 _coshl _sinhl _tanhl)
757 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
762 CXXFLAGS="$ac_save_CXXFLAGS"
767 dnl Check to see if there is native support for complex
769 dnl Don't compile bits in math/* if native support exits.
771 dnl Define USE_COMPLEX_LONG_DOUBLE etc if "atan2l/copysignl" is found.
773 dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
774 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
775 dnl Check for complex versions of math functions of platform.
776 AC_CHECK_LIB(m, main)
777 AC_REPLACE_MATHFUNCS(nan hypot hypotf atan2f expf copysignf)
779 dnl Compile the long double complex functions only if the function
780 dnl provides the non-complex long double functions that are needed.
781 dnl Currently this includes copysignl and atan2l, which should be
782 dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
783 USE_COMPLEX_LONG_DOUBLE=no
784 if test x$ac_cv_func_atan2l = x"yes" \
785 && test x$ac_cv_func_copysignl = x"yes"; then
786 USE_COMPLEX_LONG_DOUBLE=yes
787 AC_REPLACE_MATHFUNCS(hypotl signbitl)
790 AC_SUBST(USE_COMPLEX_LONG_DOUBLE)
794 dnl Check to see what architecture and operating system we are compiling
795 dnl for. Also, if architecture- or OS-specific flags are required for
796 dnl compilation, pick them up here.
798 dnl GLIBCPP_CHECK_TARGET
799 AC_DEFUN(GLIBCPP_CHECK_TARGET, [
800 . [$]{glibcpp_basedir}/configure.target
801 AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
802 AC_MSG_RESULT(OS config directory is $os_include_dir)
803 AC_LINK_FILES($os_include_dir/bits/os_defines.h, include/bits/os_defines.h)
808 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
809 dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
810 dnl must have been previously checked.)
812 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
813 dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
815 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
816 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
818 dnl Test wchar.h for mbstate_t, which is needed for char_traits and
819 dnl others even if wchar_t support is not on.
820 AC_MSG_CHECKING([for mbstate_t])
821 AC_TRY_COMPILE([#include <wchar.h>],
822 [mbstate_t teststate;],
823 have_mbstate_t=yes, have_mbstate_t=no)
824 AC_MSG_RESULT($have_mbstate_t)
825 if test x"$have_mbstate_t" = xyes; then
826 AC_DEFINE(HAVE_MBSTATE_T)
829 dnl Sanity check for existence of ISO C99 headers for extended encoding.
830 AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
831 AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
833 dnl Only continue checking if the ISO C99 headers exist and support is on.
834 if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes \
835 && test x"$enable_c_mbchar" != xno; then
837 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
838 dnl numeric_limits can instantiate type_traits<wchar_t>
839 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
840 AC_TRY_COMPILE([#include <wchar.h>],
841 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
842 has_wchar_minmax=yes, has_wchar_minmax=no)
843 AC_MSG_RESULT($has_wchar_minmax)
845 dnl Test wchar.h for WEOF, which is what we use to determine whether
846 dnl to specialize for char_traits<wchar_t> or not.
847 AC_MSG_CHECKING([for WEOF])
850 #include <stddef.h>],
852 has_weof=yes, has_weof=no)
853 AC_MSG_RESULT($has_weof)
855 dnl Tests for wide character functions used in char_traits<wchar_t>.
856 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset \
857 wcsrtombs mbsrtowcs, ac_wfuncs=yes, ac_wfuncs=no)
859 AC_MSG_CHECKING([for ISO C99 wchar_t support])
860 if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes \
861 && test x"$ac_wfuncs" = xyes; then
862 ac_isoC99_wchar_t=yes
866 AC_MSG_RESULT($ac_isoC99_wchar_t)
868 dnl Use iconv for wchar_t to char conversions. As such, check for
869 dnl X/Open Portability Guide, version 2 features (XPG2).
870 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
871 AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
873 dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
874 AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
876 LIBS="$LIBS $libiconv"
878 AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
879 ac_XPG2funcs=yes, ac_XPG2funcs=no)
883 AC_MSG_CHECKING([for XPG2 wchar_t support])
884 if test x"$ac_has_iconv_h" = xyes && test x"$ac_has_langinfo_h" = xyes \
885 && test x"$ac_XPG2funcs" = xyes; then
890 AC_MSG_RESULT($ac_XPG2_wchar_t)
892 dnl At the moment, only enable wchar_t specializations if all the
893 dnl above support is present.
894 AC_MSG_CHECKING([for enabled wchar_t specializations])
895 if test x"$ac_isoC99_wchar_t" = xyes \
896 && test x"$ac_XPG2_wchar_t" = xyes; then
897 libinst_wstring_la="libinst-wstring.la"
898 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
901 libinst_wstring_la=""
904 AC_SUBST(libinst_wstring_la)
907 dnl Wide characters disabled by the user.
908 AC_MSG_WARN([wchar_t support disabled.])
914 dnl Check to see if this version of GNU C++ is afflicted by bugs in
915 dnl __complex__ float support.
917 dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy.
919 dnl Check to see if this version of GNU C++ is afflicted by bugs in
920 dnl __complex__ support.Check for buggy __complex__ that will cause ICE in
921 dnl gcc-2.95.x when using the library, unless we define the default copy
922 dnl ctor in the specializations of complex<>.
924 dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy.
925 dnl GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
926 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT, [
927 AC_REQUIRE([AC_PROG_CXX])
929 AC_MSG_CHECKING([for GNU C++ __complex__ support])
930 AC_CACHE_VAL(glibcpp_cv_complex, [
933 AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
934 dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
935 [ dcomplex x; f(x); ],
936 glibcpp_cv_complex=ok,
937 glibcpp_cv_complex=buggy
941 AC_MSG_RESULT($glibcpp_cv_complex)
942 if test $glibcpp_cv_complex = buggy; then
943 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
946 AC_MSG_CHECKING([for GNU C++ __complex__ float support])
947 AC_CACHE_VAL(glibcpp_cv_float_complex, [
951 cat > conftest.h <<EOB
953 // Check for buggy __complex__ that causes ICE in most versions of egcs
954 // and gcc-2.95.x on certain platforms (eg., x86-win32).
956 // See http://gcc.gnu.org/ml/gcc-bugs/1999-07n/msg00845.html for
957 // more info on the bug itself.
962 __complex__ float m_value;
963 float_complex (float = 0.0f, float = 0.0f);
964 float_complex (__complex__ float val) : m_value (val) {}
965 float_complex foo (const float_complex &val)
966 { return float_complex (~val.m_value); }
969 AC_TRY_COMPILE([#include "conftest.h"], ,
970 glibcpp_cv_float_complex=ok,
971 glibcpp_cv_float_complex=buggy
975 AC_MSG_RESULT($glibcpp_cv_float_complex)
976 if test $glibcpp_cv_float_complex = buggy; then
977 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
983 dnl Check for special debugging mode; not for production use.
985 dnl GLIBCPP_ENABLE_DEBUG
986 dnl --enable-debug sets '-ggdb3 -O0'.
987 dnl --disable-debug sets '-g' and whatever optimization options the
988 dnl compiler can handle.
989 dnl + --enable-maintainer-mode automatically defaults this to on.
990 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
991 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
992 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
993 dnl defaults to `no'.
994 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
995 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
997 changequote(<<, >>)dnl
998 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
1000 [case "${enableval}" in
1001 yes) enable_debug=yes ;;
1002 no) enable_debug=no ;;
1003 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
1005 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
1007 dnl Option parsed, now set things appropriately
1008 case "${enable_debug}" in
1010 DEBUG_FLAGS='-O0 -ggdb3'
1016 AC_SUBST(DEBUG_FLAGS)
1021 dnl Check for "unusual" flags to pass to the compiler while building.
1023 dnl GLIBCPP_ENABLE_CXX_FLAGS
1024 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
1025 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
1026 dnl Somehow this same set of flags must be passed when [re]building
1028 dnl --disable-cxx-flags passes nothing.
1029 dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
1030 dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
1031 dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
1032 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
1033 dnl If "default flags" is an empty string (or "none"), the effect is
1034 dnl the same as --disable or --enable=no.
1035 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
1036 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1037 AC_ARG_ENABLE(cxx-flags,
1038 changequote(<<, >>)dnl
1039 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
1040 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
1041 changequote([, ])dnl
1042 [case "x$enableval" in
1044 AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
1046 enable_cxx_flags='' ;;
1048 enable_cxx_flags="$enableval" ;;
1050 enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
1052 dnl Thinko on my part during design. This kludge is the workaround.
1053 if test "$enable_cxx_flags" = "none"; then
1054 enable_cxx_flags='';
1057 dnl Run through flags (either default or command-line) and set anything
1058 dnl extra (e.g., #defines) that must accompany particular g++ options.
1059 if test -n "$enable_cxx_flags"; then
1060 for f in $enable_cxx_flags; do
1064 *) # and we're trying to pass /what/ exactly?
1065 AC_MSG_ERROR([compiler flags start with a -]) ;;
1069 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1070 AC_SUBST(EXTRA_CXX_FLAGS)
1075 dnl Check for which locale library to use: gnu or generic.
1077 dnl GLIBCPP_ENABLE_CLOCALE
1078 dnl --enable-clocale=gnu sets config/c_locale_gnu.cc and friends
1079 dnl --enable-clocale=generic sets config/c_locale_generic.cc and friends
1081 dnl default is generic
1083 AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
1084 AC_MSG_CHECKING([for clocale to use])
1085 AC_ARG_ENABLE(clocale,
1086 [ --enable-clocale enable model for target locale package.
1087 --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
1089 if test x$enable_clocale = xno; then
1090 enable_clocale=generic
1092 enable_clocale=generic)
1094 enable_clocale_flag=$enable_clocale
1096 dnl Check if a valid locale package
1097 case x${enable_clocale_flag} in
1099 CLOCALE_H=config/c_locale_gnu.h
1100 CLOCALE_CC=config/c_locale_gnu.cc
1104 CLOCALE_H=config/c_locale_generic.h
1105 CLOCALE_CC=config/c_locale_generic.cc
1106 AC_MSG_RESULT(generic)
1109 echo "$enable_clocale is an unknown locale package" 1>&2
1114 AC_LINK_FILES($CLOCALE_H, include/bits/c++locale.h)
1115 AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
1120 dnl Check for which I/O library to use: libio, or something specific.
1122 dnl GLIBCPP_ENABLE_CSTDIO
1123 dnl --enable-cstdio=libio sets config/c_io_libio.h and friends
1125 dnl default is stdio
1127 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
1128 AC_MSG_CHECKING([for cstdio to use])
1129 AC_ARG_ENABLE(cstdio,
1130 [ --enable-cstdio enable stdio for target io package.
1131 --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
1133 if test x$enable_cstdio = xno; then
1136 enable_cstdio=stdio)
1138 enable_cstdio_flag=$enable_cstdio
1140 dnl Check if a valid I/O package
1141 case x${enable_cstdio_flag} in
1143 CSTDIO_H=config/c_io_libio.h
1144 CSTDIO_CC=config/c_io_libio.cc
1145 AC_MSG_RESULT(libio)
1147 # see if we are on a system with libio native (ie, linux)
1148 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
1150 # Need to check and see what version of glibc is being used. If
1151 # it's not glibc-2.2 or higher, then we'll need to go ahead and
1152 # compile most of libio for linux systems.
1153 if test x$has_libio = x"yes"; then
1156 AC_MSG_CHECKING([for glibc version >= 2.2])
1157 AC_EGREP_CPP([ok], [
1158 #include <features.h>
1159 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1162 ], glibc_satisfactory=yes, glibc_satisfactory=no)
1163 AC_MSG_RESULT($glibc_satisfactory)
1167 # XXX at the moment, admit defeat and force the recompilation
1168 # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
1169 glibc_satisfactory=no
1171 if test x$glibc_satisfactory = x"yes"; then
1176 # bkoz XXX need to add checks to enable this
1177 # pme XXX here's a first pass at such a check
1178 if test x$enable_c_mbchar != xno; then
1186 # Using libio, but <libio.h> doesn't exist on the target system. . .
1188 # bkoz XXX need to add checks to enable this
1189 # pme XXX here's a first pass at such a check
1190 if test x$enable_c_mbchar != xno; then
1197 xstdio | x | xno | xnone | xyes)
1199 CSTDIO_H=config/c_io_stdio.h
1200 CSTDIO_CC=config/c_io_stdio.cc
1201 AC_MSG_RESULT(stdio)
1203 # We're not using stdio.
1206 # Wide characters are not supported with this package.
1210 echo "$enable_cstdio is an unknown io package" 1>&2
1214 AC_LINK_FILES($CSTDIO_H, include/bits/c++io.h)
1215 AC_LINK_FILES($CSTDIO_CC, src/c++io.cc)
1217 # 2000-08-04 bkoz hack
1218 CCODECVT_C=config/c_io_libio_codecvt.c
1219 AC_LINK_FILES($CCODECVT_C, libio/c_codecvt.c)
1220 # 2000-08-04 bkoz hack
1222 AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
1223 test "$need_libio" = yes || test "$need_wlibio" = yes)
1224 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
1225 AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
1226 if test "$need_libio" = yes || test "$need_wlibio" = yes; then
1227 libio_la=../libio/libio.la
1236 dnl Check for which threading library to use.
1238 dnl GLIBCPP_ENABLE_THREADS
1239 dnl --enable-threads=posix sets config/threads-posix.h et. al.
1241 dnl Default is no threads, which also disables _IO_MTSAFE_IO in
1242 dnl libio. Any actual thread package will enable it.
1244 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
1245 dnl Note this comes from the gcc/config.in and libjava/config.in
1246 dnl Efforts should be made to keep this in sync.
1247 AC_MSG_CHECKING([for threads package to use])
1248 AC_ARG_ENABLE(threads,
1249 [ --enable-threads enable thread usage for target GCC.
1250 --enable-threads=LIB use LIB thread package for target GCC. [default=no]
1252 if test x$enable_threads = xno; then
1257 enable_threads_flag=$enable_threads
1259 dnl Check if a valid thread package
1260 case x${enable_threads_flag} in
1263 target_thread_file='single'
1267 target_thread_file='posix'
1269 xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
1270 xsolaris | xwin32 | xdce | xvxworks)
1271 target_thread_file=$enable_threads_flag
1274 echo "$enable_threads is an unknown thread package" 1>&2
1279 dnl Check for thread package actually supported in libstdc++
1281 case "$target_thread_file" in
1283 THREADH=threads-no.h
1286 THREADH=threads-posix.h
1288 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
1289 AC_MSG_ERROR(thread package $THREADS not yet supported)
1292 AC_MSG_ERROR($THREADS is an unsupported/unknown thread package)
1295 AC_MSG_RESULT($THREADH)
1297 AC_LINK_FILES(config/$THREADH, include/bits/c++threads.h)
1298 if test $THREADH != threads-no.h; then
1299 AC_DEFINE(_GLIBCPP_USE_THREADS)
1305 dnl Check for template specializations for the 'long long' type extension.
1307 dnl GLIBCPP_ENABLE_LONG_LONG
1308 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
1309 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
1310 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
1311 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1312 dnl defaults to `no'.
1313 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1315 dnl GLIBCPP_ENABLE_LONG_LONG
1316 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
1317 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
1319 AC_ARG_ENABLE(long-long,
1320 changequote(<<, >>)dnl
1321 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
1322 changequote([, ])dnl
1323 [case "$enableval" in
1324 yes) enable_long_long=yes ;;
1325 no) enable_long_long=no ;;
1326 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1328 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1330 # Allow use of os-dependent settings, so that macros that turn on
1331 # C99 capabilities can be defined and used in a consistent way.
1332 OS_INC_PATH=${srcdir}/$os_include_dir
1333 ac_test_CFLAGS="${CFLAGS+set}"
1334 ac_save_CFLAGS="$CFLAGS"
1335 CFLAGS="-I$OS_INC_PATH"
1337 # Check for the existence of functions used if long long is enabled.
1338 AC_CHECK_FUNC(strtoll,,ac_strtoll=no)
1339 AC_CHECK_FUNC(strtoull,,ac_strtoull=no)
1341 # Check for lldiv_t, et. al.
1342 AC_MSG_CHECKING([for lldiv_t declaration])
1343 AC_CACHE_VAL(glibcpp_lldiv_t_use, [
1344 AC_TRY_COMPILE([#include <bits/os_defines.h>
1345 #include <stdlib.h>],
1347 [glibcpp_lldiv_t_use=yes], [glibcpp_lldiv_t_use=no])
1349 AC_MSG_RESULT($glibcpp_lldiv_t_use)
1350 if test x$glibcpp_lldiv_t_use = x"yes"; then
1351 AC_DEFINE(HAVE_LLDIV_T)
1354 AC_MSG_CHECKING([for enabled long long])
1355 if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then
1356 enable_long_long=no;
1358 AC_MSG_RESULT($enable_long_long)
1360 # Option parsed, now set things appropriately
1361 if test x"$enable_long_long" = xyes; then
1362 AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1366 CFLAGS="$ac_save_CFLAGS"
1371 dnl Check for what kind of C headers to use.
1373 dnl GLIBCPP_ENABLE_CHEADERS
1374 dnl --enable-cheaders= [does stuff].
1375 dnl --disable-cheaders [does not do anything, really].
1376 dnl + This will eventually need to be 'c_shadow' by default.
1377 dnl + Usage: GLIBCPP_ENABLE_CHEADERS[(DEFAULT)]
1378 dnl Where DEFAULT is either `c' or `c_std' or 'c_shadow'.
1379 dnl If ommitted, it defaults to `c_std'.
1380 AC_DEFUN(GLIBCPP_ENABLE_CHEADERS, [dnl
1381 define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
1382 AC_MSG_CHECKING([for c header strategy to use])
1383 AC_ARG_ENABLE(cheaders,
1384 changequote(<<, >>)dnl
1385 << --enable-cheaders construct "C" header files for
1386 g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
1388 [case "$enableval" in
1393 enable_cheaders=c_std
1396 enable_cheaders=c_shadow
1398 *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
1401 enable_cheaders=GLIBCPP_ENABLE_CHEADERS_DEFAULT)
1402 AC_MSG_RESULT($enable_cheaders)
1404 dnl Option parsed, now set things appropriately
1405 case "$enable_cheaders" in
1407 CSHADOW_FLAGS="-fno-builtin"
1408 C_INCLUDE_DIR='${top_srcdir}/include/c_shadow'
1409 AC_DEFINE(_GLIBCPP_USE_SHADOW_HEADERS)
1413 C_INCLUDE_DIR='${top_srcdir}/include/c_std'
1417 C_INCLUDE_DIR='${top_srcdir}/include/c'
1421 AC_SUBST(CSHADOW_FLAGS)
1422 AC_SUBST(C_INCLUDE_DIR)
1423 AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cheaders" = c_shadow)
1428 dnl Check for wide character support. Has the same effect as the option
1429 dnl in gcc's configure, but in a form that autoconf can mess with.
1431 dnl GLIBCPP_ENABLE_C_MBCHAR
1432 dnl --enable-c-mbchar requests all the wchar_t stuff.
1433 dnl --disable-c-mbchar doesn't.
1434 dnl + Usage: GLIBCPP_ENABLE_C_MBCHAR[(DEFAULT)]
1435 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1436 dnl defaults to `no'.
1437 AC_DEFUN(GLIBCPP_ENABLE_C_MBCHAR, [dnl
1438 define([GLIBCPP_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
1439 AC_ARG_ENABLE(c-mbchar,
1440 changequote(<<, >>)dnl
1441 << --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCPP_ENABLE_C_MBCHAR_DEFAULT],
1442 changequote([, ])dnl
1443 [case "$enableval" in
1444 yes) enable_c_mbchar=yes ;;
1445 no) enable_c_mbchar=no ;;
1446 *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
1448 enable_c_mbchar=GLIBCPP_ENABLE_C_MBCHAR_DEFAULT)dnl
1449 dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
1454 dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
1456 dnl GLIBCPP_INCLUDE_DIR
1458 dnl TOPLEVEL_INCLUDES
1459 dnl LIBMATH_INCLUDES
1460 dnl LIBSUPCXX_INCLUDES
1462 dnl CSHADOW_INCLUDES
1464 dnl GLIBCPP_EXPORT_INCLUDE
1465 AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
1466 # Root level of the include sources.
1467 GLIBCPP_INCLUDE_DIR='$(top_srcdir)/include'
1469 # Can either use include/c or include/c_std to grab "C" headers. This
1470 # variable is set to the include directory currently in use.
1471 # set with C_INCLUDE_DIR in GLIBCPP_ENABLE_CHEADERS
1473 # Passed down for canadian crosses.
1474 if test x"$CANADIAN" = xyes; then
1475 TOPLEVEL_INCLUDES='-I$(includedir)'
1478 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1480 LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
1482 #if GLIBCPP_NEED_LIBIO
1483 LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
1485 #LIBIO_INCLUDES='-I$(top_srcdir)/libio'
1488 #if GLIBCPP_USE_CSHADOW
1489 # CSHADOW_INCLUDES='-I$(GLIBCPP_INCLUDE_DIR)/std -I$(C_INCLUDE_DIR) \
1490 # -I$(top_blddir)/cshadow'
1492 CSTD_INCLUDES='-I$(GLIBCPP_INCLUDE_DIR)/std -I$(C_INCLUDE_DIR)'
1495 # Now, export this to all the little Makefiles....
1496 AC_SUBST(GLIBCPP_INCLUDE_DIR)
1497 AC_SUBST(TOPLEVEL_INCLUDES)
1498 AC_SUBST(LIBMATH_INCLUDES)
1499 AC_SUBST(LIBSUPCXX_INCLUDES)
1500 AC_SUBST(LIBIO_INCLUDES)
1501 AC_SUBST(CSTD_INCLUDES)
1506 dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
1508 AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
1509 # Optimization flags that are probably a good idea for thrill-seekers. Just
1510 # uncomment the lines below and make, everything else is ready to go...
1511 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
1513 AC_SUBST(OPTIMIZE_CXXFLAGS)
1515 WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings -Winline'
1516 AC_SUBST(WARN_FLAGS)
1520 dnl GLIBCPP_EXPORT_INSTALL_INFO
1521 dnl calculates gxx_install_dir
1522 dnl exports glibcpp_toolexecdir
1523 dnl exports glibcpp_toolexeclibdir
1525 dnl Assumes cross_compiling bits already done, and with_cross_host in
1528 dnl GLIBCPP_EXPORT_INSTALL_INFO
1529 AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
1531 glibcpp_toolexecdir=no
1532 glibcpp_toolexeclibdir=no
1534 AC_MSG_CHECKING([for interface version number])
1535 libstdcxx_interface=$INTERFACE
1536 AC_MSG_RESULT($libstdcxx_interface)
1538 # Process the option --with-gxx-include-dir=<path to include-files directory>
1539 AC_MSG_CHECKING([for --with-gxx-include-dir])
1540 AC_ARG_WITH(gxx-include-dir,
1541 [ --with-gxx-include-dir the installation directory for include files],
1542 [case "${withval}" in
1544 AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
1551 gxx_include_dir=${withval}
1553 esac], [gxx_include_dir=no])
1554 AC_MSG_RESULT($gxx_include_dir)
1556 # Process the option "--enable-version-specific-runtime-libs"
1557 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
1558 AC_ARG_ENABLE(version-specific-runtime-libs,
1559 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
1560 [ version_specific_libs=yes
1561 # Need the gcc compiler version to know where to install libraries
1562 # and header files if --enable-version-specific-runtime-libs option
1565 gcc_version_trigger=${srcdir}/../gcc/version.c
1566 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
1567 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
1568 gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
1569 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1570 glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}
1572 ],version_specific_libs=no)
1573 AC_MSG_RESULT($version_specific_libs)
1575 # Default case for install directory for include files.
1576 if test x"$version_specific_libs" = x"no" \
1577 && test x"$gxx_include_dir"=x"no"; then
1578 gxx_include_dir='$(prefix)'/include/g++-${libstdcxx_interface}
1581 # Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
1582 # Install a library built with a cross compiler in tooldir, not libdir.
1583 if test x"$glibcpp_toolexecdir" = x"no"; then
1584 if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
1585 glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
1586 glibcpp_toolexeclibdir='$(toolexecdir)/lib$(MULTISUBDIR)'
1588 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1589 glibcpp_toolexeclibdir='$(libdir)$(MULTISUBDIR)'
1593 AC_MSG_CHECKING([for install location])
1594 AC_MSG_RESULT($gxx_include_dir)
1596 AC_SUBST(gxx_include_dir)
1597 AC_SUBST(glibcpp_toolexecdir)
1598 AC_SUBST(glibcpp_toolexeclibdir)
1602 # Check whether LC_MESSAGES is available in <locale.h>.
1603 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1605 # This file file 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 AC_DEFUN(AC_LC_MESSAGES, [
1613 AC_CHECK_HEADER(locale.h, [
1614 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1615 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1616 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1617 if test $ac_cv_val_LC_MESSAGES = yes; then
1618 AC_DEFINE(HAVE_LC_MESSAGES)
1624 # Check for functions in math library.
1625 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1627 # This file can be copied and used freely without restrictions. It can
1628 # be used in projects which are not available under the GNU Public License
1629 # but which still want to provide support for the GNU gettext functionality.
1630 # Please note that the actual code is *not* freely available.
1634 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1635 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1636 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])
1637 AC_SUBST(LIBMATHOBJS)dnl
1641 # Check for string functions.
1642 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1644 # This file can be copied and used freely without restrictions. It can
1645 # be used in projects which are not available under the GNU Public License
1646 # but which still want to provide support for the GNU gettext functionality.
1647 # Please note that the actual code is *not* freely available.
1651 dnl AC_REPLACE_STRINGFUNCS(FUNCTION...)
1652 AC_DEFUN(AC_REPLACE_STRINGFUNCS,
1653 [AC_CHECK_FUNCS([$1], , [LIBSTRINGOBJS="$LIBSTRINGOBJS ${ac_func}.lo"])
1654 AC_SUBST(LIBSTRINGOBJS)dnl
1658 dnl This macro searches for a GNU version of make. If a match is found, the
1659 dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
1660 dnl set to "#". This is useful for including a special features in a Makefile,
1661 dnl which cannot be handled by other versions of make. The variable
1662 dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
1663 dnl the empty string otherwise.
1665 dnl Here is an example of its use:
1667 dnl Makefile.in might contain:
1669 dnl # A failsafe way of putting a dependency rule into a makefile
1671 dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
1673 dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
1674 dnl @ifGNUmake@ include $(DEPEND)
1675 dnl @ifGNUmake@ endif
1677 dnl Then configure.in would normally contain:
1679 dnl CHECK_GNU_MAKE()
1680 dnl AC_OUTPUT(Makefile)
1682 dnl Then perhaps to cause gnu make to override any other make, we could do
1683 dnl something like this (note that GNU make always looks for GNUmakefile first):
1685 dnl if ! test x$_cv_gnu_make_command = x ; then
1686 dnl mv Makefile GNUmakefile
1687 dnl echo .DEFAULT: > Makefile ;
1688 dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
1691 dnl Then, if any (well almost any) other make is called, and GNU make also
1692 dnl exists, then the other make wraps the GNU make.
1694 dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
1695 dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
1697 dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
1698 dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
1699 dnl #### conditional's subshell (" --version" is not a command), using a
1700 dnl #### different option to grep(1).
1702 dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
1703 dnl #### ${MAKE:-make}).
1706 GLIBCPP_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
1707 _cv_gnu_make_command='' ;
1708 dnl Search all the common names for GNU make
1709 for a in "${MAKE-make}" make gmake gnumake ; do
1710 if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
1712 _cv_gnu_make_command=$a ;
1717 dnl If there was a GNU version, then set @ifGNUmake@ to the empty
1718 dnl string, '#' otherwise
1719 if test "x$_cv_gnu_make_command" != "x" ; then
1727 sinclude(../libtool.m4)
1728 dnl The lines below arrange for aclocal not to bring an installed
1729 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
1730 dnl add a definition of LIBTOOL to Makefile.in.
1731 ifelse(,,,[AC_SUBST(LIBTOOL)
1732 AC_DEFUN([AM_PROG_LIBTOOL])
1733 AC_DEFUN([AC_LIBTOOL_DLOPEN])
1734 AC_DEFUN([AC_PROG_LD])
1738 # Do all the work for Automake. This macro actually does too much --
1739 # some checks are only needed if your package does certain things.
1740 # But this isn't really a big deal.
1745 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
1747 AC_DEFUN(AM_INIT_AUTOMAKE,
1748 [AC_REQUIRE([AC_PROG_INSTALL])
1753 dnl test to see if srcdir already configured
1754 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1755 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1758 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1759 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
1760 AC_REQUIRE([AM_SANITY_CHECK])
1761 AC_REQUIRE([AC_ARG_PROGRAM])
1762 dnl FIXME This is truly gross.
1763 missing_dir=`cd $ac_aux_dir && pwd`
1764 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
1765 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
1766 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
1767 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
1768 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
1769 AC_REQUIRE([AC_PROG_MAKE_SET])])
1772 # Check to make sure that the build environment is sane.
1775 AC_DEFUN(AM_SANITY_CHECK,
1776 [AC_MSG_CHECKING([whether build environment is sane])
1779 echo timestamp > conftestfile
1780 # Do `set' in a subshell so we don't clobber the current shell's
1781 # arguments. Must try -L first in case configure is actually a
1782 # symlink; some systems play weird games with the mod time of symlinks
1783 # (eg FreeBSD returns the mod time of the symlink's containing
1786 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1787 if test "[$]*" = "X"; then
1789 set X `ls -t $srcdir/configure conftestfile`
1791 if test "[$]*" != "X $srcdir/configure conftestfile" \
1792 && test "[$]*" != "X conftestfile $srcdir/configure"; then
1794 # If neither matched, then we have a broken ls. This can happen
1795 # if, for instance, CONFIG_SHELL is bash and it inherits a
1796 # broken ls alias from the environment. This has actually
1797 # happened. Such a system could not be considered "sane".
1798 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1799 alias in your environment])
1802 test "[$]2" = conftestfile
1808 AC_MSG_ERROR([newly created file is older than distributed files!
1809 Check your system clock])
1812 AC_MSG_RESULT(yes)])
1814 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1815 dnl The program must properly implement --version.
1816 AC_DEFUN(AM_MISSING_PROG,
1817 [AC_MSG_CHECKING(for working $2)
1818 # Run test in a subshell; some versions of sh will print an error if
1819 # an executable is not found, even if stderr is redirected.
1820 # Redirect stdin to placate older versions of autoconf. Sigh.
1821 if ($2 --version) < /dev/null > /dev/null 2>&1; then
1823 AC_MSG_RESULT(found)
1826 AC_MSG_RESULT(missing)
1830 # Add --enable-maintainer-mode option to configure.
1835 AC_DEFUN(AM_MAINTAINER_MODE,
1836 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1837 dnl maintainer-mode is disabled by default
1838 AC_ARG_ENABLE(maintainer-mode,
1839 [ --enable-maintainer-mode enable make rules and dependencies not useful
1840 (and sometimes confusing) to the casual installer],
1841 USE_MAINTAINER_MODE=$enableval,
1842 USE_MAINTAINER_MODE=no)
1843 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1844 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1845 MAINT=$MAINTAINER_MODE_TRUE
1850 # Define a conditional.
1852 AC_DEFUN(AM_CONDITIONAL,
1863 # Like AC_CONFIG_HEADER, but automatically create stamp file.
1865 AC_DEFUN(AM_CONFIG_HEADER,
1867 AC_CONFIG_HEADER([$1])
1868 dnl When config.status generates a header, we must update the stamp-h file.
1869 dnl This file resides in the same directory as the config header
1870 dnl that is generated. We must strip everything past the first ":",
1871 dnl and everything past the last "/".
1872 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1873 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1874 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1876 for am_file in <<$1>>; do
1877 case " <<$>>CONFIG_HEADERS " in
1878 *" <<$>>am_file "*<<)>>
1879 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1882 am_indx=`expr "<<$>>am_indx" + 1`