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 dnl We may get other options which we dont document:
30 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
31 if test "[$]{srcdir}" = "."; then
32 if test "[$]{with_target_subdir}" != "."; then
33 glibcpp_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
35 glibcpp_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
38 glibcpp_basedir="[$]{srcdir}/$1"
40 AC_SUBST(glibcpp_basedir)
42 AM_INIT_AUTOMAKE(libstdc++, 2.90.8)
44 # Never versions of autoconf add an underscore to these functions.
45 # Prevent future problems ...
46 ifdef([AC_PROG_CC_G],[],[define([AC_PROG_CC_G],defn([_AC_PROG_CC_G]))])
47 ifdef([AC_PROG_CC_GNU],[],[define([AC_PROG_CC_GNU],defn([_AC_PROG_CC_GNU]))])
48 ifdef([AC_PROG_CXX_G],[],[define([AC_PROG_CXX_G],defn([_AC_PROG_CXX_G]))])
49 ifdef([AC_PROG_CXX_GNU],[],[define([AC_PROG_CXX_GNU],defn([_AC_PROG_CXX_GNU]))])
53 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
54 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
55 # are probably using a cross compiler, which will not be able to fully
56 # link an executable. This should really be fixed in autoconf
59 AC_DEFUN(LIB_AC_PROG_CC,
60 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
61 dnl Fool anybody using AC_PROG_CC.
62 AC_PROVIDE([AC_PROG_CC])
63 AC_CHECK_PROG(CC, gcc, gcc)
64 if test -z "$CC"; then
65 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
66 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
71 if test $ac_cv_prog_gcc = yes; then
73 dnl Check whether -g works, even if CFLAGS is set, in case the package
74 dnl plays around with CFLAGS (such as to build both debugging and
75 dnl normal versions of a library), tasteless as that idea is.
76 ac_test_CFLAGS="${CFLAGS+set}"
77 ac_save_CFLAGS="$CFLAGS"
80 if test "$ac_test_CFLAGS" = set; then
81 CFLAGS="$ac_save_CFLAGS"
82 elif test $ac_cv_prog_cc_g = yes; then
89 test "${CFLAGS+set}" = set || CFLAGS="-g"
95 # Can't just call these here as g++ requires libstc++ to be built....
98 # Likewise for AC_PROG_CXX.
99 AC_DEFUN(LIB_AC_PROG_CXX,
100 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
101 dnl Fool anybody using AC_PROG_CXX.
102 AC_PROVIDE([AC_PROG_CXX])
103 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
104 test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
108 if test $ac_cv_prog_gxx = yes; then
110 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
111 dnl plays around with CXXFLAGS (such as to build both debugging and
112 dnl normal versions of a library), tasteless as that idea is.
113 ac_test_CXXFLAGS="${CXXFLAGS+set}"
114 ac_save_CXXFLAGS="$CXXFLAGS"
117 if test "$ac_test_CXXFLAGS" = set; then
118 CXXFLAGS="$ac_save_CXXFLAGS"
119 elif test $ac_cv_prog_cxx_g = yes; then
126 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
132 AC_CHECK_TOOL(AS, as)
133 AC_CHECK_TOOL(AR, ar)
134 AC_CHECK_TOOL(RANLIB, ranlib, :)
140 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
141 # at least currently, we never actually build a program, so we never
142 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
143 # fails, because we are probably configuring with a cross compiler
144 # which cant create executables. So we include AC_EXEEXT to keep
145 # automake happy, but we dont execute it, since we dont care about
151 # configure.host sets the following important variables
152 # glibcpp_cflags - host specific C compiler flags
153 # glibcpp_cxxflags - host specific C++ compiler flags
157 . [$]{glibcpp_basedir}/configure.host
159 case [$]{glibcpp_basedir} in
160 /* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
161 *) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
164 GLIBCPP_CFLAGS="[$]{glibcpp_cflags}"
165 GLIBCPP_CXXFLAGS="[$]{glibcpp_cxxflags}"
166 AC_SUBST(GLIBCPP_CFLAGS)
167 AC_SUBST(GLIBCPP_CXXFLAGS)
172 dnl Check to see if g++ can compile this library, and if so, if any version-
173 dnl specific precautions need to be taken.
175 dnl GLIBCPP_CHECK_COMPILER_VERSION
176 AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
177 # Sanity check that g++ is capable of dealing with v-3.
178 AC_MSG_CHECKING([for g++ that will successfully compile this code])
180 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
183 ], gpp_satisfactory=yes, AC_MSG_ERROR("please upgrade to gcc-2.95 or above"))
184 AC_MSG_RESULT($gpp_satisfactory)
189 dnl Test for newer compiler features, or features that are present in newer
190 dnl compiler version but not older compiler versions should be placed
193 dnl Define WFMT_FLAGS='-fdiagnostics-show-location=once' if possible
195 dnl Define WERROR='-Werror' if possible; g++'s that lack the new inlining
196 dnl code or the new system_header pragma will die.
198 dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
199 dnl compiler supports it.
200 dnl GLIBCPP_CHECK_COMPILER_FEATURES
201 AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
202 # All these tests are for C++; save the language and the compiler flags.
203 # The CXXFLAGS thing is suspicious, but based on similar bits
204 # found in GLIBCPP_CONFIGURE.
207 ac_test_CXXFLAGS="${CXXFLAGS+set}"
208 ac_save_CXXFLAGS="$CXXFLAGS"
211 # Check for pragma system_header.
212 AC_MSG_CHECKING([for g++ that supports pragma system_header])
213 CXXFLAGS='-Wunknown-pragmas -Werror'
214 AC_TRY_COMPILE([#pragma GCC system_header], [int foo;
215 ], [ac_newpragma=yes], [ac_newpragma=no])
216 if test "$ac_test_CXXFLAGS" = set; then
217 CXXFLAGS="$ac_save_CXXFLAGS"
219 # this is the suspicious part
222 if test "$ac_newpragma" = "no"; then
223 WERROR="$WERROR -Wno-unknown-pragmas"
225 AC_MSG_RESULT($ac_newpragma)
227 # Check for more sophisticated diagnostic control.
228 AC_MSG_CHECKING([for g++ that supports -fdiagnostics-show-location=once])
229 CXXFLAGS='-fdiagnostics-show-location=once'
230 AC_TRY_COMPILE(, [int foo;
231 ], [ac_gabydiags=yes], [ac_gabydiags=no])
232 if test "$ac_test_CXXFLAGS" = set; then
233 CXXFLAGS="$ac_save_CXXFLAGS"
235 # this is the suspicious part
238 if test "$ac_gabydiags" = "yes"; then
239 WFMT_FLAGS='-fdiagnostics-show-location=once'
241 AC_MSG_RESULT($ac_gabydiags)
243 # Check for -ffunction-sections -fdata-sections
244 AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
245 CXXFLAGS='-ffunction-sections -fdata-sections'
246 AC_TRY_COMPILE(, [int foo;
247 ], [ac_fdsections=yes], [ac_fdsections=no])
248 if test "$ac_test_CXXFLAGS" = set; then
249 CXXFLAGS="$ac_save_CXXFLAGS"
251 # this is the suspicious part
254 if test "$ac_fdsections" = "yes"; then
255 SECTION_FLAGS='-ffunction-sections -fdata-sections'
257 AC_MSG_RESULT($ac_fdsections)
262 AC_SUBST(SECTION_FLAGS)
267 dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
268 dnl the native linker is in use, all variables will be defined to something
269 dnl safe (like an empty string).
271 dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible.
272 dnl Define OPT_LDFLAGS='-Wl,-O1' if possible.
274 dnl GLIBCPP_CHECK_LINKER_FEATURES
275 AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
276 # If we're not using GNU ld, then there's no point in even trying these
277 # tests. Check for that first. We should have already tested for gld
278 # by now (in libtool), but require it now just to be safe...
279 AC_REQUIRE([AC_PROG_LD])
280 if test "$ac_cv_prog_gnu_ld" = "no"; then
284 else # GNU ld it is! Joy and bunny rabbits!
286 # All these tests are for C++; save the language and the compiler flags.
287 # Need to do this so that g++ won't try to link in libstdc++
288 ac_test_CFLAGS="${CFLAGS+set}"
289 ac_save_CFLAGS="$CFLAGS"
290 CFLAGS='-x c++ -Wl,--gc-sections'
292 # Check for -Wl,--gc-sections
293 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
301 ], [ac_sectionLDflags=yes], [ac_sectionLFflags=no], [ac_sectionLDflags=yes])
302 if test "$ac_test_CFLAGS" = set; then
303 CFLAGS="$ac_save_CFLAGS"
305 # this is the suspicious part
308 if test "$ac_sectionLDflags" = "yes"; then
309 SECTION_LDFLAGS='-Wl,--gc-sections'
311 AC_MSG_RESULT($ac_sectionLDflags)
312 OPT_LDFLAGS='-Wl,-O1'
315 AC_SUBST(SECTION_LDFLAGS)
316 AC_SUBST(OPT_LDFLAGS)
321 dnl Check to see if the (math function) argument passed is
322 dnl 1) declared when using the c++ compiler
323 dnl 2) has "C" linkage
325 dnl Define HAVE_CARGF etc if "cargf" is declared and links
327 dnl argument 1 is name of function to check
329 dnl ASSUMES argument is a math function with ONE parameter
331 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1
332 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
333 AC_MSG_CHECKING([for $1 declaration])
334 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
337 AC_TRY_COMPILE([#include <math.h>],
339 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
342 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
343 if test x$glibcpp_cv_func_$1_use = x"yes"; then
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
354 dnl Define HAVE_CARGF etc if "cargf" is declared and links
356 dnl argument 1 is name of function to check
358 dnl ASSUMES argument is a math function with TWO parameters
360 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2
361 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
362 AC_MSG_CHECKING([for $1 declaration])
363 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
366 AC_TRY_COMPILE([#include <math.h>],
368 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
371 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
372 if test x$glibcpp_cv_func_$1_use = x"yes"; then
379 dnl Check to see if the (math function) argument passed is
380 dnl 1) declared when using the c++ compiler
381 dnl 2) has "C" linkage
383 dnl Define HAVE_CARGF etc if "cargf" is declared and links
385 dnl argument 1 is name of function to check
387 dnl ASSUMES argument is a math function with THREE parameters
389 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3
390 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
391 AC_MSG_CHECKING([for $1 declaration])
392 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
395 AC_TRY_COMPILE([#include <math.h>],
397 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
400 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
401 if test x$glibcpp_cv_func_$1_use = x"yes"; then
408 dnl Because the builtins are picky picky picky about the arguments they take,
409 dnl do an explict linkage tests here.
410 dnl Check to see if the (math function) argument passed is
411 dnl 1) declared when using the c++ compiler
412 dnl 2) has "C" linkage
414 dnl Define HAVE_CARGF etc if "cargf" is declared and links
416 dnl argument 1 is name of function to check
418 dnl ASSUMES argument is a math function with ONE parameter
420 dnl GLIBCPP_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
421 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
422 AC_MSG_CHECKING([for $1 declaration])
423 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
426 AC_TRY_COMPILE([#include <math.h>],
428 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
431 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
432 if test x$glibcpp_cv_func_$1_use = x"yes"; then
433 AC_MSG_CHECKING([for $1 linkage])
434 AC_CACHE_VAL(glibcpp_cv_func_$1_link, [
435 AC_TRY_LINK([#include <math.h>],
437 [glibcpp_cv_func_$1_link=yes], [glibcpp_cv_func_$1_link=no])
439 AC_MSG_RESULT($glibcpp_cv_func_$1_link)
440 if test x$glibcpp_cv_func_$1_link = x"yes"; then
441 ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
442 AC_DEFINE_UNQUOTED(${ac_tr_func})
449 dnl Check to see what builtin math functions are supported
451 dnl check for __builtin_abs
452 dnl check for __builtin_fabsf
453 dnl check for __builtin_fabs
454 dnl check for __builtin_fabl
455 dnl check for __builtin_labs
456 dnl check for __builtin_sqrtf
457 dnl check for __builtin_sqrtl
458 dnl check for __builtin_fsqrt
459 dnl check for __builtin_sinf
460 dnl check for __builtin_sin
461 dnl check for __builtin_sinl
462 dnl check for __builtin_cosf
463 dnl check for __builtin_cos
464 dnl check for __builtin_cosl
466 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
467 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
468 dnl Test for builtin math functions.
469 dnl These are made in gcc/c-common.c
470 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
471 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
472 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
473 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
474 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
476 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
477 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fsqrt)
478 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
480 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
481 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
482 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
484 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
485 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
486 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
488 dnl There is, without a doubt, a more elegant way to have these
489 dnl names exported so that they won't be stripped out of acconfig.h by
490 dnl autoheader. I leave this as an exercise to somebody less frustrated
491 dnl than I.... please email the libstdc++ list if you can figure out a
492 dnl more elegant approach (see autoconf/acgen.m4 and specifically
493 dnl AC_CHECK_FUNC for things to steal.)
495 if test x$dummyvar = x"yes"; then
496 AC_DEFINE(HAVE___BUILTIN_ABS)
497 AC_DEFINE(HAVE___BUILTIN_LABS)
498 AC_DEFINE(HAVE___BUILTIN_COS)
499 AC_DEFINE(HAVE___BUILTIN_COSF)
500 AC_DEFINE(HAVE___BUILTIN_COSL)
501 AC_DEFINE(HAVE___BUILTIN_FABS)
502 AC_DEFINE(HAVE___BUILTIN_FABSF)
503 AC_DEFINE(HAVE___BUILTIN_FABSL)
504 AC_DEFINE(HAVE___BUILTIN_SIN)
505 AC_DEFINE(HAVE___BUILTIN_SINF)
506 AC_DEFINE(HAVE___BUILTIN_SINL)
507 AC_DEFINE(HAVE___BUILTIN_FSQRT)
508 AC_DEFINE(HAVE___BUILTIN_SQRTF)
509 AC_DEFINE(HAVE___BUILTIN_SQRTL)
515 dnl Check to see what the underlying c library or math library is like.
516 dnl These checks need to do two things:
517 dnl 1) make sure the name is declared when using the c++ compiler
518 dnl 2) make sure the name has "C" linkage
519 dnl This might seem like overkill but experience has shown that it's not...
521 dnl Define HAVE_CARGF etc if "cargf" is found.
523 dnl GLIBCPP_CHECK_MATH_SUPPORT
524 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
525 ac_test_CXXFLAGS="${CXXFLAGS+set}"
526 ac_save_CXXFLAGS="$CXXFLAGS"
527 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
530 AC_CHECK_LIB(m, sin, libm="-lm")
534 dnl Although not math functions, needed and for some reason checked here.
535 AC_CHECK_FUNCS(strtof strtold)
537 dnl Check to see if certain C math functions exist.
538 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
539 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
540 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
541 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
542 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
543 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
544 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
546 dnl Check to see if basic C math functions have float versions.
547 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
548 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
549 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(acosf)
550 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(asinf)
551 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(atanf)
552 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
553 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(ceilf)
554 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(cosf)
555 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(coshf)
556 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expf)
557 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
558 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(floorf)
559 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
560 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
561 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
562 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
563 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
564 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
565 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
566 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sinf)
567 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sinhf)
568 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
569 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(tanf)
570 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(tanhf)
571 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
572 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
574 dnl Check to see if basic C math functions have long double versions.
575 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
576 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
577 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
578 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(acosl)
579 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(asinl)
580 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(atanl)
581 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
582 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(ceill)
583 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(cosl)
584 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(coshl)
585 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
586 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
587 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(floorl)
588 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
589 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
590 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
591 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
592 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
593 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
594 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
595 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sinl)
596 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sinhl)
597 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
598 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(tanl)
599 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(tanhl)
600 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
601 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
603 dnl Some runtimes have these functions with a preceding underscore. Please
604 dnl keep this sync'd with the one above. And if you add any new symbol,
605 dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
606 dnl Check to see if certain C math functions exist.
607 dnl Check to see if certain C math functions exist.
608 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinf)
609 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnan)
610 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_finite)
611 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_copysign)
612 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(_sincos)
613 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_fpclass)
614 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_qfpclass)
616 dnl Check to see if basic C math functions have float versions.
617 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnanf)
618 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinff)
619 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_acosf)
620 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_asinf)
621 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_atanf)
622 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_atan2f)
623 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_ceilf)
624 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_cosf)
625 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_coshf)
626 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_expf)
627 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_fabsf)
628 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_floorf)
629 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_fmodf)
630 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_frexpf)
631 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_ldexpf)
632 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_logf)
633 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_log10f)
634 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_modff)
635 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_powf)
636 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_sinf)
637 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_sinhf)
638 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_sqrtf)
639 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_tanf)
640 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_tanhf)
641 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(_sincosf)
642 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_finitef)
644 dnl Check to see if basic C math functions have long double versions.
645 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnanl)
646 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinfl)
647 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_copysignl)
648 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_acosl)
649 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_asinl)
650 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_atanl)
651 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_atan2l)
652 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_ceill)
653 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_cosl)
654 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_coshl)
655 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_expl)
656 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_fabsl)
657 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_floorl)
658 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_fmodl)
659 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_frexpl)
660 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_ldexpl)
661 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_logl)
662 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_log10l)
663 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_modfl)
664 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_powl)
665 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_sinl)
666 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_sinhl)
667 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_sqrtl)
668 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_tanl)
669 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_tanhl)
670 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(_sincosl)
671 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_finitel)
674 CXXFLAGS="$ac_save_CXXFLAGS"
679 dnl Check to see if there is native support for complex
681 dnl Don't compile bits in math/* if native support exits.
683 dnl Define USE_COMPLEX_LONG_DOUBLE etc if "cargf" is found.
685 dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
686 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
687 dnl Check for complex versions of math functions of platform.
688 AC_CHECK_HEADERS([complex.h])
689 AC_REPLACE_MATHFUNCS(ccos ccosf ccosh ccoshf cexp cexpf c_log c_logf \
690 clog10 clog10f cpow cpowf csin csinf csinh csinhf csqrt csqrtf \
691 ctan ctanf ctanh ctanhf carg cargf nan hypot hypotf atan2f expf copysignf)
693 dnl Compile the long double complex functions only if the function
694 dnl provides the non-complex long double functions that are needed.
695 dnl Currently this includes copysignl and atan2l, which should be
696 dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
697 USE_COMPLEX_LONG_DOUBLE=no
698 if test x$ac_cv_func_atan2l = x"yes" \
699 && test x$ac_cv_func_copysignl = x"yes"; then
700 USE_COMPLEX_LONG_DOUBLE=yes
701 AC_REPLACE_MATHFUNCS(ccoshl ccosl cexpl cpowl csinhl csinl \
702 csqrtl ctanhl ctanl cargl hypotl signbitl c_logl clog10l)
705 AC_SUBST(USE_COMPLEX_LONG_DOUBLE)
709 dnl Check to see what architecture we are compiling for. If it's
710 dnl supported, use special hand-crafted routines to provide thread
711 dnl primitives. Also, if architecture-specific flags are required for
712 dnl compilation, add them here.
714 dnl Depending on what is found, select configure/cpu/*/bits/atomicity.h
715 dnl If not found, select configure/cpu/generic/bits/atomicity.h
717 dnl GLIBCPP_CHECK_CPU
718 AC_DEFUN(GLIBCPP_CHECK_CPU, [
719 AC_MSG_CHECKING([for cpu primitives directory])
721 case "${target_cpu}" in
723 cpu_include_dir="config/cpu/alpha"
726 cpu_include_dir="config/cpu/arm"
729 cpu_include_dir="config/cpu/i386"
731 i486 | i586 | i686 | i786)
732 cpu_include_dir="config/cpu/i486"
735 cpu_include_dir="config/cpu/powerpc"
736 CPU_FLAGS='-mcpu=powerpc'
738 sparc64 | ultrasparc)
739 cpu_include_dir="config/cpu/sparc/sparc64"
742 cpu_include_dir="config/cpu/sparc/sparc32"
745 cpu_include_dir="config/cpu/generic"
748 AC_MSG_RESULT($cpu_include_dir)
749 AC_SUBST(cpu_include_dir)
755 dnl Check to see what the underlying c library's interface to ctype looks
756 dnl like. Bits of locale rely on things like isspace, toupper, etc. This
757 dnl stuff makes sure the right bits from the clibrary get called.
759 dnl Depending on what is found, select various configure/*/bits/ctype_base.h
760 dnl Depending on what is found, select various configure/*/ctype.cc
762 dnl GLIBCPP_CHECK_CTYPE
763 AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
764 AC_CHECK_HEADER(ctype.h, [
766 dnl If doesn't match any specified, go with defaults.
769 dnl Test for <ctype> functionality -- gnu-linux
770 AC_MSG_CHECKING([<ctype> for gnu-linux ])
771 AC_TRY_COMPILE([#include <ctype.h>],
774 { return _ISspace + _ISprint + _IScntrl + _ISupper + _ISlower + _ISalpha \
775 + _ISdigit + _ISpunct + _ISxdigit + _ISalnum + _ISgraph \
776 + __ctype_tolower[a] + __ctype_toupper[a] + __ctype_b[a];}], \
777 ctype_linux=yes, ctype_linux=no)
778 AC_MSG_RESULT($ctype_linux)
779 if test $ctype_linux = "yes"; then
780 ctype_include_dir="config/gnu-linux"
784 dnl Test for <ctype> functionality -- FreeBSD 4.0
785 if test $ctype_default = "yes"; then
786 AC_MSG_CHECKING([<ctype> for freebsd 4.0 ])
787 AC_TRY_COMPILE([#include <ctype.h>],
790 { return _CTYPE_S + _CTYPE_R + _CTYPE_C + _CTYPE_U + _CTYPE_L + _CTYPE_A \
791 + _CTYPE_D + _CTYPE_P + _CTYPE_X + _CTYPE_G ;}], \
792 ctype_bsd=yes, ctype_bsd=no)
793 AC_MSG_RESULT($ctype_bsd)
794 if test $ctype_bsd = "yes"; then
795 ctype_include_dir="config/bsd"
800 dnl Test for <ctype> functionality -- FreeBSD 3.4
801 if test $ctype_default = "yes"; then
802 AC_MSG_CHECKING([<ctype> for freebsd 3.4 ])
803 AC_TRY_COMPILE([#include <ctype.h>],
806 { return _S + _R + _C + _U + _L + _A \
807 + _D + _P + _X + _G + __istype (a, 0);}], \
808 ctype_freebsd34=yes, ctype_freebsd34=no)
809 AC_MSG_RESULT($ctype_freebsd34)
810 if test $ctype_freebsd34 = "yes"; then
811 ctype_include_dir="config/bsd"
816 dnl Test for <ctype> functionality -- solaris 2.6 and 2.7
817 if test $ctype_default = "yes"; then
818 AC_MSG_CHECKING([<ctype> for solaris 2.[6,7,8] ])
819 AC_TRY_COMPILE([#include <ctype.h>],
822 { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
823 + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
824 + __trans_lower[a] + __trans_upper[a] + __ctype_mask[a];}], \
825 ctype_solaris=yes, ctype_solaris=no)
826 AC_MSG_RESULT($ctype_solaris)
828 if test $ctype_solaris = "yes"; then
829 AC_MSG_CHECKING([ for version])
831 AC_TRY_COMPILE([#include <ctype.h>],
832 [typedef long* __to_type; __to_type const& _M_toupper = __trans_upper;],\
833 ctype_solaris26=yes, ctype_solaris26=no)
835 if test $ctype_solaris26 = "yes"; then
836 ctype_include_dir="config/solaris/solaris2.6"
837 AC_MSG_RESULT("solaris2.6")
840 ctype_include_dir="config/solaris/solaris2.7"
841 AC_MSG_RESULT("solaris2.[7,8]")
847 dnl Test for <ctype> functionality -- solaris 2.5.1
848 if test $ctype_default = "yes"; then
849 AC_MSG_CHECKING([<ctype> for solaris 2.5.1 ])
850 AC_TRY_COMPILE([#include <ctype.h>],
853 { return _U + _L + _N + _S + _P + _C + _X + _B \
855 ctype_solaris25=yes, ctype_solaris25=no)
856 AC_MSG_RESULT($ctype_solaris25)
857 if test $ctype_solaris25 = "yes"; then
858 ctype_include_dir="config/solaris/solaris2.5"
863 dnl Test for <ctype> functionality -- aix
864 if test $ctype_default = "yes"; then
865 AC_MSG_CHECKING([<ctype> for aix ])
866 AC_TRY_COMPILE([#include <ctype.h>],
869 { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
870 + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
871 + _VALC('a') + _IS('c', 0);}], \
872 ctype_aix=yes, ctype_aix=no)
873 AC_MSG_RESULT($ctype_aix)
874 if test $ctype_aix = "yes"; then
875 ctype_include_dir="config/aix"
880 dnl Test for <ctype> functionality -- newlib
881 if test $ctype_default = "yes"; then
882 AC_MSG_CHECKING([<ctype> for newlib ])
883 AC_TRY_COMPILE([#include <ctype.h>],
886 { return _U + _L + _N + _S + _P + _C + _X + _B \
888 ctype_newlib=yes, ctype_newlib=no)
889 AC_MSG_RESULT($ctype_newlib)
890 if test $ctype_newlib = "yes"; then
891 ctype_include_dir="config/newlib"
896 if test $ctype_default = "yes"; then
897 ctype_include_dir="config/generic"
898 AC_MSG_WARN("Using default ctype headers.")
900 AC_SUBST(ctype_include_dir)
906 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
908 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
909 dnl Define _GLIBCPP_NEED_MBSTATE_T if mbstate_t is not in wchar.h
911 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
912 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
914 dnl Sanity check for existence of ISO C9X headers for extended encoding.
915 AC_CHECK_HEADER(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
916 AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
918 dnl Only continue checking if the ISO C9X headers exist.
919 if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes; then
921 dnl Test wchar.h for mbstate_t, which is needed for char_traits and others.
922 AC_MSG_CHECKING([for mbstate_t])
923 AC_TRY_COMPILE([#include <wchar.h>],
924 [mbstate_t teststate;],
925 use_native_mbstatet=yes, use_native_mbstatet=no)
926 AC_MSG_RESULT($use_native_mbstatet)
927 if test x"$use_native_mbstatet" = xno; then
928 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
931 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
932 dnl numeric_limits can instantiate type_traits<wchar_t>
933 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
934 AC_TRY_COMPILE([#include <wchar.h>],
935 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
936 has_wchar_minmax=yes, has_wchar_minmax=no)
937 AC_MSG_RESULT($has_wchar_minmax)
939 dnl Test wchar.h for WEOF, which is what we use to determine whether
940 dnl to specialize for char_traits<wchar_t> or not.
941 AC_MSG_CHECKING([for WEOF])
944 #include <stddef.h>],
946 has_weof=yes, has_weof=no)
947 AC_MSG_RESULT($has_weof)
949 dnl Tests for wide character functions used in char_traits<wchar_t>.
950 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset \
951 wcsrtombs mbsrtowcs, ac_wfuncs=yes, ac_wfuncs=no)
953 AC_MSG_CHECKING([for ISO C9X wchar_t support])
954 if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes \
955 && test x"$ac_wfuncs" = xyes; then
956 ac_isoC9X_wchar_t=yes
960 AC_MSG_RESULT($ac_isoC9X_wchar_t)
962 dnl Use iconv for wchar_t to char conversions. As such, check for
963 dnl X/Open Portability Guide, version 2 features (XPG2).
964 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
965 AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
966 AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
967 ac_XPG2funcs=yes, ac_XPG2funcs=no)
969 AC_MSG_CHECKING([for XPG2 wchar_t support])
970 if test x"$ac_has_iconv_h" = xyes && test x"$ac_has_langinfo_h" = xyes \
971 && test x"$ac_XPG2funcs" = xyes; then
976 AC_MSG_RESULT($ac_XPG2_wchar_t)
978 dnl At the moment, only enable wchar_t specializations if all the
979 dnl above support is present.
980 AC_MSG_CHECKING([for enabled wchar_t specializations])
981 if test x"$ac_isoC9X_wchar_t" = xyes \
982 && test x"$ac_XPG2_wchar_t" = xyes; then
983 libinst_wstring_la="libinst-wstring.la"
984 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
987 libinst_wstring_la=""
990 AC_SUBST(libinst_wstring_la)
993 AC_MSG_WARN([<wchar.h> not found])
994 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
1000 dnl Check to see if this version of GNU C++ is afflicted by bugs in
1001 dnl __complex__ float support.
1003 dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy.
1005 dnl Check to see if this version of GNU C++ is afflicted by bugs in
1006 dnl __complex__ support.Check for buggy __complex__ that will cause ICE in
1007 dnl gcc-2.95.x when using the library, unless we define the default copy
1008 dnl ctor in the specializations of complex<>.
1010 dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy.
1011 dnl GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
1012 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT, [
1013 AC_REQUIRE([AC_PROG_CXX])
1015 AC_MSG_CHECKING([for GNU C++ __complex__ support])
1016 AC_CACHE_VAL(glibcpp_cv_complex, [
1019 AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
1020 dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
1021 [ dcomplex x; f(x); ],
1022 glibcpp_cv_complex=ok,
1023 glibcpp_cv_complex=buggy
1027 AC_MSG_RESULT($glibcpp_cv_complex)
1028 if test $glibcpp_cv_complex = buggy; then
1029 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
1032 AC_MSG_CHECKING([for GNU C++ __complex__ float support])
1033 AC_CACHE_VAL(glibcpp_cv_float_complex, [
1037 cat > conftest.h <<EOB
1039 // Check for buggy __complex__ that causes ICE in most versions of egcs
1040 // and gcc-2.95.x on certain platforms (eg., x86-win32).
1042 // See http://egcs.cygnus.com/ml/gcc-bugs/1999-07/msg00845.html for
1043 // more info on the bug itself.
1048 __complex__ float m_value;
1049 float_complex (float = 0.0f, float = 0.0f);
1050 float_complex (__complex__ float val) : m_value (val) {}
1051 float_complex foo (const float_complex &val)
1052 { return float_complex (~val.m_value); }
1055 AC_TRY_COMPILE([#include "conftest.h"], ,
1056 glibcpp_cv_float_complex=ok,
1057 glibcpp_cv_float_complex=buggy
1061 AC_MSG_RESULT($glibcpp_cv_float_complex)
1062 if test $glibcpp_cv_float_complex = buggy; then
1063 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
1069 dnl Check for special debugging mode; not for production use.
1071 dnl GLIBCPP_ENABLE_DEBUG
1072 dnl --enable-debug sets '-ggdb -O0'.
1073 dnl --disable-debug sets '-g' and whatever optimization options the
1074 dnl compiler can handle.
1075 dnl + Perhaps --enable-maintainer-mode should automatically turn this on?
1076 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
1077 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
1078 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1079 dnl defaults to `no'.
1080 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
1081 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
1082 AC_ARG_ENABLE(debug,
1083 changequote(<<, >>)dnl
1084 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
1085 changequote([, ])dnl
1086 [case "${enableval}" in
1087 yes) enable_debug=yes ;;
1088 no) enable_debug=no ;;
1089 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
1091 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
1093 dnl Option parsed, now set things appropriately
1094 case "${enable_debug}" in
1096 DEBUG_FLAGS='-O0 -ggdb'
1102 AC_SUBST(DEBUG_FLAGS)
1107 dnl Check for "unusual" flags to pass to the compiler while building.
1109 dnl GLIBCPP_ENABLE_CXX_FLAGS
1110 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
1111 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
1112 dnl Somehow this same set of flags must be passed when [re]building
1114 dnl --disable-cxx-flags passes nothing.
1115 dnl + See http://sourceware.cygnus.com/ml/libstdc++/2000-q2/msg00131.html
1116 dnl http://sourceware.cygnus.com/ml/libstdc++/2000-q2/msg00284.html
1117 dnl http://sourceware.cygnus.com/ml/libstdc++/2000-q1/msg00035.html
1118 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
1119 dnl If "default flags" is an empty string (or "none"), the effect is
1120 dnl the same as --disable or --enable=no.
1121 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
1122 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1123 AC_ARG_ENABLE(cxx-flags,
1124 changequote(<<, >>)dnl
1125 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
1126 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
1127 changequote([, ])dnl
1128 [case "x$enableval" in
1130 AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
1132 enable_cxx_flags='' ;;
1134 enable_cxx_flags="$enableval" ;;
1136 enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
1138 dnl Thinko on my part during design. This kludge is the workaround.
1139 if test "$enable_cxx_flags" = "none"; then
1140 enable_cxx_flags='';
1143 dnl Run through flags (either default or command-line) and set anything
1144 dnl extra (e.g., #defines) that must accompany particular g++ options.
1145 if test -n "$enable_cxx_flags"; then
1146 for f in $enable_cxx_flags; do
1150 *) # and we're trying to pass /what/ exactly?
1151 AC_MSG_ERROR([compiler flags start with a -]) ;;
1155 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1156 AC_SUBST(EXTRA_CXX_FLAGS)
1161 dnl Check for instructions to automatically rebuild libgcc.a. Requires,
1162 dnl of course, the location of the gcc objdir. Note that if --disable-
1163 dnl namespaces is in effect, rebuilding libgcc.a is an expensive no-op.
1165 dnl GLIBCPP_ENABLE_RELIBGCC
1166 dnl --enable-libgcc-rebuild=/absolute/path/to/gcc/objdir sets GCC_OBJDIR
1167 dnl (presumably in the top-level Makefile) to /absol.../objdir
1168 dnl --disable-libgcc-rebuild will not touch libgcc.a at all (maybe print
1169 dnl a warning if this is given along with --enable-namespaces), by
1170 dnl setting GCC_OBJDIR to `no'.
1171 dnl + Doing this by default is going to be interesting. What default
1172 dnl "on" value can there be?
1173 dnl + Usage: GLIBCPP_ENABLE_RELIBGCC[(DEFAULT)]
1174 dnl The default path should be ../.. if bundled with GCC source.
1175 dnl If ommitted, it defaults to `no'.
1177 AC_DEFUN(GLIBCPP_ENABLE_RELIBGCC, [dnl
1178 define([GLIBCPP_ENABLE_RELIBGCC_DEFAULT], ifelse($1,, no, $1))dnl
1179 AC_ARG_ENABLE(libgcc-rebuild,
1180 changequote(<<, >>)dnl
1181 << --enable-libgcc-rebuild=DIR also rebuild libgcc.a; DIR is
1182 the GCC objdir; see install.html>>,
1183 changequote([, ])dnl
1184 [case "$enableval" in
1185 yes) AC_MSG_ERROR([--enable-libgcc-rebuild needs a pathname]) ;;
1186 no) enable_libgcc_rebuild=no ;;
1187 *) if test -d "$enableval" && test -d "${enableval}/gcc" && \
1188 test -d "${enableval}/libiberty"
1190 enable_libgcc_rebuild="$enableval"
1192 AC_MSG_ERROR(["$enableval" does not appear to be the GCC objdir])
1196 enable_libgcc_rebuild=GLIBCPP_ENABLE_RELIBGCC_DEFAULT)dnl
1197 GCC_OBJDIR="$enable_libgcc_rebuild"
1198 AC_SUBST(GCC_OBJDIR)
1203 dnl Check for which I/O library to use: libio, or something specific.
1205 dnl GLIBCPP_ENABLE_CSTDIO
1206 dnl --enable-cstdio=libio sets config/c_io_libio.h and friends
1208 dnl default is libio
1210 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
1211 AC_MSG_CHECKING([for cstdio to use])
1212 AC_ARG_ENABLE(cstdio,
1213 [ --enable-cstdio enable GNU libio for target io package. (default)
1214 --enable-cstdio=LIB use LIB target-speific io package.],
1215 if test x$enable_cstdio = xno; then
1218 enable_cstdio=libio)
1220 enable_cstdio_flag=$enable_cstdio
1222 dnl Check if a valid thread package
1223 case x${enable_cstdio_flag} in
1224 xlibio | x | xno | xnone | xyes)
1226 CSTDIO_H=config/c_io_libio.h
1227 CSTDIO_CC=config/c_io_libio.cc
1228 AC_MSG_RESULT(libio)
1230 # see if we are on a system with libio native (ie, linux)
1231 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
1233 # Need to check and see what version of glibc is being used. If
1234 # it's not glibc-2.2 or higher, then we'll need to go ahead and
1235 # compile most of libio for linux systems.
1236 if test x$has_libio = x"yes"; then
1239 AC_MSG_CHECKING([for glibc version >= 2.2])
1240 AC_EGREP_CPP([ok], [
1241 #include <features.h>
1242 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1245 ], glibc_satisfactory=yes, glibc_satisfactory=no)
1246 AC_MSG_RESULT($glibc_satisfactory)
1250 if test x$glibc_satisfactory = x"yes"; then
1257 # bkoz XXX need to add checks to enable this
1261 # Using libio, but <libio.h> doesn't exist on the target system. . .
1265 # bkoz XXX need to add checks to enable this
1271 CSTDIO_H=config/c_io_wince.h
1272 CSTDIO_CC=config/c_io_wince.cc
1273 AC_MSG_RESULT(wince)
1278 echo "$enable_cstdio is an unknown io package" 1>&2
1282 AC_LINK_FILES($CSTDIO_H, bits/c++io.h)
1283 AC_LINK_FILES($CSTDIO_CC, src/c++io.cc)
1285 # 2000-08-04 bkoz hack
1286 CCODECVT_C=config/c_io_libio_codecvt.c
1287 AC_LINK_FILES($CCODECVT_C, libio/c_codecvt.c)
1288 # 2000-08-04 bkoz hack
1290 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
1291 AM_CONDITIONAL(GLIBCPP_NEED_XTRA_LIBIO, test "$need_xtra_libio" = yes)
1292 AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
1297 dnl Check for which threading library to use.
1299 dnl GLIBCPP_ENABLE_THREADS
1300 dnl --enable-threads=posix sets config/threads-posix.h et. al.
1302 dnl default is no threads
1304 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
1305 dnl Note this comes from the gcc/config.in and libjava/config.in
1306 dnl Efforts should be made to keep this in sync.
1307 AC_MSG_CHECKING([for threads package to use])
1308 AC_ARG_ENABLE(threads,
1309 [ --enable-threads enable thread usage for target GCC.
1310 --enable-threads=LIB use LIB thread package for target GCC.],
1311 if test x$enable_threads = xno; then
1316 enable_threads_flag=$enable_threads
1318 dnl Check if a valid thread package
1319 case x${enable_threads_flag} in
1322 target_thread_file='single'
1326 target_thread_file=''
1328 xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
1329 xsolaris | xwin32 | xdce | xvxworks)
1330 target_thread_file=$enable_threads_flag
1333 echo "$enable_threads is an unknown thread package" 1>&2
1338 dnl Check for thread package actually supported in libstdc++
1339 case "$target_thread_file" in
1350 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
1351 AC_MSG_ERROR(thread package $THREADS not yet supported)
1354 AC_MSG_ERROR($THREADS is an unknown thread package)
1357 AC_MSG_RESULT($THREADS)
1367 AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
1368 THREADLIBS=-lpthread
1369 THREADSPEC=-lpthread
1370 dnl Not presently used
1371 dnl THREADOBJS=threads-posix.lo
1372 THREADH=threads-posix.h
1375 dnl Not presently used
1376 dnl THREADOBJS=threads-no.lo
1377 THREADH=threads-no.h
1380 AC_SUBST(THREADLIBS)
1381 AC_SUBST(THREADINCS)
1382 AC_SUBST(THREADDEPS)
1383 AC_SUBST(THREADOBJS)
1384 AC_SUBST(THREADSPEC)
1385 AC_LINK_FILES(config/$THREADH, bits/c++threads.h)
1390 dnl Check for template specializations for the 'long long' type extension.
1392 dnl GLIBCPP_ENABLE_LONG_LONG
1393 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
1394 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
1395 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
1396 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1397 dnl defaults to `no'.
1398 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1400 dnl GLIBCPP_ENABLE_LONG_LONG
1401 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
1402 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
1404 AC_ARG_ENABLE(long-long,
1405 changequote(<<, >>)dnl
1406 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
1407 changequote([, ])dnl
1408 [case "$enableval" in
1409 yes) enable_long_long=yes ;;
1410 no) enable_long_long=no ;;
1411 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1413 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1415 # Check for the existance of functions used if long long is enabled.
1416 AC_CHECK_FUNC(strtoll,,ac_strtoll=no)
1417 AC_CHECK_FUNC(strtoull,,ac_strtoull=no)
1419 AC_MSG_CHECKING([for enabled long long])
1420 if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then
1421 enable_long_long=no;
1423 AC_MSG_RESULT($enable_long_long)
1425 dnl Option parsed, now set things appropriately
1426 case "$enable_long_long" in
1427 yes) AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1434 dnl Check for whether or not to do shadowed C headers.
1436 dnl GLIBCPP_ENABLE_SHADOW
1437 dnl --enable-cshadow-headers [does stuff].
1438 dnl --disable-cshadow-headers [does not do stuff].
1439 dnl + This will eventually need to be on by default.
1440 dnl + Usage: GLIBCPP_ENABLE_SHADOW[(DEFAULT)]
1441 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1442 dnl defaults to `no'.
1443 AC_DEFUN(GLIBCPP_ENABLE_SHADOW, [dnl
1444 define([GLIBCPP_ENABLE_SHADOW_DEFAULT], ifelse($1, yes, yes, no))dnl
1445 AC_MSG_CHECKING([for enabled cshadow headers])
1446 AC_ARG_ENABLE(cshadow-headers,
1447 changequote(<<, >>)dnl
1448 << --enable-cshadow-headers construct "shadowed" C header files for
1449 g++ [default=>>GLIBCPP_ENABLE_SHADOW_DEFAULT],
1451 [case "$enableval" in
1452 yes) enable_cshadow_headers=yes
1454 no) enable_cshadow_headers=no
1456 *) AC_MSG_ERROR([Unknown argument to enable/disable shadowed C headers])
1459 enable_cshadow_headers=GLIBCPP_ENABLE_SHADOW_DEFAULT)
1460 AC_MSG_RESULT($enable_cshadow_headers)
1462 dnl Option parsed, now set things appropriately
1463 dnl CSHADOWFLAGS is currently unused, but may be useful in the future.
1464 case "$enable_cshadow_headers" in
1473 AC_SUBST(CSHADOWFLAGS)
1474 AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes)
1478 # Check whether LC_MESSAGES is available in <locale.h>.
1479 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1481 # This file file be copied and used freely without restrictions. It can
1482 # be used in projects which are not available under the GNU Public License
1483 # but which still want to provide support for the GNU gettext functionality.
1484 # Please note that the actual code is *not* freely available.
1488 AC_DEFUN(AC_LC_MESSAGES,
1489 [if test $ac_cv_header_locale_h = yes; then
1490 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1491 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1492 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1493 if test $ac_cv_val_LC_MESSAGES = yes; then
1494 AC_DEFINE(HAVE_LC_MESSAGES)
1499 # Check for functions in math library.
1500 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1502 # This file can be copied and used freely without restrictions. It can
1503 # be used in projects which are not available under the GNU Public License
1504 # but which still want to provide support for the GNU gettext functionality.
1505 # Please note that the actual code is *not* freely available.
1509 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1510 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1511 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])
1512 AC_SUBST(LIBMATHOBJS)dnl
1516 # Check for string functions.
1517 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1519 # This file can be copied and used freely without restrictions. It can
1520 # be used in projects which are not available under the GNU Public License
1521 # but which still want to provide support for the GNU gettext functionality.
1522 # Please note that the actual code is *not* freely available.
1526 dnl AC_REPLACE_STRINGFUNCS(FUNCTION...)
1527 AC_DEFUN(AC_REPLACE_STRINGFUNCS,
1528 [AC_CHECK_FUNCS([$1], , [LIBSTRINGOBJS="$LIBSTRINGOBJS ${ac_func}.lo"])
1529 AC_SUBST(LIBSTRINGOBJS)dnl
1533 dnl This macro searches for a GNU version of make. If a match is found, the
1534 dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
1535 dnl set to "#". This is useful for including a special features in a Makefile,
1536 dnl which cannot be handled by other versions of make. The variable
1537 dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
1538 dnl the empty string otherwise.
1540 dnl Here is an example of its use:
1542 dnl Makefile.in might contain:
1544 dnl # A failsafe way of putting a dependency rule into a makefile
1546 dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
1548 dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
1549 dnl @ifGNUmake@ include $(DEPEND)
1550 dnl @ifGNUmake@ endif
1552 dnl Then configure.in would normally contain:
1554 dnl CHECK_GNU_MAKE()
1555 dnl AC_OUTPUT(Makefile)
1557 dnl Then perhaps to cause gnu make to override any other make, we could do
1558 dnl something like this (note that GNU make always looks for GNUmakefile first):
1560 dnl if ! test x$_cv_gnu_make_command = x ; then
1561 dnl mv Makefile GNUmakefile
1562 dnl echo .DEFAULT: > Makefile ;
1563 dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
1566 dnl Then, if any (well almost any) other make is called, and GNU make also
1567 dnl exists, then the other make wraps the GNU make.
1569 dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
1570 dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
1572 dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
1573 dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
1574 dnl #### conditional's subshell (" --version" is not a command).
1577 GLIBCPP_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
1578 _cv_gnu_make_command='' ;
1579 dnl Search all the common names for GNU make
1580 for a in "${MAKE:-make}" make gmake gnumake ; do
1581 if ( $a --version 2> /dev/null | grep -q GNU ) ; then
1582 _cv_gnu_make_command=$a ;
1587 dnl If there was a GNU version, then set @ifGNUmake@ to the empty
1588 dnl string, '#' otherwise
1589 if test "x$_cv_gnu_make_command" != "x" ; then
1597 sinclude(../libtool.m4)
1598 dnl The lines below arrange for aclocal not to bring an installed
1599 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
1600 dnl add a definition of LIBTOOL to Makefile.in.
1601 ifelse(,,,[AC_SUBST(LIBTOOL)
1602 AC_DEFUN([AM_PROG_LIBTOOL])
1603 AC_DEFUN([AC_LIBTOOL_DLOPEN])
1604 AC_DEFUN([AC_PROG_LD])
1606 # Do all the work for Automake. This macro actually does too much --
1607 # some checks are only needed if your package does certain things.
1608 # But this isn't really a big deal.
1613 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
1615 AC_DEFUN(AM_INIT_AUTOMAKE,
1616 [AC_REQUIRE([AC_PROG_INSTALL])
1621 dnl test to see if srcdir already configured
1622 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1623 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1626 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1627 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
1628 AC_REQUIRE([AM_SANITY_CHECK])
1629 AC_REQUIRE([AC_ARG_PROGRAM])
1630 dnl FIXME This is truly gross.
1631 missing_dir=`cd $ac_aux_dir && pwd`
1632 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
1633 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
1634 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
1635 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
1636 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
1637 AC_REQUIRE([AC_PROG_MAKE_SET])])
1640 # Check to make sure that the build environment is sane.
1643 AC_DEFUN(AM_SANITY_CHECK,
1644 [AC_MSG_CHECKING([whether build environment is sane])
1647 echo timestamp > conftestfile
1648 # Do `set' in a subshell so we don't clobber the current shell's
1649 # arguments. Must try -L first in case configure is actually a
1650 # symlink; some systems play weird games with the mod time of symlinks
1651 # (eg FreeBSD returns the mod time of the symlink's containing
1654 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1655 if test "[$]*" = "X"; then
1657 set X `ls -t $srcdir/configure conftestfile`
1659 if test "[$]*" != "X $srcdir/configure conftestfile" \
1660 && test "[$]*" != "X conftestfile $srcdir/configure"; then
1662 # If neither matched, then we have a broken ls. This can happen
1663 # if, for instance, CONFIG_SHELL is bash and it inherits a
1664 # broken ls alias from the environment. This has actually
1665 # happened. Such a system could not be considered "sane".
1666 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1667 alias in your environment])
1670 test "[$]2" = conftestfile
1676 AC_MSG_ERROR([newly created file is older than distributed files!
1677 Check your system clock])
1680 AC_MSG_RESULT(yes)])
1682 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1683 dnl The program must properly implement --version.
1684 AC_DEFUN(AM_MISSING_PROG,
1685 [AC_MSG_CHECKING(for working $2)
1686 # Run test in a subshell; some versions of sh will print an error if
1687 # an executable is not found, even if stderr is redirected.
1688 # Redirect stdin to placate older versions of autoconf. Sigh.
1689 if ($2 --version) < /dev/null > /dev/null 2>&1; then
1691 AC_MSG_RESULT(found)
1694 AC_MSG_RESULT(missing)
1698 # Add --enable-maintainer-mode option to configure.
1703 AC_DEFUN(AM_MAINTAINER_MODE,
1704 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1705 dnl maintainer-mode is disabled by default
1706 AC_ARG_ENABLE(maintainer-mode,
1707 [ --enable-maintainer-mode enable make rules and dependencies not useful
1708 (and sometimes confusing) to the casual installer],
1709 USE_MAINTAINER_MODE=$enableval,
1710 USE_MAINTAINER_MODE=no)
1711 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1712 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1713 MAINT=$MAINTAINER_MODE_TRUE
1718 # Define a conditional.
1720 AC_DEFUN(AM_CONDITIONAL,
1731 # Like AC_CONFIG_HEADER, but automatically create stamp file.
1733 AC_DEFUN(AM_CONFIG_HEADER,
1735 AC_CONFIG_HEADER([$1])
1736 dnl When config.status generates a header, we must update the stamp-h file.
1737 dnl This file resides in the same directory as the config header
1738 dnl that is generated. We must strip everything past the first ":",
1739 dnl and everything past the last "/".
1740 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1741 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1742 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1744 for am_file in <<$1>>; do
1745 case " <<$>>CONFIG_HEADERS " in
1746 *" <<$>>am_file "*<<)>>
1747 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1750 am_indx=`expr "<<$>>am_indx" + 1`