2 dnl Initialize configure bits.
4 dnl Define OPTLEVEL='-O2' if new inlining code present.
7 AC_DEFUN(GLIBCPP_CONFIGURE, [
8 dnl Default to --enable-multilib
9 AC_ARG_ENABLE(multilib,
10 [ --enable-multilib build hella library versions (default)],
11 [case "${enableval}" in
14 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
15 esac], [multilib=yes])dnl
17 glibcpp_basedir=$auxdir/$1/libstdc++-v3
18 AC_SUBST(glibcpp_basedir)
20 AM_INIT_AUTOMAKE(libstdc++, 2.91)
22 # Never versions of autoconf add an underscore to these functions.
23 # Prevent future problems ...
24 ifdef([AC_PROG_CC_G],[],[define([AC_PROG_CC_G],defn([_AC_PROG_CC_G]))])
25 ifdef([AC_PROG_CC_GNU],[],[define([AC_PROG_CC_GNU],defn([_AC_PROG_CC_GNU]))])
26 ifdef([AC_PROG_CXX_G],[],[define([AC_PROG_CXX_G],defn([_AC_PROG_CXX_G]))])
27 ifdef([AC_PROG_CXX_GNU],[],[define([AC_PROG_CXX_GNU],defn([_AC_PROG_CXX_GNU]))])
31 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
32 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
33 # are probably using a cross compiler, which will not be able to fully
34 # link an executable. This should really be fixed in autoconf
37 AC_DEFUN(LIB_AC_PROG_CC,
38 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
39 dnl Fool anybody using AC_PROG_CC.
40 AC_PROVIDE([AC_PROG_CC])
41 AC_CHECK_PROG(CC, gcc, gcc)
42 if test -z "$CC"; then
43 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
44 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
49 if test $ac_cv_prog_gcc = yes; then
51 dnl Check whether -g works, even if CFLAGS is set, in case the package
52 dnl plays around with CFLAGS (such as to build both debugging and
53 dnl normal versions of a library), tasteless as that idea is.
54 ac_test_CFLAGS="${CFLAGS+set}"
55 ac_save_CFLAGS="$CFLAGS"
58 if test "$ac_test_CFLAGS" = set; then
59 CFLAGS="$ac_save_CFLAGS"
60 elif test $ac_cv_prog_cc_g = yes; then
67 test "${CFLAGS+set}" = set || CFLAGS="-g"
73 # Can't just call these here as g++ requires libstc++ to be built....
76 # Likewise for AC_PROG_CXX.
77 AC_DEFUN(LIB_AC_PROG_CXX,
78 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
79 dnl Fool anybody using AC_PROG_CXX.
80 AC_PROVIDE([AC_PROG_CXX])
81 # Use glibcpp_CXX so that we do not cause CXX to be cached with the
82 # flags that come in CXX while configuring libstdc++. They're different
83 # from those used for all other target libraries. If CXX is set in
84 # the environment, respect that here.
86 AC_CHECK_PROGS(glibcpp_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
89 test -z "$glibcpp_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
93 if test $ac_cv_prog_gxx = yes; then
95 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
96 dnl plays around with CXXFLAGS (such as to build both debugging and
97 dnl normal versions of a library), tasteless as that idea is.
98 ac_test_CXXFLAGS="${CXXFLAGS+set}"
99 ac_save_CXXFLAGS="$CXXFLAGS"
102 if test "$ac_test_CXXFLAGS" = set; then
103 CXXFLAGS="$ac_save_CXXFLAGS"
104 elif test $ac_cv_prog_cxx_g = yes; then
111 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
117 AC_CHECK_TOOL(AS, as)
118 AC_CHECK_TOOL(AR, ar)
119 AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
120 AC_CHECK_TOOL(glibcpp_expect, expect, expect-not-found-in-path-error)
121 AC_CHECK_TOOL(glibcpp_runtest, runtest, runtest-not-found-in-path-error)
122 AC_SUBST(glibcpp_expect)
123 AC_SUBST(glibcpp_runtest)
128 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
129 # at least currently, we never actually build a program, so we never
130 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
131 # fails, because we are probably configuring with a cross compiler
132 # which cant create executables. So we include AC_EXEEXT to keep
133 # automake happy, but we dont execute it, since we dont care about
139 . [$]{glibcpp_basedir}/configure.host
141 case [$]{glibcpp_basedir} in
142 /* | [A-Za-z]:[\\/]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
143 *) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
146 # This does for the target what configure.host does for the host. In
147 # addition to possibly modifying the same flags, it also sets up symlinks.
153 dnl Check to see if g++ can compile this library, and if so, if any version-
154 dnl specific precautions need to be taken.
156 dnl GLIBCPP_CHECK_COMPILER_VERSION
157 AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
158 if test ! -f stamp-sanity-compiler; then
159 AC_MSG_CHECKING([for g++ that will successfully compile libstdc++-v3])
166 ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to GCC 3.0 or above]))
168 AC_MSG_RESULT($gpp_satisfactory)
169 touch stamp-sanity-compiler
175 dnl Test for newer compiler features, or features that are present in newer
176 dnl compiler version but not older compiler versions should be placed
179 dnl Define WERROR='-Werror' if requested and possible; g++'s that lack the
180 dnl new inlining code or the new system_header pragma will die on -Werror.
181 dnl Leave it out by default and use maint-mode to use it.
183 dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
184 dnl compiler supports it and the user has not requested debug mode.
186 dnl GLIBCPP_CHECK_COMPILER_FEATURES
187 AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
188 # All these tests are for C++; save the language and the compiler flags.
189 # The CXXFLAGS thing is suspicious, but based on similar bits
190 # found in GLIBCPP_CONFIGURE.
193 ac_test_CXXFLAGS="${CXXFLAGS+set}"
194 ac_save_CXXFLAGS="$CXXFLAGS"
196 # Check for maintainer-mode bits.
197 if test x"$USE_MAINTAINER_MODE" = xno; then
203 # Check for -ffunction-sections -fdata-sections
204 AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
205 CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
206 AC_TRY_COMPILE(, [int foo;
207 ], [ac_fdsections=yes], [ac_fdsections=no])
208 if test "$ac_test_CXXFLAGS" = set; then
209 CXXFLAGS="$ac_save_CXXFLAGS"
211 # this is the suspicious part
214 if test x"$ac_fdsections" = x"yes" && test x"$enable_debug" = x"no"; then
215 SECTION_FLAGS='-ffunction-sections -fdata-sections'
217 AC_MSG_RESULT($ac_fdsections)
221 AC_SUBST(SECTION_FLAGS)
226 dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
227 dnl the native linker is in use, all variables will be defined to something
228 dnl safe (like an empty string).
230 dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible.
231 dnl Define OPT_LDFLAGS='-Wl,-O1' if possible.
233 dnl GLIBCPP_CHECK_LINKER_FEATURES
234 AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
235 # If we're not using GNU ld, then there's no point in even trying these
236 # tests. Check for that first. We should have already tested for gld
237 # by now (in libtool), but require it now just to be safe...
240 AC_REQUIRE([AC_PROG_LD])
243 if test "$ac_cv_prog_gnu_ld" = "notbroken"; then
244 # GNU ld it is! Joy and bunny rabbits!
246 # All these tests are for C++; save the language and the compiler flags.
247 # Need to do this so that g++ won't try to link in libstdc++
248 ac_test_CFLAGS="${CFLAGS+set}"
249 ac_save_CFLAGS="$CFLAGS"
250 CFLAGS='-x c++ -Wl,--gc-sections'
252 # Check for -Wl,--gc-sections
253 # XXX This test is broken at the moment, as symbols required for
254 # linking are now in libsupc++ (not built yet.....). In addition,
255 # this test has cored on solaris in the past. In addition,
256 # --gc-sections doesn't really work at the moment (keeps on discarding
257 # used sections, first .eh_frame and now some of the glibc sections for
258 # iconv). Bzzzzt. Thanks for playing, maybe next time.
259 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
267 ], [ac_sectionLDflags=yes],[ac_sectionLFflags=no], [ac_sectionLDflags=yes])
268 if test "$ac_test_CFLAGS" = set; then
269 CFLAGS="$ac_save_CFLAGS"
271 # this is the suspicious part
274 if test "$ac_sectionLDflags" = "yes"; then
275 SECTION_LDFLAGS='-Wl,--gc-sections'
277 AC_MSG_RESULT($ac_sectionLDflags)
280 # Set linker optimization flags.
281 if test x"$ac_cv_prog_gnu_ld" = x"yes" && test x"$enable_debug" = x"no"; then
282 OPT_LDFLAGS='-Wl,-O1'
285 AC_SUBST(SECTION_LDFLAGS)
286 AC_SUBST(OPT_LDFLAGS)
291 dnl Check to see if the (math function) argument passed is
292 dnl declared when using the c++ compiler
293 dnl ASSUMES argument is a math function with ONE parameter
295 dnl GLIBCPP_CHECK_MATH_DECL_1
296 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_1, [
297 AC_MSG_CHECKING([for $1 declaration])
298 if test x${glibcpp_cv_func_$1_use+set} != xset; then
299 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
302 AC_TRY_COMPILE([#include <math.h>
308 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
312 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
316 dnl Check to see if the (math function) argument passed is
317 dnl 1) declared when using the c++ compiler
318 dnl 2) has "C" linkage
319 dnl 3) if not, see if 1) and 2) for argument prepended with '_'
321 dnl Define HAVE_CARGF etc if "cargf" is declared and links
323 dnl argument 1 is name of function to check
325 dnl ASSUMES argument is a math function with ONE parameter
327 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1
328 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
329 GLIBCPP_CHECK_MATH_DECL_1($1)
330 if test x$glibcpp_cv_func_$1_use = x"yes"; then
333 GLIBCPP_CHECK_MATH_DECL_1(_$1)
334 if test x$glibcpp_cv_func__$1_use = x"yes"; then
342 dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
343 dnl of functions at once. It's an all-or-nothing check -- either
344 dnl HAVE_XYZ is defined for each of the functions, or for none of them.
345 dnl Doing it this way saves significant configure time.
346 AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
347 AC_MSG_CHECKING([for $1 functions])
348 AC_CACHE_VAL(glibcpp_cv_func_$2_use, [
351 AC_TRY_COMPILE([#include <math.h>],
352 [ `for x in $3; do echo "$x (0);"; done` ],
353 [glibcpp_cv_func_$2_use=yes],
354 [glibcpp_cv_func_$2_use=no])
356 AC_MSG_RESULT($glibcpp_cv_func_$2_use)
357 if test x$glibcpp_cv_func_$2_use = x"yes"; then
363 dnl Check to see if the (math function) argument passed is
364 dnl declared when using the c++ compiler
365 dnl ASSUMES argument is a math function with ONE parameter
367 dnl GLIBCPP_CHECK_MATH_DECL_2
368 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_2, [
369 AC_MSG_CHECKING([for $1 declaration])
370 if test x${glibcpp_cv_func_$1_use+set} != xset; then
371 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
374 AC_TRY_COMPILE([#include <math.h>],
376 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
380 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
384 dnl Check to see if the (math function) argument passed is
385 dnl 1) declared when using the c++ compiler
386 dnl 2) has "C" linkage
388 dnl Define HAVE_CARGF etc if "cargf" is declared and links
390 dnl argument 1 is name of function to check
392 dnl ASSUMES argument is a math function with TWO parameters
394 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2
395 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
396 GLIBCPP_CHECK_MATH_DECL_2($1)
397 if test x$glibcpp_cv_func_$1_use = x"yes"; then
400 GLIBCPP_CHECK_MATH_DECL_2(_$1)
401 if test x$glibcpp_cv_func__$1_use = x"yes"; then
409 dnl Check to see if the (math function) argument passed is
410 dnl declared when using the c++ compiler
411 dnl ASSUMES argument is a math function with ONE parameter
413 dnl GLIBCPP_CHECK_MATH_DECL_3
414 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_3, [
415 AC_MSG_CHECKING([for $1 declaration])
416 if test x${glibcpp_cv_func_$1_use+set} != xset; then
417 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
420 AC_TRY_COMPILE([#include <math.h>],
422 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
426 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
430 dnl Check to see if the (math function) argument passed is
431 dnl 1) declared when using the c++ compiler
432 dnl 2) has "C" linkage
434 dnl Define HAVE_CARGF etc if "cargf" is declared and links
436 dnl argument 1 is name of function to check
438 dnl ASSUMES argument is a math function with THREE parameters
440 dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3
441 AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
442 GLIBCPP_CHECK_MATH_DECL_3($1)
443 if test x$glibcpp_cv_func_$1_use = x"yes"; then
446 GLIBCPP_CHECK_MATH_DECL_3(_$1)
447 if test x$glibcpp_cv_func__$1_use = x"yes"; then
455 dnl Check to see if the (stdlib function) argument passed is
456 dnl 1) declared when using the c++ compiler
457 dnl 2) has "C" linkage
459 dnl argument 1 is name of function to check
461 dnl ASSUMES argument is a math function with TWO parameters
463 dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2
464 AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
465 AC_MSG_CHECKING([for $1 declaration])
466 if test x${glibcpp_cv_func_$1_use+set} != xset; then
467 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
470 AC_TRY_COMPILE([#include <stdlib.h>],
472 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
476 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
477 if test x$glibcpp_cv_func_$1_use = x"yes"; then
484 dnl Because the builtins are picky picky picky about the arguments they take,
485 dnl do an explict linkage tests here.
486 dnl Check to see if the (math function) argument passed is
487 dnl 1) declared when using the c++ compiler
488 dnl 2) has "C" linkage
490 dnl Define HAVE_CARGF etc if "cargf" is declared and links
492 dnl argument 1 is name of function to check
494 dnl ASSUMES argument is a math function with ONE parameter
496 dnl GLIBCPP_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
497 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
498 AC_MSG_CHECKING([for $1 declaration])
499 if test x${glibcpp_cv_func_$1_use+set} != xset; then
500 AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
503 AC_TRY_COMPILE([#include <math.h>],
505 [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
509 AC_MSG_RESULT($glibcpp_cv_func_$1_use)
510 if test x$glibcpp_cv_func_$1_use = x"yes"; then
511 AC_MSG_CHECKING([for $1 linkage])
512 if test x${glibcpp_cv_func_$1_link+set} != xset; then
513 AC_CACHE_VAL(glibcpp_cv_func_$1_link, [
514 AC_TRY_LINK([#include <math.h>],
516 [glibcpp_cv_func_$1_link=yes], [glibcpp_cv_func_$1_link=no])
519 AC_MSG_RESULT($glibcpp_cv_func_$1_link)
520 if test x$glibcpp_cv_func_$1_link = x"yes"; then
521 ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
522 AC_DEFINE_UNQUOTED(${ac_tr_func})
529 dnl Check to see what builtin math functions are supported
531 dnl check for __builtin_abs
532 dnl check for __builtin_fabsf
533 dnl check for __builtin_fabs
534 dnl check for __builtin_fabl
535 dnl check for __builtin_labs
536 dnl check for __builtin_sqrtf
537 dnl check for __builtin_sqrtl
538 dnl check for __builtin_fsqrt
539 dnl check for __builtin_sinf
540 dnl check for __builtin_sin
541 dnl check for __builtin_sinl
542 dnl check for __builtin_cosf
543 dnl check for __builtin_cos
544 dnl check for __builtin_cosl
546 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
547 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
548 dnl Test for builtin math functions.
549 dnl These are made in gcc/c-common.c
550 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
551 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
552 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
553 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
554 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
556 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
557 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fsqrt)
558 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
560 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
561 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
562 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
564 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
565 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
566 GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
568 dnl There is, without a doubt, a more elegant way to have these
569 dnl names exported so that they won't be stripped out of acconfig.h by
570 dnl autoheader. I leave this as an exercise to somebody less frustrated
571 dnl than I.... please email the libstdc++ list if you can figure out a
572 dnl more elegant approach (see autoconf/acgen.m4 and specifically
573 dnl AC_CHECK_FUNC for things to steal.)
575 if test x$dummyvar = x"yes"; then
576 AC_DEFINE(HAVE___BUILTIN_ABS)
577 AC_DEFINE(HAVE___BUILTIN_LABS)
578 AC_DEFINE(HAVE___BUILTIN_COS)
579 AC_DEFINE(HAVE___BUILTIN_COSF)
580 AC_DEFINE(HAVE___BUILTIN_COSL)
581 AC_DEFINE(HAVE___BUILTIN_FABS)
582 AC_DEFINE(HAVE___BUILTIN_FABSF)
583 AC_DEFINE(HAVE___BUILTIN_FABSL)
584 AC_DEFINE(HAVE___BUILTIN_SIN)
585 AC_DEFINE(HAVE___BUILTIN_SINF)
586 AC_DEFINE(HAVE___BUILTIN_SINL)
587 AC_DEFINE(HAVE___BUILTIN_FSQRT)
588 AC_DEFINE(HAVE___BUILTIN_SQRTF)
589 AC_DEFINE(HAVE___BUILTIN_SQRTL)
595 dnl Check to see what the underlying c library
596 dnl These checks need to do two things:
597 dnl 1) make sure the name is declared when using the c++ compiler
598 dnl 2) make sure the name has "C" linkage
599 dnl This might seem like overkill but experience has shown that it's not...
601 dnl Define HAVE_STRTOLD if "strtold" is declared and links
602 dnl Define HAVE_STRTOF if "strtof" is declared and links
603 dnl Define HAVE_DRAND48 if "drand48" is declared and links
605 dnl GLIBCPP_CHECK_STDLIB_SUPPORT
606 AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
607 ac_test_CXXFLAGS="${CXXFLAGS+set}"
608 ac_save_CXXFLAGS="$CXXFLAGS"
609 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
611 AC_CHECK_FUNCS(strtof)
612 GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
613 AC_CHECK_FUNCS(drand48)
615 CXXFLAGS="$ac_save_CXXFLAGS"
620 dnl Check to see what the underlying c library or math library is like.
621 dnl These checks need to do two things:
622 dnl 1) make sure the name is declared when using the c++ compiler
623 dnl 2) make sure the name has "C" linkage
624 dnl This might seem like overkill but experience has shown that it's not...
626 dnl Define HAVE_CARGF etc if "cargf" is found.
628 dnl GLIBCPP_CHECK_MATH_SUPPORT
629 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
630 ac_test_CXXFLAGS="${CXXFLAGS+set}"
631 ac_save_CXXFLAGS="$CXXFLAGS"
632 CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
635 AC_CHECK_LIB(m, sin, libm="-lm")
639 dnl Check to see if certain C math functions exist.
640 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
641 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
642 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
643 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
644 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
645 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
646 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
648 dnl Check to see if basic C math functions have float versions.
649 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
654 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
657 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
658 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
659 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
660 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
661 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
662 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
663 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
664 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
665 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
666 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
667 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
668 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
669 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
671 dnl Check to see if basic C math functions have long double versions.
672 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
677 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
680 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
681 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
682 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
683 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
684 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
685 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
686 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
687 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
688 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
689 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
690 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
691 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
692 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
693 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
694 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
695 GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
697 dnl Some runtimes have these functions with a preceding underscore. Please
698 dnl keep this sync'd with the one above. And if you add any new symbol,
699 dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
700 dnl Check to see if certain C math functions exist.
702 dnl Check to see if basic C math functions have float versions.
703 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
705 _acosf _asinf _atanf \
707 _coshf _sinhf _tanhf)
708 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
712 dnl Check to see if basic C math functions have long double versions.
713 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
715 _acosl _asinl _atanl \
717 _coshl _sinhl _tanhl)
718 GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
723 CXXFLAGS="$ac_save_CXXFLAGS"
728 dnl Check to see if there is native support for complex
730 dnl Don't compile bits in math/* if native support exits.
732 dnl Define USE_COMPLEX_LONG_DOUBLE etc if "atan2l/copysignl" is found.
734 dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
735 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
736 dnl Check for complex versions of math functions of platform.
737 AC_CHECK_LIB(m, main)
738 AC_REPLACE_MATHFUNCS(nan hypot hypotf atan2f expf copysignf)
740 dnl Compile the long double complex functions only if the function
741 dnl provides the non-complex long double functions that are needed.
742 dnl Currently this includes copysignl and atan2l, which should be
743 dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
744 USE_COMPLEX_LONG_DOUBLE=no
745 if test x$ac_cv_func_atan2l = x"yes" \
746 && test x$ac_cv_func_copysignl = x"yes"; then
747 USE_COMPLEX_LONG_DOUBLE=yes
748 AC_REPLACE_MATHFUNCS(hypotl signbitl)
751 AC_SUBST(USE_COMPLEX_LONG_DOUBLE)
755 dnl Check to see what architecture and operating system we are compiling
756 dnl for. Also, if architecture- or OS-specific flags are required for
757 dnl compilation, pick them up here.
759 dnl GLIBCPP_CHECK_TARGET
760 AC_DEFUN(GLIBCPP_CHECK_TARGET, [
761 . [$]{glibcpp_basedir}/configure.target
762 AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
763 AC_MSG_RESULT(OS config directory is $os_include_dir)
764 AC_LINK_FILES($os_include_dir/bits/os_defines.h, include/bits/os_defines.h)
769 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
770 dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
771 dnl must have been previously checked.)
773 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
774 dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
776 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
777 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
779 dnl Test wchar.h for mbstate_t, which is needed for char_traits and
780 dnl others even if wchar_t support is not on.
781 AC_MSG_CHECKING([for mbstate_t])
782 AC_TRY_COMPILE([#include <wchar.h>],
783 [mbstate_t teststate;],
784 have_mbstate_t=yes, have_mbstate_t=no)
785 AC_MSG_RESULT($have_mbstate_t)
786 if test x"$have_mbstate_t" = xyes; then
787 AC_DEFINE(HAVE_MBSTATE_T)
790 dnl Sanity check for existence of ISO C99 headers for extended encoding.
791 AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
792 AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
794 dnl Only continue checking if the ISO C99 headers exist and support is on.
795 if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes \
796 && test x"$enable_c_mbchar" != xno; then
798 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
799 dnl numeric_limits can instantiate type_traits<wchar_t>
800 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
801 AC_TRY_COMPILE([#include <wchar.h>],
802 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
803 has_wchar_minmax=yes, has_wchar_minmax=no)
804 AC_MSG_RESULT($has_wchar_minmax)
806 dnl Test wchar.h for WEOF, which is what we use to determine whether
807 dnl to specialize for char_traits<wchar_t> or not.
808 AC_MSG_CHECKING([for WEOF])
811 #include <stddef.h>],
813 has_weof=yes, has_weof=no)
814 AC_MSG_RESULT($has_weof)
816 dnl Tests for wide character functions used in char_traits<wchar_t>.
817 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset \
818 wcsrtombs mbsrtowcs, ac_wfuncs=yes, ac_wfuncs=no)
820 AC_MSG_CHECKING([for ISO C99 wchar_t support])
821 if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes \
822 && test x"$ac_wfuncs" = xyes; then
823 ac_isoC99_wchar_t=yes
827 AC_MSG_RESULT($ac_isoC99_wchar_t)
829 dnl Use iconv for wchar_t to char conversions. As such, check for
830 dnl X/Open Portability Guide, version 2 features (XPG2).
831 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
832 AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
834 dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
835 AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
837 LIBS="$LIBS $libiconv"
839 AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
840 ac_XPG2funcs=yes, ac_XPG2funcs=no)
844 AC_MSG_CHECKING([for XPG2 wchar_t support])
845 if test x"$ac_has_iconv_h" = xyes && test x"$ac_has_langinfo_h" = xyes \
846 && test x"$ac_XPG2funcs" = xyes; then
851 AC_MSG_RESULT($ac_XPG2_wchar_t)
853 dnl At the moment, only enable wchar_t specializations if all the
854 dnl above support is present.
855 AC_MSG_CHECKING([for enabled wchar_t specializations])
856 if test x"$ac_isoC99_wchar_t" = xyes \
857 && test x"$ac_XPG2_wchar_t" = xyes; then
858 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
864 dnl Wide characters disabled by the user.
865 AC_MSG_WARN([wchar_t support disabled.])
871 dnl Check to see if this version of GNU C++ is afflicted by bugs in
872 dnl __complex__ float support.
874 dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy.
876 dnl Check to see if this version of GNU C++ is afflicted by bugs in
877 dnl __complex__ support.Check for buggy __complex__ that will cause ICE in
878 dnl gcc-2.95.x when using the library, unless we define the default copy
879 dnl ctor in the specializations of complex<>.
881 dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy.
882 dnl GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
883 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT, [
884 AC_REQUIRE([AC_PROG_CXX])
886 AC_MSG_CHECKING([for GNU C++ __complex__ support])
887 AC_CACHE_VAL(glibcpp_cv_complex, [
890 AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
891 dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
892 [ dcomplex x; f(x); ],
893 glibcpp_cv_complex=ok,
894 glibcpp_cv_complex=buggy
898 AC_MSG_RESULT($glibcpp_cv_complex)
899 if test $glibcpp_cv_complex = buggy; then
900 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
903 AC_MSG_CHECKING([for GNU C++ __complex__ float support])
904 AC_CACHE_VAL(glibcpp_cv_float_complex, [
908 cat > conftest.h <<EOB
910 // Check for buggy __complex__ that causes ICE in most versions of egcs
911 // and gcc-2.95.x on certain platforms (eg., x86-win32).
913 // See http://gcc.gnu.org/ml/gcc-bugs/1999-07n/msg00845.html for
914 // more info on the bug itself.
919 __complex__ float m_value;
920 float_complex (float = 0.0f, float = 0.0f);
921 float_complex (__complex__ float val) : m_value (val) {}
922 float_complex foo (const float_complex &val)
923 { return float_complex (~val.m_value); }
926 AC_TRY_COMPILE([#include "conftest.h"], ,
927 glibcpp_cv_float_complex=ok,
928 glibcpp_cv_float_complex=buggy
932 AC_MSG_RESULT($glibcpp_cv_float_complex)
933 if test $glibcpp_cv_float_complex = buggy; then
934 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
940 dnl Check for special debugging mode; not for production use.
942 dnl GLIBCPP_ENABLE_DEBUG
943 dnl --enable-debug sets '-ggdb3 -O0'.
944 dnl --disable-debug sets '-g' and whatever optimization options the
945 dnl compiler can handle.
946 dnl + --enable-maintainer-mode automatically defaults this to on.
947 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
948 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
949 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
950 dnl defaults to `no'.
951 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
952 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
954 changequote(<<, >>)dnl
955 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
957 [case "${enableval}" in
958 yes) enable_debug=yes ;;
959 no) enable_debug=no ;;
960 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
962 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
964 dnl Option parsed, now set things appropriately
965 case "${enable_debug}" in
967 DEBUG_FLAGS='-O0 -ggdb3'
973 AC_SUBST(DEBUG_FLAGS)
978 dnl Check for "unusual" flags to pass to the compiler while building.
980 dnl GLIBCPP_ENABLE_CXX_FLAGS
981 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
982 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
983 dnl Somehow this same set of flags must be passed when [re]building
985 dnl --disable-cxx-flags passes nothing.
986 dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
987 dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
988 dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
989 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
990 dnl If "default flags" is an empty string (or "none"), the effect is
991 dnl the same as --disable or --enable=no.
992 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
993 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
994 AC_ARG_ENABLE(cxx-flags,
995 changequote(<<, >>)dnl
996 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
997 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
999 [case "x$enableval" in
1001 AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
1003 enable_cxx_flags='' ;;
1005 enable_cxx_flags="$enableval" ;;
1007 enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
1009 dnl Thinko on my part during design. This kludge is the workaround.
1010 if test "$enable_cxx_flags" = "none"; then
1011 enable_cxx_flags='';
1014 dnl Run through flags (either default or command-line) and set anything
1015 dnl extra (e.g., #defines) that must accompany particular g++ options.
1016 if test -n "$enable_cxx_flags"; then
1017 for f in $enable_cxx_flags; do
1021 *) # and we're trying to pass /what/ exactly?
1022 AC_MSG_ERROR([compiler flags start with a -]) ;;
1026 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1027 AC_SUBST(EXTRA_CXX_FLAGS)
1032 dnl Check for which locale library to use: gnu or generic.
1034 dnl GLIBCPP_ENABLE_CLOCALE
1035 dnl --enable-clocale=gnu sets config/c_locale_gnu.cc and friends
1036 dnl --enable-clocale=generic sets config/c_locale_generic.cc and friends
1038 dnl default is generic
1040 AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
1041 AC_MSG_CHECKING([for clocale to use])
1042 AC_ARG_ENABLE(clocale,
1043 [ --enable-clocale enable model for target locale package.
1044 --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
1046 if test x$enable_clocale = xno; then
1047 enable_clocale=generic
1049 enable_clocale=generic)
1051 enable_clocale_flag=$enable_clocale
1053 dnl Check if a valid locale package
1054 case x${enable_clocale_flag} in
1056 CLOCALE_H=config/c_locale_gnu.h
1057 CLOCALE_CC=config/c_locale_gnu.cc
1061 CLOCALE_H=config/c_locale_generic.h
1062 CLOCALE_CC=config/c_locale_generic.cc
1063 AC_MSG_RESULT(generic)
1066 echo "$enable_clocale is an unknown locale package" 1>&2
1071 AC_LINK_FILES($CLOCALE_H, include/bits/c++locale.h)
1072 AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
1077 dnl Check for which I/O library to use: libio, or something specific.
1079 dnl GLIBCPP_ENABLE_CSTDIO
1080 dnl --enable-cstdio=libio sets config/c_io_libio.h and friends
1082 dnl default is stdio
1084 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
1085 AC_MSG_CHECKING([for cstdio to use])
1086 AC_ARG_ENABLE(cstdio,
1087 [ --enable-cstdio enable stdio for target io package.
1088 --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
1090 if test x$enable_cstdio = xno; then
1093 enable_cstdio=stdio)
1095 enable_cstdio_flag=$enable_cstdio
1097 dnl Check if a valid I/O package
1098 case x${enable_cstdio_flag} in
1100 CSTDIO_H=config/c_io_libio.h
1101 BASIC_FILE_H=config/basic_file_libio.h
1102 BASIC_FILE_CC=config/basic_file_libio.cc
1103 AC_MSG_RESULT(libio)
1105 # see if we are on a system with libio native (ie, linux)
1106 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
1108 # Need to check and see what version of glibc is being used. If
1109 # it's not glibc-2.2 or higher, then we'll need to go ahead and
1110 # compile most of libio for linux systems.
1111 if test x$has_libio = x"yes"; then
1114 AC_MSG_CHECKING([for glibc version >= 2.2])
1115 AC_EGREP_CPP([ok], [
1116 #include <features.h>
1117 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
1120 ], glibc_satisfactory=yes, glibc_satisfactory=no)
1121 AC_MSG_RESULT($glibc_satisfactory)
1125 # XXX at the moment, admit defeat and force the recompilation
1126 # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
1127 glibc_satisfactory=no
1129 if test x$glibc_satisfactory = x"yes"; then
1134 # bkoz XXX need to add checks to enable this
1135 # pme XXX here's a first pass at such a check
1136 if test x$enable_c_mbchar != xno; then
1144 # Using libio, but <libio.h> doesn't exist on the target system. . .
1146 # bkoz XXX need to add checks to enable this
1147 # pme XXX here's a first pass at such a check
1148 if test x$enable_c_mbchar != xno; then
1155 xstdio | x | xno | xnone | xyes)
1157 CSTDIO_H=config/c_io_stdio.h
1158 BASIC_FILE_H=config/basic_file_stdio.h
1159 BASIC_FILE_CC=config/basic_file_stdio.cc
1160 AC_MSG_RESULT(stdio)
1162 # We're not using stdio.
1167 echo "$enable_cstdio is an unknown io package" 1>&2
1171 AC_LINK_FILES($CSTDIO_H, include/bits/c++io.h)
1172 AC_LINK_FILES($BASIC_FILE_H, include/bits/basic_file_model.h)
1173 AC_LINK_FILES($BASIC_FILE_CC, src/basic_file.cc)
1175 # 2000-08-04 bkoz hack
1176 CCODECVT_C=config/c_io_libio_codecvt.c
1177 AC_LINK_FILES($CCODECVT_C, libio/c_codecvt.c)
1178 # 2000-08-04 bkoz hack
1180 AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
1181 test "$need_libio" = yes || test "$need_wlibio" = yes)
1182 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
1183 AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
1184 if test "$need_libio" = yes || test "$need_wlibio" = yes; then
1185 libio_la=../libio/libio.la
1194 dnl Check for which threading library to use.
1196 dnl GLIBCPP_ENABLE_THREADS
1197 dnl --enable-threads=posix sets config/threads-posix.h et. al.
1199 dnl Default is no threads, which also disables _IO_MTSAFE_IO in
1200 dnl libio. Any actual thread package will enable it.
1202 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
1203 AC_MSG_CHECKING([for thread model used by GCC])
1204 target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
1205 AC_MSG_RESULT([$target_thread_file])
1207 dnl Check for thread package actually supported in libstdc++
1209 case "$target_thread_file" in
1211 THREADH=threads-no.h
1214 THREADH=threads-posix.h
1216 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
1217 AC_MSG_WARN(disabling unsupported thread package $target_thread_file)
1218 THREADH=threads-no.h
1221 AC_MSG_ERROR($target_thread_file: unsupported/unknown thread package)
1225 AC_LINK_FILES(config/$THREADH, include/bits/c++threads.h)
1226 if test $THREADH != threads-no.h; then
1227 AC_DEFINE(_GLIBCPP_USE_THREADS)
1233 dnl Check for exception handling support. If an explicit enable/disable
1234 dnl sjlj exceptions is given, we don't have to detect. Otherwise the
1235 dnl target may or may not support call frame exceptions.
1237 dnl GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
1238 dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
1239 dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
1241 dnl Define _GLIBCPP_SJLJ_EXCEPTIONS if the compiler is configured for it.
1243 AC_DEFUN(GLIBCPP_ENABLE_SJLJ_EXCEPTIONS, [
1244 AC_MSG_CHECKING([for exception model to use])
1247 AC_ARG_ENABLE(sjlj-exceptions,
1248 [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
1250 [dnl Botheration. Now we've got to detect the exception model.
1251 dnl Link tests against libgcc.a are problematic since -- at least
1252 dnl as of this writing -- we've not been given proper -L bits for
1253 dnl single-tree newlib and libgloss.
1255 dnl This is what AC_TRY_COMPILE would do if it didn't delete the
1256 dnl conftest files before we got a change to grep them first.
1257 cat > conftest.$ac_ext << EOF
1258 [#]line __oline__ "configure"
1267 old_CXXFLAGS="$CXXFLAGS"
1269 if AC_TRY_EVAL(ac_compile); then
1270 if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
1271 enable_sjlj_exceptions=yes
1272 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
1273 enable_sjlj_exceptions=no
1276 CXXFLAGS="$old_CXXFLAGS"
1278 if test x$enable_sjlj_exceptions = xyes; then
1279 AC_DEFINE(_GLIBCPP_SJLJ_EXCEPTIONS, 1,
1280 [Define if the compiler is configured for setjmp/longjmp exceptions.])
1281 ac_exception_model_name=sjlj
1282 elif test x$enable_sjlj_exceptions = xno; then
1283 ac_exception_model_name="call frame"
1285 AC_MSG_ERROR([unable to detect exception model])
1288 AC_MSG_RESULT($ac_exception_model_name)
1293 dnl Check for ISO/IEC 9899:1999 "C99" support.
1295 dnl GLIBCPP_ENABLE_C99
1296 dnl --enable-c99 defines _GLIBCPP_USE_C99
1297 dnl --disable-c99 leaves _GLIBCPP_USE_C99 undefined
1298 dnl + Usage: GLIBCPP_ENABLE_C99[(DEFAULT)]
1299 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1300 dnl defaults to `no'.
1301 dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
1303 dnl GLIBCPP_ENABLE_C99
1304 AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
1305 define([GLIBCPP_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
1308 changequote(<<, >>)dnl
1309 <<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCPP_ENABLE_C99_DEFAULT],
1310 changequote([, ])dnl
1311 [case "$enableval" in
1312 yes) enable_c99=yes ;;
1313 no) enable_c99=no ;;
1314 *) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
1316 enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
1321 # Check for the existence of <math.h> functions used if C99 is enabled.
1322 AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
1323 AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
1324 AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
1325 AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
1326 AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
1327 AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
1328 AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
1329 AC_TRY_COMPILE([#include <math.h>],
1330 [isgreaterequal(0.0,0.0);], , [ac_c99_math=no])
1331 AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
1332 AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
1333 AC_TRY_COMPILE([#include <math.h>],
1334 [islessgreater(0.0,0.0);], , [ac_c99_math=no])
1335 AC_TRY_COMPILE([#include <math.h>],
1336 [isunordered(0.0,0.0);], , [ac_c99_math=no])
1338 # Check for the existence in <stdlib.h> of lldiv_t, et. al.
1339 AC_CHECK_FUNC(strtoll,,ac_c99_stdlib=no)
1340 AC_CHECK_FUNC(strtoull,,ac_c99_stdlib=no)
1341 AC_CHECK_FUNC(llabs,,ac_c99_stdlib=no)
1342 AC_CHECK_FUNC(lldiv,,ac_c99_stdlib=no)
1343 AC_CHECK_FUNC(atoll,,ac_c99_stdlib=no)
1345 AC_MSG_CHECKING([for lldiv_t declaration])
1346 AC_CACHE_VAL(ac_c99_lldiv_t, [
1347 AC_TRY_COMPILE([#include <stdlib.h>],
1349 [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
1351 AC_MSG_RESULT($ac_c99_lldiv_t)
1352 if test x"$ac_c99_lldiv_t" = x"no"; then
1356 # Check for the existence of <wchar.h> functions used if C99 is enabled.
1357 AC_CHECK_FUNC(wcstold,,ac_c99_wchar=no)
1358 AC_CHECK_FUNC(wcstoll,,ac_c99_wchar=no)
1359 AC_CHECK_FUNC(wcstoull,,ac_c99_wchar=no)
1361 AC_MSG_CHECKING([for enabled ISO C99 support])
1362 if test x"$ac_c99_math" = x"no" || test x"$ac_c99_wchar" = x"no" \
1363 || test x"$ac_c99_stdlib" = x"no"; then
1366 AC_MSG_RESULT($enable_c99)
1368 # Option parsed, now set things appropriately
1369 if test x"$enable_c99" = x"yes"; then
1370 AC_DEFINE(_GLIBCPP_USE_C99)
1378 dnl Check for template specializations for the 'long long' type extension.
1379 dnl NB: Must check for C99 support before calling _GLIBCPP_ENABLE_LONG_LONG
1381 dnl GLIBCPP_ENABLE_LONG_LONG
1382 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
1383 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
1384 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
1385 dnl Where DEFAULT is either `yes' or `no'. If omitted, it
1386 dnl defaults to `no'.
1387 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1389 dnl GLIBCPP_ENABLE_LONG_LONG
1390 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
1391 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
1393 AC_ARG_ENABLE(long-long,
1394 changequote(<<, >>)dnl
1395 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
1396 changequote([, ])dnl
1397 [case "$enableval" in
1398 yes) enable_long_long=yes ;;
1399 no) enable_long_long=no ;;
1400 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
1402 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1404 # iostreams require strtoll, strtoull to compile. If the
1405 # GLIBCPP_ENABLE_C99 tests found these, and if C99 support is enabled,
1406 # go ahead and allow long long to be used.
1407 if test x"$enable_c99" = x"no"; then
1408 enable_long_long=no;
1411 # Option parsed, now set things appropriately
1412 AC_MSG_CHECKING([for enabled long long support])
1413 if test x"$enable_long_long" = xyes; then
1414 AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1416 AC_MSG_RESULT($enable_long_long)
1421 dnl Check for what kind of C headers to use.
1423 dnl GLIBCPP_ENABLE_CHEADERS
1424 dnl --enable-cheaders= [does stuff].
1425 dnl --disable-cheaders [does not do anything, really].
1426 dnl + This will eventually need to be 'c_shadow' by default.
1427 dnl + Usage: GLIBCPP_ENABLE_CHEADERS[(DEFAULT)]
1428 dnl Where DEFAULT is either `c' or `c_std' or 'c_shadow'.
1429 dnl If ommitted, it defaults to `c_std'.
1430 AC_DEFUN(GLIBCPP_ENABLE_CHEADERS, [dnl
1431 define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
1432 AC_MSG_CHECKING([for c header strategy to use])
1433 AC_ARG_ENABLE(cheaders,
1434 changequote(<<, >>)dnl
1435 << --enable-cheaders construct "C" header files for
1436 g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
1438 [case "$enableval" in
1443 enable_cheaders=c_std
1446 enable_cheaders=c_shadow
1448 *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
1451 enable_cheaders=GLIBCPP_ENABLE_CHEADERS_DEFAULT)
1452 AC_MSG_RESULT($enable_cheaders)
1454 dnl Option parsed, now set things appropriately
1455 case "$enable_cheaders" in
1457 CSHADOW_FLAGS="-fno-builtin"
1458 C_INCLUDE_DIR='${top_srcdir}/include/c_shadow'
1459 AC_DEFINE(_GLIBCPP_USE_SHADOW_HEADERS)
1463 C_INCLUDE_DIR='${top_srcdir}/include/c_std'
1467 C_INCLUDE_DIR='${top_srcdir}/include/c'
1471 AC_SUBST(CSHADOW_FLAGS)
1472 AC_SUBST(C_INCLUDE_DIR)
1473 AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cheaders" = c_shadow)
1478 dnl Check for wide character support. Has the same effect as the option
1479 dnl in gcc's configure, but in a form that autoconf can mess with.
1481 dnl GLIBCPP_ENABLE_C_MBCHAR
1482 dnl --enable-c-mbchar requests all the wchar_t stuff.
1483 dnl --disable-c-mbchar doesn't.
1484 dnl + Usage: GLIBCPP_ENABLE_C_MBCHAR[(DEFAULT)]
1485 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1486 dnl defaults to `no'.
1487 AC_DEFUN(GLIBCPP_ENABLE_C_MBCHAR, [dnl
1488 define([GLIBCPP_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
1489 AC_ARG_ENABLE(c-mbchar,
1490 changequote(<<, >>)dnl
1491 << --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCPP_ENABLE_C_MBCHAR_DEFAULT],
1492 changequote([, ])dnl
1493 [case "$enableval" in
1494 yes) enable_c_mbchar=yes ;;
1495 no) enable_c_mbchar=no ;;
1496 *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
1498 enable_c_mbchar=GLIBCPP_ENABLE_C_MBCHAR_DEFAULT)dnl
1499 dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
1504 dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
1506 dnl GLIBCPP_INCLUDE_DIR
1508 dnl TOPLEVEL_INCLUDES
1509 dnl LIBMATH_INCLUDES
1510 dnl LIBSUPCXX_INCLUDES
1512 dnl CSHADOW_INCLUDES
1514 dnl GLIBCPP_EXPORT_INCLUDE
1515 AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
1516 # Root level of the include sources.
1517 GLIBCPP_INCLUDE_DIR='$(top_srcdir)/include'
1519 # Can either use include/c or include/c_std to grab "C" headers. This
1520 # variable is set to the include directory currently in use.
1521 # set with C_INCLUDE_DIR in GLIBCPP_ENABLE_CHEADERS
1523 # Passed down for canadian crosses.
1524 if test x"$CANADIAN" = xyes; then
1525 TOPLEVEL_INCLUDES='-I$(includedir)'
1528 LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
1530 LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
1532 #if GLIBCPP_NEED_LIBIO
1533 LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
1535 #LIBIO_INCLUDES='-I$(top_srcdir)/libio'
1538 #if GLIBCPP_USE_CSHADOW
1539 # CSHADOW_INCLUDES='-I$(GLIBCPP_INCLUDE_DIR)/std -I$(C_INCLUDE_DIR) \
1540 # -I$(top_blddir)/cshadow'
1542 CSTD_INCLUDES='-I$(GLIBCPP_INCLUDE_DIR)/std -I$(C_INCLUDE_DIR)'
1545 # Now, export this to all the little Makefiles....
1546 AC_SUBST(GLIBCPP_INCLUDE_DIR)
1547 AC_SUBST(TOPLEVEL_INCLUDES)
1548 AC_SUBST(LIBMATH_INCLUDES)
1549 AC_SUBST(LIBSUPCXX_INCLUDES)
1550 AC_SUBST(LIBIO_INCLUDES)
1551 AC_SUBST(CSTD_INCLUDES)
1556 dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
1558 AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
1559 # Optimization flags that are probably a good idea for thrill-seekers. Just
1560 # uncomment the lines below and make, everything else is ready to go...
1561 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
1563 AC_SUBST(OPTIMIZE_CXXFLAGS)
1565 WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings -Winline'
1566 AC_SUBST(WARN_FLAGS)
1570 dnl GLIBCPP_EXPORT_INSTALL_INFO
1571 dnl calculates gxx_install_dir
1572 dnl exports glibcpp_toolexecdir
1573 dnl exports glibcpp_toolexeclibdir
1575 dnl Assumes cross_compiling bits already done, and with_cross_host in
1578 dnl GLIBCPP_EXPORT_INSTALL_INFO
1579 AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
1581 glibcpp_toolexecdir=no
1582 glibcpp_toolexeclibdir=no
1584 AC_MSG_CHECKING([for interface version number])
1585 libstdcxx_interface=$INTERFACE
1586 AC_MSG_RESULT($libstdcxx_interface)
1588 # Process the option --with-gxx-include-dir=<path to include-files directory>
1589 AC_MSG_CHECKING([for --with-gxx-include-dir])
1590 AC_ARG_WITH(gxx-include-dir,
1591 [ --with-gxx-include-dir the installation directory for include files],
1592 [case "${withval}" in
1594 AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
1601 gxx_include_dir=${withval}
1603 esac], [gxx_include_dir=no])
1604 AC_MSG_RESULT($gxx_include_dir)
1606 # Process the option "--enable-version-specific-runtime-libs"
1607 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
1608 AC_ARG_ENABLE(version-specific-runtime-libs,
1609 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
1610 [ version_specific_libs=yes
1611 # Need the gcc compiler version to know where to install libraries
1612 # and header files if --enable-version-specific-runtime-libs option
1615 gcc_version_trigger=${srcdir}/../gcc/version.c
1616 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
1617 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
1618 gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
1619 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1620 glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}
1622 ],version_specific_libs=no)
1623 AC_MSG_RESULT($version_specific_libs)
1625 # Default case for install directory for include files.
1626 if test x"$version_specific_libs" = x"no" \
1627 && test x"$gxx_include_dir" = x"no"; then
1628 gxx_include_dir='$(prefix)'/include/g++-${libstdcxx_interface}
1631 # Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
1632 # Install a library built with a cross compiler in tooldir, not libdir.
1633 if test x"$glibcpp_toolexecdir" = x"no"; then
1634 if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
1635 glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
1636 glibcpp_toolexeclibdir='$(toolexecdir)/lib$(MULTISUBDIR)'
1638 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
1639 glibcpp_toolexeclibdir='$(libdir)$(MULTISUBDIR)'
1643 AC_MSG_CHECKING([for install location])
1644 AC_MSG_RESULT($gxx_include_dir)
1646 AC_SUBST(gxx_include_dir)
1647 AC_SUBST(glibcpp_toolexecdir)
1648 AC_SUBST(glibcpp_toolexeclibdir)
1652 # Check whether LC_MESSAGES is available in <locale.h>.
1653 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1655 # This file file be copied and used freely without restrictions. It can
1656 # be used in projects which are not available under the GNU Public License
1657 # but which still want to provide support for the GNU gettext functionality.
1658 # Please note that the actual code is *not* freely available.
1662 AC_DEFUN(AC_LC_MESSAGES, [
1663 AC_CHECK_HEADER(locale.h, [
1664 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1665 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1666 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1667 if test $ac_cv_val_LC_MESSAGES = yes; then
1668 AC_DEFINE(HAVE_LC_MESSAGES)
1674 # Check for functions in math library.
1675 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1677 # This file can be copied and used freely without restrictions. It can
1678 # be used in projects which are not available under the GNU Public License
1679 # but which still want to provide support for the GNU gettext functionality.
1680 # Please note that the actual code is *not* freely available.
1684 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1685 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1686 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])
1687 AC_SUBST(LIBMATHOBJS)dnl
1691 # Check for string functions.
1692 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1694 # This file can be copied and used freely without restrictions. It can
1695 # be used in projects which are not available under the GNU Public License
1696 # but which still want to provide support for the GNU gettext functionality.
1697 # Please note that the actual code is *not* freely available.
1701 dnl AC_REPLACE_STRINGFUNCS(FUNCTION...)
1702 AC_DEFUN(AC_REPLACE_STRINGFUNCS,
1703 [AC_CHECK_FUNCS([$1], , [LIBSTRINGOBJS="$LIBSTRINGOBJS ${ac_func}.lo"])
1704 AC_SUBST(LIBSTRINGOBJS)dnl
1708 dnl This macro searches for a GNU version of make. If a match is found, the
1709 dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
1710 dnl set to "#". This is useful for including a special features in a Makefile,
1711 dnl which cannot be handled by other versions of make. The variable
1712 dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
1713 dnl the empty string otherwise.
1715 dnl Here is an example of its use:
1717 dnl Makefile.in might contain:
1719 dnl # A failsafe way of putting a dependency rule into a makefile
1721 dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
1723 dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
1724 dnl @ifGNUmake@ include $(DEPEND)
1725 dnl @ifGNUmake@ endif
1727 dnl Then configure.in would normally contain:
1729 dnl CHECK_GNU_MAKE()
1730 dnl AC_OUTPUT(Makefile)
1732 dnl Then perhaps to cause gnu make to override any other make, we could do
1733 dnl something like this (note that GNU make always looks for GNUmakefile first):
1735 dnl if ! test x$_cv_gnu_make_command = x ; then
1736 dnl mv Makefile GNUmakefile
1737 dnl echo .DEFAULT: > Makefile ;
1738 dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
1741 dnl Then, if any (well almost any) other make is called, and GNU make also
1742 dnl exists, then the other make wraps the GNU make.
1744 dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
1745 dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
1747 dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
1748 dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
1749 dnl #### conditional's subshell (" --version" is not a command), using a
1750 dnl #### different option to grep(1).
1752 dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
1753 dnl #### ${MAKE:-make}).
1756 GLIBCPP_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
1757 _cv_gnu_make_command='' ;
1758 dnl Search all the common names for GNU make
1759 for a in "${MAKE-make}" make gmake gnumake ; do
1760 if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
1762 _cv_gnu_make_command=$a ;
1767 dnl If there was a GNU version, then set @ifGNUmake@ to the empty
1768 dnl string, '#' otherwise
1769 if test "x$_cv_gnu_make_command" != "x" ; then
1777 sinclude(../libtool.m4)
1778 dnl The lines below arrange for aclocal not to bring an installed
1779 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
1780 dnl add a definition of LIBTOOL to Makefile.in.
1781 ifelse(,,,[AC_SUBST(LIBTOOL)
1782 AC_DEFUN([AM_PROG_LIBTOOL])
1783 AC_DEFUN([AC_LIBTOOL_DLOPEN])
1784 AC_DEFUN([AC_PROG_LD])