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)
44 AM_INIT_AUTOMAKE(libstdc++, 2.90.8)
46 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
47 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
48 # are probably using a cross compiler, which will not be able to fully
49 # link an executable. This should really be fixed in autoconf
52 AC_DEFUN(LIB_AC_PROG_CC,
53 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
54 dnl Fool anybody using AC_PROG_CC.
55 AC_PROVIDE([AC_PROG_CC])
56 AC_CHECK_PROG(CC, gcc, gcc)
57 if test -z "$CC"; then
58 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
59 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
64 if test $ac_cv_prog_gcc = yes; then
66 dnl Check whether -g works, even if CFLAGS is set, in case the package
67 dnl plays around with CFLAGS (such as to build both debugging and
68 dnl normal versions of a library), tasteless as that idea is.
69 ac_test_CFLAGS="${CFLAGS+set}"
70 ac_save_CFLAGS="$CFLAGS"
73 if test "$ac_test_CFLAGS" = set; then
74 CFLAGS="$ac_save_CFLAGS"
75 elif test $ac_cv_prog_cc_g = yes; then
82 test "${CFLAGS+set}" = set || CFLAGS="-g"
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 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
94 test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
98 if test $ac_cv_prog_gxx = yes; then
100 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
101 dnl plays around with CXXFLAGS (such as to build both debugging and
102 dnl normal versions of a library), tasteless as that idea is.
103 ac_test_CXXFLAGS="${CXXFLAGS+set}"
104 ac_save_CXXFLAGS="$CXXFLAGS"
107 if test "$ac_test_CXXFLAGS" = set; then
108 CXXFLAGS="$ac_save_CXXFLAGS"
109 elif test $ac_cv_prog_cxx_g = yes; then
116 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
122 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we dont
123 # run it explicitly here, it will be run implicitly before
124 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
125 # be run before AC_CANONICAL_HOST.
128 AC_CHECK_TOOL(AS, as)
129 AC_CHECK_TOOL(AR, ar)
130 AC_CHECK_TOOL(RANLIB, ranlib, :)
136 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
137 # at least currently, we never actually build a program, so we never
138 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
139 # fails, because we are probably configuring with a cross compiler
140 # which cant create executables. So we include AC_EXEEXT to keep
141 # automake happy, but we dont execute it, since we dont care about
147 # configure.host sets the following important variables
148 # glibcpp_cflags - host specific C compiler flags
149 # 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 GLIBCPP_CFLAGS="[$]{glibcpp_cflags}"
162 GLIBCPP_CXXFLAGS="[$]{glibcpp_cxxflags}"
163 AC_SUBST(GLIBCPP_CFLAGS)
164 AC_SUBST(GLIBCPP_CXXFLAGS)
169 dnl Check to see if g++ can compile this library, and if so, if any version-
170 dnl specific precautions need to be taken.
172 dnl GLIBCPP_CHECK_COMPILER_VERSION
173 AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
174 # Sanity check that g++ is capable of dealing with v-3.
175 AC_MSG_CHECKING([for g++ that will successfully compile this code])
177 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
180 ], gpp_satisfactory=yes, AC_MSG_ERROR("please upgrade to gcc-2.95 or above"))
181 AC_MSG_RESULT($gpp_satisfactory)
186 dnl Test for newer compiler features, or features that are present in newer
187 dnl compiler version but not older compiler versions should be placed
190 dnl Define WFMT_FLAGS='-fdiagnostics-show-location=once' if possible
192 dnl Define WERROR='-Werror' if possible; g++'s that lack the new inlining
193 dnl code or the new system_header pragma will die.
195 dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
196 dnl compiler supports it.
197 dnl GLIBCPP_CHECK_COMPILER_FEATURES
198 AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
199 # All these tests are for C++; save the language and the compiler flags.
200 # The CXXFLAGS thing is suspicious, but based on similar bits
201 # found in GLIBCPP_CONFIGURE.
204 ac_test_CXXFLAGS="${CXXFLAGS+set}"
205 ac_save_CXXFLAGS="$CXXFLAGS"
208 # Check for pragma system_header.
209 AC_MSG_CHECKING([for g++ that supports pragma system_header])
210 CXXFLAGS='-Wunknown-pragmas -Werror'
211 AC_TRY_COMPILE([#pragma GCC system_header], [int foo;
212 ], [ac_newpragma=yes], [ac_newpragma=no])
213 if test "$ac_test_CXXFLAGS" = set; then
214 CXXFLAGS="$ac_save_CXXFLAGS"
216 # this is the suspicious part
219 if test "$ac_newpragma" = "no"; then
220 WERROR="$WERROR -Wno-unknown-pragmas"
222 AC_MSG_RESULT($ac_newpragma)
224 # Check for more sophisticated diagnostic control.
225 AC_MSG_CHECKING([for g++ that supports -fdiagnostics-show-location=once])
226 CXXFLAGS='-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 "$ac_gabydiags" = "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='-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 "$ac_fdsections" = "yes"; then
252 SECTION_FLAGS='-ffunction-sections -fdata-sections'
254 AC_MSG_RESULT($ac_fdsections)
259 AC_SUBST(SECTION_FLAGS)
264 dnl Check to see if tricky linker opts can be used.
266 dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible
267 dnl GLIBCPP_CHECK_LINKER_FEATURES
268 AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
269 # All these tests are for C++; save the language and the compiler flags.
270 # Need to do this so that g++ won't try to link in libstdc++
271 ac_test_CFLAGS="${CFLAGS+set}"
272 ac_save_CFLAGS="$CFLAGS"
273 CFLAGS='-x c++ -Wl,--gc-sections'
275 # Check for -Wl,--gc-sections
276 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
284 ], [ac_sectionLDflags=yes], [ac_sectionLFflags=no], [ac_sectionLDflags=yes])
285 if test "$ac_test_CFLAGS" = set; then
286 CFLAGS="$ac_save_CFLAGS"
288 # this is the suspicious part
291 if test "$ac_sectionLDflags" = "yes"; then
292 SECTION_LDFLAGS='-Wl,--gc-sections'
294 AC_MSG_RESULT($ac_sectionLDflags)
296 AC_SUBST(SECTION_LDFLAGS)
301 dnl Check to see if the (math function) argument passed is
302 dnl 1) declared when using the c++ compiler
303 dnl 2) has "C" linkage
305 dnl Define HAVE_CARGF etc if "cargf" is declared and links
307 dnl argument 1 is name of function to check
309 dnl ASSUMES argument is a math function with ONE parameter
311 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1
312 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
315 AC_MSG_CHECKING([for $1 declaration])
316 AC_TRY_COMPILE([#include <math.h>],
318 [use_$1=yes], [use_$1=no])
319 AC_MSG_RESULT($use_$1)
321 if test x$use_$1 = x"yes"; then
328 dnl Check to see if the (math function) argument passed is
329 dnl 1) declared when using the c++ compiler
330 dnl 2) has "C" linkage
332 dnl Define HAVE_CARGF etc if "cargf" is declared and links
334 dnl argument 1 is name of function to check
336 dnl ASSUMES argument is a math function with TWO parameters
338 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2
339 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
342 AC_MSG_CHECKING([for $1 declaration])
343 AC_TRY_COMPILE([#include <math.h>],
345 [use_$1=yes], [use_$1=no])
346 AC_MSG_RESULT($use_$1)
348 if test x$use_$1 = x"yes"; then
355 dnl Check to see if the (math function) argument passed is
356 dnl 1) declared when using the c++ compiler
357 dnl 2) has "C" linkage
359 dnl Define HAVE_CARGF etc if "cargf" is declared and links
361 dnl argument 1 is name of function to check
363 dnl ASSUMES argument is a math function with THREE parameters
365 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3
366 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
369 AC_MSG_CHECKING([for $1 declaration])
370 AC_TRY_COMPILE([#include <math.h>],
372 [use_$1=yes], [use_$1=no])
373 AC_MSG_RESULT($use_$1)
375 if test x$use_$1 = x"yes"; then
382 dnl Because the builtins are picky picky picky about the arguments they take,
383 dnl do an explict linkage tests here.
384 dnl Check to see if the (math function) argument passed is
385 dnl 1) declared when using the c++ compiler
386 dnl 2) has "C" linkage
388 dnl Define HAVE_CARGF etc if "cargf" is declared and links
390 dnl argument 1 is name of function to check
392 dnl ASSUMES argument is a math function with ONE parameter
394 dnl GLIBCPP_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
395 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
398 AC_MSG_CHECKING([for $1 declaration])
399 AC_TRY_COMPILE([#include <math.h>],
401 [use_$1=yes], [use_$1=no])
402 AC_MSG_RESULT($use_$1)
404 if test x$use_$1 = x"yes"; then
405 AC_MSG_CHECKING([for $1 linkage])
406 AC_TRY_LINK([#include <math.h>],
408 [link_$1=yes], [link_$1=no])
409 AC_MSG_RESULT($link_$1)
410 if test x$link_$1 = x"yes"; then
411 ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
412 AC_DEFINE_UNQUOTED(${ac_tr_func})
419 dnl Check to see what builtin math functions are supported
421 dnl check for __builtin_abs
422 dnl check for __builtin_fabsf
423 dnl check for __builtin_fabs
424 dnl check for __builtin_fabl
425 dnl check for __builtin_labs
426 dnl check for __builtin_sqrtf
427 dnl check for __builtin_sqrtl
428 dnl check for __builtin_fsqrt
429 dnl check for __builtin_sinf
430 dnl check for __builtin_sin
431 dnl check for __builtin_sinl
432 dnl check for __builtin_cosf
433 dnl check for __builtin_cos
434 dnl check for __builtin_cosl
436 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
437 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
438 dnl Test for builtin math functions.
439 dnl These are made in gcc/c-common.c
440 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
441 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
442 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
443 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
444 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
446 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
447 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fsqrt)
448 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
450 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
451 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
452 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
454 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
455 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
456 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
458 dnl There is, without a doubt, a more elegant way to have these
459 dnl names exported so that they won't be stripped out of acconfig.h by
460 dnl autoheader. I leave this as an exercise to somebody less frustrated
461 dnl than I.... please email the libstdc++ list if you can figure out a
462 dnl more elegant approach (see autoconf/acgen.m4 and specifically
463 dnl AC_CHECK_FUNC for things to steal.)
465 if test x$dummyvar = x"yes"; then
466 AC_DEFINE(HAVE___BUILTIN_ABS)
467 AC_DEFINE(HAVE___BUILTIN_LABS)
468 AC_DEFINE(HAVE___BUILTIN_COS)
469 AC_DEFINE(HAVE___BUILTIN_COSF)
470 AC_DEFINE(HAVE___BUILTIN_COSL)
471 AC_DEFINE(HAVE___BUILTIN_FABS)
472 AC_DEFINE(HAVE___BUILTIN_FABSF)
473 AC_DEFINE(HAVE___BUILTIN_FABSL)
474 AC_DEFINE(HAVE___BUILTIN_SIN)
475 AC_DEFINE(HAVE___BUILTIN_SINF)
476 AC_DEFINE(HAVE___BUILTIN_SINL)
477 AC_DEFINE(HAVE___BUILTIN_FSQRT)
478 AC_DEFINE(HAVE___BUILTIN_SQRTF)
479 AC_DEFINE(HAVE___BUILTIN_SQRTL)
485 dnl Check to see what the underlying c library or math library is like.
486 dnl These checks need to do two things:
487 dnl 1) make sure the name is declared when using the c++ compiler
488 dnl 2) make sure the name has "C" linkage
489 dnl This might seem like overkill but experience has shown that it's not...
491 dnl Define HAVE_CARGF etc if "cargf" is found.
493 dnl GLIBCPP_CHECK_MATH_SUPPORT
494 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
495 ac_test_CXXFLAGS="${CXXFLAGS+set}"
496 ac_save_CXXFLAGS="$CXXFLAGS"
497 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
500 AC_CHECK_LIB(m, sin, libm="-lm")
504 dnl Although not math functions, needed and for some reason checked here.
505 AC_CHECK_FUNCS(strtof strtold)
507 dnl Check to see if certain C math functions exist.
508 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
509 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
510 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
511 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
512 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
513 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
514 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
516 dnl Check to see if basic C math functions have float versions.
517 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
518 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
519 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(acosf)
520 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(asinf)
521 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(atanf)
522 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
523 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(ceilf)
524 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(cosf)
525 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(coshf)
526 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expf)
527 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
528 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(floorf)
529 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
530 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
531 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
532 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
533 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
534 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
535 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
536 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sinf)
537 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sinhf)
538 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
539 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(tanf)
540 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(tanhf)
541 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
542 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
544 dnl Check to see if basic C math functions have long double versions.
545 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
546 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
547 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
548 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(acosl)
549 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(asinl)
550 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(atanl)
551 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
552 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(ceill)
553 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(cosl)
554 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(coshl)
555 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
556 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
557 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(floorl)
558 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
559 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
560 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
561 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
562 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
563 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
564 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
565 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sinl)
566 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sinhl)
567 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
568 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(tanl)
569 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(tanhl)
570 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
571 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
573 dnl Some runtimes have these functions with a preceding underscore. Please
574 dnl keep this sync'd with the one above. And if you add any new symbol,
575 dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
576 dnl Check to see if certain C math functions exist.
577 dnl Check to see if certain C math functions exist.
578 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinf)
579 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnan)
580 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_finite)
581 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_copysign)
582 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(_sincos)
583 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_fpclass)
584 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_qfpclass)
586 dnl Check to see if basic C math functions have float versions.
587 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnanf)
588 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinff)
589 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_acosf)
590 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_asinf)
591 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_atanf)
592 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_atan2f)
593 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_ceilf)
594 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_cosf)
595 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_coshf)
596 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_expf)
597 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_fabsf)
598 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_floorf)
599 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_fmodf)
600 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_frexpf)
601 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_ldexpf)
602 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_logf)
603 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_log10f)
604 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_modff)
605 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_powf)
606 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_sinf)
607 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_sinhf)
608 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_sqrtf)
609 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_tanf)
610 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_tanhf)
611 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(_sincosf)
612 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_finitef)
614 dnl Check to see if basic C math functions have long double versions.
615 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnanl)
616 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinfl)
617 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_copysignl)
618 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_acosl)
619 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_asinl)
620 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_atanl)
621 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_atan2l)
622 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_ceill)
623 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_cosl)
624 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_coshl)
625 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_expl)
626 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_fabsl)
627 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_floorl)
628 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_fmodl)
629 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_frexpl)
630 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_ldexpl)
631 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_logl)
632 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_log10l)
633 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_modfl)
634 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(_powl)
635 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_sinl)
636 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_sinhl)
637 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_sqrtl)
638 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_tanl)
639 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_tanhl)
640 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(_sincosl)
641 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_finitel)
644 CXXFLAGS="$ac_save_CXXFLAGS"
649 dnl Check to see if there is native support for complex
651 dnl Don't compile bits in math/* if native support exits.
653 dnl Define USE_COMPLEX_LONG_DOUBLE etc if "cargf" is found.
655 dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
656 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
657 dnl Check for complex versions of math functions of platform.
658 AC_CHECK_HEADERS([complex.h])
659 AC_REPLACE_MATHFUNCS(ccos ccosf ccosh ccoshf cexp cexpf c_log c_logf \
660 clog10 clog10f cpow cpowf csin csinf csinh csinhf csqrt csqrtf \
661 ctan ctanf ctanh ctanhf carg cargf nan hypot hypotf atan2f expf copysignf)
663 dnl Compile the long double complex functions only if the function
664 dnl provides the non-complex long double functions that are needed.
665 dnl Currently this includes copysignl and atan2l, which should be
666 dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
667 USE_COMPLEX_LONG_DOUBLE=no
668 if test x$ac_cv_func_atan2l = x"yes" \
669 && test x$ac_cv_func_copysignl = x"yes"; then
670 USE_COMPLEX_LONG_DOUBLE=yes
671 AC_REPLACE_MATHFUNCS(ccoshl ccosl cexpl cpowl csinhl csinl \
672 csqrtl ctanhl ctanl cargl hypotl signbitl c_logl clog10l)
675 AC_SUBST(USE_COMPLEX_LONG_DOUBLE)
679 dnl Check to see what architecture we are compiling for. If it's
680 dnl supported, use special hand-crafted routines to provide thread
681 dnl primitives. Also, if architecture-specific flags are required for
682 dnl compilation, add them here.
684 dnl Depending on what is found, select configure/cpu/*/bits/atomicity.h
685 dnl If not found, select configure/cpu/generic/bits/atomicity.h
687 dnl GLIBCPP_CHECK_CPU
688 AC_DEFUN(GLIBCPP_CHECK_CPU, [
689 AC_MSG_CHECKING([for cpu primitives directory])
691 case "$target_cpu" in
693 cpu_include_dir="config/cpu/alpha"
696 cpu_include_dir="config/cpu/arm"
699 cpu_include_dir="config/cpu/i386"
701 i486 | i586 | i686 | i786)
702 cpu_include_dir="config/cpu/i486"
705 cpu_include_dir="config/cpu/powerpc"
706 CPU_FLAGS='-mcpu=powerpc'
708 sparc64 | ultrasparc)
709 cpu_include_dir="config/cpu/sparc/sparc64"
712 cpu_include_dir="config/cpu/sparc/sparc32"
715 cpu_include_dir="config/cpu/generic"
718 AC_MSG_RESULT($cpu_include_dir)
719 AC_SUBST(cpu_include_dir)
725 dnl Check to see what the underlying c library's interface to ctype looks
726 dnl like. Bits of locale rely on things like isspace, toupper, etc. This
727 dnl stuff makes sure the right bits from the clibrary get called.
729 dnl Depending on what is found, select various configure/*/bits/ctype_base.h
730 dnl Depending on what is found, select various configure/*/ctype.cc
732 dnl GLIBCPP_CHECK_CTYPE
733 AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
734 AC_CHECK_HEADER(ctype.h, [
736 dnl If doesn't match any specified, go with defaults.
739 dnl Test for <ctype> functionality -- gnu-linux
740 AC_MSG_CHECKING([<ctype> for gnu-linux ])
741 AC_TRY_COMPILE([#include <ctype.h>],
744 { return _ISspace + _ISprint + _IScntrl + _ISupper + _ISlower + _ISalpha \
745 + _ISdigit + _ISpunct + _ISxdigit + _ISalnum + _ISgraph \
746 + __ctype_tolower[a] + __ctype_toupper[a] + __ctype_b[a];}], \
747 ctype_linux=yes, ctype_linux=no)
748 AC_MSG_RESULT($ctype_linux)
749 if test $ctype_linux = "yes"; then
750 ctype_include_dir="config/gnu-linux"
754 dnl Test for <ctype> functionality -- FreeBSD 4.0
755 if test $ctype_default = "yes"; then
756 AC_MSG_CHECKING([<ctype> for freebsd 4.0 ])
757 AC_TRY_COMPILE([#include <ctype.h>],
760 { return _CTYPE_S + _CTYPE_R + _CTYPE_C + _CTYPE_U + _CTYPE_L + _CTYPE_A \
761 + _CTYPE_D + _CTYPE_P + _CTYPE_X + _CTYPE_G ;}], \
762 ctype_bsd=yes, ctype_bsd=no)
763 AC_MSG_RESULT($ctype_bsd)
764 if test $ctype_bsd = "yes"; then
765 ctype_include_dir="config/bsd"
770 dnl Test for <ctype> functionality -- FreeBSD 3.4
771 if test $ctype_default = "yes"; then
772 AC_MSG_CHECKING([<ctype> for freebsd 3.4 ])
773 AC_TRY_COMPILE([#include <ctype.h>],
776 { return _S + _R + _C + _U + _L + _A \
777 + _D + _P + _X + _G + __istype (a, 0);}], \
778 ctype_freebsd34=yes, ctype_freebsd34=no)
779 AC_MSG_RESULT($ctype_freebsd34)
780 if test $ctype_freebsd34 = "yes"; then
781 ctype_include_dir="config/bsd"
786 dnl Test for <ctype> functionality -- solaris 2.6 and 2.7
787 if test $ctype_default = "yes"; then
788 AC_MSG_CHECKING([<ctype> for solaris 2.[6,7,8] ])
789 AC_TRY_COMPILE([#include <ctype.h>],
792 { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
793 + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
794 + __trans_lower[a] + __trans_upper[a] + __ctype_mask[a];}], \
795 ctype_solaris=yes, ctype_solaris=no)
796 AC_MSG_RESULT($ctype_solaris)
798 if test $ctype_solaris = "yes"; then
799 AC_MSG_CHECKING([ for version])
801 AC_TRY_COMPILE([#include <ctype.h>],
802 [typedef long* __to_type; __to_type const& _M_toupper = __trans_upper;],\
803 ctype_solaris26=yes, ctype_solaris26=no)
805 if test $ctype_solaris26 = "yes"; then
806 ctype_include_dir="config/solaris/solaris2.6"
807 AC_MSG_RESULT("solaris2.6")
810 ctype_include_dir="config/solaris/solaris2.7"
811 AC_MSG_RESULT("solaris2.[7,8]")
817 dnl Test for <ctype> functionality -- solaris 2.5.1
818 if test $ctype_default = "yes"; then
819 AC_MSG_CHECKING([<ctype> for solaris 2.5.1 ])
820 AC_TRY_COMPILE([#include <ctype.h>],
823 { return _U + _L + _N + _S + _P + _C + _X + _B \
825 ctype_solaris25=yes, ctype_solaris25=no)
826 AC_MSG_RESULT($ctype_solaris25)
827 if test $ctype_solaris25 = "yes"; then
828 ctype_include_dir="config/solaris/solaris2.5"
833 dnl Test for <ctype> functionality -- aix
834 if test $ctype_default = "yes"; then
835 AC_MSG_CHECKING([<ctype> for aix ])
836 AC_TRY_COMPILE([#include <ctype.h>],
839 { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
840 + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
841 + _VALC('a') + _IS('c', 0);}], \
842 ctype_aix=yes, ctype_aix=no)
843 AC_MSG_RESULT($ctype_aix)
844 if test $ctype_aix = "yes"; then
845 ctype_include_dir="config/aix"
850 dnl Test for <ctype> functionality -- newlib
851 if test $ctype_default = "yes"; then
852 AC_MSG_CHECKING([<ctype> for newlib ])
853 AC_TRY_COMPILE([#include <ctype.h>],
856 { return _U + _L + _N + _S + _P + _C + _X + _B \
858 ctype_newlib=yes, ctype_newlib=no)
859 AC_MSG_RESULT($ctype_newlib)
860 if test $ctype_newlib = "yes"; then
861 ctype_include_dir="config/newlib"
866 if test $ctype_default = "yes"; then
867 ctype_include_dir="config/generic"
868 AC_MSG_WARN("Using default ctype headers.")
870 AC_SUBST(ctype_include_dir)
876 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
878 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
879 dnl Define _GLIBCPP_NEED_MBSTATE_T if mbstate_t is not in wchar.h
881 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
882 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
884 dnl Sanity check for existence of ISO C9X headers for extended encoding.
885 AC_CHECK_HEADER(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
886 AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
888 dnl Only continue checking if the ISO C9X headers exist.
889 if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes; then
891 dnl Test wchar.h for mbstate_t, which is needed for char_traits and others.
892 AC_MSG_CHECKING([for mbstate_t])
893 AC_TRY_COMPILE([#include <wchar.h>],
894 [mbstate_t teststate;],
895 use_native_mbstatet=yes, use_native_mbstatet=no)
896 AC_MSG_RESULT($use_native_mbstatet)
897 if test x"$use_native_mbstatet" = xno; then
898 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
901 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
902 dnl numeric_limits can instantiate type_traits<wchar_t>
903 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
904 AC_TRY_COMPILE([#include <wchar.h>],
905 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
906 has_wchar_minmax=yes, has_wchar_minmax=no)
907 AC_MSG_RESULT($has_wchar_minmax)
909 dnl Test wchar.h for WEOF, which is what we use to determine whether
910 dnl to specialize for char_traits<wchar_t> or not.
911 AC_MSG_CHECKING([for WEOF])
914 #include <stddef.h>],
916 has_weof=yes, has_weof=no)
917 AC_MSG_RESULT($has_weof)
919 dnl Tests for wide character functions used in char_traits<wchar_t>.
920 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset, ac_wfuncs=yes, ac_wfuncs=no)
922 AC_MSG_CHECKING([for ISO C9X wchar_t support])
923 if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes && test x"$ac_wfuncs" = xyes; then
924 ac_isoC9X_wchar_t=yes
928 AC_MSG_RESULT($ac_isoC9X_wchar_t)
930 dnl Use iconv for wchar_t to char conversions. As such, check for
931 dnl X/Open Portability Guide, version 2 features (XPG2).
932 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
933 AC_CHECK_FUNCS(iconv_open iconv_close iconv, ac_XPG2funcs=yes, ac_XPG2funcs=no)
935 AC_MSG_CHECKING([for XPG2 wchar_t support])
936 if test x"$ac_has_iconv_h" = xyes && test x"$ac_XPG2funcs" = xyes; then
941 AC_MSG_RESULT($ac_XPG2_wchar_t)
943 dnl At the moment, only enable wchar_t specializations if all the
944 dnl above support is present.
945 dnl 2000-07-07-bkoz-hack-xxx
946 # ac_isoC9X_wchar_t=no
947 dnl 2000-07-07-bkoz-hack-xxx
949 AC_MSG_CHECKING([for enabled wchar_t specializations])
950 if test x"$ac_isoC9X_wchar_t" = xyes && test x"$ac_XPG2_wchar_t" = xyes; then
951 libinst_wstring_la="libinst-wstring.la"
952 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
955 libinst_wstring_la=""
958 AC_SUBST(libinst_wstring_la)
961 AC_MSG_WARN([<wchar.h> not found])
962 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
968 dnl Check to see if this version of GNU C++ is afflicted by bugs in
969 dnl __complex__ float support.
971 dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy.
973 dnl Check to see if this version of GNU C++ is afflicted by bugs in
974 dnl __complex__ support.Check for buggy __complex__ that will cause ICE in
975 dnl gcc-2.95.x when using the library, unless we define the default copy
976 dnl ctor in the specializations of complex<>.
978 dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy.
979 dnl GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
980 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT, [
981 AC_REQUIRE([AC_PROG_CXX])
983 AC_MSG_CHECKING([for GNU C++ __complex__ support])
984 AC_CACHE_VAL(glibcpp_cv_complex, [
987 AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
988 dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
989 [ dcomplex x; f(x); ],
990 glibcpp_cv_complex=ok,
991 glibcpp_cv_complex=buggy
995 AC_MSG_RESULT($glibcpp_cv_complex)
996 if test $glibcpp_cv_complex = buggy; then
997 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
1000 AC_MSG_CHECKING([for GNU C++ __complex__ float support])
1001 AC_CACHE_VAL(glibcpp_cv_float_complex, [
1005 cat > conftest.h <<EOB
1007 // Check for buggy __complex__ that causes ICE in most versions of egcs
1008 // and gcc-2.95.x on certain platforms (eg., x86-win32).
1010 // See http://egcs.cygnus.com/ml/gcc-bugs/1999-07/msg00845.html for
1011 // more info on the bug itself.
1016 __complex__ float m_value;
1017 float_complex (float = 0.0f, float = 0.0f);
1018 float_complex (__complex__ float val) : m_value (val) {}
1019 float_complex foo (const float_complex &val)
1020 { return float_complex (~val.m_value); }
1023 AC_TRY_COMPILE([#include "conftest.h"], ,
1024 glibcpp_cv_float_complex=ok,
1025 glibcpp_cv_float_complex=buggy
1029 AC_MSG_RESULT($glibcpp_cv_float_complex)
1030 if test $glibcpp_cv_float_complex = buggy; then
1031 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
1037 dnl Check for special debugging mode; not for production use.
1039 dnl GLIBCPP_ENABLE_DEBUG
1040 dnl --enable-debug sets '-ggdb -O0'.
1041 dnl --disable-debug sets '-g' and whatever optimization options the
1042 dnl compiler can handle.
1043 dnl + Perhaps --enable-maintainer-mode should automatically turn this on?
1044 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
1045 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
1046 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1047 dnl defaults to `no'.
1048 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
1049 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
1050 AC_ARG_ENABLE(debug,
1051 changequote(<<, >>)dnl
1052 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
1053 changequote([, ])dnl
1054 [case "$enableval" in
1055 yes) enable_debug=yes ;;
1056 no) enable_debug=no ;;
1057 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
1059 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
1060 dnl Option parsed, now set things appropriately
1061 case "$enable_debug" in
1063 DEBUG_FLAGS='-O0 -ggdb'
1069 AC_SUBST(DEBUG_FLAGS)
1074 dnl Check for "unusual" flags to pass to the compiler while building.
1076 dnl GLIBCPP_ENABLE_CXX_FLAGS
1077 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
1078 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
1079 dnl Somehow this same set of flags must be passed when [re]building
1081 dnl --disable-cxx-flags passes nothing.
1082 dnl + See http://sourceware.cygnus.com/ml/libstdc++/2000-q2/msg00131.html
1083 dnl http://sourceware.cygnus.com/ml/libstdc++/2000-q2/msg00284.html
1084 dnl http://sourceware.cygnus.com/ml/libstdc++/2000-q1/msg00035.html
1085 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
1086 dnl If "default flags" is an empty string (or "none"), the effect is
1087 dnl the same as --disable or --enable=no.
1088 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
1089 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
1090 AC_ARG_ENABLE(cxx-flags,
1091 changequote(<<, >>)dnl
1092 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
1093 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
1094 changequote([, ])dnl
1095 [case "x$enableval" in
1096 xyes) AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
1097 xno|x) enable_cxx_flags='' ;;
1098 *) enable_cxx_flags="$enableval" ;;
1100 enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')dnl
1101 dnl Thinko on my part during design. This kludge is the workaround.
1102 if test "$enable_cxx_flags" = "none"; then enable_cxx_flags=''; fi
1103 dnl Run through flags (either default or command-line) and set anything
1104 dnl extra (e.g., #defines) that must accompany particular g++ options.
1105 if test -n "$enable_cxx_flags"; then
1106 for f in $enable_cxx_flags; do
1110 *) # and we're trying to pass /what/ exactly?
1111 AC_MSG_ERROR([compiler flags start with a -]) ;;
1115 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1116 AC_SUBST(EXTRA_CXX_FLAGS)
1121 dnl Check for instructions to automatically rebuild libgcc.a. Requires,
1122 dnl of course, the location of the gcc objdir. Note that if --disable-
1123 dnl namespaces is in effect, rebuilding libgcc.a is an expensive no-op.
1125 dnl GLIBCPP_ENABLE_RELIBGCC
1126 dnl --enable-libgcc-rebuild=/absolute/path/to/gcc/objdir sets GCC_OBJDIR
1127 dnl (presumably in the top-level Makefile) to /absol.../objdir
1128 dnl --disable-libgcc-rebuild will not touch libgcc.a at all (maybe print
1129 dnl a warning if this is given along with --enable-namespaces), by
1130 dnl setting GCC_OBJDIR to `no'.
1131 dnl + Doing this by default is going to be interesting. What default
1132 dnl "on" value can there be?
1133 dnl + Usage: GLIBCPP_ENABLE_RELIBGCC[(DEFAULT)]
1134 dnl The default path should be ../.. if bundled with GCC source.
1135 dnl If ommitted, it defaults to `no'.
1137 AC_DEFUN(GLIBCPP_ENABLE_RELIBGCC, [dnl
1138 define([GLIBCPP_ENABLE_RELIBGCC_DEFAULT], ifelse($1,, no, $1))dnl
1139 AC_ARG_ENABLE(libgcc-rebuild,
1140 changequote(<<, >>)dnl
1141 << --enable-libgcc-rebuild=DIR also rebuild libgcc.a; DIR is
1142 the GCC objdir; see install.html>>,
1143 changequote([, ])dnl
1144 [case "$enableval" in
1145 yes) AC_MSG_ERROR([--enable-libgcc-rebuild needs a pathname]) ;;
1146 no) enable_libgcc_rebuild=no ;;
1147 *) if test -d "$enableval" && test -d "${enableval}/gcc" && \
1148 test -d "${enableval}/libiberty"
1150 enable_libgcc_rebuild="$enableval"
1152 AC_MSG_ERROR(["$enableval" does not appear to be the GCC objdir])
1156 enable_libgcc_rebuild=GLIBCPP_ENABLE_RELIBGCC_DEFAULT)dnl
1157 GCC_OBJDIR="$enable_libgcc_rebuild"
1158 AC_SUBST(GCC_OBJDIR)
1163 dnl Check for which I/O library to use: libio, or something specific.
1165 dnl GLIBCPP_ENABLE_CSTDIO
1166 dnl --enable-cstdio=libio sets config/c_io_libio.h and friends
1168 dnl default is libio
1170 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
1171 AC_MSG_CHECKING([for cstdio to use])
1172 AC_ARG_ENABLE(cstdio,
1173 [ --enable-cstdio enable GNU libio for target io package. (default)
1174 --enable-cstdio=LIB use LIB target-speific io package.],
1175 if test x$enable_cstdio = xno; then
1178 enable_cstdio=libio)
1180 enable_cstdio_flag=$enable_cstdio
1182 dnl Check if a valid thread package
1183 case x${enable_cstdio_flag} in
1184 xlibio | x | xno | xnone | xyes)
1186 CSTDIO_H=config/c_io_libio.h
1187 CSTDIO_CC=config/c_io_libio.cc
1188 AC_MSG_RESULT(libio)
1190 # see if we are on a system with libio native (ie, linux)
1191 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
1193 # Need to check and see what version of glibc is being used. If
1194 # it's not glibc-2.2 or higher, then we'll need to go ahead and
1195 # compile most of libio for linux systems.
1196 if test x$has_libio = x"yes"; then
1199 AC_MSG_CHECKING([for glibc version >= 2.2])
1200 AC_EGREP_CPP([ok], [
1201 #include <features.h>
1202 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1205 ], glibc_satisfactory=yes, glibc_satisfactory=no)
1206 AC_MSG_RESULT($glibc_satisfactory)
1210 if test x$glibc_satisfactory = x"yes"; then
1217 # bkoz XXX need to add checks to enable this
1221 # Using libio, but <libio.h> doesn't exist on the target system. . .
1225 # bkoz XXX need to add checks to enable this
1231 CSTDIO_H=config/c_io_wince.h
1232 CSTDIO_CC=config/c_io_wince.cc
1233 AC_MSG_RESULT(wince)
1238 echo "$enable_cstdio is an unknown io package" 1>&2
1242 AC_LINK_FILES($CSTDIO_H, bits/c++io.h)
1243 AC_LINK_FILES($CSTDIO_CC, src/c++io.cc)
1244 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
1245 AM_CONDITIONAL(GLIBCPP_NEED_XTRA_LIBIO, test "$need_xtra_libio" = yes)
1246 AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
1251 dnl Check for which threading library to use.
1253 dnl GLIBCPP_ENABLE_THREADS
1254 dnl --enable-threads=posix sets config/threads-posix.h et. al.
1256 dnl default is no threads
1258 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
1259 dnl Note this comes from the gcc/config.in and libjava/config.in
1260 dnl Efforts should be made to keep this in sync.
1261 AC_MSG_CHECKING([for threads package to use])
1262 AC_ARG_ENABLE(threads,
1263 [ --enable-threads enable thread usage for target GCC.
1264 --enable-threads=LIB use LIB thread package for target GCC.],
1265 if test x$enable_threads = xno; then
1270 enable_threads_flag=$enable_threads
1272 dnl Check if a valid thread package
1273 case x${enable_threads_flag} in
1276 target_thread_file='single'
1280 target_thread_file=''
1282 xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
1283 xsolaris | xwin32 | xdce | xvxworks)
1284 target_thread_file=$enable_threads_flag
1287 echo "$enable_threads is an unknown thread package" 1>&2
1292 dnl Check for thread package actually supported in libstdc++
1293 case "$target_thread_file" in
1304 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
1305 AC_MSG_ERROR(thread package $THREADS not yet supported)
1308 AC_MSG_ERROR($THREADS is an unknown thread package)
1311 AC_MSG_RESULT($THREADS)
1321 AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
1322 THREADLIBS=-lpthread
1323 THREADSPEC=-lpthread
1324 dnl Not presently used
1325 dnl THREADOBJS=threads-posix.lo
1326 THREADH=threads-posix.h
1329 dnl Not presently used
1330 dnl THREADOBJS=threads-no.lo
1331 THREADH=threads-no.h
1334 AC_SUBST(THREADLIBS)
1335 AC_SUBST(THREADINCS)
1336 AC_SUBST(THREADDEPS)
1337 AC_SUBST(THREADOBJS)
1338 AC_SUBST(THREADSPEC)
1339 AC_LINK_FILES(config/$THREADH, bits/c++threads.h)
1344 dnl Check for template specializations for the 'long long' type extension.
1346 dnl GLIBCPP_ENABLE_LONG_LONG
1347 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
1348 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
1349 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
1350 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1351 dnl defaults to `no'.
1352 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1354 dnl GLIBCPP_ENABLE_LONG_LONG
1355 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
1356 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
1358 AC_ARG_ENABLE(long-long,
1359 changequote(<<, >>)dnl
1360 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
1361 changequote([, ])dnl
1362 [case "$enableval" in
1363 yes) enable_long_long=yes ;;
1364 no) enable_long_long=no ;;
1365 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1367 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1369 # Check for the existance of functions used if long long is enabled.
1370 AC_CHECK_FUNC(strtoll,,ac_strtoll=no)
1371 AC_CHECK_FUNC(strtoull,,ac_strtoull=no)
1373 AC_MSG_CHECKING([for enabled long long])
1374 if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then
1375 enable_long_long=no;
1377 AC_MSG_RESULT($enable_long_long)
1379 dnl Option parsed, now set things appropriately
1380 case "$enable_long_long" in
1381 yes) AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1388 dnl Check for whether or not to do shadowed C headers.
1390 dnl GLIBCPP_ENABLE_SHADOW
1391 dnl --enable-cshadow-headers [does stuff].
1392 dnl --disable-cshadow-headers [does not do stuff].
1393 dnl + This will eventually need to be on by default.
1394 dnl + Usage: GLIBCPP_ENABLE_SHADOW[(DEFAULT)]
1395 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1396 dnl defaults to `no'.
1397 AC_DEFUN(GLIBCPP_ENABLE_SHADOW, [dnl
1398 define([GLIBCPP_ENABLE_SHADOW_DEFAULT], ifelse($1, yes, yes, no))dnl
1399 AC_MSG_CHECKING([for enabled cshadow headers])
1400 AC_ARG_ENABLE(cshadow-headers,
1401 changequote(<<, >>)dnl
1402 << --enable-cshadow-headers construct "shadowed" C header files for
1403 g++ [default=>>GLIBCPP_ENABLE_SHADOW_DEFAULT],
1404 changequote([, ])dnl
1405 [case "$enableval" in
1406 yes) enable_cshadow_headers=yes
1408 no) enable_cshadow_headers=no
1410 *) AC_MSG_ERROR([Unknown argument to enable/disable shadowed C headers])
1413 enable_cshadow_headers=GLIBCPP_ENABLE_SHADOW_DEFAULT)dnl
1414 AC_MSG_RESULT($enable_cshadow_headers)
1415 dnl Option parsed, now set things appropriately
1416 dnl CSHADOWFLAGS is currently unused, but may be useful in the future.
1417 case "$enable_cshadow_headers" in
1426 AC_SUBST(CSHADOWFLAGS)
1427 AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes)
1431 # Check whether LC_MESSAGES is available in <locale.h>.
1432 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1434 # This file file be copied and used freely without restrictions. It can
1435 # be used in projects which are not available under the GNU Public License
1436 # but which still want to provide support for the GNU gettext functionality.
1437 # Please note that the actual code is *not* freely available.
1441 AC_DEFUN(AC_LC_MESSAGES,
1442 [if test $ac_cv_header_locale_h = yes; then
1443 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1444 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1445 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1446 if test $ac_cv_val_LC_MESSAGES = yes; then
1447 AC_DEFINE(HAVE_LC_MESSAGES)
1452 # Check for functions in math library.
1453 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1455 # This file can be copied and used freely without restrictions. It can
1456 # be used in projects which are not available under the GNU Public License
1457 # but which still want to provide support for the GNU gettext functionality.
1458 # Please note that the actual code is *not* freely available.
1462 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1463 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1464 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])
1465 AC_SUBST(LIBMATHOBJS)dnl
1469 # Check for string functions.
1470 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1472 # This file can be copied and used freely without restrictions. It can
1473 # be used in projects which are not available under the GNU Public License
1474 # but which still want to provide support for the GNU gettext functionality.
1475 # Please note that the actual code is *not* freely available.
1479 dnl AC_REPLACE_STRINGFUNCS(FUNCTION...)
1480 AC_DEFUN(AC_REPLACE_STRINGFUNCS,
1481 [AC_CHECK_FUNCS([$1], , [LIBSTRINGOBJS="$LIBSTRINGOBJS ${ac_func}.lo"])
1482 AC_SUBST(LIBSTRINGOBJS)dnl
1486 dnl This macro searches for a GNU version of make. If a match is found, the
1487 dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
1488 dnl set to "#". This is useful for including a special features in a Makefile,
1489 dnl which cannot be handled by other versions of make. The variable
1490 dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
1491 dnl the empty string otherwise.
1493 dnl Here is an example of its use:
1495 dnl Makefile.in might contain:
1497 dnl # A failsafe way of putting a dependency rule into a makefile
1499 dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
1501 dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
1502 dnl @ifGNUmake@ include $(DEPEND)
1503 dnl @ifGNUmake@ endif
1505 dnl Then configure.in would normally contain:
1507 dnl CHECK_GNU_MAKE()
1508 dnl AC_OUTPUT(Makefile)
1510 dnl Then perhaps to cause gnu make to override any other make, we could do
1511 dnl something like this (note that GNU make always looks for GNUmakefile first):
1513 dnl if ! test x$_cv_gnu_make_command = x ; then
1514 dnl mv Makefile GNUmakefile
1515 dnl echo .DEFAULT: > Makefile ;
1516 dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
1519 dnl Then, if any (well almost any) other make is called, and GNU make also
1520 dnl exists, then the other make wraps the GNU make.
1522 dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
1523 dnl @version $Id: acinclude.m4,v 1.46 2000/07/24 16:33:55 bkoz Exp $
1525 dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
1526 dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
1527 dnl #### conditional's subshell (" --version" is not a command).
1530 GLIBCPP_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
1531 _cv_gnu_make_command='' ;
1532 dnl Search all the common names for GNU make
1533 for a in "${MAKE:-make}" make gmake gnumake ; do
1534 if ( $a --version 2> /dev/null | grep -q GNU ) ; then
1535 _cv_gnu_make_command=$a ;
1540 dnl If there was a GNU version, then set @ifGNUmake@ to the empty
1541 dnl string, '#' otherwise
1542 if test "x$_cv_gnu_make_command" != "x" ; then
1552 # Do all the work for Automake. This macro actually does too much --
1553 # some checks are only needed if your package does certain things.
1554 # But this isn't really a big deal.
1559 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
1561 AC_DEFUN(AM_INIT_AUTOMAKE,
1562 [AC_REQUIRE([AC_PROG_INSTALL])
1567 dnl test to see if srcdir already configured
1568 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1569 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1572 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1573 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
1574 AC_REQUIRE([AM_SANITY_CHECK])
1575 AC_REQUIRE([AC_ARG_PROGRAM])
1576 dnl FIXME This is truly gross.
1577 missing_dir=`cd $ac_aux_dir && pwd`
1578 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
1579 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
1580 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
1581 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
1582 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
1583 AC_REQUIRE([AC_PROG_MAKE_SET])])
1586 # Check to make sure that the build environment is sane.
1589 AC_DEFUN(AM_SANITY_CHECK,
1590 [AC_MSG_CHECKING([whether build environment is sane])
1593 echo timestamp > conftestfile
1594 # Do `set' in a subshell so we don't clobber the current shell's
1595 # arguments. Must try -L first in case configure is actually a
1596 # symlink; some systems play weird games with the mod time of symlinks
1597 # (eg FreeBSD returns the mod time of the symlink's containing
1600 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1601 if test "[$]*" = "X"; then
1603 set X `ls -t $srcdir/configure conftestfile`
1605 if test "[$]*" != "X $srcdir/configure conftestfile" \
1606 && test "[$]*" != "X conftestfile $srcdir/configure"; then
1608 # If neither matched, then we have a broken ls. This can happen
1609 # if, for instance, CONFIG_SHELL is bash and it inherits a
1610 # broken ls alias from the environment. This has actually
1611 # happened. Such a system could not be considered "sane".
1612 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1613 alias in your environment])
1616 test "[$]2" = conftestfile
1622 AC_MSG_ERROR([newly created file is older than distributed files!
1623 Check your system clock])
1626 AC_MSG_RESULT(yes)])
1628 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1629 dnl The program must properly implement --version.
1630 AC_DEFUN(AM_MISSING_PROG,
1631 [AC_MSG_CHECKING(for working $2)
1632 # Run test in a subshell; some versions of sh will print an error if
1633 # an executable is not found, even if stderr is redirected.
1634 # Redirect stdin to placate older versions of autoconf. Sigh.
1635 if ($2 --version) < /dev/null > /dev/null 2>&1; then
1637 AC_MSG_RESULT(found)
1640 AC_MSG_RESULT(missing)
1644 # Add --enable-maintainer-mode option to configure.
1649 AC_DEFUN(AM_MAINTAINER_MODE,
1650 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1651 dnl maintainer-mode is disabled by default
1652 AC_ARG_ENABLE(maintainer-mode,
1653 [ --enable-maintainer-mode enable make rules and dependencies not useful
1654 (and sometimes confusing) to the casual installer],
1655 USE_MAINTAINER_MODE=$enableval,
1656 USE_MAINTAINER_MODE=no)
1657 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1658 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1659 MAINT=$MAINTAINER_MODE_TRUE
1664 # Define a conditional.
1666 AC_DEFUN(AM_CONDITIONAL,
1678 # serial 40 AC_PROG_LIBTOOL
1679 AC_DEFUN(AC_PROG_LIBTOOL,
1680 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
1682 # Save cache, so that ltconfig can load it
1685 # Actually configure libtool. ac_aux_dir is where install-sh is found.
1686 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
1687 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1688 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
1689 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
1690 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
1691 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
1692 || AC_MSG_ERROR([libtool configure failed])
1694 # Reload cache, that may have been modified by ltconfig
1697 # This can be used to rebuild libtool when needed
1698 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
1700 # Always use our own libtool.
1701 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1702 AC_SUBST(LIBTOOL)dnl
1704 # Redirect the config.log output again, so that the ltconfig log is not
1705 # clobbered by the next message.
1706 exec 5>>./config.log
1709 AC_DEFUN(AC_LIBTOOL_SETUP,
1711 AC_REQUIRE([AC_ENABLE_SHARED])dnl
1712 AC_REQUIRE([AC_ENABLE_STATIC])dnl
1713 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1714 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1715 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1716 AC_REQUIRE([AC_PROG_RANLIB])dnl
1717 AC_REQUIRE([AC_PROG_CC])dnl
1718 AC_REQUIRE([AC_PROG_LD])dnl
1719 AC_REQUIRE([AC_PROG_NM])dnl
1720 AC_REQUIRE([AC_PROG_LN_S])dnl
1723 # Check for any special flags to pass to ltconfig.
1724 libtool_flags="--cache-file=$cache_file"
1725 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
1726 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
1727 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
1728 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
1729 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
1730 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
1731 [libtool_flags="$libtool_flags --enable-dlopen"])
1732 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1733 [libtool_flags="$libtool_flags --enable-win32-dll"])
1734 AC_ARG_ENABLE(libtool-lock,
1735 [ --disable-libtool-lock avoid locking (might break parallel builds)])
1736 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
1737 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
1739 # Some flags need to be propagated to the compiler or linker for good
1743 # Find out which ABI we are using.
1744 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1745 if AC_TRY_EVAL(ac_compile); then
1746 case "`/usr/bin/file conftest.o`" in
1762 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1763 SAVE_CFLAGS="$CFLAGS"
1764 CFLAGS="$CFLAGS -belf"
1765 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1766 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
1767 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1768 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1769 CFLAGS="$SAVE_CFLAGS"
1773 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1774 [*-*-cygwin* | *-*-mingw*)
1775 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1776 AC_CHECK_TOOL(AS, as, false)
1777 AC_CHECK_TOOL(OBJDUMP, objdump, false)
1783 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
1784 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
1786 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
1787 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
1789 # AC_ENABLE_SHARED - implement the --enable-shared flag
1790 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
1791 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1793 AC_DEFUN(AC_ENABLE_SHARED, [dnl
1794 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1795 AC_ARG_ENABLE(shared,
1796 changequote(<<, >>)dnl
1797 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
1798 changequote([, ])dnl
1799 [p=${PACKAGE-default}
1800 case "$enableval" in
1801 yes) enable_shared=yes ;;
1802 no) enable_shared=no ;;
1805 # Look at the argument we got. We use all the common list separators.
1806 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1807 for pkg in $enableval; do
1808 if test "X$pkg" = "X$p"; then
1815 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
1818 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
1819 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1820 AC_ENABLE_SHARED(no)])
1822 # AC_ENABLE_STATIC - implement the --enable-static flag
1823 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
1824 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1826 AC_DEFUN(AC_ENABLE_STATIC, [dnl
1827 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1828 AC_ARG_ENABLE(static,
1829 changequote(<<, >>)dnl
1830 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
1831 changequote([, ])dnl
1832 [p=${PACKAGE-default}
1833 case "$enableval" in
1834 yes) enable_static=yes ;;
1835 no) enable_static=no ;;
1838 # Look at the argument we got. We use all the common list separators.
1839 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1840 for pkg in $enableval; do
1841 if test "X$pkg" = "X$p"; then
1848 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
1851 # AC_DISABLE_STATIC - set the default static flag to --disable-static
1852 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1853 AC_ENABLE_STATIC(no)])
1856 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
1857 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
1858 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1860 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
1861 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
1862 AC_ARG_ENABLE(fast-install,
1863 changequote(<<, >>)dnl
1864 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
1865 changequote([, ])dnl
1866 [p=${PACKAGE-default}
1867 case "$enableval" in
1868 yes) enable_fast_install=yes ;;
1869 no) enable_fast_install=no ;;
1871 enable_fast_install=no
1872 # Look at the argument we got. We use all the common list separators.
1873 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1874 for pkg in $enableval; do
1875 if test "X$pkg" = "X$p"; then
1876 enable_fast_install=yes
1882 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
1885 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
1886 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1887 AC_ENABLE_FAST_INSTALL(no)])
1889 # AC_PROG_LD - find the path to the GNU or non-GNU linker
1890 AC_DEFUN(AC_PROG_LD,
1891 [AC_ARG_WITH(gnu-ld,
1892 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1893 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1894 AC_REQUIRE([AC_PROG_CC])dnl
1895 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1896 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1898 if test "$ac_cv_prog_gcc" = yes; then
1899 # Check if gcc -print-prog-name=ld gives a path.
1900 AC_MSG_CHECKING([for ld used by GCC])
1901 ac_prog=`($CC -print-prog-name=ld) 2>&5`
1903 # Accept absolute paths.
1905 [\\/]* | [A-Za-z]:[\\/]*)
1906 re_direlt='/[^/][^/]*/\.\./'
1908 # Canonicalize the path of ld
1909 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1910 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1911 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1913 test -z "$LD" && LD="$ac_prog"
1916 # If it fails, then pretend we aren't using GCC.
1920 # If it is relative, then search for the first ld in PATH.
1924 elif test "$with_gnu_ld" = yes; then
1925 AC_MSG_CHECKING([for GNU ld])
1927 AC_MSG_CHECKING([for non-GNU ld])
1929 AC_CACHE_VAL(ac_cv_path_LD,
1930 [if test -z "$LD"; then
1931 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1932 for ac_dir in $PATH; do
1933 test -z "$ac_dir" && ac_dir=.
1934 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1935 ac_cv_path_LD="$ac_dir/$ac_prog"
1936 # Check to see if the program is GNU ld. I'd rather use --version,
1937 # but apparently some GNU ld's only accept -v.
1938 # Break only if it was the GNU/non-GNU ld that we prefer.
1939 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1940 test "$with_gnu_ld" != no && break
1942 test "$with_gnu_ld" != yes && break
1948 ac_cv_path_LD="$LD" # Let the user override the test with a path.
1951 if test -n "$LD"; then
1956 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1960 AC_DEFUN(AC_PROG_LD_GNU,
1961 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
1962 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1963 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1964 ac_cv_prog_gnu_ld=yes
1966 ac_cv_prog_gnu_ld=no
1970 # AC_PROG_NM - find the path to a BSD-compatible name lister
1971 AC_DEFUN(AC_PROG_NM,
1972 [AC_MSG_CHECKING([for BSD-compatible nm])
1973 AC_CACHE_VAL(ac_cv_path_NM,
1974 [if test -n "$NM"; then
1975 # Let the user override the test.
1978 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1979 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1980 test -z "$ac_dir" && ac_dir=.
1981 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1982 # Check to see if the nm accepts a BSD-compat flag.
1983 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1984 # nm: unknown option "B" ignored
1985 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1986 ac_cv_path_NM="$ac_dir/nm -B"
1988 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1989 ac_cv_path_NM="$ac_dir/nm -p"
1992 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1993 continue # so that we can try to find one that supports BSD flags
1998 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2001 AC_MSG_RESULT([$NM])
2004 # AC_CHECK_LIBM - check for math library
2005 AC_DEFUN(AC_CHECK_LIBM,
2006 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
2009 *-*-beos* | *-*-cygwin*)
2010 # These system don't have libm
2013 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
2014 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
2017 AC_CHECK_LIB(m, main, LIBM="-lm")
2022 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
2023 # the libltdl convenience library, adds --enable-ltdl-convenience to
2024 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
2025 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
2026 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
2027 # '${top_builddir}/' (note the single quotes!) if your package is not
2028 # flat, and, if you're not using automake, define top_builddir as
2029 # appropriate in the Makefiles.
2030 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2031 case "$enable_ltdl_convenience" in
2032 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
2033 "") enable_ltdl_convenience=yes
2034 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
2036 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
2037 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
2040 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
2041 # the libltdl installable library, and adds --enable-ltdl-install to
2042 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
2043 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
2044 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
2045 # '${top_builddir}/' (note the single quotes!) if your package is not
2046 # flat, and, if you're not using automake, define top_builddir as
2047 # appropriate in the Makefiles.
2048 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
2049 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2050 AC_CHECK_LIB(ltdl, main,
2051 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
2052 [if test x"$enable_ltdl_install" = xno; then
2053 AC_MSG_WARN([libltdl not installed, but installation disabled])
2055 enable_ltdl_install=yes
2058 if test x"$enable_ltdl_install" = x"yes"; then
2059 ac_configure_args="$ac_configure_args --enable-ltdl-install"
2060 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
2061 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
2063 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
2070 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
2071 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
2072 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
2073 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
2074 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
2075 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
2076 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
2078 dnl This is just to silence aclocal about the macro not being used
2079 ifelse([AC_DISABLE_FAST_INSTALL])dnl
2081 # Like AC_CONFIG_HEADER, but automatically create stamp file.
2083 AC_DEFUN(AM_CONFIG_HEADER,
2085 AC_CONFIG_HEADER([$1])
2086 dnl When config.status generates a header, we must update the stamp-h file.
2087 dnl This file resides in the same directory as the config header
2088 dnl that is generated. We must strip everything past the first ":",
2089 dnl and everything past the last "/".
2090 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
2091 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
2092 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
2094 for am_file in <<$1>>; do
2095 case " <<$>>CONFIG_HEADERS " in
2096 *" <<$>>am_file "*<<)>>
2097 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
2100 am_indx=`expr "<<$>>am_indx" + 1`