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. In particular, test for
171 dnl newer compiler features, or features that are present in newer
172 dnl compiler version but not older compiler versions should be placed
175 dnl Define FMTFLAGS='-fdiagnostics-show-location=once' if possible
176 dnl Define WERROR='-Werror' if possible; g++'s that lack the new inlining
177 dnl code or the new system_header pragma will die. Other options dealing
178 dnl with warnings, errors, and compiler complaints may be folded into
179 dnl the WERROR variable.
181 dnl GLIBCPP_CHECK_COMPILER_VERSION
182 AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
183 # All these tests are for C++; save the language and the compiler flags.
184 # The CXXFLAGS thing is suspicious, but based on similar bits
185 # found in GLIBCPP_CONFIGURE.
188 ac_test_CXXFLAGS="${CXXFLAGS+set}"
189 ac_save_CXXFLAGS="$CXXFLAGS"
192 # Sanity check that g++ is capable of dealing with v-3.
193 AC_MSG_CHECKING([for g++ that will successfullly compile this code])
195 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
198 ], gpp_satisfactory=yes, AC_MSG_ERROR("please upgrade to gcc-2.95 or above"))
199 AC_MSG_RESULT($gpp_satisfactory)
201 # Check for pragma system_header.
202 AC_MSG_CHECKING([for g++ that supports pragma system_header])
203 CXXFLAGS='-Wunknown-pragmas -Werror'
204 AC_TRY_COMPILE([#pragma system_header], [int foo;
205 ], [ac_newpragma=yes], [ac_newpragma=no])
206 if test "$ac_test_CXXFLAGS" = set; then
207 CXXFLAGS="$ac_save_CXXFLAGS"
209 # this is the suspicious part
212 if test "$ac_newpragma" = "no"; then
213 WERROR="$WERROR -Wno-unknown-pragmas"
215 AC_MSG_RESULT($ac_newpragma)
217 # Check for more sophisticated diagnostic control.
218 AC_MSG_CHECKING([for g++ that supports -fdiagnostics-show-location=once])
219 CXXFLAGS='-fdiagnostics-show-location=once'
220 AC_TRY_COMPILE(, [int foo;
221 ], [ac_gabydiags=yes], [ac_gabydiags=no])
222 if test "$ac_test_CXXFLAGS" = set; then
223 CXXFLAGS="$ac_save_CXXFLAGS"
225 # this is the suspicious part
228 if test "$ac_gabydiags" = "yes"; then
229 FMTFLAGS='-fdiagnostics-show-location=once'
231 AC_MSG_RESULT($ac_gabydiags)
240 dnl Check to see what builtin math functions are supported
242 dnl Define _GLIBCPP_HAS_BUILTIN_SINF if __builtin_sinf
243 dnl Define _GLIBCPP_HAS_BUILTIN_COSF if __builtin_cosf
244 dnl Define _GLIBCPP_HAS_BUILTIN_FABSF if __builtin_fabsf
245 dnl Define _GLIBCPP_HAS_BUILTIN_SQRTF if __builtin_sqrtf
247 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
248 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
249 dnl Test for builtin math functions.
250 AC_MSG_CHECKING([for __builtin_sinf])
251 AC_TRY_COMPILE([#include <math.h>],
252 [float foo(void) { __builtin_sinf(0.0); }],
253 use_builtin_sinf=yes, use_builtin_sinf=no)
254 AC_MSG_RESULT($use_builtin_sinf)
255 if test $use_builtin_sinf = "yes"; then
256 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_SINF)
259 AC_MSG_CHECKING([for __builtin_cosf])
260 AC_TRY_COMPILE([#include <math.h>],
261 [float foo(void) { __builtin_cosf(0.0); }],
262 use_builtin_cosf=yes, use_builtin_cosf=no)
263 AC_MSG_RESULT($use_builtin_cosf)
264 if test $use_builtin_cosf = "yes"; then
265 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_COSF)
268 AC_MSG_CHECKING([for __builtin_fabsf])
269 AC_TRY_COMPILE([#include <math.h>],
270 [float foo(void) { __builtin_fabsf(0.0); }],
271 use_builtin_fabsf=yes, use_builtin_fabsf=no)
272 AC_MSG_RESULT($use_builtin_fabsf)
273 if test $use_builtin_fabsf = "yes"; then
274 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_FABSF)
277 AC_MSG_CHECKING([for __builtin_sqrtf])
278 AC_TRY_COMPILE([#include <math.h>],
279 [float foo(void) { __builtin_sqrtf(0.0); }],
280 use_builtin_sqrtf=yes, use_builtin_sqrtf=no)
281 AC_MSG_RESULT($use_builtin_sqrtf)
282 if test $use_builtin_sqrtf = "yes"; then
283 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_SQRTF)
288 dnl Check to see what architecture we are compiling for. If it's
289 dnl supported, use special hand-crafted routines to provide thread
290 dnl primitives. Also, if architecture-specific flags are required for
291 dnl compilation, add them here.
293 dnl Depending on what is found, select configure/cpu/*/bits/atomicity.h
294 dnl If not found, select configure/cpu/generic/bits/atomicity.h
296 dnl GLIBCPP_CHECK_CPU
297 AC_DEFUN(GLIBCPP_CHECK_CPU, [
298 AC_MSG_CHECKING([for cpu primitives directory])
300 case "$target_cpu" in
302 cpu_include_dir="config/cpu/alpha"
305 cpu_include_dir="config/cpu/arm"
308 cpu_include_dir="config/cpu/i386"
310 i486 | i586 | i686 | i786)
311 cpu_include_dir="config/cpu/i486"
314 cpu_include_dir="config/cpu/powerpc"
315 CPUFLAGS='-mcpu=powerpc'
317 sparc64 | ultrasparc)
318 cpu_include_dir="config/cpu/sparc/sparc64"
321 cpu_include_dir="config/cpu/sparc/sparc32"
324 cpu_include_dir="config/cpu/generic"
327 AC_MSG_RESULT($cpu_include_dir)
328 AC_SUBST(cpu_include_dir)
334 dnl Check to see what the underlying c library's interface to ctype looks
335 dnl like. Bits of locale rely on things like isspace, toupper, etc. This
336 dnl stuff makes sure the right bits from the clibrary get called.
338 dnl Depending on what is found, select various configure/*/bits/ctype_base.h
339 dnl Depending on what is found, select various configure/*/ctype.cc
341 dnl GLIBCPP_CHECK_CTYPE
342 AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
343 AC_CHECK_HEADER(ctype.h, [
345 dnl If doesn't match any specified, go with defaults.
348 dnl Test for <ctype> functionality -- gnu-linux
349 AC_MSG_CHECKING([<ctype> for gnu-linux ])
350 AC_TRY_COMPILE([#include <ctype.h>],
353 { return _ISspace + _ISprint + _IScntrl + _ISupper + _ISlower + _ISalpha \
354 + _ISdigit + _ISpunct + _ISxdigit + _ISalnum + _ISgraph \
355 + __ctype_tolower[a] + __ctype_toupper[a] + __ctype_b[a];}], \
356 ctype_linux=yes, ctype_linux=no)
357 AC_MSG_RESULT($ctype_linux)
358 if test $ctype_linux = "yes"; then
359 ctype_include_dir="config/gnu-linux"
363 dnl Test for <ctype> functionality -- FreeBSD 4.0
364 if test $ctype_default = "yes"; then
365 AC_MSG_CHECKING([<ctype> for freebsd 4.0 ])
366 AC_TRY_COMPILE([#include <ctype.h>],
369 { return _CTYPE_S + _CTYPE_R + _CTYPE_C + _CTYPE_U + _CTYPE_L + _CTYPE_A \
370 + _CTYPE_D + _CTYPE_P + _CTYPE_X + _CTYPE_G ;}], \
371 ctype_bsd=yes, ctype_bsd=no)
372 AC_MSG_RESULT($ctype_bsd)
373 if test $ctype_bsd = "yes"; then
374 ctype_include_dir="config/bsd"
379 dnl Test for <ctype> functionality -- FreeBSD 3.4
380 if test $ctype_default = "yes"; then
381 AC_MSG_CHECKING([<ctype> for freebsd 3.4 ])
382 AC_TRY_COMPILE([#include <ctype.h>],
385 { return _S + _R + _C + _U + _L + _A \
386 + _D + _P + _X + _G + __istype (a, 0);}], \
387 ctype_freebsd34=yes, ctype_freebsd34=no)
388 AC_MSG_RESULT($ctype_freebsd34)
389 if test $ctype_freebsd34 = "yes"; then
390 ctype_include_dir="config/bsd"
395 dnl Test for <ctype> functionality -- solaris 2.6 and 2.7
396 if test $ctype_default = "yes"; then
397 AC_MSG_CHECKING([<ctype> for solaris 2.[6,7,8] ])
398 AC_TRY_COMPILE([#include <ctype.h>],
401 { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
402 + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
403 + __trans_lower[a] + __trans_upper[a] + __ctype_mask[a];}], \
404 ctype_solaris=yes, ctype_solaris=no)
405 AC_MSG_RESULT($ctype_solaris)
407 if test $ctype_solaris = "yes"; then
408 AC_MSG_CHECKING([ for version])
410 AC_TRY_COMPILE([#include <ctype.h>],
411 [typedef long* __to_type; __to_type const& _M_toupper = __trans_upper;],\
412 ctype_solaris26=yes, ctype_solaris26=no)
414 if test $ctype_solaris26 = "yes"; then
415 ctype_include_dir="config/solaris/solaris2.6"
416 AC_MSG_RESULT("solaris2.6")
419 ctype_include_dir="config/solaris/solaris2.7"
420 AC_MSG_RESULT("solaris2.[7,8]")
426 dnl Test for <ctype> functionality -- solaris 2.5.1
427 if test $ctype_default = "yes"; then
428 AC_MSG_CHECKING([<ctype> for solaris 2.5.1 ])
429 AC_TRY_COMPILE([#include <ctype.h>],
432 { return _U + _L + _N + _S + _P + _C + _X + _B \
434 ctype_solaris25=yes, ctype_solaris25=no)
435 AC_MSG_RESULT($ctype_solaris25)
436 if test $ctype_solaris25 = "yes"; then
437 ctype_include_dir="config/solaris/solaris2.5"
442 dnl Test for <ctype> functionality -- aix
443 if test $ctype_default = "yes"; then
444 AC_MSG_CHECKING([<ctype> for aix ])
445 AC_TRY_COMPILE([#include <ctype.h>],
448 { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
449 + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
450 + _VALC('a') + _IS('c', 0);}], \
451 ctype_aix=yes, ctype_aix=no)
452 AC_MSG_RESULT($ctype_aix)
453 if test $ctype_aix = "yes"; then
454 ctype_include_dir="config/aix"
459 dnl Test for <ctype> functionality -- newlib
460 if test $ctype_default = "yes"; then
461 AC_MSG_CHECKING([<ctype> for newlib ])
462 AC_TRY_COMPILE([#include <ctype.h>],
465 { return _U + _L + _N + _S + _P + _C + _X + _B \
467 ctype_newlib=yes, ctype_newlib=no)
468 AC_MSG_RESULT($ctype_newlib)
469 if test $ctype_newlib = "yes"; then
470 ctype_include_dir="config/newlib"
475 if test $ctype_default = "yes"; then
476 ctype_include_dir="config/generic"
477 AC_MSG_WARN("Using default ctype headers.")
479 AC_SUBST(ctype_include_dir)
485 dnl Check to see what the underlying c library or math library is like.
487 dnl Define HAVE_CARGF etc if "cargf" is found.
489 dnl GLIBCPP_CHECK_MATH_SUPPORT
490 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
491 AC_CHECK_LIB(m, sin, libm="-lm")
495 dnl Check for complex versions of math functions of platform.
496 AC_CHECK_HEADERS([complex.h])
497 AC_REPLACE_MATHFUNCS(ccos ccosf ccosh ccoshf cexp cexpf c_log c_logf \
498 clog10 clog10f cpow cpowf csin csinf csinh csinhf csqrt csqrtf \
499 ctan ctanf ctanh ctanhf \
500 carg cargf nan hypot hypotf atan2f expf copysignf)
502 dnl We compile the long double complex functions only if the function
503 dnl provides the non-complex long double functions.
505 AC_CHECK_FUNC(copysignl,
507 AC_REPLACE_MATHFUNCS(ccoshl ccosl cexpl cpowl csinhl csinl \
508 csqrtl ctanhl ctanl cargl hypotl signbitl c_logl clog10l))
509 AC_SUBST(USE_LONG_DOUBLE)
511 dnl Check to see if basic C math functions have faster float versions.
512 AC_CHECK_FUNCS(modf isnan isnanf isnanl isinf isinff isinfl copysign \
513 copysignl cosf coshf logf log10f powf sinf sinhf sqrtf tanf tanhf \
514 strtof strtold fabsf sincos sincosf sincosl finite finite fqfinite \
517 #Some runtimes have these functions with a preceding underscore. Please
518 # keep this sync'd with the one above. And if you add any new symbol,
519 # please add the corresponding block in the @BOTTOM@ section of
521 AC_CHECK_FUNCS(_modf _isnan _isnanf _isnanl _isinf _isinff _isinfl _copysign \
522 _copysignl _cosf _coshf _logf _log10f _powf _sinf _sinhf _sqrtf _tanf _tanhf \
523 _strtof _strtold _fabsf _sincos _sincosf _sincosl _finite _finitef _qfinite \
531 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
533 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
534 dnl Define _GLIBCPP_NEED_MBSTATE_T if mbstate_t is not in wchar.h
535 dnl Define _GLIBCPP_HAS_WCHAR_MIN_MAX if WCHAR_MIN, WCHAR_MAX in wchar.h
537 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
538 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
539 AC_CHECK_HEADER(wchar.h,[
540 dnl Test wchar.h for mbstate_t, which is needed for char_traits and others.
541 AC_MSG_CHECKING([for native mbstate_t])
542 AC_TRY_COMPILE([#include <wchar.h>],
543 [mbstate_t teststate;],
544 use_native_mbstatet=yes, use_native_mbstatet=no)
545 AC_MSG_RESULT($use_native_mbstatet)
546 if test $use_native_mbstatet = "no"; then
547 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
550 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
551 dnl numeric_limits can instantiate type_traits<wchar_t>
552 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
553 AC_TRY_COMPILE([#include <wchar.h>],
554 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
555 has_wchar_minmax=yes, has_wchar_minmax=no)
556 AC_MSG_RESULT($has_wchar_minmax)
557 if test $has_wchar_minmax = "yes"; then
558 AC_DEFINE(_GLIBCPP_HAS_WCHAR_MIN_MAX)
561 # Test wchar.h for WEOF, which is what we use to determine whether
562 # to specialize for wchar_t or not.
563 AC_MSG_CHECKING([for WEOF])
566 #include <stddef.h>],
568 has_weof=yes, has_weof=no)
569 AC_MSG_RESULT($has_weof)
571 dnl Tests for wide character functions.
572 AC_REPLACE_STRINGFUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset)
573 AC_SUBST(libinst_wstring_la)
575 AC_MSG_CHECKING([for wide character support])
576 if test $has_weof = "yes" && test $has_wchar_minmax = "yes"; then
577 libinst_wstring_la="libinst-wstring.la"
578 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
581 libinst_wstring_la=""
582 AC_MSG_RESULT("not specializing for wchar_t")
585 AC_MSG_WARN([<wchar.h> not found])
586 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
592 dnl Check to see if this version of GNU C++ is afflicted by bugs in
593 dnl __complex__ float support.
595 dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy.
597 dnl GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT
598 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT, [
599 AC_REQUIRE([AC_PROG_CXX])
600 AC_MSG_CHECKING([for GNU C++ __complex__ float support])
601 AC_CACHE_VAL(glibcpp_cv_float_complex, [
605 cat > conftest.h <<EOB
607 // Check for buggy __complex__ that causes ICE in most versions of egcs
608 // and gcc-2.95.x on certain platforms (eg., x86-win32).
610 // See http://egcs.cygnus.com/ml/gcc-bugs/1999-07/msg00845.html for
611 // more info on the bug itself.
616 __complex__ float m_value;
617 float_complex (float = 0.0f, float = 0.0f);
618 float_complex (__complex__ float val) : m_value (val) {}
619 float_complex foo (const float_complex &val)
620 { return float_complex (~val.m_value); }
623 AC_TRY_COMPILE([#include "conftest.h"], ,
624 glibcpp_cv_float_complex=ok,
625 glibcpp_cv_float_complex=buggy
629 AC_MSG_RESULT($glibcpp_cv_float_complex)
630 if test $glibcpp_cv_float_complex = buggy; then
631 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
638 dnl Check to see if this version of GNU C++ is afflicted by bugs in
639 dnl __complex__ support.Check for buggy __complex__ that will cause ICE in
640 dnl gcc-2.95.x when using the library, unless we define the default copy
641 dnl ctor in the specializations of complex<>.
643 dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy.
645 dnl GLIBCPP_CHECK_COMPLEX_SUPPORT
646 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_SUPPORT, [
647 AC_REQUIRE([AC_PROG_CXX])
648 AC_MSG_CHECKING([for GNU C++ __complex__ support])
649 AC_CACHE_VAL(glibcpp_cv_complex, [
652 AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
653 dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
654 [ dcomplex x; f(x); ],
655 glibcpp_cv_complex=ok,
656 glibcpp_cv_complex=buggy
660 AC_MSG_RESULT($glibcpp_cv_complex)
661 if test $glibcpp_cv_complex = buggy; then
662 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
668 dnl Check for special debugging mode; not for production use.
670 dnl GLIBCPP_ENABLE_DEBUG
671 dnl --enable-debug sets '-ggdb -O0'.
672 dnl --disable-debug sets '-g' and whatever optimization options the
673 dnl compiler can handle.
674 dnl + Perhaps --enable-maintainer-mode should automatically turn this on?
675 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
676 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
677 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
678 dnl defaults to `no'.
679 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
680 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
682 changequote(<<, >>)dnl
683 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
685 [case "$enableval" in
686 yes) enable_debug=yes ;;
687 no) enable_debug=no ;;
688 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
690 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
691 dnl Option parsed, now set things appropriately
692 case "$enable_debug" in
694 DEBUGFLAGS='-O0 -ggdb'
705 dnl Check for "unusual" flags to pass to the compiler while building.
707 dnl GLIBCPP_ENABLE_CXX_FLAGS
708 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
709 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
710 dnl Somehow this same set of flags must be passed when [re]building
712 dnl --disable-cxx-flags passes nothing.
713 dnl + See http://sourceware.cygnus.com/ml/libstdc++/2000-q2/msg00131.html
714 dnl http://sourceware.cygnus.com/ml/libstdc++/2000-q2/msg00284.html
715 dnl http://sourceware.cygnus.com/ml/libstdc++/2000-q1/msg00035.html
716 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
717 dnl If "default flags" is an empty string (or "none"), the effect is
718 dnl the same as --disable or --enable=no.
719 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
720 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
721 AC_ARG_ENABLE(cxx-flags,
722 changequote(<<, >>)dnl
723 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
724 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
726 [case "x$enableval" in
727 xyes) AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
728 xno|x) enable_cxx_flags='' ;;
729 *) enable_cxx_flags="$enableval" ;;
731 enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')dnl
732 dnl Thinko on my part during design. This kludge is the workaround.
733 if test "$enable_cxx_flags" = "none"; then enable_cxx_flags=''; fi
734 dnl Run through flags (either default or command-line) and set anything
735 dnl extra (e.g., #defines) that must accompany particular g++ options.
736 if test -n "$enable_cxx_flags"; then
737 for f in $enable_cxx_flags; do
741 *) # and we're trying to pass /what/ exactly?
742 AC_MSG_ERROR([compiler flags start with a -]) ;;
746 EXTRA_CXX_FLAGS="$enable_cxx_flags"
747 AC_SUBST(EXTRA_CXX_FLAGS)
752 dnl Check for instructions to automatically rebuild libgcc.a. Requires,
753 dnl of course, the location of the gcc objdir. Note that if --disable-
754 dnl namespaces is in effect, rebuilding libgcc.a is an expensive no-op.
756 dnl GLIBCPP_ENABLE_RELIBGCC
757 dnl --enable-libgcc-rebuild=/absolute/path/to/gcc/objdir sets GCC_OBJDIR
758 dnl (presumably in the top-level Makefile) to /absol.../objdir
759 dnl --disable-libgcc-rebuild will not touch libgcc.a at all (maybe print
760 dnl a warning if this is given along with --enable-namespaces), by
761 dnl setting GCC_OBJDIR to `no'.
762 dnl + Doing this by default is going to be interesting. What default
763 dnl "on" value can there be?
764 dnl + Usage: GLIBCPP_ENABLE_RELIBGCC[(DEFAULT)]
765 dnl The default path should be ../.. if bundled with GCC source.
766 dnl If ommitted, it defaults to `no'.
768 AC_DEFUN(GLIBCPP_ENABLE_RELIBGCC, [dnl
769 define([GLIBCPP_ENABLE_RELIBGCC_DEFAULT], ifelse($1,, no, $1))dnl
770 AC_ARG_ENABLE(libgcc-rebuild,
771 changequote(<<, >>)dnl
772 << --enable-libgcc-rebuild=DIR also rebuild libgcc.a; DIR is
773 the GCC objdir; see install.html>>,
775 [case "$enableval" in
776 yes) AC_MSG_ERROR([--enable-libgcc-rebuild needs a pathname]) ;;
777 no) enable_libgcc_rebuild=no ;;
778 *) if test -d "$enableval" && test -d "${enableval}/gcc" && \
779 test -d "${enableval}/libiberty"
781 enable_libgcc_rebuild="$enableval"
783 AC_MSG_ERROR(["$enableval" does not appear to be the GCC objdir])
787 enable_libgcc_rebuild=GLIBCPP_ENABLE_RELIBGCC_DEFAULT)dnl
788 GCC_OBJDIR="$enable_libgcc_rebuild"
794 dnl Check for which I/O library to use: libio, or something specific.
796 dnl GLIBCPP_ENABLE_CSTDIO
797 dnl --enable-cstdio=libio sets config/c_io_libio.h and friends
801 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
802 AC_MSG_CHECKING([for cstdio to use])
803 AC_ARG_ENABLE(cstdio,
804 [ --enable-cstdio enable GNU libio for target io package. (default)
805 --enable-cstdio=LIB use LIB target-speific io package.],
806 if test x$enable_cstdio = xno; then
811 enable_cstdio_flag=$enable_cstdio
813 dnl Check if a valid thread package
814 case x${enable_cstdio_flag} in
815 xlibio | x | xno | xnone | xyes)
817 CSTDIO_H=c_io_libio.h
818 CSTDIO_CC=c_io_libio.cc
821 # see if we are on a system with libio native (ie, linux)
822 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
823 if test $has_libio = "yes"; then
827 BUILD_LIBIO_INCLUDE='-I../libio'
830 AC_SUBST(BUILD_LIBIO_INCLUDE)
832 # see if the _G_config.h header needs to be built.
833 # NB: This replaces the _G_CONFIG_H machinery in libio-v2
834 AC_CHECK_HEADER(_G_config.h, has_gconf_h=yes, has_gconf_h=no)
835 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO_CONFIG_H, test "$has_gconf_h" = no)
838 CSTDIO_H=c_io_wince.h
839 CSTDIO_CC=c_io_wince.cc
844 AC_SUBST(BUILD_LIBIO_INCLUDE)
847 echo "$enable_cstdio is an unknown io package" 1>&2
853 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
858 dnl Check for which threading library to use.
860 dnl GLIBCPP_ENABLE_THREADS
861 dnl --enable-threads=posix sets config/threads-posix.h et. al.
863 dnl default is no threads
865 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
866 dnl Note this comes from the gcc/config.in and libjava/config.in
867 dnl Efforts should be made to keep this in sync.
868 AC_MSG_CHECKING([for threads package to use])
869 AC_ARG_ENABLE(threads,
870 [ --enable-threads enable thread usage for target GCC.
871 --enable-threads=LIB use LIB thread package for target GCC.],
872 if test x$enable_threads = xno; then
877 enable_threads_flag=$enable_threads
879 dnl Check if a valid thread package
880 case x${enable_threads_flag} in
883 target_thread_file='single'
887 target_thread_file=''
889 xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
890 xsolaris | xwin32 | xdce | xvxworks)
891 target_thread_file=$enable_threads_flag
894 echo "$enable_threads is an unknown thread package" 1>&2
899 dnl Check for thread package actually supported in libstdc++
900 case "$target_thread_file" in
911 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
912 AC_MSG_ERROR(thread package $THREADS not yet supported)
915 AC_MSG_ERROR($THREADS is an unknown thread package)
918 AC_MSG_RESULT($THREADS)
928 AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
931 dnl Not presently used
932 dnl THREADOBJS=threads-posix.lo
933 THREADH=threads-posix.h
936 dnl Not presently used
937 dnl THREADOBJS=threads-no.lo
950 dnl Check for template specializations for the 'long long' type extension.
952 dnl GLIBCPP_ENABLE_LONG_LONG
953 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
954 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
955 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
956 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
957 dnl defaults to `no'.
959 dnl GLIBCPP_ENABLE_LONG_LONG
960 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
961 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
962 AC_MSG_CHECKING([for enabled long long])
963 AC_ARG_ENABLE(long-long,
964 changequote(<<, >>)dnl
965 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
967 [case "$enableval" in
968 yes) enable_long_long=yes ;;
969 no) enable_long_long=no ;;
970 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
972 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
973 AC_MSG_RESULT($enable_long_long)
974 dnl Option parsed, now set things appropriately
975 case "$enable_long_long" in
976 yes) AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
983 dnl Check for whether or not to do shadowed C headers.
985 dnl GLIBCPP_ENABLE_SHADOW
986 dnl --enable-cshadow-headers [does stuff].
987 dnl --disable-cshadow-headers [does not do stuff].
988 dnl + This will eventually need to be on by default.
989 dnl + Usage: GLIBCPP_ENABLE_SHADOW[(DEFAULT)]
990 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
991 dnl defaults to `no'.
992 AC_DEFUN(GLIBCPP_ENABLE_SHADOW, [dnl
993 define([GLIBCPP_ENABLE_SHADOW_DEFAULT], ifelse($1, yes, yes, no))dnl
994 AC_MSG_CHECKING([for enabled cshadow headers])
995 AC_ARG_ENABLE(cshadow-headers,
996 changequote(<<, >>)dnl
997 << --enable-cshadow-headers construct "shadowed" C header files for
998 g++ [default=>>GLIBCPP_ENABLE_SHADOW_DEFAULT],
1000 [case "$enableval" in
1001 yes) enable_cshadow_headers=yes
1003 no) enable_cshadow_headers=no
1005 *) AC_MSG_ERROR([Unknown argument to enable/disable shadowed C headers])
1008 enable_cshadow_headers=GLIBCPP_ENABLE_SHADOW_DEFAULT)dnl
1009 AC_MSG_RESULT($enable_cshadow_headers)
1010 dnl Option parsed, now set things appropriately
1011 case "$enable_cshadow_headers" in
1013 SHADOW_INCLUDES="-I$srcdir/shadow -I$blddir/cshadow"
1014 $srcdir/inclosure "-I $blddir/../../gcc/include/ -I /usr/include/ -G machine/ansi.h" | $srcdir/mkcshadow
1020 # SHADOW_INCLUDES is currently not used anywhere in the source
1021 AC_SUBST(SHADOW_INCLUDES)
1025 # Check whether LC_MESSAGES is available in <locale.h>.
1026 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1028 # This file file be copied and used freely without restrictions. It can
1029 # be used in projects which are not available under the GNU Public License
1030 # but which still want to provide support for the GNU gettext functionality.
1031 # Please note that the actual code is *not* freely available.
1035 AC_DEFUN(AC_LC_MESSAGES,
1036 [if test $ac_cv_header_locale_h = yes; then
1037 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1038 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1039 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1040 if test $ac_cv_val_LC_MESSAGES = yes; then
1041 AC_DEFINE(HAVE_LC_MESSAGES)
1046 # Check for functions in math library.
1047 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1049 # This file can be copied and used freely without restrictions. It can
1050 # be used in projects which are not available under the GNU Public License
1051 # but which still want to provide support for the GNU gettext functionality.
1052 # Please note that the actual code is *not* freely available.
1056 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1057 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1058 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])
1059 AC_SUBST(LIBMATHOBJS)dnl
1063 # Check for string functions.
1064 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1066 # This file can be copied and used freely without restrictions. It can
1067 # be used in projects which are not available under the GNU Public License
1068 # but which still want to provide support for the GNU gettext functionality.
1069 # Please note that the actual code is *not* freely available.
1073 dnl AC_REPLACE_STRINGFUNCS(FUNCTION...)
1074 AC_DEFUN(AC_REPLACE_STRINGFUNCS,
1075 [AC_CHECK_FUNCS([$1], , [LIBSTRINGOBJS="$LIBSTRINGOBJS ${ac_func}.lo"])
1076 AC_SUBST(LIBSTRINGOBJS)dnl
1079 # Do all the work for Automake. This macro actually does too much --
1080 # some checks are only needed if your package does certain things.
1081 # But this isn't really a big deal.
1086 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
1088 AC_DEFUN(AM_INIT_AUTOMAKE,
1089 [AC_REQUIRE([AC_PROG_INSTALL])
1094 dnl test to see if srcdir already configured
1095 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1096 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1099 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1100 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
1101 AC_REQUIRE([AM_SANITY_CHECK])
1102 AC_REQUIRE([AC_ARG_PROGRAM])
1103 dnl FIXME This is truly gross.
1104 missing_dir=`cd $ac_aux_dir && pwd`
1105 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
1106 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
1107 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
1108 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
1109 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
1110 AC_REQUIRE([AC_PROG_MAKE_SET])])
1113 # Check to make sure that the build environment is sane.
1116 AC_DEFUN(AM_SANITY_CHECK,
1117 [AC_MSG_CHECKING([whether build environment is sane])
1120 echo timestamp > conftestfile
1121 # Do `set' in a subshell so we don't clobber the current shell's
1122 # arguments. Must try -L first in case configure is actually a
1123 # symlink; some systems play weird games with the mod time of symlinks
1124 # (eg FreeBSD returns the mod time of the symlink's containing
1127 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1128 if test "[$]*" = "X"; then
1130 set X `ls -t $srcdir/configure conftestfile`
1132 if test "[$]*" != "X $srcdir/configure conftestfile" \
1133 && test "[$]*" != "X conftestfile $srcdir/configure"; then
1135 # If neither matched, then we have a broken ls. This can happen
1136 # if, for instance, CONFIG_SHELL is bash and it inherits a
1137 # broken ls alias from the environment. This has actually
1138 # happened. Such a system could not be considered "sane".
1139 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1140 alias in your environment])
1143 test "[$]2" = conftestfile
1149 AC_MSG_ERROR([newly created file is older than distributed files!
1150 Check your system clock])
1153 AC_MSG_RESULT(yes)])
1155 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1156 dnl The program must properly implement --version.
1157 AC_DEFUN(AM_MISSING_PROG,
1158 [AC_MSG_CHECKING(for working $2)
1159 # Run test in a subshell; some versions of sh will print an error if
1160 # an executable is not found, even if stderr is redirected.
1161 # Redirect stdin to placate older versions of autoconf. Sigh.
1162 if ($2 --version) < /dev/null > /dev/null 2>&1; then
1164 AC_MSG_RESULT(found)
1167 AC_MSG_RESULT(missing)
1171 # Add --enable-maintainer-mode option to configure.
1176 AC_DEFUN(AM_MAINTAINER_MODE,
1177 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1178 dnl maintainer-mode is disabled by default
1179 AC_ARG_ENABLE(maintainer-mode,
1180 [ --enable-maintainer-mode enable make rules and dependencies not useful
1181 (and sometimes confusing) to the casual installer],
1182 USE_MAINTAINER_MODE=$enableval,
1183 USE_MAINTAINER_MODE=no)
1184 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1185 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1186 MAINT=$MAINTAINER_MODE_TRUE
1191 # Define a conditional.
1193 AC_DEFUN(AM_CONDITIONAL,
1205 # serial 40 AC_PROG_LIBTOOL
1206 AC_DEFUN(AC_PROG_LIBTOOL,
1207 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
1209 # Save cache, so that ltconfig can load it
1212 # Actually configure libtool. ac_aux_dir is where install-sh is found.
1213 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
1214 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1215 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
1216 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
1217 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
1218 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
1219 || AC_MSG_ERROR([libtool configure failed])
1221 # Reload cache, that may have been modified by ltconfig
1224 # This can be used to rebuild libtool when needed
1225 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
1227 # Always use our own libtool.
1228 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1229 AC_SUBST(LIBTOOL)dnl
1231 # Redirect the config.log output again, so that the ltconfig log is not
1232 # clobbered by the next message.
1233 exec 5>>./config.log
1236 AC_DEFUN(AC_LIBTOOL_SETUP,
1238 AC_REQUIRE([AC_ENABLE_SHARED])dnl
1239 AC_REQUIRE([AC_ENABLE_STATIC])dnl
1240 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1241 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1242 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1243 AC_REQUIRE([AC_PROG_RANLIB])dnl
1244 AC_REQUIRE([AC_PROG_CC])dnl
1245 AC_REQUIRE([AC_PROG_LD])dnl
1246 AC_REQUIRE([AC_PROG_NM])dnl
1247 AC_REQUIRE([AC_PROG_LN_S])dnl
1251 NONE) lt_target="$host" ;;
1252 *) lt_target="$target" ;;
1255 # Check for any special flags to pass to ltconfig.
1256 libtool_flags="--cache-file=$cache_file"
1257 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
1258 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
1259 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
1260 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
1261 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
1262 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
1263 [libtool_flags="$libtool_flags --enable-dlopen"])
1264 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1265 [libtool_flags="$libtool_flags --enable-win32-dll"])
1266 AC_ARG_ENABLE(libtool-lock,
1267 [ --disable-libtool-lock avoid locking (might break parallel builds)])
1268 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
1269 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
1271 # Some flags need to be propagated to the compiler or linker for good
1273 case "$lt_target" in
1275 # Find out which ABI we are using.
1276 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1277 if AC_TRY_EVAL(ac_compile); then
1278 case "`/usr/bin/file conftest.o`" in
1294 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1295 SAVE_CFLAGS="$CFLAGS"
1296 CFLAGS="$CFLAGS -belf"
1297 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1298 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
1299 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1300 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1301 CFLAGS="$SAVE_CFLAGS"
1305 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1306 [*-*-cygwin* | *-*-mingw*)
1307 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1308 AC_CHECK_TOOL(AS, as, false)
1309 AC_CHECK_TOOL(OBJDUMP, objdump, false)
1315 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
1316 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
1318 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
1319 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
1321 # AC_ENABLE_SHARED - implement the --enable-shared flag
1322 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
1323 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1325 AC_DEFUN(AC_ENABLE_SHARED, [dnl
1326 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1327 AC_ARG_ENABLE(shared,
1328 changequote(<<, >>)dnl
1329 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
1330 changequote([, ])dnl
1331 [p=${PACKAGE-default}
1332 case "$enableval" in
1333 yes) enable_shared=yes ;;
1334 no) enable_shared=no ;;
1337 # Look at the argument we got. We use all the common list separators.
1338 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1339 for pkg in $enableval; do
1340 if test "X$pkg" = "X$p"; then
1347 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
1350 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
1351 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1352 AC_ENABLE_SHARED(no)])
1354 # AC_ENABLE_STATIC - implement the --enable-static flag
1355 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
1356 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1358 AC_DEFUN(AC_ENABLE_STATIC, [dnl
1359 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1360 AC_ARG_ENABLE(static,
1361 changequote(<<, >>)dnl
1362 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
1363 changequote([, ])dnl
1364 [p=${PACKAGE-default}
1365 case "$enableval" in
1366 yes) enable_static=yes ;;
1367 no) enable_static=no ;;
1370 # Look at the argument we got. We use all the common list separators.
1371 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1372 for pkg in $enableval; do
1373 if test "X$pkg" = "X$p"; then
1380 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
1383 # AC_DISABLE_STATIC - set the default static flag to --disable-static
1384 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1385 AC_ENABLE_STATIC(no)])
1388 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
1389 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
1390 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1392 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
1393 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
1394 AC_ARG_ENABLE(fast-install,
1395 changequote(<<, >>)dnl
1396 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
1397 changequote([, ])dnl
1398 [p=${PACKAGE-default}
1399 case "$enableval" in
1400 yes) enable_fast_install=yes ;;
1401 no) enable_fast_install=no ;;
1403 enable_fast_install=no
1404 # Look at the argument we got. We use all the common list separators.
1405 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1406 for pkg in $enableval; do
1407 if test "X$pkg" = "X$p"; then
1408 enable_fast_install=yes
1414 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
1417 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
1418 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1419 AC_ENABLE_FAST_INSTALL(no)])
1421 # AC_PROG_LD - find the path to the GNU or non-GNU linker
1422 AC_DEFUN(AC_PROG_LD,
1423 [AC_ARG_WITH(gnu-ld,
1424 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1425 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1426 AC_REQUIRE([AC_PROG_CC])dnl
1427 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1428 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1430 if test "$ac_cv_prog_gcc" = yes; then
1431 # Check if gcc -print-prog-name=ld gives a path.
1432 AC_MSG_CHECKING([for ld used by GCC])
1433 ac_prog=`($CC -print-prog-name=ld) 2>&5`
1435 # Accept absolute paths.
1437 [\\/]* | [A-Za-z]:[\\/]*)
1438 re_direlt='/[^/][^/]*/\.\./'
1440 # Canonicalize the path of ld
1441 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1442 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1443 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1445 test -z "$LD" && LD="$ac_prog"
1448 # If it fails, then pretend we aren't using GCC.
1452 # If it is relative, then search for the first ld in PATH.
1456 elif test "$with_gnu_ld" = yes; then
1457 AC_MSG_CHECKING([for GNU ld])
1459 AC_MSG_CHECKING([for non-GNU ld])
1461 AC_CACHE_VAL(ac_cv_path_LD,
1462 [if test -z "$LD"; then
1463 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1464 for ac_dir in $PATH; do
1465 test -z "$ac_dir" && ac_dir=.
1466 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1467 ac_cv_path_LD="$ac_dir/$ac_prog"
1468 # Check to see if the program is GNU ld. I'd rather use --version,
1469 # but apparently some GNU ld's only accept -v.
1470 # Break only if it was the GNU/non-GNU ld that we prefer.
1471 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1472 test "$with_gnu_ld" != no && break
1474 test "$with_gnu_ld" != yes && break
1480 ac_cv_path_LD="$LD" # Let the user override the test with a path.
1483 if test -n "$LD"; then
1488 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1492 AC_DEFUN(AC_PROG_LD_GNU,
1493 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
1494 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1495 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1496 ac_cv_prog_gnu_ld=yes
1498 ac_cv_prog_gnu_ld=no
1502 # AC_PROG_NM - find the path to a BSD-compatible name lister
1503 AC_DEFUN(AC_PROG_NM,
1504 [AC_MSG_CHECKING([for BSD-compatible nm])
1505 AC_CACHE_VAL(ac_cv_path_NM,
1506 [if test -n "$NM"; then
1507 # Let the user override the test.
1510 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1511 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1512 test -z "$ac_dir" && ac_dir=.
1513 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1514 # Check to see if the nm accepts a BSD-compat flag.
1515 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1516 # nm: unknown option "B" ignored
1517 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1518 ac_cv_path_NM="$ac_dir/nm -B"
1520 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1521 ac_cv_path_NM="$ac_dir/nm -p"
1524 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1525 continue # so that we can try to find one that supports BSD flags
1530 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1533 AC_MSG_RESULT([$NM])
1536 # AC_CHECK_LIBM - check for math library
1537 AC_DEFUN(AC_CHECK_LIBM,
1538 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1540 case "$lt_target" in
1541 *-*-beos* | *-*-cygwin*)
1542 # These system don't have libm
1545 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1546 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1549 AC_CHECK_LIB(m, main, LIBM="-lm")
1554 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1555 # the libltdl convenience library, adds --enable-ltdl-convenience to
1556 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1557 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1558 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1559 # '${top_builddir}/' (note the single quotes!) if your package is not
1560 # flat, and, if you're not using automake, define top_builddir as
1561 # appropriate in the Makefiles.
1562 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1563 case "$enable_ltdl_convenience" in
1564 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1565 "") enable_ltdl_convenience=yes
1566 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1568 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
1569 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1572 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1573 # the libltdl installable library, and adds --enable-ltdl-install to
1574 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1575 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1576 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1577 # '${top_builddir}/' (note the single quotes!) if your package is not
1578 # flat, and, if you're not using automake, define top_builddir as
1579 # appropriate in the Makefiles.
1580 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1581 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1582 AC_CHECK_LIB(ltdl, main,
1583 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1584 [if test x"$enable_ltdl_install" = xno; then
1585 AC_MSG_WARN([libltdl not installed, but installation disabled])
1587 enable_ltdl_install=yes
1590 if test x"$enable_ltdl_install" = x"yes"; then
1591 ac_configure_args="$ac_configure_args --enable-ltdl-install"
1592 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
1593 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1595 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1602 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
1603 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
1604 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
1605 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
1606 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
1607 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
1608 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
1610 dnl This is just to silence aclocal about the macro not being used
1611 ifelse([AC_DISABLE_FAST_INSTALL])dnl
1613 # Like AC_CONFIG_HEADER, but automatically create stamp file.
1615 AC_DEFUN(AM_CONFIG_HEADER,
1617 AC_CONFIG_HEADER([$1])
1618 dnl When config.status generates a header, we must update the stamp-h file.
1619 dnl This file resides in the same directory as the config header
1620 dnl that is generated. We must strip everything past the first ":",
1621 dnl and everything past the last "/".
1622 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1623 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1624 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1626 for am_file in <<$1>>; do
1627 case " <<$>>CONFIG_HEADERS " in
1628 *" <<$>>am_file "*<<)>>
1629 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1632 am_indx=`expr "<<$>>am_indx" + 1`