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.
171 dnl Define OPTLEVEL='-O2' if new inlining code present.
173 dnl GLIBCPP_CHECK_COMPILER_VERSION
174 AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
175 AC_MSG_CHECKING([for g++ that will successfullly 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)
183 AC_MSG_CHECKING([for g++ that supports new inlining mechanism])
185 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95)
191 WERRORSUPPRESS=-Wno-error
193 if test "$OPTLEVEL" = ""; then
199 AC_SUBST(WERRORSUPPRESS)
204 dnl Check to see what builtin math functions are supported
206 dnl Define _GLIBCPP_HAS_BUILTIN_SINF if __builtin_sinf
207 dnl Define _GLIBCPP_HAS_BUILTIN_COSF if __builtin_cosf
208 dnl Define _GLIBCPP_HAS_BUILTIN_FABSF if __builtin_fabsf
209 dnl Define _GLIBCPP_HAS_BUILTIN_SQRTF if __builtin_sqrtf
211 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
212 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
213 dnl Test for builtin math functions.
214 AC_MSG_CHECKING([for __builtin_sinf])
215 AC_TRY_COMPILE([#include <math.h>],
216 [float foo(void) { __builtin_sinf(0.0); }],
217 use_builtin_sinf=yes, use_builtin_sinf=no)
218 AC_MSG_RESULT($use_builtin_sinf)
219 if test $use_builtin_sinf = "yes"; then
220 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_SINF)
223 AC_MSG_CHECKING([for __builtin_cosf])
224 AC_TRY_COMPILE([#include <math.h>],
225 [float foo(void) { __builtin_cosf(0.0); }],
226 use_builtin_cosf=yes, use_builtin_cosf=no)
227 AC_MSG_RESULT($use_builtin_cosf)
228 if test $use_builtin_cosf = "yes"; then
229 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_COSF)
232 AC_MSG_CHECKING([for __builtin_fabsf])
233 AC_TRY_COMPILE([#include <math.h>],
234 [float foo(void) { __builtin_fabsf(0.0); }],
235 use_builtin_fabsf=yes, use_builtin_fabsf=no)
236 AC_MSG_RESULT($use_builtin_fabsf)
237 if test $use_builtin_fabsf = "yes"; then
238 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_FABSF)
241 AC_MSG_CHECKING([for __builtin_sqrtf])
242 AC_TRY_COMPILE([#include <math.h>],
243 [float foo(void) { __builtin_sqrtf(0.0); }],
244 use_builtin_sqrtf=yes, use_builtin_sqrtf=no)
245 AC_MSG_RESULT($use_builtin_sqrtf)
246 if test $use_builtin_sqrtf = "yes"; then
247 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_SQRTF)
253 dnl Check to see what architecture we are compiling for. If it's
254 dnl supported, use special hand-crafted routines to provide thread
257 dnl Depending on what is found, select various configure/cpu/*/atomicity.h
258 dnl If not found, select configure/cpu/generic/atomicity.h
260 dnl GLIBCPP_CHECK_CPU
261 AC_DEFUN(GLIBCPP_CHECK_CPU, [
262 AC_MSG_CHECKING([for cpu primitives directory])
263 case "$target_cpu" in
265 cpu_include_dir="config/cpu/alpha"
268 cpu_include_dir="config/cpu/arm"
270 i486 | i586 | i686 | i786)
271 cpu_include_dir="config/cpu/i386"
274 cpu_include_dir="config/cpu/powerpc"
276 sparc64 | ultrasparc)
277 cpu_include_dir="config/cpu/sparc/sparc64"
280 cpu_include_dir="config/cpu/sparc/sparc32"
283 cpu_include_dir="config/cpu/generic"
286 AC_MSG_RESULT($cpu_include_dir)
287 AC_SUBST(cpu_include_dir)
292 dnl Check to see what the underlying c library's interface to ctype looks
293 dnl like. Bits of locale rely on things like isspace, toupper, etc. This
294 dnl stuff makes sure the right bits from the clibrary get called.
296 dnl Depending on what is found, select various configure/*/bits/ctype_base.h
297 dnl Depending on what is found, select various configure/*/ctype.cc
299 dnl GLIBCPP_CHECK_CTYPE
300 AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
301 AC_CHECK_HEADER(ctype.h, [
303 dnl If doesn't match any specified, go with defaults.
306 dnl Test for <ctype> functionality -- gnu-linux
307 AC_MSG_CHECKING([for gnu-linux <ctype>])
308 AC_TRY_COMPILE([#include <ctype.h>],
311 { return _ISspace + _ISprint + _IScntrl + _ISupper + _ISlower + _ISalpha \
312 + _ISdigit + _ISpunct + _ISxdigit + _ISalnum + _ISgraph \
313 + __ctype_tolower[a] + __ctype_toupper[a] + __ctype_b[a];}], \
314 ctype_linux=yes, ctype_linux=no)
315 AC_MSG_RESULT($ctype_linux)
316 if test $ctype_linux = "yes"; then
317 ctype_include_dir="config/gnu-linux"
321 dnl Test for <ctype> functionality -- solaris 2.6 and 2.7
322 if test $ctype_default = "yes"; then
323 AC_MSG_CHECKING([for solaris 2.6 or 2.7 <ctype>])
324 AC_TRY_COMPILE([#include <ctype.h>],
327 { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
328 + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
329 + __trans_lower[a] + __trans_upper[a] + __ctype_mask[a];}], \
330 ctype_solaris=yes, ctype_solaris=no)
331 AC_MSG_RESULT($ctype_solaris)
333 if test $ctype_solaris = "yes"; then
334 AC_MSG_CHECKING([ for version])
336 AC_TRY_COMPILE([#include <ctype.h>],
337 [typedef long* __to_type; __to_type const& _M_toupper = __trans_upper;],\
338 ctype_solaris26=yes, ctype_solaris26=no)
340 if test $ctype_solaris26 = "yes"; then
341 ctype_include_dir="config/solaris/solaris2.6"
342 AC_MSG_RESULT("solaris2.6")
345 ctype_include_dir="config/solaris/solaris2.7"
346 AC_MSG_RESULT("solaris2.7")
352 dnl Test for <ctype> functionality -- solaris 2.5.1
353 if test $ctype_default = "yes"; then
354 AC_MSG_CHECKING([for solaris 2.5.1 <ctype>])
355 AC_TRY_COMPILE([#include <ctype.h>],
358 { return _U + _L + _N + _S + _P + _C + _X + _B \
360 ctype_solaris25=yes, ctype_solaris25=no)
361 AC_MSG_RESULT($ctype_solaris25)
362 if test $ctype_solaris25 = "yes"; then
363 ctype_include_dir="config/solaris/solaris2.5"
368 dnl Test for <ctype> functionality -- aix
369 if test $ctype_default = "yes"; then
370 AC_MSG_CHECKING([for aix <ctype>])
371 AC_TRY_COMPILE([#include <ctype.h>],
374 { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
375 + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
376 + _VALC('a') + _IS('c', 0);}], \
377 ctype_aix=yes, ctype_aix=no)
378 AC_MSG_RESULT($ctype_aix)
379 if test $ctype_aix = "yes"; then
380 ctype_include_dir="config/aix"
385 dnl Test for <ctype> functionality -- newlib
386 if test $ctype_default = "yes"; then
387 AC_MSG_CHECKING([for newlib <ctype>])
388 AC_TRY_COMPILE([#include <ctype.h>],
391 { return _U + _L + _N + _S + _P + _C + _X + _B \
393 ctype_newlib=yes, ctype_newlib=no)
394 AC_MSG_RESULT($ctype_newlib)
395 if test $ctype_newlib = "yes"; then
396 ctype_include_dir="config/newlib"
401 if test $ctype_default = "yes"; then
402 ctype_include_dir="config/generic"
403 AC_MSG_WARN("Using default ctype headers.")
405 AC_SUBST(ctype_include_dir)
411 dnl Check to see what the underlying c library or math library is like.
413 dnl Define HAVE_CARGF etc if "cargf" is found.
415 dnl GLIBCPP_CHECK_MATH_SUPPORT
416 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
417 AC_CHECK_LIB(m, sin, libm="-lm")
421 dnl Check for complex versions of math functions of platform.
422 AC_CHECK_HEADERS([complex.h])
423 AC_REPLACE_MATHFUNCS(ccos ccosf ccosh ccoshf cexp cexpf c_log c_logf \
424 clog10 clog10f cpow cpowf csin csinf csinh csinhf csqrt csqrtf \
425 ctan ctanf ctanh ctanhf \
426 carg cargf nan hypot hypotf atan2f expf copysignf)
428 dnl We compile the long double complex functions only if the function
429 dnl provides the non-complex functions.
433 AC_REPLACE_MATHFUNCS(ccoshl ccosl cexpl cpowl csinhl csinl \
434 csqrtl ctanhl ctanl cargl hypotl signbitl c_logl clog10l))
435 AC_SUBST(USE_LONG_DOUBLE)
437 dnl Check to see if basic C math functions have faster float versions.
438 AC_CHECK_FUNCS(modf isnan isnanf isnanl isinf isinff isinfl copysign \
439 copysignl cosf coshf logf log10f powf sinf sinhf sqrtf tanf tanhf \
440 strtof strtold fabsf sincos sincosf sincosl finite finite fqfinite \
443 #Some runtimes have these functions with a preceding underscore. Please
444 # keep this sync'd with the one above. And if you add any new symbol,
445 # please add the corresponding block in the @BOTTOM@ section of
447 AC_CHECK_FUNCS(_modf _isnan _isnanf _isnanl _isinf _isinff _isinfl _copysign \
448 _copysignl _cosf _coshf _logf _log10f _powf _sinf _sinhf _sqrtf _tanf _tanhf \
449 _strtof _strtold _fabsf _sincos _sincosf _sincosl _finite _finitef _qfinite \
457 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
459 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
460 dnl Define _GLIBCPP_NEED_MBSTATE_T if mbstate_t is not in wchar.h
461 dnl Define _GLIBCPP_HAS_WCHAR_MIN_MAX if WCHAR_MIN, WCHAR_MAX in wchar.h
463 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
464 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
465 AC_CHECK_HEADER(wchar.h,[
466 dnl Test wchar.h for mbstate_t, which is needed for char_traits and others.
467 AC_MSG_CHECKING([for native mbstate_t])
468 AC_TRY_COMPILE([#include <wchar.h>],
469 [mbstate_t teststate;],
470 use_native_mbstatet=yes, use_native_mbstatet=no)
471 AC_MSG_RESULT($use_native_mbstatet)
472 if test $use_native_mbstatet = "no"; then
473 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
476 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
477 dnl numeric_limits can instantiate type_traits<wchar_t>
478 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
479 AC_TRY_COMPILE([#include <wchar.h>],
480 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
481 has_wchar_minmax=yes, has_wchar_minmax=no)
482 AC_MSG_RESULT($has_wchar_minmax)
483 if test $has_wchar_minmax = "yes"; then
484 AC_DEFINE(_GLIBCPP_HAS_WCHAR_MIN_MAX)
487 # Test wchar.h for WEOF, which is what we use to determine whether
488 # to specialize for wchar_t or not.
489 AC_MSG_CHECKING([for WEOF])
492 #include <stddef.h>],
494 has_weof=yes, has_weof=no)
495 AC_MSG_RESULT($has_weof)
497 dnl Tests for wide character functions.
498 AC_REPLACE_STRINGFUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset)
499 AC_SUBST(libinst_wstring_la)
501 AC_MSG_CHECKING([for wide character support])
502 if test $has_weof = "yes" && test $has_wchar_minmax = "yes"; then
503 libinst_wstring_la="libinst-wstring.la"
504 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
507 libinst_wstring_la=""
508 AC_MSG_RESULT("not specializing for wchar_t")
511 AC_MSG_WARN([<wchar.h> not found])
512 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
518 dnl Check to see if this version of GNU C++ is afflicted by bugs in
519 dnl __complex__ float support.
521 dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy.
523 dnl GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT
524 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT, [
525 AC_REQUIRE([AC_PROG_CXX])
526 AC_MSG_CHECKING([for GNU C++ __complex__ float support])
527 AC_CACHE_VAL(glibcpp_cv_float_complex, [
531 cat > conftest.h <<EOB
533 // Check for buggy __complex__ that causes ICE in most versions of egcs
534 // and gcc-2.95.x on certain platforms (eg., x86-win32).
536 // See http://egcs.cygnus.com/ml/gcc-bugs/1999-07/msg00845.html for
537 // more info on the bug itself.
542 __complex__ float m_value;
543 float_complex (float = 0.0f, float = 0.0f);
544 float_complex (__complex__ float val) : m_value (val) {}
545 float_complex foo (const float_complex &val)
546 { return float_complex (~val.m_value); }
549 AC_TRY_COMPILE([#include "conftest.h"], ,
550 glibcpp_cv_float_complex=ok,
551 glibcpp_cv_float_complex=buggy
555 AC_MSG_RESULT($glibcpp_cv_float_complex)
556 if test $glibcpp_cv_float_complex = buggy; then
557 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
564 dnl Check to see if this version of GNU C++ is afflicted by bugs in
565 dnl __complex__ support.Check for buggy __complex__ that will cause ICE in
566 dnl gcc-2.95.x when using the library, unless we define the default copy
567 dnl ctor in the specializations of complex<>.
569 dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy.
571 dnl GLIBCPP_CHECK_COMPLEX_SUPPORT
572 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_SUPPORT, [
573 AC_REQUIRE([AC_PROG_CXX])
574 AC_MSG_CHECKING([for GNU C++ __complex__ support])
575 AC_CACHE_VAL(glibcpp_cv_complex, [
578 AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
579 dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
580 [ dcomplex x; f(x); ],
581 glibcpp_cv_complex=ok,
582 glibcpp_cv_complex=buggy
586 AC_MSG_RESULT($glibcpp_cv_complex)
587 if test $glibcpp_cv_complex = buggy; then
588 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
594 dnl Check for certain special build configurations.
596 dnl GLIBCPP_ENABLE_DEBUG
597 dnl --enable-debug sets '-ggdb -O0'.
598 dnl --disable-debug sets '-g' and whatever optimization options the
599 dnl compiler can handle.
600 dnl + Perhaps --enable-maintainer-mode should automatically turn this on?
601 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
602 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
603 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
604 dnl defaults to `no'.
605 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
606 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
608 changequote(<<, >>)dnl
609 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
611 [case "$enableval" in
612 yes) enable_debug=yes ;;
613 no) enable_debug=no ;;
614 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
616 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
617 dnl Option parsed, now set things appropriately
618 case "$enable_debug" in
619 yes) DEBUGFLAGS='-ggdb -O0'
629 dnl Check for certain special build configurations.
631 dnl GLIBCPP_ENABLE_NAMESPACES
632 dnl --enable-namespaces sets '-fhonor-std' and defines _GLIBCPP_USE_NAMESPACES
633 dnl --disable-namespaces sets '-fno-honor-std' (the macro should be
634 dnl undefined by default in whatever.h.in).
635 dnl + Eventually, this will go away.
636 dnl + Usage: GLIBCPP_ENABLE_NAMESPACES[(DEFAULT)]
637 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
638 dnl defaults to `no'.
639 AC_DEFUN(GLIBCPP_ENABLE_NAMESPACES, [dnl
640 define([GLIBCPP_ENABLE_NAMESPACES_DEFAULT], ifelse($1, yes, yes, no))dnl
641 AC_ARG_ENABLE(namespaces,
642 changequote(<<, >>)dnl
643 << --enable-namespaces turns on 'std' [default=>>GLIBCPP_ENABLE_NAMESPACES_DEFAULT],
645 [case "$enableval" in
646 yes) enable_namespaces=yes ;;
647 no) enable_namespaces=no ;;
648 *) AC_MSG_ERROR([Unknown argument to enable/disable namespaces]) ;;
650 enable_namespaces=GLIBCPP_ENABLE_NAMESPACES_DEFAULT)dnl
651 dnl Option parsed, now set things appropriately
652 case "$enable_namespaces" in
653 yes) NAMESPACES='-fhonor-std'
654 AC_DEFINE(_GLIBCPP_USE_NAMESPACES)
656 no) NAMESPACES='-fno-honor-std'
664 dnl Check for instructions to automatically rebuild libgcc.a. Requires,
665 dnl of course, the location of the gcc objdir. Note that if --disable-
666 dnl namespaces is in effect, rebuilding libgcc.a is an expensive no-op.
668 dnl GLIBCPP_ENABLE_RELIBGCC
669 dnl --enable-libgcc-rebuild=/absolute/path/to/gcc/objdir sets GCC_OBJDIR
670 dnl (presumably in the top-level Makefile) to /absol.../objdir
671 dnl --disable-libgcc-rebuild will not touch libgcc.a at all (maybe print
672 dnl a warning if this is given along with --enable-namespaces), by
673 dnl setting GCC_OBJDIR to `no'.
674 dnl + Doing this by default is going to be interesting. What default
675 dnl "on" value can there be?
676 dnl + Usage: GLIBCPP_ENABLE_RELIBGCC[(DEFAULT)]
677 dnl The default path should be ../.. if bundled with GCC source.
678 dnl If ommitted, it defaults to `no'.
680 AC_DEFUN(GLIBCPP_ENABLE_RELIBGCC, [dnl
681 define([GLIBCPP_ENABLE_RELIBGCC_DEFAULT], ifelse($1,, no, $1))dnl
682 AC_ARG_ENABLE(libgcc-rebuild,
683 changequote(<<, >>)dnl
684 << --enable-libgcc-rebuild=DIR also rebuild libgcc.a; DIR is
685 the GCC objdir; see install.html>>,
687 [case "$enableval" in
688 yes) AC_MSG_ERROR([--enable-libgcc-rebuild needs a pathname]) ;;
689 no) enable_libgcc_rebuild=no ;;
690 *) if test -d "$enableval" && test -d "${enableval}/gcc" && \
691 test -d "${enableval}/libiberty"
693 enable_libgcc_rebuild="$enableval"
695 AC_MSG_ERROR(["$enableval" does not appear to be the GCC objdir])
699 enable_libgcc_rebuild=GLIBCPP_ENABLE_RELIBGCC_DEFAULT)dnl
700 GCC_OBJDIR="$enable_libgcc_rebuild"
706 dnl Check for certain special build configurations.
708 dnl GLIBCPP_ENABLE_CSTDIO
709 dnl --enable-cstdio=libio sets config/c_io_libio.h and friends
713 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
714 AC_MSG_CHECKING([for cstdio to use])
715 AC_ARG_ENABLE(cstdio,
716 [ --enable-cstdio enable GNU libio for target io package. (default)
717 --enable-cstdio=LIB use LIB target-speific io package.],
718 if test x$enable_cstdio = xno; then
723 enable_cstdio_flag=$enable_cstdio
725 dnl Check if a valid thread package
726 case x${enable_cstdio_flag} in
727 xlibio | x | xno | xnone | xyes)
729 CSTDIO_H=c_io_libio.h
730 CSTDIO_CC=c_io_libio.cc
733 # see if we are on a system with libio native (ie, linux)
734 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
735 if test $has_libio = "yes"; then
739 BUILD_LIBIO_INCLUDE='-I../libio'
742 AC_SUBST(BUILD_LIBIO_INCLUDE)
745 CSTDIO_H=c_io_wince.h
746 CSTDIO_CC=c_io_wince.cc
751 AC_SUBST(BUILD_LIBIO_INCLUDE)
754 echo "$enable_cstdio is an unknown io package" 1>&2
760 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
765 dnl Check for certain special build configurations.
767 dnl GLIBCPP_ENABLE_THREADS
768 dnl --enable-threads=posix sets config/threads-posix.h et. al.
770 dnl default is no threads
772 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
773 dnl Note this comes from the gcc/config.in and libjava/config.in
774 dnl Efforts should be made to keep this in sync.
775 AC_MSG_CHECKING([for threads package to use])
776 AC_ARG_ENABLE(threads,
777 [ --enable-threads enable thread usage for target GCC.
778 --enable-threads=LIB use LIB thread package for target GCC.],
779 if test x$enable_threads = xno; then
784 enable_threads_flag=$enable_threads
786 dnl Check if a valid thread package
787 case x${enable_threads_flag} in
790 target_thread_file='single'
794 target_thread_file=''
796 xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
797 xsolaris | xwin32 | xdce | xvxworks)
798 target_thread_file=$enable_threads_flag
801 echo "$enable_threads is an unknown thread package" 1>&2
806 dnl Check for thread package actually supported in libstdc++
807 case "$target_thread_file" in
818 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
819 AC_MSG_ERROR(thread package $THREADS not yet supported)
822 AC_MSG_ERROR($THREADS is an unknown thread package)
825 AC_MSG_RESULT($THREADS)
835 AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
838 dnl Not presently used
839 dnl THREADOBJS=threads-posix.lo
840 THREADH=threads-posix.h
843 dnl Not presently used
844 dnl THREADOBJS=threads-no.lo
857 dnl Check for certain special build configurations.
859 dnl GLIBCPP_ENABLE_LONG_LONG
860 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
861 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
862 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
863 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
864 dnl defaults to `no'.
866 dnl GLIBCPP_ENABLE_LONG_LONG
867 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
868 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
869 AC_ARG_ENABLE(long-long,
870 changequote(<<, >>)dnl
871 <<--enable-long_long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
873 [case "$enableval" in
874 yes) enable_long_long=yes ;;
875 no) enable_long_long=no ;;
876 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
878 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
879 dnl Option parsed, now set things appropriately
880 case "$enable_long_long" in
881 yes) AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
898 # Do all the work for Automake. This macro actually does too much --
899 # some checks are only needed if your package does certain things.
900 # But this isn't really a big deal.
905 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
907 AC_DEFUN(AM_INIT_AUTOMAKE,
908 [AC_REQUIRE([AC_PROG_INSTALL])
913 dnl test to see if srcdir already configured
914 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
915 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
918 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
919 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
920 AC_REQUIRE([AM_SANITY_CHECK])
921 AC_REQUIRE([AC_ARG_PROGRAM])
922 dnl FIXME This is truly gross.
923 missing_dir=`cd $ac_aux_dir && pwd`
924 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
925 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
926 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
927 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
928 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
929 AC_REQUIRE([AC_PROG_MAKE_SET])])
932 # Check to make sure that the build environment is sane.
935 AC_DEFUN(AM_SANITY_CHECK,
936 [AC_MSG_CHECKING([whether build environment is sane])
939 echo timestamp > conftestfile
940 # Do `set' in a subshell so we don't clobber the current shell's
941 # arguments. Must try -L first in case configure is actually a
942 # symlink; some systems play weird games with the mod time of symlinks
943 # (eg FreeBSD returns the mod time of the symlink's containing
946 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
947 if test "[$]*" = "X"; then
949 set X `ls -t $srcdir/configure conftestfile`
951 if test "[$]*" != "X $srcdir/configure conftestfile" \
952 && test "[$]*" != "X conftestfile $srcdir/configure"; then
954 # If neither matched, then we have a broken ls. This can happen
955 # if, for instance, CONFIG_SHELL is bash and it inherits a
956 # broken ls alias from the environment. This has actually
957 # happened. Such a system could not be considered "sane".
958 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
959 alias in your environment])
962 test "[$]2" = conftestfile
968 AC_MSG_ERROR([newly created file is older than distributed files!
969 Check your system clock])
974 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
975 dnl The program must properly implement --version.
976 AC_DEFUN(AM_MISSING_PROG,
977 [AC_MSG_CHECKING(for working $2)
978 # Run test in a subshell; some versions of sh will print an error if
979 # an executable is not found, even if stderr is redirected.
980 # Redirect stdin to placate older versions of autoconf. Sigh.
981 if ($2 --version) < /dev/null > /dev/null 2>&1; then
986 AC_MSG_RESULT(missing)
990 # Add --enable-maintainer-mode option to configure.
995 AC_DEFUN(AM_MAINTAINER_MODE,
996 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
997 dnl maintainer-mode is disabled by default
998 AC_ARG_ENABLE(maintainer-mode,
999 [ --enable-maintainer-mode enable make rules and dependencies not useful
1000 (and sometimes confusing) to the casual installer],
1001 USE_MAINTAINER_MODE=$enableval,
1002 USE_MAINTAINER_MODE=no)
1003 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1004 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1005 MAINT=$MAINTAINER_MODE_TRUE
1010 # Define a conditional.
1012 AC_DEFUN(AM_CONDITIONAL,
1023 # Check for functions in math library.
1024 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1026 # This file can be copied and used freely without restrictions. It can
1027 # be used in projects which are not available under the GNU Public License
1028 # but which still want to provide support for the GNU gettext functionality.
1029 # Please note that the actual code is *not* freely available.
1033 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1034 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1035 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])
1036 AC_SUBST(LIBMATHOBJS)dnl
1039 # Check for string functions.
1040 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1042 # This file can be copied and used freely without restrictions. It can
1043 # be used in projects which are not available under the GNU Public License
1044 # but which still want to provide support for the GNU gettext functionality.
1045 # Please note that the actual code is *not* freely available.
1049 dnl AC_REPLACE_STRINGFUNCS(FUNCTION...)
1050 AC_DEFUN(AC_REPLACE_STRINGFUNCS,
1051 [AC_CHECK_FUNCS([$1], , [LIBSTRINGOBJS="$LIBSTRINGOBJS ${ac_func}.lo"])
1052 AC_SUBST(LIBSTRINGOBJS)dnl
1056 # serial 40 AC_PROG_LIBTOOL
1057 AC_DEFUN(AC_PROG_LIBTOOL,
1058 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
1060 # Save cache, so that ltconfig can load it
1063 # Actually configure libtool. ac_aux_dir is where install-sh is found.
1064 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
1065 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1066 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
1067 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
1068 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
1069 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
1070 || AC_MSG_ERROR([libtool configure failed])
1072 # Reload cache, that may have been modified by ltconfig
1075 # This can be used to rebuild libtool when needed
1076 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
1078 # Always use our own libtool.
1079 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1080 AC_SUBST(LIBTOOL)dnl
1082 # Redirect the config.log output again, so that the ltconfig log is not
1083 # clobbered by the next message.
1084 exec 5>>./config.log
1087 AC_DEFUN(AC_LIBTOOL_SETUP,
1089 AC_REQUIRE([AC_ENABLE_SHARED])dnl
1090 AC_REQUIRE([AC_ENABLE_STATIC])dnl
1091 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1092 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1093 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1094 AC_REQUIRE([AC_PROG_RANLIB])dnl
1095 AC_REQUIRE([AC_PROG_CC])dnl
1096 AC_REQUIRE([AC_PROG_LD])dnl
1097 AC_REQUIRE([AC_PROG_NM])dnl
1098 AC_REQUIRE([AC_PROG_LN_S])dnl
1102 NONE) lt_target="$host" ;;
1103 *) lt_target="$target" ;;
1106 # Check for any special flags to pass to ltconfig.
1107 libtool_flags="--cache-file=$cache_file"
1108 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
1109 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
1110 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
1111 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
1112 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
1113 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
1114 [libtool_flags="$libtool_flags --enable-dlopen"])
1115 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1116 [libtool_flags="$libtool_flags --enable-win32-dll"])
1117 AC_ARG_ENABLE(libtool-lock,
1118 [ --disable-libtool-lock avoid locking (might break parallel builds)])
1119 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
1120 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
1122 # Some flags need to be propagated to the compiler or linker for good
1124 case "$lt_target" in
1126 # Find out which ABI we are using.
1127 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1128 if AC_TRY_EVAL(ac_compile); then
1129 case "`/usr/bin/file conftest.o`" in
1145 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1146 SAVE_CFLAGS="$CFLAGS"
1147 CFLAGS="$CFLAGS -belf"
1148 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1149 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
1150 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1151 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1152 CFLAGS="$SAVE_CFLAGS"
1156 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1157 [*-*-cygwin* | *-*-mingw*)
1158 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1159 AC_CHECK_TOOL(AS, as, false)
1160 AC_CHECK_TOOL(OBJDUMP, objdump, false)
1166 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
1167 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
1169 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
1170 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
1172 # AC_ENABLE_SHARED - implement the --enable-shared flag
1173 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
1174 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1176 AC_DEFUN(AC_ENABLE_SHARED, [dnl
1177 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1178 AC_ARG_ENABLE(shared,
1179 changequote(<<, >>)dnl
1180 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
1181 changequote([, ])dnl
1182 [p=${PACKAGE-default}
1183 case "$enableval" in
1184 yes) enable_shared=yes ;;
1185 no) enable_shared=no ;;
1188 # Look at the argument we got. We use all the common list separators.
1189 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1190 for pkg in $enableval; do
1191 if test "X$pkg" = "X$p"; then
1198 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
1201 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
1202 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1203 AC_ENABLE_SHARED(no)])
1205 # AC_ENABLE_STATIC - implement the --enable-static flag
1206 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
1207 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1209 AC_DEFUN(AC_ENABLE_STATIC, [dnl
1210 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1211 AC_ARG_ENABLE(static,
1212 changequote(<<, >>)dnl
1213 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
1214 changequote([, ])dnl
1215 [p=${PACKAGE-default}
1216 case "$enableval" in
1217 yes) enable_static=yes ;;
1218 no) enable_static=no ;;
1221 # Look at the argument we got. We use all the common list separators.
1222 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1223 for pkg in $enableval; do
1224 if test "X$pkg" = "X$p"; then
1231 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
1234 # AC_DISABLE_STATIC - set the default static flag to --disable-static
1235 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1236 AC_ENABLE_STATIC(no)])
1239 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
1240 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
1241 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1243 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
1244 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
1245 AC_ARG_ENABLE(fast-install,
1246 changequote(<<, >>)dnl
1247 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
1248 changequote([, ])dnl
1249 [p=${PACKAGE-default}
1250 case "$enableval" in
1251 yes) enable_fast_install=yes ;;
1252 no) enable_fast_install=no ;;
1254 enable_fast_install=no
1255 # Look at the argument we got. We use all the common list separators.
1256 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1257 for pkg in $enableval; do
1258 if test "X$pkg" = "X$p"; then
1259 enable_fast_install=yes
1265 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
1268 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
1269 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1270 AC_ENABLE_FAST_INSTALL(no)])
1272 # AC_PROG_LD - find the path to the GNU or non-GNU linker
1273 AC_DEFUN(AC_PROG_LD,
1274 [AC_ARG_WITH(gnu-ld,
1275 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1276 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1277 AC_REQUIRE([AC_PROG_CC])dnl
1278 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1279 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1281 if test "$ac_cv_prog_gcc" = yes; then
1282 # Check if gcc -print-prog-name=ld gives a path.
1283 AC_MSG_CHECKING([for ld used by GCC])
1284 ac_prog=`($CC -print-prog-name=ld) 2>&5`
1286 # Accept absolute paths.
1288 [\\/]* | [A-Za-z]:[\\/]*)
1289 re_direlt='/[^/][^/]*/\.\./'
1291 # Canonicalize the path of ld
1292 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1293 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1294 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1296 test -z "$LD" && LD="$ac_prog"
1299 # If it fails, then pretend we aren't using GCC.
1303 # If it is relative, then search for the first ld in PATH.
1307 elif test "$with_gnu_ld" = yes; then
1308 AC_MSG_CHECKING([for GNU ld])
1310 AC_MSG_CHECKING([for non-GNU ld])
1312 AC_CACHE_VAL(ac_cv_path_LD,
1313 [if test -z "$LD"; then
1314 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1315 for ac_dir in $PATH; do
1316 test -z "$ac_dir" && ac_dir=.
1317 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1318 ac_cv_path_LD="$ac_dir/$ac_prog"
1319 # Check to see if the program is GNU ld. I'd rather use --version,
1320 # but apparently some GNU ld's only accept -v.
1321 # Break only if it was the GNU/non-GNU ld that we prefer.
1322 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1323 test "$with_gnu_ld" != no && break
1325 test "$with_gnu_ld" != yes && break
1331 ac_cv_path_LD="$LD" # Let the user override the test with a path.
1334 if test -n "$LD"; then
1339 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1343 AC_DEFUN(AC_PROG_LD_GNU,
1344 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
1345 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1346 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1347 ac_cv_prog_gnu_ld=yes
1349 ac_cv_prog_gnu_ld=no
1353 # AC_PROG_NM - find the path to a BSD-compatible name lister
1354 AC_DEFUN(AC_PROG_NM,
1355 [AC_MSG_CHECKING([for BSD-compatible nm])
1356 AC_CACHE_VAL(ac_cv_path_NM,
1357 [if test -n "$NM"; then
1358 # Let the user override the test.
1361 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1362 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1363 test -z "$ac_dir" && ac_dir=.
1364 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1365 # Check to see if the nm accepts a BSD-compat flag.
1366 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1367 # nm: unknown option "B" ignored
1368 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1369 ac_cv_path_NM="$ac_dir/nm -B"
1371 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1372 ac_cv_path_NM="$ac_dir/nm -p"
1375 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1376 continue # so that we can try to find one that supports BSD flags
1381 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1384 AC_MSG_RESULT([$NM])
1387 # AC_CHECK_LIBM - check for math library
1388 AC_DEFUN(AC_CHECK_LIBM,
1389 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1391 case "$lt_target" in
1392 *-*-beos* | *-*-cygwin*)
1393 # These system don't have libm
1396 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1397 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1400 AC_CHECK_LIB(m, main, LIBM="-lm")
1405 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1406 # the libltdl convenience library, adds --enable-ltdl-convenience to
1407 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1408 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1409 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1410 # '${top_builddir}/' (note the single quotes!) if your package is not
1411 # flat, and, if you're not using automake, define top_builddir as
1412 # appropriate in the Makefiles.
1413 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1414 case "$enable_ltdl_convenience" in
1415 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1416 "") enable_ltdl_convenience=yes
1417 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1419 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
1420 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1423 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1424 # the libltdl installable library, and adds --enable-ltdl-install to
1425 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1426 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1427 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1428 # '${top_builddir}/' (note the single quotes!) if your package is not
1429 # flat, and, if you're not using automake, define top_builddir as
1430 # appropriate in the Makefiles.
1431 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1432 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1433 AC_CHECK_LIB(ltdl, main,
1434 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1435 [if test x"$enable_ltdl_install" = xno; then
1436 AC_MSG_WARN([libltdl not installed, but installation disabled])
1438 enable_ltdl_install=yes
1441 if test x"$enable_ltdl_install" = x"yes"; then
1442 ac_configure_args="$ac_configure_args --enable-ltdl-install"
1443 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
1444 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1446 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1453 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
1454 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
1455 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
1456 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
1457 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
1458 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
1459 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
1461 dnl This is just to silence aclocal about the macro not being used
1462 ifelse([AC_DISABLE_FAST_INSTALL])dnl
1464 # Like AC_CONFIG_HEADER, but automatically create stamp file.
1466 AC_DEFUN(AM_CONFIG_HEADER,
1468 AC_CONFIG_HEADER([$1])
1469 dnl When config.status generates a header, we must update the stamp-h file.
1470 dnl This file resides in the same directory as the config header
1471 dnl that is generated. We must strip everything past the first ":",
1472 dnl and everything past the last "/".
1473 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1474 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1475 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1477 for am_file in <<$1>>; do
1478 case " <<$>>CONFIG_HEADERS " in
1479 *" <<$>>am_file "*<<)>>
1480 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1483 am_indx=`expr "<<$>>am_indx" + 1`
1487 # Check whether LC_MESSAGES is available in <locale.h>.
1488 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1490 # This file file be copied and used freely without restrictions. It can
1491 # be used in projects which are not available under the GNU Public License
1492 # but which still want to provide support for the GNU gettext functionality.
1493 # Please note that the actual code is *not* freely available.
1497 AC_DEFUN(AC_LC_MESSAGES,
1498 [if test $ac_cv_header_locale_h = yes; then
1499 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1500 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1501 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1502 if test $ac_cv_val_LC_MESSAGES = yes; then
1503 AC_DEFINE(HAVE_LC_MESSAGES)