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 successfully 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
536 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
537 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
539 dnl Sanity check for existence of ISO C9X headers for extended encoding.
540 AC_CHECK_HEADER(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
541 AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
543 dnl Only continue checking if the ISO C9X headers exist.
544 if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes; then
546 dnl Test wchar.h for mbstate_t, which is needed for char_traits and others.
547 AC_MSG_CHECKING([for mbstate_t])
548 AC_TRY_COMPILE([#include <wchar.h>],
549 [mbstate_t teststate;],
550 use_native_mbstatet=yes, use_native_mbstatet=no)
551 AC_MSG_RESULT($use_native_mbstatet)
552 if test x"$use_native_mbstatet" = xno; then
553 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
556 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
557 dnl numeric_limits can instantiate type_traits<wchar_t>
558 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
559 AC_TRY_COMPILE([#include <wchar.h>],
560 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
561 has_wchar_minmax=yes, has_wchar_minmax=no)
562 AC_MSG_RESULT($has_wchar_minmax)
564 dnl Test wchar.h for WEOF, which is what we use to determine whether
565 dnl to specialize for char_traits<wchar_t> or not.
566 AC_MSG_CHECKING([for WEOF])
569 #include <stddef.h>],
571 has_weof=yes, has_weof=no)
572 AC_MSG_RESULT($has_weof)
574 dnl Tests for wide character functions used in char_traits<wchar_t>.
575 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset, ac_wfuncs=yes, ac_wfuncs=no)
577 AC_MSG_CHECKING([for ISO C9X wchar_t support])
578 if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes && test x"$ac_wfuncs" = xyes; then
579 ac_isoC9X_wchar_t=yes
583 AC_MSG_RESULT($ac_isoC9X_wchar_t)
585 dnl Use iconv for wchar_t to char conversions. As such, check for
586 dnl X/Open Portability Guide, version 2 features (XPG2).
587 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
588 AC_CHECK_FUNCS(iconv_open iconv_close iconv, ac_XPG2funcs=yes, ac_XPG2funcs=no)
590 AC_MSG_CHECKING([for XPG2 wchar_t support])
591 if test x"$ac_has_iconv_h" = xyes && test x"$ac_XPG2funcs" = xyes; then
596 AC_MSG_RESULT($ac_XPG2_wchar_t)
598 dnl At the moment, only enable wchar_t specializations if all the
599 dnl above support is present.
600 AC_MSG_CHECKING([for enabled wchar_t specializations])
601 if test x"$ac_isoC9X_wchar_t" = xyes && test x"$ac_XPG2_wchar_t" = xyes; then
602 libinst_wstring_la="libinst-wstring.la"
603 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
606 libinst_wstring_la=""
609 AC_SUBST(libinst_wstring_la)
612 AC_MSG_WARN([<wchar.h> not found])
613 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
619 dnl Check to see if this version of GNU C++ is afflicted by bugs in
620 dnl __complex__ float support.
622 dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy.
624 dnl GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT
625 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT, [
626 AC_REQUIRE([AC_PROG_CXX])
627 AC_MSG_CHECKING([for GNU C++ __complex__ float support])
628 AC_CACHE_VAL(glibcpp_cv_float_complex, [
632 cat > conftest.h <<EOB
634 // Check for buggy __complex__ that causes ICE in most versions of egcs
635 // and gcc-2.95.x on certain platforms (eg., x86-win32).
637 // See http://egcs.cygnus.com/ml/gcc-bugs/1999-07/msg00845.html for
638 // more info on the bug itself.
643 __complex__ float m_value;
644 float_complex (float = 0.0f, float = 0.0f);
645 float_complex (__complex__ float val) : m_value (val) {}
646 float_complex foo (const float_complex &val)
647 { return float_complex (~val.m_value); }
650 AC_TRY_COMPILE([#include "conftest.h"], ,
651 glibcpp_cv_float_complex=ok,
652 glibcpp_cv_float_complex=buggy
656 AC_MSG_RESULT($glibcpp_cv_float_complex)
657 if test $glibcpp_cv_float_complex = buggy; then
658 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
665 dnl Check to see if this version of GNU C++ is afflicted by bugs in
666 dnl __complex__ support.Check for buggy __complex__ that will cause ICE in
667 dnl gcc-2.95.x when using the library, unless we define the default copy
668 dnl ctor in the specializations of complex<>.
670 dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy.
672 dnl GLIBCPP_CHECK_COMPLEX_SUPPORT
673 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_SUPPORT, [
674 AC_REQUIRE([AC_PROG_CXX])
675 AC_MSG_CHECKING([for GNU C++ __complex__ support])
676 AC_CACHE_VAL(glibcpp_cv_complex, [
679 AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
680 dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
681 [ dcomplex x; f(x); ],
682 glibcpp_cv_complex=ok,
683 glibcpp_cv_complex=buggy
687 AC_MSG_RESULT($glibcpp_cv_complex)
688 if test $glibcpp_cv_complex = buggy; then
689 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
695 dnl Check for special debugging mode; not for production use.
697 dnl GLIBCPP_ENABLE_DEBUG
698 dnl --enable-debug sets '-ggdb -O0'.
699 dnl --disable-debug sets '-g' and whatever optimization options the
700 dnl compiler can handle.
701 dnl + Perhaps --enable-maintainer-mode should automatically turn this on?
702 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
703 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
704 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
705 dnl defaults to `no'.
706 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
707 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
709 changequote(<<, >>)dnl
710 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
712 [case "$enableval" in
713 yes) enable_debug=yes ;;
714 no) enable_debug=no ;;
715 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
717 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
718 dnl Option parsed, now set things appropriately
719 case "$enable_debug" in
721 DEBUGFLAGS='-O0 -ggdb'
732 dnl Check for "unusual" flags to pass to the compiler while building.
734 dnl GLIBCPP_ENABLE_CXX_FLAGS
735 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
736 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
737 dnl Somehow this same set of flags must be passed when [re]building
739 dnl --disable-cxx-flags passes nothing.
740 dnl + See http://sourceware.cygnus.com/ml/libstdc++/2000-q2/msg00131.html
741 dnl http://sourceware.cygnus.com/ml/libstdc++/2000-q2/msg00284.html
742 dnl http://sourceware.cygnus.com/ml/libstdc++/2000-q1/msg00035.html
743 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
744 dnl If "default flags" is an empty string (or "none"), the effect is
745 dnl the same as --disable or --enable=no.
746 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
747 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
748 AC_ARG_ENABLE(cxx-flags,
749 changequote(<<, >>)dnl
750 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
751 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
753 [case "x$enableval" in
754 xyes) AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
755 xno|x) enable_cxx_flags='' ;;
756 *) enable_cxx_flags="$enableval" ;;
758 enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')dnl
759 dnl Thinko on my part during design. This kludge is the workaround.
760 if test "$enable_cxx_flags" = "none"; then enable_cxx_flags=''; fi
761 dnl Run through flags (either default or command-line) and set anything
762 dnl extra (e.g., #defines) that must accompany particular g++ options.
763 if test -n "$enable_cxx_flags"; then
764 for f in $enable_cxx_flags; do
768 *) # and we're trying to pass /what/ exactly?
769 AC_MSG_ERROR([compiler flags start with a -]) ;;
773 EXTRA_CXX_FLAGS="$enable_cxx_flags"
774 AC_SUBST(EXTRA_CXX_FLAGS)
779 dnl Check for instructions to automatically rebuild libgcc.a. Requires,
780 dnl of course, the location of the gcc objdir. Note that if --disable-
781 dnl namespaces is in effect, rebuilding libgcc.a is an expensive no-op.
783 dnl GLIBCPP_ENABLE_RELIBGCC
784 dnl --enable-libgcc-rebuild=/absolute/path/to/gcc/objdir sets GCC_OBJDIR
785 dnl (presumably in the top-level Makefile) to /absol.../objdir
786 dnl --disable-libgcc-rebuild will not touch libgcc.a at all (maybe print
787 dnl a warning if this is given along with --enable-namespaces), by
788 dnl setting GCC_OBJDIR to `no'.
789 dnl + Doing this by default is going to be interesting. What default
790 dnl "on" value can there be?
791 dnl + Usage: GLIBCPP_ENABLE_RELIBGCC[(DEFAULT)]
792 dnl The default path should be ../.. if bundled with GCC source.
793 dnl If ommitted, it defaults to `no'.
795 AC_DEFUN(GLIBCPP_ENABLE_RELIBGCC, [dnl
796 define([GLIBCPP_ENABLE_RELIBGCC_DEFAULT], ifelse($1,, no, $1))dnl
797 AC_ARG_ENABLE(libgcc-rebuild,
798 changequote(<<, >>)dnl
799 << --enable-libgcc-rebuild=DIR also rebuild libgcc.a; DIR is
800 the GCC objdir; see install.html>>,
802 [case "$enableval" in
803 yes) AC_MSG_ERROR([--enable-libgcc-rebuild needs a pathname]) ;;
804 no) enable_libgcc_rebuild=no ;;
805 *) if test -d "$enableval" && test -d "${enableval}/gcc" && \
806 test -d "${enableval}/libiberty"
808 enable_libgcc_rebuild="$enableval"
810 AC_MSG_ERROR(["$enableval" does not appear to be the GCC objdir])
814 enable_libgcc_rebuild=GLIBCPP_ENABLE_RELIBGCC_DEFAULT)dnl
815 GCC_OBJDIR="$enable_libgcc_rebuild"
821 dnl Check for which I/O library to use: libio, or something specific.
823 dnl GLIBCPP_ENABLE_CSTDIO
824 dnl --enable-cstdio=libio sets config/c_io_libio.h and friends
828 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
829 AC_MSG_CHECKING([for cstdio to use])
830 AC_ARG_ENABLE(cstdio,
831 [ --enable-cstdio enable GNU libio for target io package. (default)
832 --enable-cstdio=LIB use LIB target-speific io package.],
833 if test x$enable_cstdio = xno; then
838 enable_cstdio_flag=$enable_cstdio
840 dnl Check if a valid thread package
841 case x${enable_cstdio_flag} in
842 xlibio | x | xno | xnone | xyes)
844 CSTDIO_H=c_io_libio.h
845 CSTDIO_CC=c_io_libio.cc
848 # see if we are on a system with libio native (ie, linux)
849 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
850 if test $has_libio = "yes"; then
854 BUILD_LIBIO_INCLUDE='-I../libio'
857 AC_SUBST(BUILD_LIBIO_INCLUDE)
859 # see if the _G_config.h header needs to be built.
860 # NB: This replaces the _G_CONFIG_H machinery in libio-v2
861 AC_CHECK_HEADER(_G_config.h, has_gconf_h=yes, has_gconf_h=no)
862 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO_CONFIG_H, test "$has_gconf_h" = no)
865 CSTDIO_H=c_io_wince.h
866 CSTDIO_CC=c_io_wince.cc
871 AC_SUBST(BUILD_LIBIO_INCLUDE)
874 echo "$enable_cstdio is an unknown io package" 1>&2
880 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
885 dnl Check for which threading library to use.
887 dnl GLIBCPP_ENABLE_THREADS
888 dnl --enable-threads=posix sets config/threads-posix.h et. al.
890 dnl default is no threads
892 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
893 dnl Note this comes from the gcc/config.in and libjava/config.in
894 dnl Efforts should be made to keep this in sync.
895 AC_MSG_CHECKING([for threads package to use])
896 AC_ARG_ENABLE(threads,
897 [ --enable-threads enable thread usage for target GCC.
898 --enable-threads=LIB use LIB thread package for target GCC.],
899 if test x$enable_threads = xno; then
904 enable_threads_flag=$enable_threads
906 dnl Check if a valid thread package
907 case x${enable_threads_flag} in
910 target_thread_file='single'
914 target_thread_file=''
916 xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
917 xsolaris | xwin32 | xdce | xvxworks)
918 target_thread_file=$enable_threads_flag
921 echo "$enable_threads is an unknown thread package" 1>&2
926 dnl Check for thread package actually supported in libstdc++
927 case "$target_thread_file" in
938 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
939 AC_MSG_ERROR(thread package $THREADS not yet supported)
942 AC_MSG_ERROR($THREADS is an unknown thread package)
945 AC_MSG_RESULT($THREADS)
955 AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
958 dnl Not presently used
959 dnl THREADOBJS=threads-posix.lo
960 THREADH=threads-posix.h
963 dnl Not presently used
964 dnl THREADOBJS=threads-no.lo
977 dnl Check for template specializations for the 'long long' type extension.
979 dnl GLIBCPP_ENABLE_LONG_LONG
980 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
981 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
982 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
983 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
984 dnl defaults to `no'.
985 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
987 dnl GLIBCPP_ENABLE_LONG_LONG
988 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
989 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
991 AC_ARG_ENABLE(long-long,
992 changequote(<<, >>)dnl
993 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
995 [case "$enableval" in
996 yes) enable_long_long=yes ;;
997 no) enable_long_long=no ;;
998 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1000 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1002 # Check for the existance of functions used if long long is enabled.
1003 AC_CHECK_FUNC(strtoll,,ac_strtoll=no)
1004 AC_CHECK_FUNC(strtoull,,ac_strtoull=no)
1006 AC_MSG_CHECKING([for enabled long long])
1007 if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then
1008 enable_long_long=no;
1010 AC_MSG_RESULT($enable_long_long)
1012 dnl Option parsed, now set things appropriately
1013 case "$enable_long_long" in
1014 yes) AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1021 dnl Check for whether or not to do shadowed C headers.
1023 dnl GLIBCPP_ENABLE_SHADOW
1024 dnl --enable-cshadow-headers [does stuff].
1025 dnl --disable-cshadow-headers [does not do stuff].
1026 dnl + This will eventually need to be on by default.
1027 dnl + Usage: GLIBCPP_ENABLE_SHADOW[(DEFAULT)]
1028 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1029 dnl defaults to `no'.
1030 AC_DEFUN(GLIBCPP_ENABLE_SHADOW, [dnl
1031 define([GLIBCPP_ENABLE_SHADOW_DEFAULT], ifelse($1, yes, yes, no))dnl
1032 AC_MSG_CHECKING([for enabled cshadow headers])
1033 AC_ARG_ENABLE(cshadow-headers,
1034 changequote(<<, >>)dnl
1035 << --enable-cshadow-headers construct "shadowed" C header files for
1036 g++ [default=>>GLIBCPP_ENABLE_SHADOW_DEFAULT],
1037 changequote([, ])dnl
1038 [case "$enableval" in
1039 yes) enable_cshadow_headers=yes
1041 no) enable_cshadow_headers=no
1043 *) AC_MSG_ERROR([Unknown argument to enable/disable shadowed C headers])
1046 enable_cshadow_headers=GLIBCPP_ENABLE_SHADOW_DEFAULT)dnl
1047 AC_MSG_RESULT($enable_cshadow_headers)
1048 dnl Option parsed, now set things appropriately
1049 case "$enable_cshadow_headers" in
1051 CSHADOWFLAGS="-D_ISOC9X_SOURCE"
1052 CSHADOW_INCLUDES=" -I$srcdir/shadow -I$blddir/cshadow"
1060 AC_SUBST(CSHADOWFLAGS)
1061 AC_SUBST(CSHADOW_INCLUDES)
1062 AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes)
1066 # Check whether LC_MESSAGES is available in <locale.h>.
1067 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1069 # This file file be copied and used freely without restrictions. It can
1070 # be used in projects which are not available under the GNU Public License
1071 # but which still want to provide support for the GNU gettext functionality.
1072 # Please note that the actual code is *not* freely available.
1076 AC_DEFUN(AC_LC_MESSAGES,
1077 [if test $ac_cv_header_locale_h = yes; then
1078 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1079 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1080 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1081 if test $ac_cv_val_LC_MESSAGES = yes; then
1082 AC_DEFINE(HAVE_LC_MESSAGES)
1087 # Check for functions in math library.
1088 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1090 # This file can be copied and used freely without restrictions. It can
1091 # be used in projects which are not available under the GNU Public License
1092 # but which still want to provide support for the GNU gettext functionality.
1093 # Please note that the actual code is *not* freely available.
1097 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1098 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1099 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])
1100 AC_SUBST(LIBMATHOBJS)dnl
1104 # Check for string functions.
1105 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1107 # This file can be copied and used freely without restrictions. It can
1108 # be used in projects which are not available under the GNU Public License
1109 # but which still want to provide support for the GNU gettext functionality.
1110 # Please note that the actual code is *not* freely available.
1114 dnl AC_REPLACE_STRINGFUNCS(FUNCTION...)
1115 AC_DEFUN(AC_REPLACE_STRINGFUNCS,
1116 [AC_CHECK_FUNCS([$1], , [LIBSTRINGOBJS="$LIBSTRINGOBJS ${ac_func}.lo"])
1117 AC_SUBST(LIBSTRINGOBJS)dnl
1120 # Do all the work for Automake. This macro actually does too much --
1121 # some checks are only needed if your package does certain things.
1122 # But this isn't really a big deal.
1127 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
1129 AC_DEFUN(AM_INIT_AUTOMAKE,
1130 [AC_REQUIRE([AC_PROG_INSTALL])
1135 dnl test to see if srcdir already configured
1136 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1137 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1140 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1141 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
1142 AC_REQUIRE([AM_SANITY_CHECK])
1143 AC_REQUIRE([AC_ARG_PROGRAM])
1144 dnl FIXME This is truly gross.
1145 missing_dir=`cd $ac_aux_dir && pwd`
1146 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
1147 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
1148 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
1149 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
1150 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
1151 AC_REQUIRE([AC_PROG_MAKE_SET])])
1154 # Check to make sure that the build environment is sane.
1157 AC_DEFUN(AM_SANITY_CHECK,
1158 [AC_MSG_CHECKING([whether build environment is sane])
1161 echo timestamp > conftestfile
1162 # Do `set' in a subshell so we don't clobber the current shell's
1163 # arguments. Must try -L first in case configure is actually a
1164 # symlink; some systems play weird games with the mod time of symlinks
1165 # (eg FreeBSD returns the mod time of the symlink's containing
1168 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1169 if test "[$]*" = "X"; then
1171 set X `ls -t $srcdir/configure conftestfile`
1173 if test "[$]*" != "X $srcdir/configure conftestfile" \
1174 && test "[$]*" != "X conftestfile $srcdir/configure"; then
1176 # If neither matched, then we have a broken ls. This can happen
1177 # if, for instance, CONFIG_SHELL is bash and it inherits a
1178 # broken ls alias from the environment. This has actually
1179 # happened. Such a system could not be considered "sane".
1180 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1181 alias in your environment])
1184 test "[$]2" = conftestfile
1190 AC_MSG_ERROR([newly created file is older than distributed files!
1191 Check your system clock])
1194 AC_MSG_RESULT(yes)])
1196 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1197 dnl The program must properly implement --version.
1198 AC_DEFUN(AM_MISSING_PROG,
1199 [AC_MSG_CHECKING(for working $2)
1200 # Run test in a subshell; some versions of sh will print an error if
1201 # an executable is not found, even if stderr is redirected.
1202 # Redirect stdin to placate older versions of autoconf. Sigh.
1203 if ($2 --version) < /dev/null > /dev/null 2>&1; then
1205 AC_MSG_RESULT(found)
1208 AC_MSG_RESULT(missing)
1212 # Add --enable-maintainer-mode option to configure.
1217 AC_DEFUN(AM_MAINTAINER_MODE,
1218 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1219 dnl maintainer-mode is disabled by default
1220 AC_ARG_ENABLE(maintainer-mode,
1221 [ --enable-maintainer-mode enable make rules and dependencies not useful
1222 (and sometimes confusing) to the casual installer],
1223 USE_MAINTAINER_MODE=$enableval,
1224 USE_MAINTAINER_MODE=no)
1225 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1226 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1227 MAINT=$MAINTAINER_MODE_TRUE
1232 # Define a conditional.
1234 AC_DEFUN(AM_CONDITIONAL,
1246 # serial 40 AC_PROG_LIBTOOL
1247 AC_DEFUN(AC_PROG_LIBTOOL,
1248 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
1250 # Save cache, so that ltconfig can load it
1253 # Actually configure libtool. ac_aux_dir is where install-sh is found.
1254 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
1255 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1256 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
1257 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
1258 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
1259 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
1260 || AC_MSG_ERROR([libtool configure failed])
1262 # Reload cache, that may have been modified by ltconfig
1265 # This can be used to rebuild libtool when needed
1266 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
1268 # Always use our own libtool.
1269 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1270 AC_SUBST(LIBTOOL)dnl
1272 # Redirect the config.log output again, so that the ltconfig log is not
1273 # clobbered by the next message.
1274 exec 5>>./config.log
1277 AC_DEFUN(AC_LIBTOOL_SETUP,
1279 AC_REQUIRE([AC_ENABLE_SHARED])dnl
1280 AC_REQUIRE([AC_ENABLE_STATIC])dnl
1281 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1282 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1283 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1284 AC_REQUIRE([AC_PROG_RANLIB])dnl
1285 AC_REQUIRE([AC_PROG_CC])dnl
1286 AC_REQUIRE([AC_PROG_LD])dnl
1287 AC_REQUIRE([AC_PROG_NM])dnl
1288 AC_REQUIRE([AC_PROG_LN_S])dnl
1292 NONE) lt_target="$host" ;;
1293 *) lt_target="$target" ;;
1296 # Check for any special flags to pass to ltconfig.
1297 libtool_flags="--cache-file=$cache_file"
1298 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
1299 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
1300 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
1301 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
1302 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
1303 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
1304 [libtool_flags="$libtool_flags --enable-dlopen"])
1305 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1306 [libtool_flags="$libtool_flags --enable-win32-dll"])
1307 AC_ARG_ENABLE(libtool-lock,
1308 [ --disable-libtool-lock avoid locking (might break parallel builds)])
1309 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
1310 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
1312 # Some flags need to be propagated to the compiler or linker for good
1314 case "$lt_target" in
1316 # Find out which ABI we are using.
1317 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1318 if AC_TRY_EVAL(ac_compile); then
1319 case "`/usr/bin/file conftest.o`" in
1335 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1336 SAVE_CFLAGS="$CFLAGS"
1337 CFLAGS="$CFLAGS -belf"
1338 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1339 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
1340 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1341 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1342 CFLAGS="$SAVE_CFLAGS"
1346 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1347 [*-*-cygwin* | *-*-mingw*)
1348 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1349 AC_CHECK_TOOL(AS, as, false)
1350 AC_CHECK_TOOL(OBJDUMP, objdump, false)
1356 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
1357 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
1359 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
1360 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
1362 # AC_ENABLE_SHARED - implement the --enable-shared flag
1363 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
1364 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1366 AC_DEFUN(AC_ENABLE_SHARED, [dnl
1367 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1368 AC_ARG_ENABLE(shared,
1369 changequote(<<, >>)dnl
1370 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
1371 changequote([, ])dnl
1372 [p=${PACKAGE-default}
1373 case "$enableval" in
1374 yes) enable_shared=yes ;;
1375 no) enable_shared=no ;;
1378 # Look at the argument we got. We use all the common list separators.
1379 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1380 for pkg in $enableval; do
1381 if test "X$pkg" = "X$p"; then
1388 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
1391 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
1392 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1393 AC_ENABLE_SHARED(no)])
1395 # AC_ENABLE_STATIC - implement the --enable-static flag
1396 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
1397 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1399 AC_DEFUN(AC_ENABLE_STATIC, [dnl
1400 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1401 AC_ARG_ENABLE(static,
1402 changequote(<<, >>)dnl
1403 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
1404 changequote([, ])dnl
1405 [p=${PACKAGE-default}
1406 case "$enableval" in
1407 yes) enable_static=yes ;;
1408 no) enable_static=no ;;
1411 # Look at the argument we got. We use all the common list separators.
1412 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1413 for pkg in $enableval; do
1414 if test "X$pkg" = "X$p"; then
1421 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
1424 # AC_DISABLE_STATIC - set the default static flag to --disable-static
1425 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1426 AC_ENABLE_STATIC(no)])
1429 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
1430 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
1431 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1433 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
1434 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
1435 AC_ARG_ENABLE(fast-install,
1436 changequote(<<, >>)dnl
1437 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
1438 changequote([, ])dnl
1439 [p=${PACKAGE-default}
1440 case "$enableval" in
1441 yes) enable_fast_install=yes ;;
1442 no) enable_fast_install=no ;;
1444 enable_fast_install=no
1445 # Look at the argument we got. We use all the common list separators.
1446 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1447 for pkg in $enableval; do
1448 if test "X$pkg" = "X$p"; then
1449 enable_fast_install=yes
1455 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
1458 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
1459 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1460 AC_ENABLE_FAST_INSTALL(no)])
1462 # AC_PROG_LD - find the path to the GNU or non-GNU linker
1463 AC_DEFUN(AC_PROG_LD,
1464 [AC_ARG_WITH(gnu-ld,
1465 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1466 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1467 AC_REQUIRE([AC_PROG_CC])dnl
1468 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1469 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1471 if test "$ac_cv_prog_gcc" = yes; then
1472 # Check if gcc -print-prog-name=ld gives a path.
1473 AC_MSG_CHECKING([for ld used by GCC])
1474 ac_prog=`($CC -print-prog-name=ld) 2>&5`
1476 # Accept absolute paths.
1478 [\\/]* | [A-Za-z]:[\\/]*)
1479 re_direlt='/[^/][^/]*/\.\./'
1481 # Canonicalize the path of ld
1482 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1483 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1484 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1486 test -z "$LD" && LD="$ac_prog"
1489 # If it fails, then pretend we aren't using GCC.
1493 # If it is relative, then search for the first ld in PATH.
1497 elif test "$with_gnu_ld" = yes; then
1498 AC_MSG_CHECKING([for GNU ld])
1500 AC_MSG_CHECKING([for non-GNU ld])
1502 AC_CACHE_VAL(ac_cv_path_LD,
1503 [if test -z "$LD"; then
1504 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1505 for ac_dir in $PATH; do
1506 test -z "$ac_dir" && ac_dir=.
1507 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1508 ac_cv_path_LD="$ac_dir/$ac_prog"
1509 # Check to see if the program is GNU ld. I'd rather use --version,
1510 # but apparently some GNU ld's only accept -v.
1511 # Break only if it was the GNU/non-GNU ld that we prefer.
1512 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1513 test "$with_gnu_ld" != no && break
1515 test "$with_gnu_ld" != yes && break
1521 ac_cv_path_LD="$LD" # Let the user override the test with a path.
1524 if test -n "$LD"; then
1529 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1533 AC_DEFUN(AC_PROG_LD_GNU,
1534 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
1535 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1536 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1537 ac_cv_prog_gnu_ld=yes
1539 ac_cv_prog_gnu_ld=no
1543 # AC_PROG_NM - find the path to a BSD-compatible name lister
1544 AC_DEFUN(AC_PROG_NM,
1545 [AC_MSG_CHECKING([for BSD-compatible nm])
1546 AC_CACHE_VAL(ac_cv_path_NM,
1547 [if test -n "$NM"; then
1548 # Let the user override the test.
1551 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1552 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1553 test -z "$ac_dir" && ac_dir=.
1554 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1555 # Check to see if the nm accepts a BSD-compat flag.
1556 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1557 # nm: unknown option "B" ignored
1558 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1559 ac_cv_path_NM="$ac_dir/nm -B"
1561 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1562 ac_cv_path_NM="$ac_dir/nm -p"
1565 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1566 continue # so that we can try to find one that supports BSD flags
1571 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1574 AC_MSG_RESULT([$NM])
1577 # AC_CHECK_LIBM - check for math library
1578 AC_DEFUN(AC_CHECK_LIBM,
1579 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1581 case "$lt_target" in
1582 *-*-beos* | *-*-cygwin*)
1583 # These system don't have libm
1586 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1587 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1590 AC_CHECK_LIB(m, main, LIBM="-lm")
1595 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1596 # the libltdl convenience library, adds --enable-ltdl-convenience to
1597 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1598 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1599 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1600 # '${top_builddir}/' (note the single quotes!) if your package is not
1601 # flat, and, if you're not using automake, define top_builddir as
1602 # appropriate in the Makefiles.
1603 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1604 case "$enable_ltdl_convenience" in
1605 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1606 "") enable_ltdl_convenience=yes
1607 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1609 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
1610 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1613 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1614 # the libltdl installable library, and adds --enable-ltdl-install to
1615 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1616 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1617 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1618 # '${top_builddir}/' (note the single quotes!) if your package is not
1619 # flat, and, if you're not using automake, define top_builddir as
1620 # appropriate in the Makefiles.
1621 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1622 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1623 AC_CHECK_LIB(ltdl, main,
1624 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1625 [if test x"$enable_ltdl_install" = xno; then
1626 AC_MSG_WARN([libltdl not installed, but installation disabled])
1628 enable_ltdl_install=yes
1631 if test x"$enable_ltdl_install" = x"yes"; then
1632 ac_configure_args="$ac_configure_args --enable-ltdl-install"
1633 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
1634 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1636 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1643 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
1644 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
1645 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
1646 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
1647 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
1648 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
1649 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
1651 dnl This is just to silence aclocal about the macro not being used
1652 ifelse([AC_DISABLE_FAST_INSTALL])dnl
1654 # Like AC_CONFIG_HEADER, but automatically create stamp file.
1656 AC_DEFUN(AM_CONFIG_HEADER,
1658 AC_CONFIG_HEADER([$1])
1659 dnl When config.status generates a header, we must update the stamp-h file.
1660 dnl This file resides in the same directory as the config header
1661 dnl that is generated. We must strip everything past the first ":",
1662 dnl and everything past the last "/".
1663 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1664 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1665 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1667 for am_file in <<$1>>; do
1668 case " <<$>>CONFIG_HEADERS " in
1669 *" <<$>>am_file "*<<)>>
1670 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1673 am_indx=`expr "<<$>>am_indx" + 1`