1 # generated automatically by aclocal 1.7.6 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
16 dnl Check to see what architecture and operating system we are compiling
17 dnl for. Also, if architecture- or OS-specific flags are required for
18 dnl compilation, pick them up here.
20 AC_DEFUN(GLIBCXX_CHECK_HOST, [
21 . $glibcxx_srcdir/configure.host
22 AC_MSG_NOTICE(CPU config directory is $cpu_include_dir)
23 AC_MSG_NOTICE(OS config directory is $os_include_dir)
28 dnl Initialize basic configure bits.
33 AC_DEFUN(GLIBCXX_TOPREL_CONFIGURE, [
34 # Sets up multi_basedir, which is srcdir/.. plus the usual
35 # "multi_source_toprel_bottom_adjust" lunacy as needed.
36 AM_ENABLE_MULTILIB(, ..)
38 # The generated code is exactly the same, except that automake's looks in
39 # ".. $srcdir/.." and autoconf's looks in multi_basedir. Apparently other
40 # things are triggered on the presence of the two ...AUX_DIR[S], but I don't
41 # know what they are or what the other differences might be (and they keep
44 # Looking in multi_basedir seems smarter, so actually execute that branch.
46 # this is for automake
49 # this is for autoconf
50 AC_CONFIG_AUX_DIRS(${multi_basedir})
59 dnl Initialize the rest of the library configury. At this point we have
60 dnl variables like $host.
63 dnl gcc_version (x.y.z format)
66 dnl glibcxx_builddir (absolute path)
67 dnl glibcxx_srcdir (absolute path)
68 dnl toplevel_srcdir (absolute path)
71 dnl with_target_subdir
73 dnl - the variables in GLIBCXX_CHECK_HOST / configure.host
74 dnl - default settings for all AM_CONFITIONAL test variables
75 dnl - lots of tools, like CC and CXX
77 AC_DEFUN(GLIBCXX_CONFIGURE, [
78 # Keep these sync'd with the list in Makefile.am. The first provides an
79 # expandable list at autoconf time; the second provides an expandable list
80 # (i.e., shell variable) at configure time.
81 m4_define([glibcxx_SUBDIRS],[include libmath libsupc++ src po testsuite])
82 SUBDIRS='glibcxx_SUBDIRS'
84 # These need to be absolute paths, yet at the same time need to
85 # canonicalize only relative paths, because then amd will not unmount
86 # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
87 glibcxx_builddir=`${PWDCMD-pwd}`
89 [\\/$]* | ?:[\\/]*) glibcxx_srcdir=${srcdir} ;;
90 *) glibcxx_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
92 toplevel_srcdir=${glibcxx_srcdir}/..
93 AC_SUBST(glibcxx_builddir)
94 AC_SUBST(glibcxx_srcdir)
95 AC_SUBST(toplevel_srcdir)
97 # We use these options to decide which functions to include. They are
98 # set from the top level.
99 AC_ARG_WITH([target-subdir],
100 AC_HELP_STRING([--with-target-subdir=SUBDIR],
101 [configuring in a subdirectory]))
103 AC_ARG_WITH([cross-host],
104 AC_HELP_STRING([--with-cross-host=HOST],
105 [configuring with a cross compiler]))
107 AC_ARG_WITH([newlib],
108 AC_HELP_STRING([--with-newlib],
109 [assume newlib as a system C library]))
111 # We're almost certainly being configured before anything else which uses
112 # C++, so all of our AC_PROG_* discoveries will be cached. It's vital that
113 # we not cache the value of CXX that we "discover" here, because it's set
114 # to something unique for us and libjava. Other target libraries need to
115 # find CXX for themselves. We yank the rug out from under the normal AC_*
116 # process by sneakily renaming the cache variable. This also lets us debug
117 # the value of "our" CXX in postmortems.
119 # We must also force CXX to /not/ be a precious variable, otherwise the
120 # wrong (non-multilib-adjusted) value will be used in multilibs. This
121 # little trick also affects CPPFLAGS, CXXFLAGS, and LDFLAGS. And as a side
122 # effect, CXXFLAGS is no longer automagically subst'd, so we have to do
123 # that ourselves. Un-preciousing AC_PROG_CC also affects CC and CFLAGS.
125 # -fno-builtin must be present here so that a non-conflicting form of
126 # std::exit can be guessed by AC_PROG_CXX, and used in later tests.
128 m4_define([ac_cv_prog_CXX],[glibcxx_cv_prog_CXX])
129 m4_rename([_AC_ARG_VAR_PRECIOUS],[glibcxx_PRECIOUS])
130 m4_define([_AC_ARG_VAR_PRECIOUS],[])
131 save_CXXFLAGS="$CXXFLAGS"
132 CXXFLAGS="$CXXFLAGS -fno-builtin"
135 CXXFLAGS="$save_CXXFLAGS"
136 m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
140 # For directory versioning (e.g., headers) and other variables.
141 AC_MSG_CHECKING([for GCC version number])
142 gcc_version=`$CXX -dumpversion`
143 AC_MSG_RESULT($gcc_version)
145 # For some reason, gettext needs this.
148 # Will set LN_S to either 'ln -s', 'ln', or 'cp -p' (if linking isn't
149 # available). Uncomment the next line to force a particular method.
153 AC_CHECK_TOOL(AS, as)
154 AC_CHECK_TOOL(AR, ar)
155 AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
159 # Set up safe default values for all subsequent AM_CONDITIONAL tests.
162 #enable_libstdcxx_debug=no
163 #enable_libstdcxx_pch=no
169 # Find platform-specific directories containing configuration info.
170 # Also possibly modify flags used elsewhere, as needed by the platform.
175 m4_include([linkage.m4])
179 dnl Tests for newer compiler features, or features that are present in newer
180 dnl compiler versions but not older compiler versions still in use, should
184 dnl WERROR='-Werror' if requested and possible; g++'s that lack the
185 dnl new inlining code or the new system_header pragma will die on -Werror.
186 dnl Leave it out by default and use maint-mode to use it.
187 dnl SECTION_FLAGS='-ffunction-sections -fdata-sections' if
188 dnl compiler supports it and the user has not requested debug mode.
190 AC_DEFUN(GLIBCXX_CHECK_COMPILER_FEATURES, [
191 # All these tests are for C++; save the language and the compiler flags.
192 # The CXXFLAGS thing is suspicious, but based on similar bits previously
193 # found in GLIBCXX_CONFIGURE.
196 ac_test_CXXFLAGS="${CXXFLAGS+set}"
197 ac_save_CXXFLAGS="$CXXFLAGS"
199 # Check for maintainer-mode bits.
200 if test x"$USE_MAINTAINER_MODE" = xno; then
206 # Check for -ffunction-sections -fdata-sections
207 AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
208 CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
209 AC_TRY_COMPILE(, [int foo;], [ac_fdsections=yes], [ac_fdsections=no])
210 if test "$ac_test_CXXFLAGS" = set; then
211 CXXFLAGS="$ac_save_CXXFLAGS"
213 # this is the suspicious part
216 if test x"$ac_fdsections" = x"yes"; then
217 SECTION_FLAGS='-ffunction-sections -fdata-sections'
219 AC_MSG_RESULT($ac_fdsections)
223 AC_SUBST(SECTION_FLAGS)
228 dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
229 dnl the native linker is in use, all variables will be defined to something
230 dnl safe (like an empty string).
233 dnl SECTION_LDFLAGS='-Wl,--gc-sections' if possible
234 dnl OPT_LDFLAGS='-Wl,-O1' if possible
235 dnl LD (as a side effect of testing)
238 dnl glibcxx_gnu_ld_version (possibly)
240 dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
241 dnl set glibcxx_gnu_ld_version to 12345. Zeros cause problems.
243 AC_DEFUN(GLIBCXX_CHECK_LINKER_FEATURES, [
244 # If we're not using GNU ld, then there's no point in even trying these
245 # tests. Check for that first. We should have already tested for gld
246 # by now (in libtool), but require it now just to be safe...
247 test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
248 test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
249 AC_REQUIRE([AC_PROG_LD])
250 AC_REQUIRE([AC_PROG_AWK])
252 # The name set by libtool depends on the version of libtool. Shame on us
253 # for depending on an impl detail, but c'est la vie. Older versions used
254 # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
255 # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
256 # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
257 # set (hence we're using an older libtool), then set it.
258 if test x${with_gnu_ld+set} != xset; then
259 if test x${ac_cv_prog_gnu_ld+set} != xset; then
260 # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
263 with_gnu_ld=$ac_cv_prog_gnu_ld
267 # Start by getting the version number. I think the libtool test already
268 # does some of this, but throws away the result.
270 ldver=`$LD --version 2>/dev/null | head -1 | \
271 sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
273 glibcxx_gnu_ld_version=`echo $ldver | \
274 $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
277 if test "$with_gnu_ld" = "notbroken"; then
278 # GNU ld it is! Joy and bunny rabbits!
280 # All these tests are for C++; save the language and the compiler flags.
281 # Need to do this so that g++ won't try to link in libstdc++
282 ac_test_CFLAGS="${CFLAGS+set}"
283 ac_save_CFLAGS="$CFLAGS"
284 CFLAGS='-x c++ -Wl,--gc-sections'
286 # Check for -Wl,--gc-sections
287 # XXX This test is broken at the moment, as symbols required for linking
288 # are now in libsupc++ (not built yet). In addition, this test has
289 # cored on solaris in the past. In addition, --gc-sections doesn't
290 # really work at the moment (keeps on discarding used sections, first
291 # .eh_frame and now some of the glibc sections for iconv).
292 # Bzzzzt. Thanks for playing, maybe next time.
293 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
301 ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
302 if test "$ac_test_CFLAGS" = set; then
303 CFLAGS="$ac_save_CFLAGS"
305 # this is the suspicious part
308 if test "$ac_sectionLDflags" = "yes"; then
309 SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
311 AC_MSG_RESULT($ac_sectionLDflags)
314 # Set linker optimization flags.
315 if test x"$with_gnu_ld" = x"yes"; then
316 OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
319 AC_SUBST(SECTION_LDFLAGS)
320 AC_SUBST(OPT_LDFLAGS)
325 dnl Check to see if this target can enable the wchar_t parts.
326 dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
327 dnl must have been previously checked.) By default, wide characters are
331 dnl HAVE_MBSTATE_T if mbstate_t is not in wchar.h
332 dnl _GLIBCXX_USE_WCHAR_T if all the bits are found.
334 AC_DEFUN(GLIBCXX_CHECK_WCHAR_T_SUPPORT, [
335 # Test wchar.h for mbstate_t, which is needed for char_traits and
336 # others even if wchar_t support is not on.
337 AC_MSG_CHECKING([for mbstate_t])
338 AC_TRY_COMPILE([#include <wchar.h>],
339 [mbstate_t teststate;],
340 have_mbstate_t=yes, have_mbstate_t=no)
341 AC_MSG_RESULT($have_mbstate_t)
342 if test x"$have_mbstate_t" = xyes; then
343 AC_DEFINE(HAVE_MBSTATE_T)
346 # Sanity check for existence of ISO C99 headers for extended encoding.
347 AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
348 AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
350 # Only continue checking if the ISO C99 headers exist and support is on.
351 if test x"$ac_has_wchar_h" = xyes &&
352 test x"$ac_has_wctype_h" = xyes &&
353 test x"$enable_c_mbchar" != xno; then
355 # Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
356 # numeric_limits can instantiate type_traits<wchar_t>
357 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
358 AC_TRY_COMPILE([#include <wchar.h>],
359 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
360 has_wchar_minmax=yes, has_wchar_minmax=no)
361 AC_MSG_RESULT($has_wchar_minmax)
363 # Test wchar.h for WEOF, which is what we use to determine whether
364 # to specialize for char_traits<wchar_t> or not.
365 AC_MSG_CHECKING([for WEOF])
368 #include <stddef.h>],
370 has_weof=yes, has_weof=no)
371 AC_MSG_RESULT($has_weof)
373 # Tests for wide character functions used in char_traits<wchar_t>.
375 AC_CHECK_FUNCS([wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset],
378 # Checks for names injected into std:: by the c_std headers.
379 AC_CHECK_FUNCS([btowc wctob fgetwc fgetws fputwc fputws fwide \
380 fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
381 vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
382 mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
383 wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
384 wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr],
387 AC_MSG_CHECKING([for ISO C99 wchar_t support])
388 if test x"$has_weof" = xyes &&
389 test x"$has_wchar_minmax" = xyes &&
390 test x"$ac_wfuncs" = xyes;
392 ac_isoC99_wchar_t=yes
396 AC_MSG_RESULT($ac_isoC99_wchar_t)
398 # Use iconv for wchar_t to char conversions. As such, check for
399 # X/Open Portability Guide, version 2 features (XPG2).
400 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
401 AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
403 # Check for existence of libiconv.a providing XPG2 wchar_t support.
404 AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
406 LIBS="$LIBS $libiconv"
408 AC_CHECK_FUNCS([iconv_open iconv_close iconv nl_langinfo],
409 [ac_XPG2funcs=yes], [ac_XPG2funcs=no])
413 AC_MSG_CHECKING([for XPG2 wchar_t support])
414 if test x"$ac_has_iconv_h" = xyes &&
415 test x"$ac_has_langinfo_h" = xyes &&
416 test x"$ac_XPG2funcs" = xyes;
422 AC_MSG_RESULT($ac_XPG2_wchar_t)
424 # At the moment, only enable wchar_t specializations if all the
425 # above support is present.
426 if test x"$ac_isoC99_wchar_t" = xyes &&
427 test x"$ac_XPG2_wchar_t" = xyes;
429 AC_DEFINE(_GLIBCXX_USE_WCHAR_T)
433 AC_MSG_CHECKING([for enabled wchar_t specializations])
434 AC_MSG_RESULT($enable_wchar_t)
439 dnl Check for headers for, and arguments to, the setrlimit() function.
440 dnl Used only in testsuite_hooks.h. Called from GLIBCXX_CONFIGURE_TESTSUITE.
443 dnl _GLIBCXX_MEM_LIMITS if we can set artificial limits on memory
444 dnl various HAVE_MEMLIMIT_* for individual limit names
446 AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT_ancilliary, [
449 #include <sys/time.h>
450 #include <sys/resource.h>
452 [ int f = RLIMIT_$1 ; ],
453 [glibcxx_mresult=1], [glibcxx_mresult=0])
454 AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcxx_mresult,
455 [Only used in build directory testsuite_hooks.h.])
458 AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT, [
459 setrlimit_have_headers=yes
460 AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
462 [setrlimit_have_headers=no])
463 # If don't have the headers, then we can't run the tests now, and we
464 # won't be seeing any of these during testsuite compilation.
465 if test $setrlimit_have_headers = yes; then
466 # Can't do these in a loop, else the resulting syntax is wrong.
467 GLIBCXX_CHECK_SETRLIMIT_ancilliary(DATA)
468 GLIBCXX_CHECK_SETRLIMIT_ancilliary(RSS)
469 GLIBCXX_CHECK_SETRLIMIT_ancilliary(VMEM)
470 GLIBCXX_CHECK_SETRLIMIT_ancilliary(AS)
472 # Check for rlimit, setrlimit.
473 AC_CACHE_VAL(ac_setrlimit, [
476 #include <sys/time.h>
477 #include <sys/resource.h>
481 [ac_setrlimit=yes], [ac_setrlimit=no])
485 AC_MSG_CHECKING([for testsuite memory limit support])
486 if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
488 AC_DEFINE(_GLIBCXX_MEM_LIMITS)
492 AC_MSG_RESULT($ac_mem_limits)
497 dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
498 dnl Define HAVE_S_ISREG / HAVE_S_IFREG appropriately.
500 AC_DEFUN(GLIBCXX_CHECK_S_ISREG_OR_S_IFREG, [
501 AC_CACHE_VAL(glibcxx_cv_S_ISREG, [
503 [#include <sys/stat.h>],
506 S_ISREG(buffer.st_mode);],
507 [glibcxx_cv_S_ISREG=yes],
508 [glibcxx_cv_S_ISREG=no])
510 AC_CACHE_VAL(glibcxx_cv_S_IFREG, [
512 [#include <sys/stat.h>],
515 S_IFREG & buffer.st_mode;],
516 [glibcxx_cv_S_IFREG=yes],
517 [glibcxx_cv_S_IFREG=no])
519 if test $glibcxx_cv_S_ISREG = yes; then
520 AC_DEFINE(HAVE_S_ISREG)
521 elif test $glibcxx_cv_S_IFREG = yes; then
522 AC_DEFINE(HAVE_S_IFREG)
528 dnl Check whether poll is available in <poll.h>, and define HAVE_POLL.
530 AC_DEFUN(GLIBCXX_CHECK_POLL, [
531 AC_CACHE_VAL(glibcxx_cv_POLL, [
534 [struct pollfd pfd[1];
535 pfd[0].events = POLLIN;
537 [glibcxx_cv_POLL=yes],
538 [glibcxx_cv_POLL=no])
540 if test $glibcxx_cv_POLL = yes; then
547 dnl Check whether writev is available in <sys/uio.h>, and define HAVE_WRITEV.
549 AC_DEFUN(GLIBCXX_CHECK_WRITEV, [
550 AC_CACHE_VAL(glibcxx_cv_WRITEV, [
552 [#include <sys/uio.h>],
553 [struct iovec iov[2];
555 [glibcxx_cv_WRITEV=yes],
556 [glibcxx_cv_WRITEV=no])
558 if test $glibcxx_cv_WRITEV = yes; then
559 AC_DEFINE(HAVE_WRITEV)
565 dnl Does any necessary configuration of the testsuite directory. Generates
566 dnl the testsuite_hooks.h header.
568 dnl GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE must be done before this.
571 dnl enable_abi_check / GLIBCXX_TEST_ABI
575 AC_DEFUN(GLIBCXX_CONFIGURE_TESTSUITE, [
576 if $GLIBCXX_IS_NATIVE; then
577 # Do checks for memory limit functions.
578 GLIBCXX_CHECK_SETRLIMIT
580 # Look for setenv, so that extended locale tests can be performed.
581 GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
584 # Export file names for ABI checking.
585 baseline_dir="$glibcxx_srcdir/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
586 AC_SUBST(baseline_dir)
588 # Determine if checking the ABI is desirable.
589 if test $enable_symvers = no; then
594 enable_abi_check=no ;;
596 enable_abi_check=yes ;;
600 AM_CONDITIONAL(GLIBCXX_TEST_WCHAR_T, test $enable_wchar_t = yes)
601 AM_CONDITIONAL(GLIBCXX_TEST_ABI, test $enable_abi_check = yes)
606 dnl Set up *_INCLUDES variables for all sundry Makefile.am's.
610 dnl TOPLEVEL_INCLUDES
612 AC_DEFUN(GLIBCXX_EXPORT_INCLUDES, [
613 # Used for every C++ compile we perform.
615 -I$glibcxx_builddir/include/$host_alias \
616 -I$glibcxx_builddir/include \
617 -I$glibcxx_srcdir/libsupc++"
619 # For Canadian crosses, pick this up too.
620 if test $CANADIAN = yes; then
621 GLIBCXX_INCLUDES="$GLIBCXX_INCLUDES '-I${includedir}'"
624 # Stuff in the actual top level. Currently only used by libsupc++ to
625 # get unwind* headers from the gcc dir.
626 #TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include'
627 TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc'
629 # Now, export this to all the little Makefiles....
630 AC_SUBST(GLIBCXX_INCLUDES)
631 AC_SUBST(TOPLEVEL_INCLUDES)
636 dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
637 dnl (SECTION_FLAGS is done under CHECK_COMPILER_FEATURES.)
640 dnl OPTIMIZE_CXXFLAGS
643 AC_DEFUN(GLIBCXX_EXPORT_FLAGS, [
644 # Optimization flags that are probably a good idea for thrill-seekers. Just
645 # uncomment the lines below and make, everything else is ready to go...
646 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
648 AC_SUBST(OPTIMIZE_CXXFLAGS)
650 WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings'
656 dnl All installation directory information is determined here.
660 dnl glibcxx_prefixdir
661 dnl glibcxx_toolexecdir
662 dnl glibcxx_toolexeclibdir
664 dnl Assumes cross_compiling bits already done, and with_cross_host in
667 AC_DEFUN(GLIBCXX_EXPORT_INSTALL_INFO, [
668 glibcxx_toolexecdir=no
669 glibcxx_toolexeclibdir=no
670 glibcxx_prefixdir=$prefix
672 AC_MSG_CHECKING([for gxx-include-dir])
673 AC_ARG_WITH([gxx-include-dir],
674 AC_HELP_STRING([--with-gxx-include-dir=DIR],
675 [installation directory for include files]),
677 yes) AC_MSG_ERROR([Missing directory for --with-gxx-include-dir]) ;;
678 no) gxx_include_dir=no ;;
679 *) gxx_include_dir=$withval ;;
681 [gxx_include_dir=no])
682 AC_MSG_RESULT($gxx_include_dir)
684 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
685 AC_ARG_ENABLE([version-specific-runtime-libs],
686 AC_HELP_STRING([--enable-version-specific-runtime-libs],
687 [Specify that runtime libraries should be installed in a compiler-specific directory]),
688 [case "$enableval" in
689 yes) version_specific_libs=yes ;;
690 no) version_specific_libs=no ;;
691 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
693 [version_specific_libs=no])
694 AC_MSG_RESULT($version_specific_libs)
696 # Default case for install directory for include files.
697 if test $version_specific_libs = no && test $gxx_include_dir = no; then
698 gxx_include_dir='${prefix}'/include/c++/${gcc_version}
701 # Version-specific runtime libs processing.
702 if test $version_specific_libs = yes; then
703 # Need the gcc compiler version to know where to install libraries
704 # and header files if --enable-version-specific-runtime-libs option
706 if test x"$gxx_include_dir" = x"no"; then
707 gxx_include_dir='${libdir}/gcc-lib/${host_alias}/'$gcc_version/include/c++
709 glibcxx_toolexecdir='${libdir}/gcc-lib/${host_alias}'
710 glibcxx_toolexeclibdir='${toolexecdir}/'$gcc_version'$(MULTISUBDIR)'
713 # Calculate glibcxx_toolexecdir, glibcxx_toolexeclibdir
714 # Install a library built with a cross compiler in tooldir, not libdir.
715 if test x"$glibcxx_toolexecdir" = x"no"; then
716 if test -n "$with_cross_host" &&
717 test x"$with_cross_host" != x"no"; then
718 glibcxx_toolexecdir='${exec_prefix}/${host_alias}'
719 glibcxx_toolexeclibdir='${toolexecdir}/lib'
721 glibcxx_toolexecdir='${libdir}/gcc-lib/${host_alias}'
722 glibcxx_toolexeclibdir='${libdir}'
724 multi_os_directory=`$CXX -print-multi-os-directory`
725 case $multi_os_directory in
726 .) ;; # Avoid trailing /.
727 *) glibcxx_toolexeclibdir=$glibcxx_toolexeclibdir/$multi_os_directory ;;
731 AC_MSG_CHECKING([for install location])
732 AC_MSG_RESULT($gxx_include_dir)
734 AC_SUBST(glibcxx_prefixdir)
735 AC_SUBST(gxx_include_dir)
736 AC_SUBST(glibcxx_toolexecdir)
737 AC_SUBST(glibcxx_toolexeclibdir)
743 dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING)
744 dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c)
745 dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER)
747 dnl See docs/html/17_intro/configury.html#enable for documentation.
749 m4_define([GLIBCXX_ENABLE],[dnl
750 m4_define([_g_switch],[--enable-$1])dnl
751 m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl
752 AC_ARG_ENABLE($1,_g_help,
757 m4_bpatsubst([$5],[permit ])) ;;
758 *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;;
759 dnl Idea for future: generate a URL pointing to
760 dnl "onlinedocs/configopts.html#whatever"
767 *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;;
771 [enable_]m4_bpatsubst([$1],-,_)[=][$2])
772 m4_undefine([_g_switch])dnl
773 m4_undefine([_g_help])dnl
778 dnl Check for ISO/IEC 9899:1999 "C99" support.
780 dnl --enable-c99 defines _GLIBCXX_USE_C99
781 dnl --disable-c99 leaves _GLIBCXX_USE_C99 undefined
782 dnl + Usage: GLIBCXX_ENABLE_C99[(DEFAULT)]
783 dnl Where DEFAULT is either `yes' or `no'.
784 dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
786 AC_DEFUN(GLIBCXX_ENABLE_C99, [
787 GLIBCXX_ENABLE(c99,$1,,[turns on ISO/IEC 9899:1999 support])
792 # Check for the existence of <math.h> functions used if C99 is enabled.
794 AC_MSG_CHECKING([for ISO C99 support in <math.h>])
795 AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
796 AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
797 AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
798 AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
799 AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
800 AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
801 AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
802 AC_TRY_COMPILE([#include <math.h>],
803 [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
804 AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
805 AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
806 AC_TRY_COMPILE([#include <math.h>],
807 [islessgreater(0.0,0.0);],, [ac_c99_math=no])
808 AC_TRY_COMPILE([#include <math.h>],
809 [isunordered(0.0,0.0);],, [ac_c99_math=no])
810 AC_MSG_RESULT($ac_c99_math)
812 # Check for the existence in <stdio.h> of vscanf, et. al.
814 AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
815 AC_TRY_COMPILE([#include <stdio.h>],
816 [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
817 AC_TRY_COMPILE([#include <stdio.h>
819 void foo(char* fmt, ...)
820 {va_list args; va_start(args, fmt);
821 vfscanf(stderr, "%i", args);}],
822 [],, [ac_c99_stdio=no])
823 AC_TRY_COMPILE([#include <stdio.h>
825 void foo(char* fmt, ...)
826 {va_list args; va_start(args, fmt);
827 vscanf("%i", args);}],
828 [],, [ac_c99_stdio=no])
829 AC_TRY_COMPILE([#include <stdio.h>
831 void foo(char* fmt, ...)
832 {va_list args; va_start(args, fmt);
833 vsnprintf(fmt, 0, "%i", args);}],
834 [],, [ac_c99_stdio=no])
835 AC_TRY_COMPILE([#include <stdio.h>
837 void foo(char* fmt, ...)
838 {va_list args; va_start(args, fmt);
839 vsscanf(fmt, "%i", args);}],
840 [],, [ac_c99_stdio=no])
841 AC_MSG_RESULT($ac_c99_stdio)
843 # Check for the existence in <stdlib.h> of lldiv_t, et. al.
845 AC_MSG_CHECKING([for lldiv_t declaration])
846 AC_CACHE_VAL(ac_c99_lldiv_t, [
847 AC_TRY_COMPILE([#include <stdlib.h>],
849 [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
851 AC_MSG_RESULT($ac_c99_lldiv_t)
853 AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
854 AC_TRY_COMPILE([#include <stdlib.h>],
855 [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
856 AC_TRY_COMPILE([#include <stdlib.h>],
857 [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
858 AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
859 AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
860 AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
861 AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
862 if test x"$ac_c99_lldiv_t" = x"no"; then
865 AC_MSG_RESULT($ac_c99_stdlib)
867 # Check for the existence of <wchar.h> functions used if C99 is enabled.
868 # XXX the wchar.h checks should be rolled into the general C99 bits.
870 AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
871 AC_TRY_COMPILE([#include <wchar.h>],
872 [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
873 AC_TRY_COMPILE([#include <wchar.h>],
874 [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
875 AC_TRY_COMPILE([#include <wchar.h>],
876 [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
877 AC_MSG_RESULT($ac_c99_wchar)
879 AC_MSG_CHECKING([for enabled ISO C99 support])
880 if test x"$ac_c99_math" = x"no" ||
881 test x"$ac_c99_stdio" = x"no" ||
882 test x"$ac_c99_stdlib" = x"no" ||
883 test x"$ac_c99_wchar" = x"no"; then
886 AC_MSG_RESULT($enable_c99)
888 # Option parsed, now set things appropriately
889 if test x"$enable_c99" = x"yes"; then
890 AC_DEFINE(_GLIBCXX_USE_C99)
898 dnl Check for what type of C headers to use.
900 dnl --enable-cheaders= [does stuff].
901 dnl --disable-cheaders [does not do anything, really].
902 dnl + Usage: GLIBCXX_ENABLE_CHEADERS[(DEFAULT)]
903 dnl Where DEFAULT is either `c' or `c_std'.
905 AC_DEFUN(GLIBCXX_ENABLE_CHEADERS, [
906 GLIBCXX_ENABLE(cheaders,$1,[=KIND],
907 [construct "C" headers for g++], [permit c|c_std])
908 AC_MSG_NOTICE("C" header strategy set to $enable_cheaders)
910 C_INCLUDE_DIR='${glibcxx_srcdir}/include/'$enable_cheaders
912 AC_SUBST(C_INCLUDE_DIR)
913 AM_CONDITIONAL(GLIBCXX_C_HEADERS_C, test $enable_cheaders = c)
914 AM_CONDITIONAL(GLIBCXX_C_HEADERS_C_STD, test $enable_cheaders = c_std)
915 AM_CONDITIONAL(GLIBCXX_C_HEADERS_COMPATIBILITY, test $c_compatibility = yes)
920 dnl Check for which locale library to use. The choice is mapped to
921 dnl a subdirectory of config/locale.
923 dnl Default is generic.
925 AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
926 AC_MSG_CHECKING([for C locale to use])
927 GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
928 [use MODEL for target locale package],
929 [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
931 # If they didn't use this option switch, or if they specified --enable
932 # with no specific model, we'll have to look for one. If they
933 # specified --disable (???), do likewise.
934 if test $enable_clocale = no || test $enable_clocale = yes; then
938 # Either a known package, or "auto"
939 enable_clocale_flag=$enable_clocale
941 # Probe for locale support if no specific model is specified.
942 # Default to "generic".
943 if test $enable_clocale_flag = auto; then
944 case x${target_os} in
946 AC_EGREP_CPP([_GLIBCXX_ok], [
947 #include <features.h>
948 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
951 ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
953 # Test for bugs early in glibc-2.2.x series
954 if test x$enable_clocale_flag = xgnu; then
956 #define _GNU_SOURCE 1
959 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
960 extern __typeof(newlocale) __newlocale;
961 extern __typeof(duplocale) __duplocale;
962 extern __typeof(strcoll_l) __strcoll_l;
966 const char __one[] = "Äuglein Augmen";
967 const char __two[] = "Äuglein";
972 loc = __newlocale(1 << LC_ALL, "de_DE", 0);
973 loc_dup = __duplocale(loc);
974 i = __strcoll_l(__one, __two, loc);
975 j = __strcoll_l(__one, __two, loc_dup);
979 [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
980 [enable_clocale_flag=generic])
983 # ... at some point put __strxfrm_l tests in as well.
986 enable_clocale_flag=generic
991 # Deal with gettext issues. Default to not using it (=no) until we detect
992 # support for it later. Let the user turn it off via --e/d, but let that
993 # default to on for easier handling.
996 AC_HELP_STRING([--enable-nls],[use Native Language Support (default)]),
1000 # Set configure bits for specified locale package
1001 case ${enable_clocale_flag} in
1003 AC_MSG_RESULT(generic)
1005 CLOCALE_H=config/locale/generic/c_locale.h
1006 CLOCALE_CC=config/locale/generic/c_locale.cc
1007 CCODECVT_H=config/locale/generic/codecvt_specializations.h
1008 CCODECVT_CC=config/locale/generic/codecvt_members.cc
1009 CCOLLATE_CC=config/locale/generic/collate_members.cc
1010 CCTYPE_CC=config/locale/generic/ctype_members.cc
1011 CMESSAGES_H=config/locale/generic/messages_members.h
1012 CMESSAGES_CC=config/locale/generic/messages_members.cc
1013 CMONEY_CC=config/locale/generic/monetary_members.cc
1014 CNUMERIC_CC=config/locale/generic/numeric_members.cc
1015 CTIME_H=config/locale/generic/time_members.h
1016 CTIME_CC=config/locale/generic/time_members.cc
1017 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
1022 # Declare intention to use gettext, and add support for specific
1024 # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
1027 # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
1028 AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
1029 if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
1032 # Export the build objects.
1033 for ling in $ALL_LINGUAS; do \
1034 glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
1035 glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
1037 AC_SUBST(glibcxx_MOFILES)
1038 AC_SUBST(glibcxx_POFILES)
1040 CLOCALE_H=config/locale/gnu/c_locale.h
1041 CLOCALE_CC=config/locale/gnu/c_locale.cc
1042 CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
1043 CCODECVT_CC=config/locale/gnu/codecvt_members.cc
1044 CCOLLATE_CC=config/locale/gnu/collate_members.cc
1045 CCTYPE_CC=config/locale/gnu/ctype_members.cc
1046 CMESSAGES_H=config/locale/gnu/messages_members.h
1047 CMESSAGES_CC=config/locale/gnu/messages_members.cc
1048 CMONEY_CC=config/locale/gnu/monetary_members.cc
1049 CNUMERIC_CC=config/locale/gnu/numeric_members.cc
1050 CTIME_H=config/locale/gnu/time_members.h
1051 CTIME_CC=config/locale/gnu/time_members.cc
1052 CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
1055 AC_MSG_RESULT(IEEE 1003.1)
1057 CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
1058 CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc
1059 CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
1060 CCODECVT_CC=config/locale/generic/codecvt_members.cc
1061 CCOLLATE_CC=config/locale/generic/collate_members.cc
1062 CCTYPE_CC=config/locale/generic/ctype_members.cc
1063 CMESSAGES_H=config/locale/ieee_1003.1-2001/messages_members.h
1064 CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc
1065 CMONEY_CC=config/locale/generic/monetary_members.cc
1066 CNUMERIC_CC=config/locale/generic/numeric_members.cc
1067 CTIME_H=config/locale/generic/time_members.h
1068 CTIME_CC=config/locale/generic/time_members.cc
1069 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
1073 # This is where the testsuite looks for locale catalogs, using the
1074 # -DLOCALEDIR define during testsuite compilation.
1075 glibcxx_localedir=${glibcxx_builddir}/po/share/locale
1076 AC_SUBST(glibcxx_localedir)
1078 # A standalone libintl (e.g., GNU libintl) may be in use.
1079 if test $USE_NLS = yes; then
1080 AC_CHECK_HEADERS([libintl.h], [], USE_NLS=no)
1081 AC_SEARCH_LIBS(gettext, intl, [], USE_NLS=no)
1083 if test $USE_NLS = yes; then
1084 AC_DEFINE(_GLIBCXX_USE_NLS)
1089 AC_SUBST(CCODECVT_H)
1090 AC_SUBST(CMESSAGES_H)
1091 AC_SUBST(CCODECVT_CC)
1092 AC_SUBST(CCOLLATE_CC)
1094 AC_SUBST(CMESSAGES_CC)
1096 AC_SUBST(CNUMERIC_CC)
1099 AC_SUBST(CLOCALE_CC)
1100 AC_SUBST(CLOCALE_INTERNAL_H)
1105 dnl Check for whether the Boost-derived checks should be turned on.
1107 dnl --enable-concept-checks turns them on.
1108 dnl --disable-concept-checks leaves them off.
1109 dnl + Usage: GLIBCXX_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
1110 dnl Where DEFAULT is either `yes' or `no'.
1112 AC_DEFUN(GLIBCXX_ENABLE_CONCEPT_CHECKS, [
1113 GLIBCXX_ENABLE(concept-checks,$1,,[use Boost-derived template checks])
1114 if test $enable_concept_checks = yes; then
1115 AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS)
1121 dnl Check for which I/O library to use: stdio, or something specific.
1123 dnl Default is stdio.
1125 AC_DEFUN(GLIBCXX_ENABLE_CSTDIO, [
1126 AC_MSG_CHECKING([for underlying I/O to use])
1127 GLIBCXX_ENABLE(cstdio,stdio,[=PACKAGE],
1128 [use target-specific I/O package], [permit stdio])
1130 # Now that libio has been removed, you can have any color you want as long
1131 # as it's black. This is one big no-op until other packages are added, but
1132 # showing the framework never hurts.
1133 case ${enable_cstdio} in
1135 CSTDIO_H=config/io/c_io_stdio.h
1136 BASIC_FILE_H=config/io/basic_file_stdio.h
1137 BASIC_FILE_CC=config/io/basic_file_stdio.cc
1138 AC_MSG_RESULT(stdio)
1142 dnl Set directory for fpos.h
1143 FPOS_H=$fpos_include_dir
1147 AC_SUBST(BASIC_FILE_H)
1148 AC_SUBST(BASIC_FILE_CC)
1153 dnl Check for "unusual" flags to pass to the compiler while building.
1155 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
1156 dnl experimental flags such as -fpch, -fIMI, -Dfloat=char, etc.
1157 dnl --disable-cxx-flags passes nothing.
1158 dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
1159 dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
1160 dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
1161 dnl + Usage: GLIBCXX_ENABLE_CXX_FLAGS(default flags)
1162 dnl If "default flags" is an empty string, the effect is the same
1163 dnl as --disable or --enable=no.
1165 AC_DEFUN(GLIBCXX_ENABLE_CXX_FLAGS, [dnl
1166 AC_MSG_CHECKING([for extra compiler flags for building])
1167 GLIBCXX_ENABLE(cxx-flags,$1,[=FLAGS],
1168 [pass compiler FLAGS when building library],
1169 [case "x$enable_cxx_flags" in
1170 xno | x) enable_cxx_flags= ;;
1172 *) AC_MSG_ERROR(_g_switch needs compiler flags as arguments) ;;
1175 # Run through flags (either default or command-line) and set anything
1176 # extra (e.g., #defines) that must accompany particular g++ options.
1177 if test -n "$enable_cxx_flags"; then
1178 for f in $enable_cxx_flags; do
1182 *) # and we're trying to pass /what/ exactly?
1183 AC_MSG_ERROR([compiler flags start with a -]) ;;
1188 EXTRA_CXX_FLAGS="$enable_cxx_flags"
1189 AC_MSG_RESULT($EXTRA_CXX_FLAGS)
1190 AC_SUBST(EXTRA_CXX_FLAGS)
1195 dnl Check for wide character support. Has the same effect as the option
1196 dnl in gcc's configure, but in a form that autoconf can mess with.
1198 dnl --enable-c-mbchar requests all the wchar_t stuff.
1199 dnl --disable-c-mbchar doesn't.
1200 dnl + Usage: GLIBCXX_ENABLE_C_MBCHAR[(DEFAULT)]
1201 dnl Where DEFAULT is either `yes' or `no'.
1203 AC_DEFUN(GLIBCXX_ENABLE_C_MBCHAR, [
1204 GLIBCXX_ENABLE(c-mbchar,$1,,[enable multibyte (wide) characters])
1205 # Option parsed, now other scripts can test enable_c_mbchar for yes/no.
1210 dnl Check to see if debugging libraries are to be built.
1212 dnl --enable-libstdcxx-debug
1213 dnl builds a separate set of debugging libraries in addition to the
1214 dnl normal (shared, static) libstdc++ binaries.
1216 dnl --disable-libstdcxx-debug
1217 dnl builds only one (non-debug) version of libstdc++.
1219 dnl --enable-libstdcxx-debug-flags=FLAGS
1220 dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
1222 dnl + Usage: GLIBCXX_ENABLE_DEBUG[(DEFAULT)]
1223 dnl Where DEFAULT is either `yes' or `no'.
1225 AC_DEFUN(GLIBCXX_ENABLE_DEBUG, [
1226 AC_MSG_CHECKING([for additional debug build])
1227 GLIBCXX_ENABLE(libstdcxx-debug,$1,,[build extra debug library])
1228 AC_MSG_RESULT($enable_libstdcxx_debug)
1229 AM_CONDITIONAL(GLIBCXX_BUILD_DEBUG, test $enable_libstdcxx_debug = yes)
1234 dnl Check for explicit debug flags.
1236 dnl --enable-libstdcxx-debug-flags='-O1'
1237 dnl is a general method for passing flags to be used when
1238 dnl building debug libraries with --enable-debug.
1240 dnl --disable-libstdcxx-debug-flags does nothing.
1241 dnl + Usage: GLIBCXX_ENABLE_DEBUG_FLAGS(default flags)
1242 dnl If "default flags" is an empty string, the effect is the same
1243 dnl as --disable or --enable=no.
1245 AC_DEFUN(GLIBCXX_ENABLE_DEBUG_FLAGS, [
1246 GLIBCXX_ENABLE(libstdcxx-debug-flags,[$1],[=FLAGS],
1247 [pass compiler FLAGS when building debug library],
1248 [case "x$enable_libstdcxx_debug_flags" in
1249 xno | x) enable_libstdcxx_debug_flags= ;;
1251 *) AC_MSG_ERROR(_g_switch needs compiler flags as arguments) ;;
1254 # Option parsed, now set things appropriately
1255 DEBUG_FLAGS="$enable_libstdcxx_debug_flags"
1256 AC_SUBST(DEBUG_FLAGS)
1258 AC_MSG_NOTICE([Debug build flags set to $DEBUG_FLAGS])
1263 dnl Check for libunwind exception handling support. If enabled, then
1264 dnl we assume that the _Unwind_* functions that make up the Unwind ABI
1265 dnl (_Unwind_RaiseException, _Unwind_Resume, etc.) are defined by
1266 dnl libunwind instead of libgcc, and that libstdc++ has a dependency
1267 dnl on libunwind as well as libgcc.
1269 dnl --enable-libunwind-exceptions forces the use of libunwind.
1270 dnl --disable-libunwind-exceptions assumes there is no libunwind.
1275 AC_DEFUN(GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS, [
1276 AC_MSG_CHECKING([for use of libunwind])
1277 GLIBCXX_ENABLE(libunwind-exceptions,no,,
1278 [force use of libunwind for exceptions])
1279 AC_MSG_RESULT($use_libunwind_exceptions)
1280 if test $enable_libunwind_exceptions = yes; then
1281 LIBUNWIND_FLAG="-lunwind"
1285 AC_SUBST(LIBUNWIND_FLAG)
1290 dnl Check for template specializations for the 'long long' type extension.
1291 dnl The result determines only whether 'long long' I/O is enabled; things
1292 dnl like numeric_limits<> specializations are always available.
1294 dnl --enable-long-long defines _GLIBCXX_USE_LONG_LONG
1295 dnl --disable-long-long leaves _GLIBCXX_USE_LONG_LONG undefined
1296 dnl + Usage: GLIBCXX_ENABLE_LONG_LONG[(DEFAULT)]
1297 dnl Where DEFAULT is either `yes' or `no'.
1298 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1300 AC_DEFUN(GLIBCXX_ENABLE_LONG_LONG, [
1301 GLIBCXX_ENABLE(long-long,$1,,[enables I/O support for 'long long'])
1306 AC_MSG_CHECKING([for enabled long long I/O support])
1307 # iostreams require strtoll, strtoull to compile
1308 AC_TRY_COMPILE([#include <stdlib.h>],
1309 [char* tmp; strtoll("gnu", &tmp, 10);],,[enable_long_long=no])
1310 AC_TRY_COMPILE([#include <stdlib.h>],
1311 [char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
1313 # Option parsed, now set things appropriately
1314 if test $enable_long_long = yes; then
1315 AC_DEFINE(_GLIBCXX_USE_LONG_LONG)
1317 AC_MSG_RESULT($enable_long_long)
1324 dnl Check to see if building and using a C++ precompiled header can be done.
1326 dnl --enable-libstdcxx-pch=yes
1327 dnl default, this shows intent to use stdc++.h.gch If it looks like it
1328 dnl may work, after some light-hearted attempts to puzzle out compiler
1329 dnl support, flip bits on in include/Makefile.am
1331 dnl --disable-libstdcxx-pch
1332 dnl turns off attempts to use or build stdc++.h.gch.
1335 dnl glibcxx_PCHFLAGS
1337 AC_DEFUN(GLIBCXX_ENABLE_PCH, [
1338 AC_MSG_CHECKING([for enabled PCH])
1339 GLIBCXX_ENABLE(libstdcxx-pch,$1,,[build pre-compiled libstdc++ headers])
1340 AC_MSG_RESULT([$enable_libstdcxx_pch])
1342 if test $enable_libstdcxx_pch = yes; then
1343 AC_CACHE_CHECK([for compiler with PCH support],
1344 [glibcxx_cv_prog_CXX_pch],
1345 [ac_save_CXXFLAGS="$CXXFLAGS"
1346 CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated"
1349 echo '#include <math.h>' > conftest.h
1350 if $CXX $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \
1351 -o conftest.h.gch 1>&5 2>&1 &&
1352 echo '#error "pch failed"' > conftest.h &&
1353 echo '#include "conftest.h"' > conftest.cc &&
1354 $CXX -c $CXXFLAGS $CPPFLAGS conftest.cc 1>&5 2>&1 ;
1356 glibcxx_cv_prog_CXX_pch=yes
1358 glibcxx_cv_prog_CXX_pch=no
1361 CXXFLAGS=$ac_save_CXXFLAGS
1364 enable_libstdcxx_pch=$glibcxx_cv_prog_CXX_pch
1367 AM_CONDITIONAL(GLIBCXX_BUILD_PCH, test $enable_libstdcxx_pch = yes)
1368 if test $enable_libstdcxx_pch = yes; then
1369 glibcxx_PCHFLAGS="-include bits/stdc++.h"
1373 AC_SUBST(glibcxx_PCHFLAGS)
1378 dnl Check for exception handling support. If an explicit enable/disable
1379 dnl sjlj exceptions is given, we don't have to detect. Otherwise the
1380 dnl target may or may not support call frame exceptions.
1382 dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
1383 dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
1384 dnl Neither one forces an attempt at detection.
1387 dnl _GLIBCXX_SJLJ_EXCEPTIONS if the compiler is configured for it
1389 AC_DEFUN(GLIBCXX_ENABLE_SJLJ_EXCEPTIONS, [
1390 AC_MSG_CHECKING([for exception model to use])
1393 GLIBCXX_ENABLE(sjlj-exceptions,auto,,
1394 [force use of builtin_setjmp for exceptions],
1395 [permit yes|no|auto])
1397 if test $enable_sjlj_exceptions = auto; then
1398 # Botheration. Now we've got to detect the exception model. Link tests
1399 # against libgcc.a are problematic since we've not been given proper -L
1400 # bits for single-tree newlib and libgloss.
1402 # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
1403 cat > conftest.$ac_ext << EOF
1404 [#]line __oline__ "configure"
1413 old_CXXFLAGS="$CXXFLAGS"
1415 if AC_TRY_EVAL(ac_compile); then
1416 if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
1417 enable_sjlj_exceptions=yes
1418 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
1419 enable_sjlj_exceptions=no
1422 CXXFLAGS="$old_CXXFLAGS"
1426 # This is a tad weird, for hysterical raisins. We have to map enable/disable
1427 # to two different models.
1428 case $enable_sjlj_exceptions in
1430 AC_DEFINE(_GLIBCXX_SJLJ_EXCEPTIONS, 1,
1431 [Define if the compiler is configured for setjmp/longjmp exceptions.])
1432 ac_exception_model_name=sjlj
1435 ac_exception_model_name="call frame"
1438 AC_MSG_ERROR([unable to detect exception model])
1442 AC_MSG_RESULT($ac_exception_model_name)
1447 dnl Add version tags to symbols in shared library (or not), additionally
1448 dnl marking other symbols as private/local (or not).
1450 dnl --enable-symvers=style adds a version script to the linker call when
1451 dnl creating the shared library. The choice of version script is
1452 dnl controlled by 'style'.
1453 dnl --disable-symvers does not.
1454 dnl + Usage: GLIBCXX_ENABLE_SYMVERS[(DEFAULT)]
1455 dnl Where DEFAULT is either 'yes' or 'no'. Passing `yes' tries to
1456 dnl choose a default style based on linker characteristics. Passing
1457 dnl 'no' disables versioning.
1459 AC_DEFUN(GLIBCXX_ENABLE_SYMVERS, [
1461 GLIBCXX_ENABLE(symvers,$1,[=STYLE],
1462 [enables symbol versioning of the shared library],
1463 [permit yes|no|gnu])
1465 # If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we
1466 # don't know enough about $LD to do tricks...
1467 AC_REQUIRE([GLIBCXX_CHECK_LINKER_FEATURES])
1468 # FIXME The following test is too strict, in theory.
1469 if test $enable_shared = no ||
1471 test x$glibcxx_gnu_ld_version = x; then
1475 # Check to see if libgcc_s exists, indicating that shared libgcc is possible.
1476 if test $enable_symvers != no; then
1477 AC_MSG_CHECKING([for shared libgcc])
1478 ac_save_CFLAGS="$CFLAGS"
1480 AC_TRY_LINK(, [return 0;], glibcxx_shared_libgcc=yes, glibcxx_shared_libgcc=no)
1481 CFLAGS="$ac_save_CFLAGS"
1482 AC_MSG_RESULT($glibcxx_shared_libgcc)
1485 # For GNU ld, we need at least this version. The format is described in
1486 # GLIBCXX_CHECK_LINKER_FEATURES above.
1487 glibcxx_min_gnu_ld_version=21400
1488 # XXXXXXXXXXX glibcxx_gnu_ld_version=21390
1490 # Check to see if unspecified "yes" value can win, given results above.
1491 # Change "yes" into either "no" or a style name.
1492 if test $enable_symvers = yes; then
1493 if test $with_gnu_ld = yes &&
1494 test $glibcxx_shared_libgcc = yes;
1496 if test $glibcxx_gnu_ld_version -ge $glibcxx_min_gnu_ld_version ; then
1499 # The right tools, the right setup, but too old. Fallbacks?
1500 AC_MSG_WARN(=== Linker version $glibcxx_gnu_ld_version is too old for)
1501 AC_MSG_WARN(=== full symbol versioning support in this release of GCC.)
1502 AC_MSG_WARN(=== You would need to upgrade your binutils to version)
1503 AC_MSG_WARN(=== $glibcxx_min_gnu_ld_version or later and rebuild GCC.)
1504 if test $glibcxx_gnu_ld_version -ge 21200 ; then
1505 # Globbing fix is present, proper block support is not.
1506 dnl AC_MSG_WARN([=== Dude, you are soooo close. Maybe we can fake it.])
1507 dnl enable_symvers=???
1508 AC_MSG_WARN([=== Symbol versioning will be disabled.])
1512 AC_MSG_WARN([=== Symbol versioning will be disabled.])
1518 AC_MSG_WARN([=== You have requested some kind of symbol versioning, but])
1519 AC_MSG_WARN([=== either you are not using a supported linker, or you are])
1520 AC_MSG_WARN([=== not building a shared libgcc_s (which is required).])
1521 AC_MSG_WARN([=== Symbol versioning will be disabled.])
1526 # Everything parsed; figure out what file to use.
1527 case $enable_symvers in
1529 SYMVER_MAP=config/linker-map.dummy
1532 SYMVER_MAP=config/linker-map.gnu
1533 AC_DEFINE(_GLIBCXX_SYMVER)
1537 AC_SUBST(SYMVER_MAP)
1538 AC_SUBST(port_specific_symbol_files)
1539 AM_CONDITIONAL(GLIBCXX_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
1540 AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
1545 dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
1546 dnl We must stage the required headers so that they will be installed
1547 dnl with the library (unlike libgcc, the STL implementation is provided
1548 dnl solely within headers). Since we must not inject random user-space
1549 dnl macro names into user-provided C++ code, we first stage into <file>-in
1550 dnl and process to <file> with an output command. The reason for a two-
1551 dnl stage process here is to correctly handle $srcdir!=$objdir without
1552 dnl having to write complex code (the sed commands to clean the macro
1553 dnl namespace are complex and fragile enough as it is). We must also
1554 dnl add a relative path so that -I- is supported properly.
1557 dnl glibcxx_thread_h
1560 dnl HAVE_GTHR_DEFAULT
1561 dnl _GLIBCXX_SUPPORTS_WEAK
1563 AC_DEFUN(GLIBCXX_ENABLE_THREADS, [
1564 AC_MSG_CHECKING([for thread model used by GCC])
1565 target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
1566 AC_MSG_RESULT([$target_thread_file])
1568 if test $target_thread_file != single; then
1569 AC_DEFINE(HAVE_GTHR_DEFAULT)
1570 AC_DEFINE(_GLIBCXX_SUPPORTS_WEAK, __GXX_WEAK__)
1573 glibcxx_thread_h=gthr-$target_thread_file.h
1574 AC_SUBST(glibcxx_thread_h)
1578 # Check whether LC_MESSAGES is available in <locale.h>.
1579 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1581 # This file file be copied and used freely without restrictions. It can
1582 # be used in projects which are not available under the GNU Public License
1583 # but which still want to provide support for the GNU gettext functionality.
1584 # Please note that the actual code is *not* freely available.
1587 AC_DEFUN(AC_LC_MESSAGES, [
1588 AC_CHECK_HEADER(locale.h, [
1589 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1590 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1591 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1592 if test $ac_cv_val_LC_MESSAGES = yes; then
1593 AC_DEFINE(HAVE_LC_MESSAGES)
1599 sinclude([../libtool.m4])
1600 dnl The lines below arrange for aclocal not to bring an installed
1601 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
1602 dnl add a definition of LIBTOOL to Makefile.in.
1603 ifelse(,,,[AC_SUBST(LIBTOOL)
1604 AC_DEFUN([AM_PROG_LIBTOOL])
1605 AC_DEFUN([AC_LIBTOOL_DLOPEN])
1606 AC_DEFUN([AC_PROG_LD])
1609 dnl vim:et:ts=2:sw=2
1611 # Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
1613 # This program is free software; you can redistribute it and/or modify
1614 # it under the terms of the GNU General Public License as published by
1615 # the Free Software Foundation; either version 2, or (at your option)
1616 # any later version.
1618 # This program is distributed in the hope that it will be useful,
1619 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1620 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1621 # GNU General Public License for more details.
1623 # You should have received a copy of the GNU General Public License
1624 # along with this program; if not, write to the Free Software
1625 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1630 # AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR])
1631 # ---------------------------------------------------
1632 # Add --enable-multilib to configure.
1633 AC_DEFUN([AM_ENABLE_MULTILIB],
1634 [# Default to --enable-multilib
1635 AC_ARG_ENABLE(multilib,
1636 [ --enable-multilib build many library versions (default)],
1637 [case "$enableval" in
1638 yes) multilib=yes ;;
1640 *) AC_MSG_ERROR([bad value $enableval for multilib option]) ;;
1644 # We may get other options which we leave undocumented:
1645 # --with-target-subdir, --with-multisrctop, --with-multisubdir
1646 # See config-ml.in if you want the gory details.
1648 if test "$srcdir" = "."; then
1649 if test "$with_target_subdir" != "."; then
1650 multi_basedir="$srcdir/$with_multisrctop../$2"
1652 multi_basedir="$srcdir/$with_multisrctop$2"
1655 multi_basedir="$srcdir/$2"
1657 AC_SUBST(multi_basedir)
1659 AC_OUTPUT_COMMANDS([
1660 # Only add multilib support code if we just rebuilt the top-level
1662 case " $CONFIG_FILES " in
1663 *" ]m4_default([$1],Makefile)[ "*)
1664 ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in
1671 with_multisubdir="$with_multisubdir"
1672 with_multisrctop="$with_multisrctop"
1673 with_target_subdir="$with_target_subdir"
1674 ac_configure_args="${multilib_arg} ${ac_configure_args}"
1675 multi_basedir="$multi_basedir"
1676 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1679 # isc-posix.m4 serial 2 (gettext-0.11.2)
1680 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1681 dnl This file is free software, distributed under the terms of the GNU
1682 dnl General Public License. As a special exception to the GNU General
1683 dnl Public License, this file may be distributed as part of a program
1684 dnl that contains a configuration script generated by Autoconf, under
1685 dnl the same distribution terms as the rest of that program.
1687 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
1689 # This test replaces the one in autoconf.
1690 # Currently this macro should have the same name as the autoconf macro
1691 # because gettext's gettext.m4 (distributed in the automake package)
1692 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
1693 # give these diagnostics:
1694 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1695 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1697 undefine([AC_ISC_POSIX])
1699 AC_DEFUN([AC_ISC_POSIX],
1701 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1702 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1706 # Add --enable-maintainer-mode option to configure.
1709 # Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
1711 # This program is free software; you can redistribute it and/or modify
1712 # it under the terms of the GNU General Public License as published by
1713 # the Free Software Foundation; either version 2, or (at your option)
1714 # any later version.
1716 # This program is distributed in the hope that it will be useful,
1717 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1718 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1719 # GNU General Public License for more details.
1721 # You should have received a copy of the GNU General Public License
1722 # along with this program; if not, write to the Free Software
1723 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1728 AC_DEFUN([AM_MAINTAINER_MODE],
1729 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1730 dnl maintainer-mode is disabled by default
1731 AC_ARG_ENABLE(maintainer-mode,
1732 [ --enable-maintainer-mode enable make rules and dependencies not useful
1733 (and sometimes confusing) to the casual installer],
1734 USE_MAINTAINER_MODE=$enableval,
1735 USE_MAINTAINER_MODE=no)
1736 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
1737 AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
1738 MAINT=$MAINTAINER_MODE_TRUE
1743 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
1745 # AM_CONDITIONAL -*- Autoconf -*-
1747 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
1749 # This program is free software; you can redistribute it and/or modify
1750 # it under the terms of the GNU General Public License as published by
1751 # the Free Software Foundation; either version 2, or (at your option)
1752 # any later version.
1754 # This program is distributed in the hope that it will be useful,
1755 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1756 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1757 # GNU General Public License for more details.
1759 # You should have received a copy of the GNU General Public License
1760 # along with this program; if not, write to the Free Software
1761 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1768 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1769 # -------------------------------------
1770 # Define a conditional.
1771 AC_DEFUN([AM_CONDITIONAL],
1772 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
1773 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1775 AC_SUBST([$1_FALSE])
1783 AC_CONFIG_COMMANDS_PRE(
1784 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1785 AC_MSG_ERROR([conditional "$1" was never defined.
1786 Usually this means the macro was only invoked conditionally.])
1789 # Do all the work for Automake. -*- Autoconf -*-
1791 # This macro actually does too much some checks are only needed if
1792 # your package does certain things. But this isn't really a big deal.
1794 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
1795 # Free Software Foundation, Inc.
1797 # This program is free software; you can redistribute it and/or modify
1798 # it under the terms of the GNU General Public License as published by
1799 # the Free Software Foundation; either version 2, or (at your option)
1800 # any later version.
1802 # This program is distributed in the hope that it will be useful,
1803 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1804 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1805 # GNU General Public License for more details.
1807 # You should have received a copy of the GNU General Public License
1808 # along with this program; if not, write to the Free Software
1809 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1816 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
1817 # the ones we care about.
1818 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1820 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1821 # AM_INIT_AUTOMAKE([OPTIONS])
1822 # -----------------------------------------------
1823 # The call with PACKAGE and VERSION arguments is the old style
1824 # call (pre autoconf-2.50), which is being phased out. PACKAGE
1825 # and VERSION should now be passed to AC_INIT and removed from
1826 # the call to AM_INIT_AUTOMAKE.
1827 # We support both call styles for the transition. After
1828 # the next Automake release, Autoconf can make the AC_INIT
1829 # arguments mandatory, and then we can depend on a new Autoconf
1830 # release and drop the old call support.
1831 AC_DEFUN([AM_INIT_AUTOMAKE],
1832 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1833 AC_REQUIRE([AC_PROG_INSTALL])dnl
1834 # test to see if srcdir already configured
1835 if test "`cd $srcdir && pwd`" != "`pwd`" &&
1836 test -f $srcdir/config.status; then
1837 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1840 # test whether we have cygpath
1841 if test -z "$CYGPATH_W"; then
1842 if (cygpath --version) >/dev/null 2>/dev/null; then
1843 CYGPATH_W='cygpath -w'
1848 AC_SUBST([CYGPATH_W])
1850 # Define the identity of the package.
1851 dnl Distinguish between old-style and new-style calls.
1853 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1854 AC_SUBST([PACKAGE], [$1])dnl
1855 AC_SUBST([VERSION], [$2])],
1856 [_AM_SET_OPTIONS([$1])dnl
1857 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1858 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1860 _AM_IF_OPTION([no-define],,
1861 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1862 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1864 # Some tools Automake needs.
1865 AC_REQUIRE([AM_SANITY_CHECK])dnl
1866 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1867 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1868 AM_MISSING_PROG(AUTOCONF, autoconf)
1869 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1870 AM_MISSING_PROG(AUTOHEADER, autoheader)
1871 AM_MISSING_PROG(MAKEINFO, makeinfo)
1872 AM_MISSING_PROG(AMTAR, tar)
1874 AM_PROG_INSTALL_STRIP
1875 # We need awk for the "check" target. The system "awk" is bad on
1877 AC_REQUIRE([AC_PROG_AWK])dnl
1878 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1879 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1881 _AM_IF_OPTION([no-dependencies],,
1882 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1883 [_AM_DEPENDENCIES(CC)],
1884 [define([AC_PROG_CC],
1885 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1886 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1887 [_AM_DEPENDENCIES(CXX)],
1888 [define([AC_PROG_CXX],
1889 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1894 # When config.status generates a header, we must update the stamp-h file.
1895 # This file resides in the same directory as the config header
1896 # that is generated. The stamp files are numbered to have different names.
1898 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1899 # loop where config.status creates the headers, so we can generate
1900 # our stamp files there.
1901 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1902 [# Compute $1's index in $config_headers.
1904 for _am_header in $config_headers :; do
1909 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1912 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
1914 # Copyright 2002 Free Software Foundation, Inc.
1916 # This program is free software; you can redistribute it and/or modify
1917 # it under the terms of the GNU General Public License as published by
1918 # the Free Software Foundation; either version 2, or (at your option)
1919 # any later version.
1921 # This program is distributed in the hope that it will be useful,
1922 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1923 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1924 # GNU General Public License for more details.
1926 # You should have received a copy of the GNU General Public License
1927 # along with this program; if not, write to the Free Software
1928 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1930 # AM_AUTOMAKE_VERSION(VERSION)
1931 # ----------------------------
1932 # Automake X.Y traces this macro to ensure aclocal.m4 has been
1933 # generated from the m4 files accompanying Automake X.Y.
1934 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
1936 # AM_SET_CURRENT_AUTOMAKE_VERSION
1937 # -------------------------------
1938 # Call AM_AUTOMAKE_VERSION so it can be traced.
1939 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
1940 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1941 [AM_AUTOMAKE_VERSION([1.7.6])])
1943 # Helper functions for option handling. -*- Autoconf -*-
1945 # Copyright 2001, 2002 Free Software Foundation, Inc.
1947 # This program is free software; you can redistribute it and/or modify
1948 # it under the terms of the GNU General Public License as published by
1949 # the Free Software Foundation; either version 2, or (at your option)
1950 # any later version.
1952 # This program is distributed in the hope that it will be useful,
1953 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1954 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1955 # GNU General Public License for more details.
1957 # You should have received a copy of the GNU General Public License
1958 # along with this program; if not, write to the Free Software
1959 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1964 # _AM_MANGLE_OPTION(NAME)
1965 # -----------------------
1966 AC_DEFUN([_AM_MANGLE_OPTION],
1967 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1969 # _AM_SET_OPTION(NAME)
1970 # ------------------------------
1971 # Set option NAME. Presently that only means defining a flag for this option.
1972 AC_DEFUN([_AM_SET_OPTION],
1973 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1975 # _AM_SET_OPTIONS(OPTIONS)
1976 # ----------------------------------
1977 # OPTIONS is a space-separated list of Automake options.
1978 AC_DEFUN([_AM_SET_OPTIONS],
1979 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1981 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1982 # -------------------------------------------
1983 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1984 AC_DEFUN([_AM_IF_OPTION],
1985 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1988 # Check to make sure that the build environment is sane.
1991 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
1993 # This program is free software; you can redistribute it and/or modify
1994 # it under the terms of the GNU General Public License as published by
1995 # the Free Software Foundation; either version 2, or (at your option)
1996 # any later version.
1998 # This program is distributed in the hope that it will be useful,
1999 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2000 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2001 # GNU General Public License for more details.
2003 # You should have received a copy of the GNU General Public License
2004 # along with this program; if not, write to the Free Software
2005 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2012 AC_DEFUN([AM_SANITY_CHECK],
2013 [AC_MSG_CHECKING([whether build environment is sane])
2016 echo timestamp > conftest.file
2017 # Do `set' in a subshell so we don't clobber the current shell's
2018 # arguments. Must try -L first in case configure is actually a
2019 # symlink; some systems play weird games with the mod time of symlinks
2020 # (eg FreeBSD returns the mod time of the symlink's containing
2023 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
2024 if test "$[*]" = "X"; then
2026 set X `ls -t $srcdir/configure conftest.file`
2029 if test "$[*]" != "X $srcdir/configure conftest.file" \
2030 && test "$[*]" != "X conftest.file $srcdir/configure"; then
2032 # If neither matched, then we have a broken ls. This can happen
2033 # if, for instance, CONFIG_SHELL is bash and it inherits a
2034 # broken ls alias from the environment. This has actually
2035 # happened. Such a system could not be considered "sane".
2036 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
2037 alias in your environment])
2040 test "$[2]" = conftest.file
2046 AC_MSG_ERROR([newly created file is older than distributed files!
2047 Check your system clock])
2049 AC_MSG_RESULT(yes)])
2054 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
2056 # This program is free software; you can redistribute it and/or modify
2057 # it under the terms of the GNU General Public License as published by
2058 # the Free Software Foundation; either version 2, or (at your option)
2059 # any later version.
2061 # This program is distributed in the hope that it will be useful,
2062 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2063 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2064 # GNU General Public License for more details.
2066 # You should have received a copy of the GNU General Public License
2067 # along with this program; if not, write to the Free Software
2068 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2073 # AM_MISSING_PROG(NAME, PROGRAM)
2074 # ------------------------------
2075 AC_DEFUN([AM_MISSING_PROG],
2076 [AC_REQUIRE([AM_MISSING_HAS_RUN])
2077 $1=${$1-"${am_missing_run}$2"}
2081 # AM_MISSING_HAS_RUN
2082 # ------------------
2083 # Define MISSING if not defined so far and test if it supports --run.
2084 # If it does, set am_missing_run to use it, otherwise, to nothing.
2085 AC_DEFUN([AM_MISSING_HAS_RUN],
2086 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2087 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
2088 # Use eval to expand $SHELL
2089 if eval "$MISSING --run true"; then
2090 am_missing_run="$MISSING --run "
2093 AC_MSG_WARN([`missing' script is too old or missing])
2099 # Copyright 2001 Free Software Foundation, Inc.
2101 # This program is free software; you can redistribute it and/or modify
2102 # it under the terms of the GNU General Public License as published by
2103 # the Free Software Foundation; either version 2, or (at your option)
2104 # any later version.
2106 # This program is distributed in the hope that it will be useful,
2107 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2108 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2109 # GNU General Public License for more details.
2111 # You should have received a copy of the GNU General Public License
2112 # along with this program; if not, write to the Free Software
2113 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2116 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
2117 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
2118 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
2120 # Of course, Automake must honor this variable whenever it calls a
2121 # tool from the auxiliary directory. The problem is that $srcdir (and
2122 # therefore $ac_aux_dir as well) can be either absolute or relative,
2123 # depending on how configure is run. This is pretty annoying, since
2124 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
2125 # source directory, any form will work fine, but in subdirectories a
2126 # relative path needs to be adjusted first.
2128 # $ac_aux_dir/missing
2129 # fails when called from a subdirectory if $ac_aux_dir is relative
2130 # $top_srcdir/$ac_aux_dir/missing
2131 # fails if $ac_aux_dir is absolute,
2132 # fails when called from a subdirectory in a VPATH build with
2133 # a relative $ac_aux_dir
2135 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
2136 # are both prefixed by $srcdir. In an in-source build this is usually
2137 # harmless because $srcdir is `.', but things will broke when you
2138 # start a VPATH build or use an absolute $srcdir.
2140 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
2141 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
2142 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
2143 # and then we would define $MISSING as
2144 # MISSING="\${SHELL} $am_aux_dir/missing"
2145 # This will work as long as MISSING is not called from configure, because
2146 # unfortunately $(top_srcdir) has no meaning in configure.
2147 # However there are other variables, like CC, which are often used in
2148 # configure, and could therefore not use this "fixed" $ac_aux_dir.
2150 # Another solution, used here, is to always expand $ac_aux_dir to an
2151 # absolute PATH. The drawback is that using absolute paths prevent a
2152 # configured tree to be moved without reconfiguration.
2154 # Rely on autoconf to set up CDPATH properly.
2157 AC_DEFUN([AM_AUX_DIR_EXPAND], [
2158 # expand $ac_aux_dir to an absolute path
2159 am_aux_dir=`cd $ac_aux_dir && pwd`
2162 # AM_PROG_INSTALL_SH
2163 # ------------------
2164 # Define $install_sh.
2166 # Copyright 2001 Free Software Foundation, Inc.
2168 # This program is free software; you can redistribute it and/or modify
2169 # it under the terms of the GNU General Public License as published by
2170 # the Free Software Foundation; either version 2, or (at your option)
2171 # any later version.
2173 # This program is distributed in the hope that it will be useful,
2174 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2175 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2176 # GNU General Public License for more details.
2178 # You should have received a copy of the GNU General Public License
2179 # along with this program; if not, write to the Free Software
2180 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2183 AC_DEFUN([AM_PROG_INSTALL_SH],
2184 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2185 install_sh=${install_sh-"$am_aux_dir/install-sh"}
2186 AC_SUBST(install_sh)])
2188 # AM_PROG_INSTALL_STRIP
2190 # Copyright 2001 Free Software Foundation, Inc.
2192 # This program is free software; you can redistribute it and/or modify
2193 # it under the terms of the GNU General Public License as published by
2194 # the Free Software Foundation; either version 2, or (at your option)
2195 # any later version.
2197 # This program is distributed in the hope that it will be useful,
2198 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2199 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2200 # GNU General Public License for more details.
2202 # You should have received a copy of the GNU General Public License
2203 # along with this program; if not, write to the Free Software
2204 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2207 # One issue with vendor `install' (even GNU) is that you can't
2208 # specify the program used to strip binaries. This is especially
2209 # annoying in cross-compiling environments, where the build's strip
2210 # is unlikely to handle the host's binaries.
2211 # Fortunately install-sh will honor a STRIPPROG variable, so we
2212 # always use install-sh in `make install-strip', and initialize
2213 # STRIPPROG with the value of the STRIP variable (set by the user).
2214 AC_DEFUN([AM_PROG_INSTALL_STRIP],
2215 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2216 # Installed binaries are usually stripped using `strip' when the user
2217 # run `make install-strip'. However `strip' might not be the right
2218 # tool to use in cross-compilation environments, therefore Automake
2219 # will honor the `STRIP' environment variable to overrule this program.
2220 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
2221 if test "$cross_compiling" != no; then
2222 AC_CHECK_TOOL([STRIP], [strip], :)
2224 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
2225 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2228 # Copyright (C) 2003 Free Software Foundation, Inc.
2230 # This program is free software; you can redistribute it and/or modify
2231 # it under the terms of the GNU General Public License as published by
2232 # the Free Software Foundation; either version 2, or (at your option)
2233 # any later version.
2235 # This program is distributed in the hope that it will be useful,
2236 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2237 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2238 # GNU General Public License for more details.
2240 # You should have received a copy of the GNU General Public License
2241 # along with this program; if not, write to the Free Software
2242 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2247 # Check whether the underlying file-system supports filenames
2248 # with a leading dot. For instance MS-DOS doesn't.
2249 AC_DEFUN([AM_SET_LEADING_DOT],
2250 [rm -rf .tst 2>/dev/null
2251 mkdir .tst 2>/dev/null
2252 if test -d .tst; then
2257 rmdir .tst 2>/dev/null
2258 AC_SUBST([am__leading_dot])])
2260 # serial 5 -*- Autoconf -*-
2262 # Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
2264 # This program is free software; you can redistribute it and/or modify
2265 # it under the terms of the GNU General Public License as published by
2266 # the Free Software Foundation; either version 2, or (at your option)
2267 # any later version.
2269 # This program is distributed in the hope that it will be useful,
2270 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2271 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2272 # GNU General Public License for more details.
2274 # You should have received a copy of the GNU General Public License
2275 # along with this program; if not, write to the Free Software
2276 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2280 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
2281 # written in clear, in which case automake, when reading aclocal.m4,
2282 # will think it sees a *use*, and therefore will trigger all it's
2283 # C support machinery. Also note that it means that autoscan, seeing
2284 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
2288 # _AM_DEPENDENCIES(NAME)
2289 # ----------------------
2290 # See how the compiler implements dependency checking.
2291 # NAME is "CC", "CXX", "GCJ", or "OBJC".
2292 # We try a few techniques and use that to set a single cache variable.
2294 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
2295 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
2296 # dependency, and given that the user is not expected to run this macro,
2297 # just rely on AC_PROG_CC.
2298 AC_DEFUN([_AM_DEPENDENCIES],
2299 [AC_REQUIRE([AM_SET_DEPDIR])dnl
2300 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
2301 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
2302 AC_REQUIRE([AM_DEP_TRACK])dnl
2304 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
2305 [$1], CXX, [depcc="$CXX" am_compiler_list=],
2306 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
2307 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
2308 [depcc="$$1" am_compiler_list=])
2310 AC_CACHE_CHECK([dependency style of $depcc],
2311 [am_cv_$1_dependencies_compiler_type],
2312 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
2313 # We make a subdir and do the tests there. Otherwise we can end up
2314 # making bogus files that we don't know about and never remove. For
2315 # instance it was reported that on HP-UX the gcc test will end up
2316 # making a dummy file named `D' -- because `-MD' means `put the output
2319 # Copy depcomp to subdir because otherwise we won't find it if we're
2320 # using a relative directory.
2321 cp "$am_depcomp" conftest.dir
2323 # We will build objects and dependencies in a subdirectory because
2324 # it helps to detect inapplicable dependency modes. For instance
2325 # both Tru64's cc and ICC support -MD to output dependencies as a
2326 # side effect of compilation, but ICC will put the dependencies in
2327 # the current directory while Tru64 will put them in the object
2331 am_cv_$1_dependencies_compiler_type=none
2332 if test "$am_compiler_list" = ""; then
2333 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2335 for depmode in $am_compiler_list; do
2336 # Setup a source with many dependencies, because some compilers
2337 # like to wrap large dependency lists on column 80 (with \), and
2338 # we should not choose a depcomp mode which is confused by this.
2340 # We need to recreate these files for each test, as the compiler may
2341 # overwrite some of them when testing with obscure command lines.
2342 # This happens at least with the AIX C compiler.
2344 for i in 1 2 3 4 5 6; do
2345 echo '#include "conftst'$i'.h"' >> sub/conftest.c
2348 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2352 # after this tag, mechanisms are not by side-effect, so they'll
2353 # only be used when explicitly requested
2354 if test "x$enable_dependency_tracking" = xyes; then
2362 # We check with `-c' and `-o' for the sake of the "dashmstdout"
2363 # mode. It turns out that the SunPro C++ compiler does not properly
2364 # handle `-M -o', and we need to detect this.
2365 if depmode=$depmode \
2366 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
2367 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2368 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
2369 >/dev/null 2>conftest.err &&
2370 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2371 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
2372 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2373 # icc doesn't choke on unknown options, it will just issue warnings
2374 # (even with -Werror). So we grep stderr for any message
2375 # that says an option was ignored.
2376 if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
2377 am_cv_$1_dependencies_compiler_type=$depmode
2386 am_cv_$1_dependencies_compiler_type=none
2389 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2390 AM_CONDITIONAL([am__fastdep$1], [
2391 test "x$enable_dependency_tracking" != xno \
2392 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2398 # Choose a directory name for dependency files.
2399 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
2400 AC_DEFUN([AM_SET_DEPDIR],
2401 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2402 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2408 AC_DEFUN([AM_DEP_TRACK],
2409 [AC_ARG_ENABLE(dependency-tracking,
2410 [ --disable-dependency-tracking Speeds up one-time builds
2411 --enable-dependency-tracking Do not reject slow dependency extractors])
2412 if test "x$enable_dependency_tracking" != xno; then
2413 am_depcomp="$ac_aux_dir/depcomp"
2416 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2417 AC_SUBST([AMDEPBACKSLASH])
2420 # Generate code to set up dependency tracking. -*- Autoconf -*-
2422 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
2424 # This program is free software; you can redistribute it and/or modify
2425 # it under the terms of the GNU General Public License as published by
2426 # the Free Software Foundation; either version 2, or (at your option)
2427 # any later version.
2429 # This program is distributed in the hope that it will be useful,
2430 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2431 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2432 # GNU General Public License for more details.
2434 # You should have received a copy of the GNU General Public License
2435 # along with this program; if not, write to the Free Software
2436 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2441 # _AM_OUTPUT_DEPENDENCY_COMMANDS
2442 # ------------------------------
2443 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
2444 [for mf in $CONFIG_FILES; do
2445 # Strip MF so we end up with the name of the file.
2446 mf=`echo "$mf" | sed -e 's/:.*$//'`
2447 # Check whether this is an Automake generated Makefile or not.
2448 # We used to match only the files named `Makefile.in', but
2449 # some people rename them; so instead we look at the file content.
2450 # Grep'ing the first line is not enough: some people post-process
2451 # each Makefile.in and add a new line on top of each file to say so.
2452 # So let's grep whole file.
2453 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
2454 dirpart=`AS_DIRNAME("$mf")`
2458 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
2459 # Extract the definition of DEP_FILES from the Makefile without
2461 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
2462 test -z "$DEPDIR" && continue
2463 # When using ansi2knr, U may be empty or an underscore; expand it
2464 U=`sed -n -e '/^U = / s///p' < "$mf"`
2465 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
2466 # We invoke sed twice because it is the simplest approach to
2467 # changing $(DEPDIR) to its actual value in the expansion.
2468 for file in `sed -n -e '
2469 /^DEP_FILES = .*\\\\$/ {
2478 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
2479 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
2480 # Make sure the directory exists.
2481 test -f "$dirpart/$file" && continue
2482 fdir=`AS_DIRNAME(["$file"])`
2483 AS_MKDIR_P([$dirpart/$fdir])
2484 # echo "creating $dirpart/$file"
2485 echo '# dummy' > "$dirpart/$file"
2488 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
2491 # AM_OUTPUT_DEPENDENCY_COMMANDS
2492 # -----------------------------
2493 # This macro should only be invoked once -- use via AC_REQUIRE.
2495 # This code is only required when automatic dependency tracking
2496 # is enabled. FIXME. This creates each `.P' file that we will
2497 # need in order to bootstrap the dependency handling code.
2498 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
2499 [AC_CONFIG_COMMANDS([depfiles],
2500 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
2501 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
2504 # Check to see how 'make' treats includes. -*- Autoconf -*-
2506 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
2508 # This program is free software; you can redistribute it and/or modify
2509 # it under the terms of the GNU General Public License as published by
2510 # the Free Software Foundation; either version 2, or (at your option)
2511 # any later version.
2513 # This program is distributed in the hope that it will be useful,
2514 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2515 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2516 # GNU General Public License for more details.
2518 # You should have received a copy of the GNU General Public License
2519 # along with this program; if not, write to the Free Software
2520 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2527 # Check to see how make treats includes.
2528 AC_DEFUN([AM_MAKE_INCLUDE],
2529 [am_make=${MAKE-make}
2530 cat > confinc << 'END'
2535 # If we don't find an include directive, just comment out the code.
2536 AC_MSG_CHECKING([for style of include used by $am_make])
2540 # First try GNU make style include.
2541 echo "include confinc" > confmf
2542 # We grep out `Entering directory' and `Leaving directory'
2543 # messages which can occur if `w' ends up in MAKEFLAGS.
2544 # In particular we don't look at `^make:' because GNU make might
2545 # be invoked under some other name (usually "gmake"), in which
2546 # case it prints its new name instead of `make'.
2547 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
2552 # Now try BSD make style include.
2553 if test "$am__include" = "#"; then
2554 echo '.include "confinc"' > confmf
2555 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
2556 am__include=.include
2561 AC_SUBST([am__include])
2562 AC_SUBST([am__quote])
2563 AC_MSG_RESULT([$_am_result])
2564 rm -f confinc confmf