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>],
342 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
346 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
350 dnl Check to see if the (math function) argument passed is
351 dnl 1) declared when using the c++ compiler
352 dnl 2) has "C" linkage
353 dnl 3) if not, see if 1) and 2) for argument prepended with '_'
355 dnl Define HAVE_CARGF etc if "cargf" is declared and links
357 dnl argument 1 is name of function to check
359 dnl ASSUMES argument is a math function with ONE parameter
361 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1
362 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
363 GLIBCPP_CHECK_MATH_DECL_1($1)
364 if test x$glibcpp_cv_func_$1_use = x"yes"; then
367 GLIBCPP_CHECK_MATH_DECL_1(_$1)
368 if test x$glibcpp_cv_func__$1_use = x"yes"; then
376 dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
377 dnl of functions at once. It's an all-or-nothing check -- either
378 dnl HAVE_XYZ is defined for each of the functions, or for none of them.
379 dnl Doing it this way saves significant configure time.
380 AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
381 AC_MSG_CHECKING([for $1 functions])
382 AC_CACHE_VAL(glibcpp_cv_func_$2_use, [
385 AC_TRY_COMPILE([#include <math.h>],
386 [ `for x in $3; do echo "$x (0);"; done` ],
387 [glibcpp_cv_func_$2_use=yes],
388 [glibcpp_cv_func_$2_use=no])
390 AC_MSG_RESULT($glibcpp_cv_func_$2_use)
391 if test x$glibcpp_cv_func_$2_use = x"yes"; then
397 dnl Check to see if the (math function) argument passed is
398 dnl declared when using the c++ compiler
399 dnl ASSUMES argument is a math function with ONE parameter
401 dnl GLIBCPP_CHECK_MATH_DECL_2
402 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_2, [
403 AC_MSG_CHECKING([for $1 declaration])
404 if test x${glibcpp_cv_func_$1_use+set} != xset; then
405 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
408 AC_TRY_COMPILE([#include <math.h>],
410 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
414 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
418 dnl Check to see if the (math function) argument passed is
419 dnl 1) declared when using the c++ compiler
420 dnl 2) has "C" linkage
422 dnl Define HAVE_CARGF etc if "cargf" is declared and links
424 dnl argument 1 is name of function to check
426 dnl ASSUMES argument is a math function with TWO parameters
428 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2
429 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
430 GLIBCPP_CHECK_MATH_DECL_2($1)
431 if test x$glibcpp_cv_func_$1_use = x"yes"; then
434 GLIBCPP_CHECK_MATH_DECL_2(_$1)
435 if test x$glibcpp_cv_func__$1_use = x"yes"; then
443 dnl Check to see if the (math function) argument passed is
444 dnl declared when using the c++ compiler
445 dnl ASSUMES argument is a math function with ONE parameter
447 dnl GLIBCPP_CHECK_MATH_DECL_3
448 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_3, [
449 AC_MSG_CHECKING([for $1 declaration])
450 if test x${glibcpp_cv_func_$1_use+set} != xset; then
451 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
454 AC_TRY_COMPILE([#include <math.h>],
456 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
460 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
464 dnl Check to see if the (math function) argument passed is
465 dnl 1) declared when using the c++ compiler
466 dnl 2) has "C" linkage
468 dnl Define HAVE_CARGF etc if "cargf" is declared and links
470 dnl argument 1 is name of function to check
472 dnl ASSUMES argument is a math function with THREE parameters
474 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3
475 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
476 GLIBCPP_CHECK_MATH_DECL_3($1)
477 if test x$glibcpp_cv_func_$1_use = x"yes"; then
480 GLIBCPP_CHECK_MATH_DECL_3(_$1)
481 if test x$glibcpp_cv_func__$1_use = x"yes"; then
489 dnl Check to see if the (stdlib function) argument passed is
490 dnl 1) declared when using the c++ compiler
491 dnl 2) has "C" linkage
493 dnl Define HAVE_STRTOLD if "strtold" is declared and links
494 dnl Define HAVE_STRTOF if "strtof" is declared and links
496 dnl argument 1 is name of function to check
498 dnl ASSUMES argument is a math function with TWO parameters
500 dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2
501 AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
502 AC_MSG_CHECKING([for $1 declaration])
503 if test x${glibcpp_cv_func_$1_use+set} != xset; then
504 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
507 AC_TRY_COMPILE([#include <stdlib.h>],
509 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
513 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
514 if test x$glibcpp_cv_func_$1_use = x"yes"; then
521 dnl Because the builtins are picky picky picky about the arguments they take,
522 dnl do an explict linkage tests here.
523 dnl Check to see if the (math function) argument passed is
524 dnl 1) declared when using the c++ compiler
525 dnl 2) has "C" linkage
527 dnl Define HAVE_CARGF etc if "cargf" is declared and links
529 dnl argument 1 is name of function to check
531 dnl ASSUMES argument is a math function with ONE parameter
533 dnl GLIBCPP_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
534 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
535 AC_MSG_CHECKING([for $1 declaration])
536 if test x${glibcpp_cv_func_$1_use+set} != xset; then
537 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
540 AC_TRY_COMPILE([#include <math.h>],
542 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
546 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
547 if test x$glibcpp_cv_func_$1_use = x"yes"; then
548 AC_MSG_CHECKING([for $1 linkage])
549 if test x${glibcpp_cv_func_$1_link+set} != xset; then
550 AC_CACHE_VAL(glibcpp_cv_func_$1_link, [
551 AC_TRY_LINK([#include <math.h>],
553 [glibcpp_cv_func_$1_link=yes], [glibcpp_cv_func_$1_link=no])
556 AC_MSG_RESULT($glibcpp_cv_func_$1_link)
557 if test x$glibcpp_cv_func_$1_link = x"yes"; then
558 ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
559 AC_DEFINE_UNQUOTED(${ac_tr_func})
566 dnl Check to see what builtin math functions are supported
568 dnl check for __builtin_abs
569 dnl check for __builtin_fabsf
570 dnl check for __builtin_fabs
571 dnl check for __builtin_fabl
572 dnl check for __builtin_labs
573 dnl check for __builtin_sqrtf
574 dnl check for __builtin_sqrtl
575 dnl check for __builtin_fsqrt
576 dnl check for __builtin_sinf
577 dnl check for __builtin_sin
578 dnl check for __builtin_sinl
579 dnl check for __builtin_cosf
580 dnl check for __builtin_cos
581 dnl check for __builtin_cosl
583 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
584 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
585 dnl Test for builtin math functions.
586 dnl These are made in gcc/c-common.c
587 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
588 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
589 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
590 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
591 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
593 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
594 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fsqrt)
595 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
597 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
598 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
599 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
601 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
602 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
603 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
605 dnl There is, without a doubt, a more elegant way to have these
606 dnl names exported so that they won't be stripped out of acconfig.h by
607 dnl autoheader. I leave this as an exercise to somebody less frustrated
608 dnl than I.... please email the libstdc++ list if you can figure out a
609 dnl more elegant approach (see autoconf/acgen.m4 and specifically
610 dnl AC_CHECK_FUNC for things to steal.)
612 if test x$dummyvar = x"yes"; then
613 AC_DEFINE(HAVE___BUILTIN_ABS)
614 AC_DEFINE(HAVE___BUILTIN_LABS)
615 AC_DEFINE(HAVE___BUILTIN_COS)
616 AC_DEFINE(HAVE___BUILTIN_COSF)
617 AC_DEFINE(HAVE___BUILTIN_COSL)
618 AC_DEFINE(HAVE___BUILTIN_FABS)
619 AC_DEFINE(HAVE___BUILTIN_FABSF)
620 AC_DEFINE(HAVE___BUILTIN_FABSL)
621 AC_DEFINE(HAVE___BUILTIN_SIN)
622 AC_DEFINE(HAVE___BUILTIN_SINF)
623 AC_DEFINE(HAVE___BUILTIN_SINL)
624 AC_DEFINE(HAVE___BUILTIN_FSQRT)
625 AC_DEFINE(HAVE___BUILTIN_SQRTF)
626 AC_DEFINE(HAVE___BUILTIN_SQRTL)
632 dnl Check to see what the underlying c library
633 dnl These checks need to do two things:
634 dnl 1) make sure the name is declared when using the c++ compiler
635 dnl 2) make sure the name has "C" linkage
636 dnl This might seem like overkill but experience has shown that it's not...
638 dnl Define HAVE_STRTOF etc if "strtof" is found.
639 dnl Define HAVE_STRTOLD etc if "strtold" is found.
641 dnl GLIBCPP_CHECK_STDLIB_SUPPORT
642 AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
643 ac_test_CXXFLAGS="${CXXFLAGS+set}"
644 ac_save_CXXFLAGS="$CXXFLAGS"
645 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
647 AC_CHECK_FUNCS(strtof)
648 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
650 CXXFLAGS="$ac_save_CXXFLAGS"
655 dnl Check to see what the underlying c library or math library is like.
656 dnl These checks need to do two things:
657 dnl 1) make sure the name is declared when using the c++ compiler
658 dnl 2) make sure the name has "C" linkage
659 dnl This might seem like overkill but experience has shown that it's not...
661 dnl Define HAVE_CARGF etc if "cargf" is found.
663 dnl GLIBCPP_CHECK_MATH_SUPPORT
664 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
665 ac_test_CXXFLAGS="${CXXFLAGS+set}"
666 ac_save_CXXFLAGS="$CXXFLAGS"
667 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
670 AC_CHECK_LIB(m, sin, libm="-lm")
674 dnl Check to see if certain C math functions exist.
675 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
676 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
677 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
678 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
679 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
680 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
681 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
683 dnl Check to see if basic C math functions have float versions.
684 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
689 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
692 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
693 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
694 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
695 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
696 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
697 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
698 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
699 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
700 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
701 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
702 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
703 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
704 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
706 dnl Check to see if basic C math functions have long double versions.
707 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
712 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
715 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
716 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
717 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
718 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
719 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
720 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
721 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
722 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
723 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
724 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
725 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
726 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
727 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
728 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
729 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
730 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
732 dnl Some runtimes have these functions with a preceding underscore. Please
733 dnl keep this sync'd with the one above. And if you add any new symbol,
734 dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
735 dnl Check to see if certain C math functions exist.
737 dnl Check to see if basic C math functions have float versions.
738 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
740 _acosf _asinf _atanf \
742 _coshf _sinhf _tanhf)
743 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
747 dnl Check to see if basic C math functions have long double versions.
748 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
750 _acosl _asinl _atanl \
752 _coshl _sinhl _tanhl)
753 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
758 CXXFLAGS="$ac_save_CXXFLAGS"
763 dnl Check to see if there is native support for complex
765 dnl Don't compile bits in math/* if native support exits.
767 dnl Define USE_COMPLEX_LONG_DOUBLE etc if "atan2l/copysignl" is found.
769 dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
770 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
771 dnl Check for complex versions of math functions of platform.
772 AC_CHECK_LIB(m, main)
773 AC_REPLACE_MATHFUNCS(nan hypot hypotf atan2f expf copysignf)
775 dnl Compile the long double complex functions only if the function
776 dnl provides the non-complex long double functions that are needed.
777 dnl Currently this includes copysignl and atan2l, which should be
778 dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
779 USE_COMPLEX_LONG_DOUBLE=no
780 if test x$ac_cv_func_atan2l = x"yes" \
781 && test x$ac_cv_func_copysignl = x"yes"; then
782 USE_COMPLEX_LONG_DOUBLE=yes
783 AC_REPLACE_MATHFUNCS(hypotl signbitl)
786 AC_SUBST(USE_COMPLEX_LONG_DOUBLE)
790 dnl Check to see what architecture and operating system we are compiling
791 dnl for. Also, if architecture- or OS-specific flags are required for
792 dnl compilation, pick them up here.
794 dnl GLIBCPP_CHECK_TARGET
795 AC_DEFUN(GLIBCPP_CHECK_TARGET, [
796 . [$]{glibcpp_basedir}/configure.target
797 AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
798 AC_MSG_RESULT(OS config directory is $os_include_dir)
799 AC_LINK_FILES($os_include_dir/bits/os_defines.h, include/bits/os_defines.h)
804 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
805 dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
806 dnl must have been previously checked.)
808 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
809 dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
811 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
812 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
814 dnl Test wchar.h for mbstate_t, which is needed for char_traits and
815 dnl others even if wchar_t support is not on.
816 AC_MSG_CHECKING([for mbstate_t])
817 AC_TRY_COMPILE([#include <wchar.h>],
818 [mbstate_t teststate;],
819 have_mbstate_t=yes, have_mbstate_t=no)
820 AC_MSG_RESULT($have_mbstate_t)
821 if test x"$have_mbstate_t" = xyes; then
822 AC_DEFINE(HAVE_MBSTATE_T)
825 dnl Sanity check for existence of ISO C99 headers for extended encoding.
826 AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
827 AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
829 dnl Only continue checking if the ISO C99 headers exist and support is on.
830 if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes \
831 && test x"$enable_c_mbchar" != xno; then
833 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
834 dnl numeric_limits can instantiate type_traits<wchar_t>
835 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
836 AC_TRY_COMPILE([#include <wchar.h>],
837 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
838 has_wchar_minmax=yes, has_wchar_minmax=no)
839 AC_MSG_RESULT($has_wchar_minmax)
841 dnl Test wchar.h for WEOF, which is what we use to determine whether
842 dnl to specialize for char_traits<wchar_t> or not.
843 AC_MSG_CHECKING([for WEOF])
846 #include <stddef.h>],
848 has_weof=yes, has_weof=no)
849 AC_MSG_RESULT($has_weof)
851 dnl Tests for wide character functions used in char_traits<wchar_t>.
852 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset \
853 wcsrtombs mbsrtowcs, ac_wfuncs=yes, ac_wfuncs=no)
855 AC_MSG_CHECKING([for ISO C99 wchar_t support])
856 if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes \
857 && test x"$ac_wfuncs" = xyes; then
858 ac_isoC99_wchar_t=yes
862 AC_MSG_RESULT($ac_isoC99_wchar_t)
864 dnl Use iconv for wchar_t to char conversions. As such, check for
865 dnl X/Open Portability Guide, version 2 features (XPG2).
866 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
867 AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
869 dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
870 AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
872 LIBS="$LIBS $libiconv"
874 AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
875 ac_XPG2funcs=yes, ac_XPG2funcs=no)
879 AC_MSG_CHECKING([for XPG2 wchar_t support])
880 if test x"$ac_has_iconv_h" = xyes && test x"$ac_has_langinfo_h" = xyes \
881 && test x"$ac_XPG2funcs" = xyes; then
886 AC_MSG_RESULT($ac_XPG2_wchar_t)
888 dnl At the moment, only enable wchar_t specializations if all the
889 dnl above support is present.
890 AC_MSG_CHECKING([for enabled wchar_t specializations])
891 if test x"$ac_isoC99_wchar_t" = xyes \
892 && test x"$ac_XPG2_wchar_t" = xyes; then
893 libinst_wstring_la="libinst-wstring.la"
894 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
897 libinst_wstring_la=""
900 AC_SUBST(libinst_wstring_la)
903 dnl Wide characters disabled by the user.
904 AC_MSG_WARN([wchar_t support disabled.])
910 dnl Check to see if this version of GNU C++ is afflicted by bugs in
911 dnl __complex__ float support.
913 dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy.
915 dnl Check to see if this version of GNU C++ is afflicted by bugs in
916 dnl __complex__ support.Check for buggy __complex__ that will cause ICE in
917 dnl gcc-2.95.x when using the library, unless we define the default copy
918 dnl ctor in the specializations of complex<>.
920 dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy.
921 dnl GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
922 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT, [
923 AC_REQUIRE([AC_PROG_CXX])
925 AC_MSG_CHECKING([for GNU C++ __complex__ support])
926 AC_CACHE_VAL(glibcpp_cv_complex, [
929 AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
930 dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
931 [ dcomplex x; f(x); ],
932 glibcpp_cv_complex=ok,
933 glibcpp_cv_complex=buggy
937 AC_MSG_RESULT($glibcpp_cv_complex)
938 if test $glibcpp_cv_complex = buggy; then
939 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
942 AC_MSG_CHECKING([for GNU C++ __complex__ float support])
943 AC_CACHE_VAL(glibcpp_cv_float_complex, [
947 cat > conftest.h <<EOB
949 // Check for buggy __complex__ that causes ICE in most versions of egcs
950 // and gcc-2.95.x on certain platforms (eg., x86-win32).
952 // See http://gcc.gnu.org/ml/gcc-bugs/1999-07n/msg00845.html for
953 // more info on the bug itself.
958 __complex__ float m_value;
959 float_complex (float = 0.0f, float = 0.0f);
960 float_complex (__complex__ float val) : m_value (val) {}
961 float_complex foo (const float_complex &val)
962 { return float_complex (~val.m_value); }
965 AC_TRY_COMPILE([#include "conftest.h"], ,
966 glibcpp_cv_float_complex=ok,
967 glibcpp_cv_float_complex=buggy
971 AC_MSG_RESULT($glibcpp_cv_float_complex)
972 if test $glibcpp_cv_float_complex = buggy; then
973 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
979 dnl Check for special debugging mode; not for production use.
981 dnl GLIBCPP_ENABLE_DEBUG
982 dnl --enable-debug sets '-ggdb3 -O0'.
983 dnl --disable-debug sets '-g' and whatever optimization options the
984 dnl compiler can handle.
985 dnl + --enable-maintainer-mode automatically defaults this to on.
986 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
987 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
988 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
989 dnl defaults to `no'.
990 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
991 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
993 changequote(<<, >>)dnl
994 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
996 [case "${enableval}" in
997 yes) enable_debug=yes ;;
998 no) enable_debug=no ;;
999 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
1001 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
1003 dnl Option parsed, now set things appropriately
1004 case "${enable_debug}" in
1006 DEBUG_FLAGS='-O0 -ggdb3'
1012 AC_SUBST(DEBUG_FLAGS)
1017 dnl Check for "unusual" flags to pass to the compiler while building.
1019 dnl GLIBCPP_ENABLE_CXX_FLAGS
1020 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
1021 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
1022 dnl Somehow this same set of flags must be passed when [re]building
1024 dnl --disable-cxx-flags passes nothing.
1025 dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
1026 dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
1027 dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
1028 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
1029 dnl If "default flags" is an empty string (or "none"), the effect is
1030 dnl the same as --disable or --enable=no.
1031 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
1032 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1033 AC_ARG_ENABLE(cxx-flags,
1034 changequote(<<, >>)dnl
1035 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
1036 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
1037 changequote([, ])dnl
1038 [case "x$enableval" in
1040 AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
1042 enable_cxx_flags='' ;;
1044 enable_cxx_flags="$enableval" ;;
1046 enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
1048 dnl Thinko on my part during design. This kludge is the workaround.
1049 if test "$enable_cxx_flags" = "none"; then
1050 enable_cxx_flags='';
1053 dnl Run through flags (either default or command-line) and set anything
1054 dnl extra (e.g., #defines) that must accompany particular g++ options.
1055 if test -n "$enable_cxx_flags"; then
1056 for f in $enable_cxx_flags; do
1060 *) # and we're trying to pass /what/ exactly?
1061 AC_MSG_ERROR([compiler flags start with a -]) ;;
1065 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1066 AC_SUBST(EXTRA_CXX_FLAGS)
1071 dnl Check for which locale library to use: gnu or generic.
1073 dnl GLIBCPP_ENABLE_CLOCALE
1074 dnl --enable-clocale=gnu sets config/c_locale_gnu.cc and friends
1075 dnl --enable-clocale=generic sets config/c_locale_generic.cc and friends
1077 dnl default is generic
1079 AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
1080 AC_MSG_CHECKING([for clocale to use])
1081 AC_ARG_ENABLE(clocale,
1082 [ --enable-clocale enable model for target locale package.
1083 --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
1085 if test x$enable_clocale = xno; then
1086 enable_clocale=generic
1088 enable_clocale=generic)
1090 enable_clocale_flag=$enable_clocale
1092 dnl Check if a valid locale package
1093 case x${enable_clocale_flag} in
1095 CLOCALE_H=config/c_locale_gnu.h
1096 CLOCALE_CC=config/c_locale_gnu.cc
1100 CLOCALE_H=config/c_locale_generic.h
1101 CLOCALE_CC=config/c_locale_generic.cc
1102 AC_MSG_RESULT(generic)
1105 echo "$enable_clocale is an unknown locale package" 1>&2
1110 AC_LINK_FILES($CLOCALE_H, include/bits/c++locale.h)
1111 AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
1116 dnl Check for which I/O library to use: libio, or something specific.
1118 dnl GLIBCPP_ENABLE_CSTDIO
1119 dnl --enable-cstdio=libio sets config/c_io_libio.h and friends
1121 dnl default is stdio
1123 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
1124 AC_MSG_CHECKING([for cstdio to use])
1125 AC_ARG_ENABLE(cstdio,
1126 [ --enable-cstdio enable stdio for target io package.
1127 --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
1129 if test x$enable_cstdio = xno; then
1132 enable_cstdio=stdio)
1134 enable_cstdio_flag=$enable_cstdio
1136 dnl Check if a valid I/O package
1137 case x${enable_cstdio_flag} in
1139 CSTDIO_H=config/c_io_libio.h
1140 CSTDIO_CC=config/c_io_libio.cc
1141 AC_MSG_RESULT(libio)
1143 # see if we are on a system with libio native (ie, linux)
1144 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
1146 # Need to check and see what version of glibc is being used. If
1147 # it's not glibc-2.2 or higher, then we'll need to go ahead and
1148 # compile most of libio for linux systems.
1149 if test x$has_libio = x"yes"; then
1152 AC_MSG_CHECKING([for glibc version >= 2.2])
1153 AC_EGREP_CPP([ok], [
1154 #include <features.h>
1155 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1158 ], glibc_satisfactory=yes, glibc_satisfactory=no)
1159 AC_MSG_RESULT($glibc_satisfactory)
1163 # XXX at the moment, admit defeat and force the recompilation
1164 # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
1165 glibc_satisfactory=no
1167 if test x$glibc_satisfactory = x"yes"; then
1172 # bkoz XXX need to add checks to enable this
1173 # pme XXX here's a first pass at such a check
1174 if test x$enable_c_mbchar != xno; then
1182 # Using libio, but <libio.h> doesn't exist on the target system. . .
1184 # bkoz XXX need to add checks to enable this
1185 # pme XXX here's a first pass at such a check
1186 if test x$enable_c_mbchar != xno; then
1193 xstdio | x | xno | xnone | xyes)
1195 CSTDIO_H=config/c_io_stdio.h
1196 CSTDIO_CC=config/c_io_stdio.cc
1197 AC_MSG_RESULT(stdio)
1199 # We're not using stdio.
1202 # Wide characters are not supported with this package.
1206 echo "$enable_cstdio is an unknown io package" 1>&2
1210 AC_LINK_FILES($CSTDIO_H, include/bits/c++io.h)
1211 AC_LINK_FILES($CSTDIO_CC, src/c++io.cc)
1213 # 2000-08-04 bkoz hack
1214 CCODECVT_C=config/c_io_libio_codecvt.c
1215 AC_LINK_FILES($CCODECVT_C, libio/c_codecvt.c)
1216 # 2000-08-04 bkoz hack
1218 AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
1219 test "$need_libio" = yes || test "$need_wlibio" = yes)
1220 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
1221 AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
1222 if test "$need_libio" = yes || test "$need_wlibio" = yes; then
1223 libio_la=../libio/libio.la
1232 dnl Check for which threading library to use.
1234 dnl GLIBCPP_ENABLE_THREADS
1235 dnl --enable-threads=posix sets config/threads-posix.h et. al.
1237 dnl Default is no threads, which also disables _IO_MTSAFE_IO in
1238 dnl libio. Any actual thread package will enable it.
1240 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
1241 dnl Note this comes from the gcc/config.in and libjava/config.in
1242 dnl Efforts should be made to keep this in sync.
1243 AC_MSG_CHECKING([for threads package to use])
1244 AC_ARG_ENABLE(threads,
1245 [ --enable-threads enable thread usage for target GCC.
1246 --enable-threads=LIB use LIB thread package for target GCC. [default=no]
1248 if test x$enable_threads = xno; then
1253 enable_threads_flag=$enable_threads
1255 dnl Check if a valid thread package
1256 case x${enable_threads_flag} in
1259 target_thread_file='single'
1263 target_thread_file='posix'
1265 xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
1266 xsolaris | xwin32 | xdce | xvxworks)
1267 target_thread_file=$enable_threads_flag
1270 echo "$enable_threads is an unknown thread package" 1>&2
1275 dnl Check for thread package actually supported in libstdc++
1277 case "$target_thread_file" in
1279 THREADH=threads-no.h
1282 THREADH=threads-posix.h
1284 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
1285 AC_MSG_ERROR(thread package $THREADS not yet supported)
1288 AC_MSG_ERROR($THREADS is an unsupported/unknown thread package)
1291 AC_MSG_RESULT($THREADH)
1293 AC_LINK_FILES(config/$THREADH, include/bits/c++threads.h)
1294 if test $THREADH != threads-no.h; then
1295 AC_DEFINE(_GLIBCPP_USE_THREADS)
1301 dnl Check for template specializations for the 'long long' type extension.
1303 dnl GLIBCPP_ENABLE_LONG_LONG
1304 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
1305 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
1306 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
1307 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1308 dnl defaults to `no'.
1309 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1311 dnl GLIBCPP_ENABLE_LONG_LONG
1312 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
1313 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
1315 AC_ARG_ENABLE(long-long,
1316 changequote(<<, >>)dnl
1317 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
1318 changequote([, ])dnl
1319 [case "$enableval" in
1320 yes) enable_long_long=yes ;;
1321 no) enable_long_long=no ;;
1322 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1324 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1326 # Allow use of os-dependent settings, so that macros that turn on
1327 # C99 capabilities can be defined and used in a consistent way.
1328 OS_INC_PATH=${srcdir}/$os_include_dir
1329 ac_test_CFLAGS="${CFLAGS+set}"
1330 ac_save_CFLAGS="$CFLAGS"
1331 CFLAGS="-I$OS_INC_PATH"
1333 # Check for the existence of functions used if long long is enabled.
1334 AC_CHECK_FUNC(strtoll,,ac_strtoll=no)
1335 AC_CHECK_FUNC(strtoull,,ac_strtoull=no)
1337 # Check for lldiv_t, et. al.
1338 AC_MSG_CHECKING([for lldiv_t declaration])
1339 AC_CACHE_VAL(glibcpp_lldiv_t_use, [
1340 AC_TRY_COMPILE([#include <bits/os_defines.h>
1341 #include <stdlib.h>],
1343 [glibcpp_lldiv_t_use=yes], [glibcpp_lldiv_t_use=no])
1345 AC_MSG_RESULT($glibcpp_lldiv_t_use)
1346 if test x$glibcpp_lldiv_t_use = x"yes"; then
1347 AC_DEFINE(HAVE_LLDIV_T)
1350 AC_MSG_CHECKING([for enabled long long])
1351 if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then
1352 enable_long_long=no;
1354 AC_MSG_RESULT($enable_long_long)
1356 # Option parsed, now set things appropriately
1357 if test x"$enable_long_long" = xyes; then
1358 AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1362 CFLAGS="$ac_save_CFLAGS"
1367 dnl Check for what kind of C headers to use.
1369 dnl GLIBCPP_ENABLE_CHEADERS
1370 dnl --enable-cheaders= [does stuff].
1371 dnl --disable-cheaders [does not do anything, really].
1372 dnl + This will eventually need to be 'c_shadow' by default.
1373 dnl + Usage: GLIBCPP_ENABLE_CHEADERS[(DEFAULT)]
1374 dnl Where DEFAULT is either `c' or `c_std' or 'c_shadow'.
1375 dnl If ommitted, it defaults to `c_std'.
1376 AC_DEFUN(GLIBCPP_ENABLE_CHEADERS, [dnl
1377 define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
1378 AC_MSG_CHECKING([for c header strategy to use])
1379 AC_ARG_ENABLE(cheaders,
1380 changequote(<<, >>)dnl
1381 << --enable-cheaders construct "C" header files for
1382 g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
1384 [case "$enableval" in
1389 enable_cheaders=c_std
1392 enable_cheaders=c_shadow
1394 *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
1397 enable_cheaders=GLIBCPP_ENABLE_CHEADERS_DEFAULT)
1398 AC_MSG_RESULT($enable_cheaders)
1400 dnl Option parsed, now set things appropriately
1401 case "$enable_cheaders" in
1403 CSHADOW_FLAGS="-fno-builtin"
1404 C_INCLUDE_DIR='${top_srcdir}/include/c_shadow'
1405 AC_DEFINE(_GLIBCPP_USE_SHADOW_HEADERS)
1409 C_INCLUDE_DIR='${top_srcdir}/include/c_std'
1413 C_INCLUDE_DIR='${top_srcdir}/include/c'
1417 AC_SUBST(CSHADOW_FLAGS)
1418 AC_SUBST(C_INCLUDE_DIR)
1419 AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cheaders" = c_shadow)
1424 dnl Check for wide character support. Has the same effect as the option
1425 dnl in gcc's configure, but in a form that autoconf can mess with.
1427 dnl GLIBCPP_ENABLE_C_MBCHAR
1428 dnl --enable-c-mbchar requests all the wchar_t stuff.
1429 dnl --disable-c-mbchar doesn't.
1430 dnl + Usage: GLIBCPP_ENABLE_C_MBCHAR[(DEFAULT)]
1431 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1432 dnl defaults to `no'.
1433 AC_DEFUN(GLIBCPP_ENABLE_C_MBCHAR, [dnl
1434 define([GLIBCPP_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
1435 AC_ARG_ENABLE(c-mbchar,
1436 changequote(<<, >>)dnl
1437 << --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCPP_ENABLE_C_MBCHAR_DEFAULT],
1438 changequote([, ])dnl
1439 [case "$enableval" in
1440 yes) enable_c_mbchar=yes ;;
1441 no) enable_c_mbchar=no ;;
1442 *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
1444 enable_c_mbchar=GLIBCPP_ENABLE_C_MBCHAR_DEFAULT)dnl
1445 dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
1450 dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
1452 dnl GLIBCPP_INCLUDE_DIR
1454 dnl TOPLEVEL_INCLUDES
1455 dnl LIBMATH_INCLUDES
1456 dnl LIBSUPCXX_INCLUDES
1458 dnl CSHADOW_INCLUDES
1460 dnl GLIBCPP_EXPORT_INCLUDE
1461 AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
1462 # Root level of the include sources.
1463 GLIBCPP_INCLUDE_DIR='$(top_srcdir)/include'
1465 # Can either use include/c or include/c_std to grab "C" headers. This
1466 # variable is set to the include directory currently in use.
1467 # set with C_INCLUDE_DIR in GLIBCPP_ENABLE_CHEADERS
1469 # Passed down for canadian crosses.
1470 if test x"$CANADIAN" = xyes; then
1471 TOPLEVEL_INCLUDES='-I$(includedir)'
1474 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1476 LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
1478 #if GLIBCPP_NEED_LIBIO
1479 LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
1481 #LIBIO_INCLUDES='-I$(top_srcdir)/libio'
1484 #if GLIBCPP_USE_CSHADOW
1485 # CSHADOW_INCLUDES='-I$(GLIBCPP_INCLUDE_DIR)/std -I$(C_INCLUDE_DIR) \
1486 # -I$(top_blddir)/cshadow'
1488 CSTD_INCLUDES='-I$(GLIBCPP_INCLUDE_DIR)/std -I$(C_INCLUDE_DIR)'
1491 # Now, export this to all the little Makefiles....
1492 AC_SUBST(GLIBCPP_INCLUDE_DIR)
1493 AC_SUBST(TOPLEVEL_INCLUDES)
1494 AC_SUBST(LIBMATH_INCLUDES)
1495 AC_SUBST(LIBSUPCXX_INCLUDES)
1496 AC_SUBST(LIBIO_INCLUDES)
1497 AC_SUBST(CSTD_INCLUDES)
1502 dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
1504 AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
1505 # Optimization flags that are probably a good idea for thrill-seekers. Just
1506 # uncomment the lines below and make, everything else is ready to go...
1507 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
1509 AC_SUBST(OPTIMIZE_CXXFLAGS)
1511 WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings -Winline'
1512 AC_SUBST(WARN_FLAGS)
1516 dnl GLIBCPP_EXPORT_INSTALL_INFO
1517 dnl calculates gxx_install_dir
1518 dnl exports glibcpp_toolexecdir
1519 dnl exports glibcpp_toolexeclibdir
1521 dnl Assumes cross_compiling bits already done, and with_cross_host in
1524 dnl GLIBCPP_EXPORT_INSTALL_INFO
1525 AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
1527 glibcpp_toolexecdir=no
1528 glibcpp_toolexeclibdir=no
1530 AC_MSG_CHECKING([for interface version number])
1531 libstdcxx_interface=$INTERFACE
1532 AC_MSG_RESULT($libstdcxx_interface)
1534 # Process the option --with-gxx-include-dir=<path to include-files directory>
1535 AC_MSG_CHECKING([for --with-gxx-include-dir])
1536 AC_ARG_WITH(gxx-include-dir,
1537 [ --with-gxx-include-dir the installation directory for include files],
1538 [case "${withval}" in
1540 AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
1547 gxx_include_dir=${withval}
1549 esac], [gxx_include_dir=no])
1550 AC_MSG_RESULT($gxx_include_dir)
1552 # Process the option "--enable-version-specific-runtime-libs"
1553 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
1554 AC_ARG_ENABLE(version-specific-runtime-libs,
1555 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
1556 [ version_specific_libs=yes
1557 # Need the gcc compiler version to know where to install libraries
1558 # and header files if --enable-version-specific-runtime-libs option
1561 gcc_version_trigger=${srcdir}/../gcc/version.c
1562 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
1563 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
1564 gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
1565 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1566 glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}
1568 ],version_specific_libs=no)
1569 AC_MSG_RESULT($version_specific_libs)
1571 # Default case for install directory for include files.
1572 if test x"$version_specific_libs" = x"no" \
1573 && test x"$gxx_include_dir"=x"no"; then
1574 gxx_include_dir='$(prefix)'/include/g++-${libstdcxx_interface}
1577 # Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
1578 # Install a library built with a cross compiler in tooldir, not libdir.
1579 if test x"$glibcpp_toolexecdir" = x"no"; then
1580 if test x"$with_cross_host" = x"yes"; then
1581 glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
1582 glibcpp_toolexeclibdir='$(toolexecdir)/lib$(MULTISUBDIR)'
1584 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1585 glibcpp_toolexeclibdir='$(libdir)$(MULTISUBDIR)'
1589 AC_MSG_CHECKING([for install location])
1590 AC_MSG_RESULT($gxx_include_dir)
1592 AC_SUBST(gxx_include_dir)
1593 AC_SUBST(glibcpp_toolexecdir)
1594 AC_SUBST(glibcpp_toolexeclibdir)
1598 # Check whether LC_MESSAGES is available in <locale.h>.
1599 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1601 # This file file be copied and used freely without restrictions. It can
1602 # be used in projects which are not available under the GNU Public License
1603 # but which still want to provide support for the GNU gettext functionality.
1604 # Please note that the actual code is *not* freely available.
1608 AC_DEFUN(AC_LC_MESSAGES, [
1609 AC_CHECK_HEADER(locale.h, [
1610 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1611 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1612 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1613 if test $ac_cv_val_LC_MESSAGES = yes; then
1614 AC_DEFINE(HAVE_LC_MESSAGES)
1620 # Check for functions in math library.
1621 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1623 # This file can be copied and used freely without restrictions. It can
1624 # be used in projects which are not available under the GNU Public License
1625 # but which still want to provide support for the GNU gettext functionality.
1626 # Please note that the actual code is *not* freely available.
1630 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1631 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1632 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])
1633 AC_SUBST(LIBMATHOBJS)dnl
1637 # Check for string functions.
1638 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1640 # This file can be copied and used freely without restrictions. It can
1641 # be used in projects which are not available under the GNU Public License
1642 # but which still want to provide support for the GNU gettext functionality.
1643 # Please note that the actual code is *not* freely available.
1647 dnl AC_REPLACE_STRINGFUNCS(FUNCTION...)
1648 AC_DEFUN(AC_REPLACE_STRINGFUNCS,
1649 [AC_CHECK_FUNCS([$1], , [LIBSTRINGOBJS="$LIBSTRINGOBJS ${ac_func}.lo"])
1650 AC_SUBST(LIBSTRINGOBJS)dnl
1654 dnl This macro searches for a GNU version of make. If a match is found, the
1655 dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
1656 dnl set to "#". This is useful for including a special features in a Makefile,
1657 dnl which cannot be handled by other versions of make. The variable
1658 dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
1659 dnl the empty string otherwise.
1661 dnl Here is an example of its use:
1663 dnl Makefile.in might contain:
1665 dnl # A failsafe way of putting a dependency rule into a makefile
1667 dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
1669 dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
1670 dnl @ifGNUmake@ include $(DEPEND)
1671 dnl @ifGNUmake@ endif
1673 dnl Then configure.in would normally contain:
1675 dnl CHECK_GNU_MAKE()
1676 dnl AC_OUTPUT(Makefile)
1678 dnl Then perhaps to cause gnu make to override any other make, we could do
1679 dnl something like this (note that GNU make always looks for GNUmakefile first):
1681 dnl if ! test x$_cv_gnu_make_command = x ; then
1682 dnl mv Makefile GNUmakefile
1683 dnl echo .DEFAULT: > Makefile ;
1684 dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
1687 dnl Then, if any (well almost any) other make is called, and GNU make also
1688 dnl exists, then the other make wraps the GNU make.
1690 dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
1691 dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
1693 dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
1694 dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
1695 dnl #### conditional's subshell (" --version" is not a command), using a
1696 dnl #### different option to grep(1).
1698 dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
1699 dnl #### ${MAKE:-make}).
1702 GLIBCPP_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
1703 _cv_gnu_make_command='' ;
1704 dnl Search all the common names for GNU make
1705 for a in "${MAKE-make}" make gmake gnumake ; do
1706 if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
1708 _cv_gnu_make_command=$a ;
1713 dnl If there was a GNU version, then set @ifGNUmake@ to the empty
1714 dnl string, '#' otherwise
1715 if test "x$_cv_gnu_make_command" != "x" ; then
1723 sinclude(../libtool.m4)
1724 dnl The lines below arrange for aclocal not to bring an installed
1725 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
1726 dnl add a definition of LIBTOOL to Makefile.in.
1727 ifelse(,,,[AC_SUBST(LIBTOOL)
1728 AC_DEFUN([AM_PROG_LIBTOOL])
1729 AC_DEFUN([AC_LIBTOOL_DLOPEN])
1730 AC_DEFUN([AC_PROG_LD])
1734 # Do all the work for Automake. This macro actually does too much --
1735 # some checks are only needed if your package does certain things.
1736 # But this isn't really a big deal.
1741 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
1743 AC_DEFUN(AM_INIT_AUTOMAKE,
1744 [AC_REQUIRE([AC_PROG_INSTALL])
1749 dnl test to see if srcdir already configured
1750 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1751 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1754 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1755 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
1756 AC_REQUIRE([AM_SANITY_CHECK])
1757 AC_REQUIRE([AC_ARG_PROGRAM])
1758 dnl FIXME This is truly gross.
1759 missing_dir=`cd $ac_aux_dir && pwd`
1760 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
1761 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
1762 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
1763 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
1764 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
1765 AC_REQUIRE([AC_PROG_MAKE_SET])])
1768 # Check to make sure that the build environment is sane.
1771 AC_DEFUN(AM_SANITY_CHECK,
1772 [AC_MSG_CHECKING([whether build environment is sane])
1775 echo timestamp > conftestfile
1776 # Do `set' in a subshell so we don't clobber the current shell's
1777 # arguments. Must try -L first in case configure is actually a
1778 # symlink; some systems play weird games with the mod time of symlinks
1779 # (eg FreeBSD returns the mod time of the symlink's containing
1782 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1783 if test "[$]*" = "X"; then
1785 set X `ls -t $srcdir/configure conftestfile`
1787 if test "[$]*" != "X $srcdir/configure conftestfile" \
1788 && test "[$]*" != "X conftestfile $srcdir/configure"; then
1790 # If neither matched, then we have a broken ls. This can happen
1791 # if, for instance, CONFIG_SHELL is bash and it inherits a
1792 # broken ls alias from the environment. This has actually
1793 # happened. Such a system could not be considered "sane".
1794 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1795 alias in your environment])
1798 test "[$]2" = conftestfile
1804 AC_MSG_ERROR([newly created file is older than distributed files!
1805 Check your system clock])
1808 AC_MSG_RESULT(yes)])
1810 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1811 dnl The program must properly implement --version.
1812 AC_DEFUN(AM_MISSING_PROG,
1813 [AC_MSG_CHECKING(for working $2)
1814 # Run test in a subshell; some versions of sh will print an error if
1815 # an executable is not found, even if stderr is redirected.
1816 # Redirect stdin to placate older versions of autoconf. Sigh.
1817 if ($2 --version) < /dev/null > /dev/null 2>&1; then
1819 AC_MSG_RESULT(found)
1822 AC_MSG_RESULT(missing)
1826 # Add --enable-maintainer-mode option to configure.
1831 AC_DEFUN(AM_MAINTAINER_MODE,
1832 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1833 dnl maintainer-mode is disabled by default
1834 AC_ARG_ENABLE(maintainer-mode,
1835 [ --enable-maintainer-mode enable make rules and dependencies not useful
1836 (and sometimes confusing) to the casual installer],
1837 USE_MAINTAINER_MODE=$enableval,
1838 USE_MAINTAINER_MODE=no)
1839 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1840 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1841 MAINT=$MAINTAINER_MODE_TRUE
1846 # Define a conditional.
1848 AC_DEFUN(AM_CONDITIONAL,
1859 # Like AC_CONFIG_HEADER, but automatically create stamp file.
1861 AC_DEFUN(AM_CONFIG_HEADER,
1863 AC_CONFIG_HEADER([$1])
1864 dnl When config.status generates a header, we must update the stamp-h file.
1865 dnl This file resides in the same directory as the config header
1866 dnl that is generated. We must strip everything past the first ":",
1867 dnl and everything past the last "/".
1868 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1869 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1870 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1872 for am_file in <<$1>>; do
1873 case " <<$>>CONFIG_HEADERS " in
1874 *" <<$>>am_file "*<<)>>
1875 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1878 am_indx=`expr "<<$>>am_indx" + 1`