OSDN Git Service

2003-09-18 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / aclocal.m4
1 # generated automatically by aclocal 1.7.6 -*- Autoconf -*-
2
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.
8
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
12 # PARTICULAR PURPOSE.
13
14
15 dnl
16 dnl GLIBCXX_CONDITIONAL (NAME, SHELL-TEST)
17 dnl
18 dnl Exactly like AM_CONDITIONAL, but delays evaluation of the test until the
19 dnl end of configure.  This lets tested variables be reassigned, and the
20 dnl conditional will depend on the final state of the variable.  For a simple
21 dnl example of why this is needed, see GLIBCXX_ENABLE_HOSTED.
22 dnl
23 m4_define([_m4_divert(glibcxx_diversion)], 8000)dnl
24 AC_DEFUN(GLIBCXX_CONDITIONAL, [dnl
25   m4_divert_text([glibcxx_diversion],dnl
26    AM_CONDITIONAL([$1],[$2])
27   )dnl
28 ])dnl
29 AC_DEFUN(GLIBCXX_EVALUATE_CONDITIONALS, [m4_undivert([glibcxx_diversion])])dnl
30
31
32 dnl
33 dnl Check to see what architecture and operating system we are compiling
34 dnl for.  Also, if architecture- or OS-specific flags are required for
35 dnl compilation, pick them up here.
36 dnl
37 AC_DEFUN(GLIBCXX_CHECK_HOST, [
38   . $glibcxx_srcdir/configure.host
39   AC_MSG_NOTICE(CPU config directory is $cpu_include_dir)
40   AC_MSG_NOTICE(OS config directory is $os_include_dir)
41 ])
42
43
44 dnl
45 dnl Initialize basic configure bits.
46 dnl
47 dnl Substs:
48 dnl  multi_basedir
49 dnl
50 AC_DEFUN(GLIBCXX_TOPREL_CONFIGURE, [
51   # Sets up multi_basedir, which is srcdir/.. plus the usual
52   # "multi_source_toprel_bottom_adjust" lunacy as needed.
53   AM_ENABLE_MULTILIB(, ..)
54
55   # The generated code is exactly the same, except that automake's looks in
56   # ".. $srcdir/.." and autoconf's looks in multi_basedir.  Apparently other
57   # things are triggered on the presence of the two ...AUX_DIR[S], but I don't
58   # know what they are or what the other differences might be (and they keep
59   # changing anyhow).
60   #
61   # Looking in multi_basedir seems smarter, so actually execute that branch.
62   if false; then
63     # this is for automake
64     AC_CONFIG_AUX_DIR(..)
65   else
66     # this is for autoconf
67     AC_CONFIG_AUX_DIRS(${multi_basedir})
68   fi
69
70   dnl XXX Turn this on.
71   dnl AC_LANG_CPLUSPLUS
72 ])
73
74
75 dnl
76 dnl Initialize the rest of the library configury.  At this point we have
77 dnl variables like $host.
78 dnl
79 dnl Sets:
80 dnl  gcc_version          (x.y.z format)
81 dnl  SUBDIRS
82 dnl Substs:
83 dnl  glibcxx_builddir     (absolute path)
84 dnl  glibcxx_srcdir       (absolute path)
85 dnl  toplevel_srcdir      (absolute path)
86 dnl  with_cross_host
87 dnl  with_newlib
88 dnl  with_target_subdir
89 dnl plus
90 dnl  - the variables in GLIBCXX_CHECK_HOST / configure.host
91 dnl  - default settings for all AM_CONFITIONAL test variables
92 dnl  - lots of tools, like CC and CXX
93 dnl
94 AC_DEFUN(GLIBCXX_CONFIGURE, [
95   # Keep these sync'd with the list in Makefile.am.  The first provides an
96   # expandable list at autoconf time; the second provides an expandable list
97   # (i.e., shell variable) at configure time.
98   m4_define([glibcxx_SUBDIRS],[include libmath libsupc++ src po testsuite])
99   SUBDIRS='glibcxx_SUBDIRS'
100
101   # These need to be absolute paths, yet at the same time need to
102   # canonicalize only relative paths, because then amd will not unmount
103   # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
104   glibcxx_builddir=`${PWDCMD-pwd}`
105   case $srcdir in
106     [\\/$]* | ?:[\\/]*) glibcxx_srcdir=${srcdir} ;;
107     *) glibcxx_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
108   esac
109   toplevel_srcdir=${glibcxx_srcdir}/..
110   AC_SUBST(glibcxx_builddir)
111   AC_SUBST(glibcxx_srcdir)
112   AC_SUBST(toplevel_srcdir)
113
114   # We use these options to decide which functions to include.  They are
115   # set from the top level.
116   AC_ARG_WITH([target-subdir],
117     AC_HELP_STRING([--with-target-subdir=SUBDIR],
118                    [configuring in a subdirectory]))
119
120   AC_ARG_WITH([cross-host],
121     AC_HELP_STRING([--with-cross-host=HOST],
122                    [configuring with a cross compiler]))
123
124   AC_ARG_WITH([newlib],
125     AC_HELP_STRING([--with-newlib],
126                    [assume newlib as a system C library]))
127
128   # We're almost certainly being configured before anything else which uses
129   # C++, so all of our AC_PROG_* discoveries will be cached.  It's vital that
130   # we not cache the value of CXX that we "discover" here, because it's set
131   # to something unique for us and libjava.  Other target libraries need to
132   # find CXX for themselves.  We yank the rug out from under the normal AC_*
133   # process by sneakily renaming the cache variable.  This also lets us debug
134   # the value of "our" CXX in postmortems.
135   #
136   # We must also force CXX to /not/ be a precious variable, otherwise the
137   # wrong (non-multilib-adjusted) value will be used in multilibs.  This
138   # little trick also affects CPPFLAGS, CXXFLAGS, and LDFLAGS.  And as a side
139   # effect, CXXFLAGS is no longer automagically subst'd, so we have to do
140   # that ourselves.  Un-preciousing AC_PROG_CC also affects CC and CFLAGS.
141   #
142   # -fno-builtin must be present here so that a non-conflicting form of
143   # std::exit can be guessed by AC_PROG_CXX, and used in later tests.
144
145   m4_define([ac_cv_prog_CXX],[glibcxx_cv_prog_CXX])
146   m4_rename([_AC_ARG_VAR_PRECIOUS],[glibcxx_PRECIOUS])
147   m4_define([_AC_ARG_VAR_PRECIOUS],[])
148   save_CXXFLAGS="$CXXFLAGS"
149   CXXFLAGS="$CXXFLAGS -fno-builtin"
150   AC_PROG_CC
151   AC_PROG_CXX
152   CXXFLAGS="$save_CXXFLAGS"
153   m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
154   AC_SUBST(CFLAGS)
155   AC_SUBST(CXXFLAGS)
156
157   # For directory versioning (e.g., headers) and other variables.
158   AC_MSG_CHECKING([for GCC version number])
159   gcc_version=`$CXX -dumpversion`
160   AC_MSG_RESULT($gcc_version)
161
162   # Will set LN_S to either 'ln -s', 'ln', or 'cp -p' (if linking isn't
163   # available).  Uncomment the next line to force a particular method.
164   AC_PROG_LN_S
165   #LN_S='cp -p'
166
167   AC_CHECK_TOOL(AS, as)
168   AC_CHECK_TOOL(AR, ar)
169   AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
170
171   AM_MAINTAINER_MODE
172
173   # Set up safe default values for all subsequent AM_CONDITIONAL tests
174   # which are themselves conditionally expanded.
175   ## (Right now, this only matters for enable_wchar_t, but nothing prevents
176   ## other macros from doing the same.  This should be automated.)  -pme
177   need_libmath=no
178   enable_wchar_t=no
179   #enable_libstdcxx_debug=no
180   #enable_libstdcxx_pch=no
181   #enable_cheaders=c
182   #c_compatibility=no
183   #enable_abi_check=no
184   #enable_symvers=no
185   #enable_hosted_libstdcxx=yes
186
187   # Find platform-specific directories containing configuration info.
188   # Also possibly modify flags used elsewhere, as needed by the platform.
189   GLIBCXX_CHECK_HOST
190 ])
191
192
193 m4_include([linkage.m4])
194 m4_include([../config/no-executables.m4])
195
196
197 dnl
198 dnl Tests for newer compiler features, or features that are present in newer
199 dnl compiler versions but not older compiler versions still in use, should
200 dnl be placed here.
201 dnl
202 dnl Defines:
203 dnl  WERROR='-Werror' if requested and possible; g++'s that lack the
204 dnl   new inlining code or the new system_header pragma will die on -Werror.
205 dnl   Leave it out by default and use maint-mode to use it.
206 dnl  SECTION_FLAGS='-ffunction-sections -fdata-sections' if
207 dnl   compiler supports it and the user has not requested debug mode.
208 dnl
209 AC_DEFUN(GLIBCXX_CHECK_COMPILER_FEATURES, [
210   # All these tests are for C++; save the language and the compiler flags.
211   # The CXXFLAGS thing is suspicious, but based on similar bits previously
212   # found in GLIBCXX_CONFIGURE.
213   AC_LANG_SAVE
214   AC_LANG_CPLUSPLUS
215   ac_test_CXXFLAGS="${CXXFLAGS+set}"
216   ac_save_CXXFLAGS="$CXXFLAGS"
217
218   # Check for maintainer-mode bits.
219   if test x"$USE_MAINTAINER_MODE" = xno; then
220     WERROR=''
221   else
222     WERROR='-Werror'
223   fi
224
225   # Check for -ffunction-sections -fdata-sections
226   AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
227   CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
228   AC_TRY_COMPILE(, [int foo;], [ac_fdsections=yes], [ac_fdsections=no])
229   if test "$ac_test_CXXFLAGS" = set; then
230     CXXFLAGS="$ac_save_CXXFLAGS"
231   else
232     # this is the suspicious part
233     CXXFLAGS=''
234   fi
235   if test x"$ac_fdsections" = x"yes"; then
236     SECTION_FLAGS='-ffunction-sections -fdata-sections'
237   fi
238   AC_MSG_RESULT($ac_fdsections)
239
240   AC_LANG_RESTORE
241   AC_SUBST(WERROR)
242   AC_SUBST(SECTION_FLAGS)
243 ])
244
245
246 dnl
247 dnl If GNU ld is in use, check to see if tricky linker opts can be used.  If
248 dnl the native linker is in use, all variables will be defined to something
249 dnl safe (like an empty string).
250 dnl
251 dnl Defines:
252 dnl  SECTION_LDFLAGS='-Wl,--gc-sections' if possible
253 dnl  OPT_LDFLAGS='-Wl,-O1' if possible
254 dnl  LD (as a side effect of testing)
255 dnl Sets:
256 dnl  with_gnu_ld
257 dnl  glibcxx_gnu_ld_version (possibly)
258 dnl
259 dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
260 dnl set glibcxx_gnu_ld_version to 12345.  Zeros cause problems.
261 dnl
262 AC_DEFUN(GLIBCXX_CHECK_LINKER_FEATURES, [
263   # If we're not using GNU ld, then there's no point in even trying these
264   # tests.  Check for that first.  We should have already tested for gld
265   # by now (in libtool), but require it now just to be safe...
266   test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
267   test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
268   AC_REQUIRE([AC_PROG_LD])
269   AC_REQUIRE([AC_PROG_AWK])
270
271   # The name set by libtool depends on the version of libtool.  Shame on us
272   # for depending on an impl detail, but c'est la vie.  Older versions used
273   # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
274   # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
275   # makes sense).  We'll test with_gnu_ld everywhere else, so if that isn't
276   # set (hence we're using an older libtool), then set it.
277   if test x${with_gnu_ld+set} != xset; then
278     if test x${ac_cv_prog_gnu_ld+set} != xset; then
279       # We got through "ac_require(ac_prog_ld)" and still not set?  Huh?
280       with_gnu_ld=no
281     else
282       with_gnu_ld=$ac_cv_prog_gnu_ld
283     fi
284   fi
285
286   # Start by getting the version number.  I think the libtool test already
287   # does some of this, but throws away the result.
288   changequote(,)
289   ldver=`$LD --version 2>/dev/null | head -1 | \
290          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
291   changequote([,])
292   glibcxx_gnu_ld_version=`echo $ldver | \
293          $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
294
295   # Set --gc-sections.
296   if test "$with_gnu_ld" = "notbroken"; then
297     # GNU ld it is!  Joy and bunny rabbits!
298
299     # All these tests are for C++; save the language and the compiler flags.
300     # Need to do this so that g++ won't try to link in libstdc++
301     ac_test_CFLAGS="${CFLAGS+set}"
302     ac_save_CFLAGS="$CFLAGS"
303     CFLAGS='-x c++  -Wl,--gc-sections'
304
305     # Check for -Wl,--gc-sections
306     # XXX This test is broken at the moment, as symbols required for linking
307     # are now in libsupc++ (not built yet).  In addition, this test has
308     # cored on solaris in the past.  In addition, --gc-sections doesn't
309     # really work at the moment (keeps on discarding used sections, first
310     # .eh_frame and now some of the glibc sections for iconv).
311     # Bzzzzt.  Thanks for playing, maybe next time.
312     AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
313     AC_TRY_RUN([
314      int main(void)
315      {
316        try { throw 1; }
317        catch (...) { };
318        return 0;
319      }
320     ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
321     if test "$ac_test_CFLAGS" = set; then
322       CFLAGS="$ac_save_CFLAGS"
323     else
324       # this is the suspicious part
325       CFLAGS=''
326     fi
327     if test "$ac_sectionLDflags" = "yes"; then
328       SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
329     fi
330     AC_MSG_RESULT($ac_sectionLDflags)
331   fi
332
333   # Set linker optimization flags.
334   if test x"$with_gnu_ld" = x"yes"; then
335     OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
336   fi
337
338   AC_SUBST(SECTION_LDFLAGS)
339   AC_SUBST(OPT_LDFLAGS)
340 ])
341
342
343 dnl
344 dnl Check to see if this target can enable the wchar_t parts.
345 dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled.  (This
346 dnl must have been previously checked.)  By default, wide characters are
347 dnl disabled.
348 dnl
349 dnl Defines:
350 dnl  HAVE_MBSTATE_T if mbstate_t is not in wchar.h
351 dnl  _GLIBCXX_USE_WCHAR_T if all the bits are found.
352 dnl
353 AC_DEFUN(GLIBCXX_CHECK_WCHAR_T_SUPPORT, [
354   # Test wchar.h for mbstate_t, which is needed for char_traits and
355   # others even if wchar_t support is not on.
356   AC_MSG_CHECKING([for mbstate_t])
357   AC_TRY_COMPILE([#include <wchar.h>],
358   [mbstate_t teststate;],
359   have_mbstate_t=yes, have_mbstate_t=no)
360   AC_MSG_RESULT($have_mbstate_t)
361   if test x"$have_mbstate_t" = xyes; then
362     AC_DEFINE(HAVE_MBSTATE_T)
363   fi
364
365   # Sanity check for existence of ISO C99 headers for extended encoding.
366   AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
367   AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
368
369   # Only continue checking if the ISO C99 headers exist and support is on.
370   if test x"$ac_has_wchar_h" = xyes &&
371      test x"$ac_has_wctype_h" = xyes &&
372      test x"$enable_c_mbchar" != xno; then
373
374     # Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
375     # numeric_limits can instantiate type_traits<wchar_t>
376     AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
377     AC_TRY_COMPILE([#include <wchar.h>],
378     [int i = WCHAR_MIN; int j = WCHAR_MAX;],
379     has_wchar_minmax=yes, has_wchar_minmax=no)
380     AC_MSG_RESULT($has_wchar_minmax)
381
382     # Test wchar.h for WEOF, which is what we use to determine whether
383     # to specialize for char_traits<wchar_t> or not.
384     AC_MSG_CHECKING([for WEOF])
385     AC_TRY_COMPILE([
386       #include <wchar.h>
387       #include <stddef.h>],
388     [wint_t i = WEOF;],
389     has_weof=yes, has_weof=no)
390     AC_MSG_RESULT($has_weof)
391
392     # Tests for wide character functions used in char_traits<wchar_t>.
393     ac_wfuncs=yes
394     AC_CHECK_FUNCS([wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset],
395     [],[ac_wfuncs=no])
396
397     # Checks for names injected into std:: by the c_std headers.
398     AC_CHECK_FUNCS([btowc wctob fgetwc fgetws fputwc fputws fwide \
399     fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
400     vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
401     mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
402     wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
403     wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr],
404     [],[ac_wfuncs=no])
405
406     AC_MSG_CHECKING([for ISO C99 wchar_t support])
407     if test x"$has_weof" = xyes &&
408        test x"$has_wchar_minmax" = xyes &&
409        test x"$ac_wfuncs" = xyes;
410     then
411       ac_isoC99_wchar_t=yes
412     else
413       ac_isoC99_wchar_t=no
414     fi
415     AC_MSG_RESULT($ac_isoC99_wchar_t)
416
417     # Use iconv for wchar_t to char conversions. As such, check for
418     # X/Open Portability Guide, version 2 features (XPG2).
419     AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
420     AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
421
422     # Check for existence of libiconv.a providing XPG2 wchar_t support.
423     AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
424     ac_save_LIBS="$LIBS"
425     LIBS="$LIBS $libiconv"
426
427     AC_CHECK_FUNCS([iconv_open iconv_close iconv nl_langinfo],
428     [ac_XPG2funcs=yes], [ac_XPG2funcs=no])
429
430     LIBS="$ac_save_LIBS"
431
432     AC_MSG_CHECKING([for XPG2 wchar_t support])
433     if test x"$ac_has_iconv_h" = xyes &&
434        test x"$ac_has_langinfo_h" = xyes &&
435        test x"$ac_XPG2funcs" = xyes;
436     then
437       ac_XPG2_wchar_t=yes
438     else
439       ac_XPG2_wchar_t=no
440     fi
441     AC_MSG_RESULT($ac_XPG2_wchar_t)
442
443     # At the moment, only enable wchar_t specializations if all the
444     # above support is present.
445     if test x"$ac_isoC99_wchar_t" = xyes &&
446        test x"$ac_XPG2_wchar_t" = xyes;
447     then
448       AC_DEFINE(_GLIBCXX_USE_WCHAR_T)
449       enable_wchar_t=yes
450     fi
451   fi
452   AC_MSG_CHECKING([for enabled wchar_t specializations])
453   AC_MSG_RESULT($enable_wchar_t)
454 ])
455
456
457 dnl
458 dnl Check for headers for, and arguments to, the setrlimit() function.
459 dnl Used only in testsuite_hooks.h.  Called from GLIBCXX_CONFIGURE_TESTSUITE.
460 dnl
461 dnl Defines:
462 dnl  _GLIBCXX_MEM_LIMITS if we can set artificial limits on memory
463 dnl  various HAVE_MEMLIMIT_* for individual limit names
464 dnl
465 AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT_ancilliary, [
466   AC_TRY_COMPILE(
467     [#include <unistd.h>
468      #include <sys/time.h>
469      #include <sys/resource.h>
470     ],
471     [ int f = RLIMIT_$1 ; ],
472     [glibcxx_mresult=1], [glibcxx_mresult=0])
473   AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcxx_mresult,
474                      [Only used in build directory testsuite_hooks.h.])
475 ])
476
477 AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT, [
478   setrlimit_have_headers=yes
479   AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
480                    [],
481                    [setrlimit_have_headers=no])
482   # If don't have the headers, then we can't run the tests now, and we
483   # won't be seeing any of these during testsuite compilation.
484   if test $setrlimit_have_headers = yes; then
485     # Can't do these in a loop, else the resulting syntax is wrong.
486     GLIBCXX_CHECK_SETRLIMIT_ancilliary(DATA)
487     GLIBCXX_CHECK_SETRLIMIT_ancilliary(RSS)
488     GLIBCXX_CHECK_SETRLIMIT_ancilliary(VMEM)
489     GLIBCXX_CHECK_SETRLIMIT_ancilliary(AS)
490
491     # Check for rlimit, setrlimit.
492     AC_CACHE_VAL(ac_setrlimit, [
493       AC_TRY_COMPILE(
494         [#include <unistd.h>
495          #include <sys/time.h>
496          #include <sys/resource.h>
497         ],
498         [struct rlimit r;
499          setrlimit(0, &r);],
500         [ac_setrlimit=yes], [ac_setrlimit=no])
501     ])
502   fi
503
504   AC_MSG_CHECKING([for testsuite memory limit support])
505   if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
506     ac_mem_limits=yes
507     AC_DEFINE(_GLIBCXX_MEM_LIMITS)
508   else
509     ac_mem_limits=no
510   fi
511   AC_MSG_RESULT($ac_mem_limits)
512 ])
513
514
515 dnl
516 dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
517 dnl Define HAVE_S_ISREG / HAVE_S_IFREG appropriately.
518 dnl
519 AC_DEFUN(GLIBCXX_CHECK_S_ISREG_OR_S_IFREG, [
520   AC_CACHE_VAL(glibcxx_cv_S_ISREG, [
521     AC_TRY_LINK(
522       [#include <sys/stat.h>],
523       [struct stat buffer;
524        fstat(0, &buffer);
525        S_ISREG(buffer.st_mode);],
526       [glibcxx_cv_S_ISREG=yes],
527       [glibcxx_cv_S_ISREG=no])
528   ])
529   AC_CACHE_VAL(glibcxx_cv_S_IFREG, [
530     AC_TRY_LINK(
531       [#include <sys/stat.h>],
532       [struct stat buffer;
533        fstat(0, &buffer);
534        S_IFREG & buffer.st_mode;],
535       [glibcxx_cv_S_IFREG=yes],
536       [glibcxx_cv_S_IFREG=no])
537   ])
538   if test $glibcxx_cv_S_ISREG = yes; then
539     AC_DEFINE(HAVE_S_ISREG)
540   elif test $glibcxx_cv_S_IFREG = yes; then
541     AC_DEFINE(HAVE_S_IFREG)
542   fi
543 ])
544
545
546 dnl
547 dnl Check whether poll is available in <poll.h>, and define HAVE_POLL.
548 dnl
549 AC_DEFUN(GLIBCXX_CHECK_POLL, [
550   AC_CACHE_VAL(glibcxx_cv_POLL, [
551     AC_TRY_COMPILE(
552       [#include <poll.h>],
553       [struct pollfd pfd[1];
554        pfd[0].events = POLLIN;
555        poll(pfd, 1, 0);],
556       [glibcxx_cv_POLL=yes],
557       [glibcxx_cv_POLL=no])
558   ])
559   if test $glibcxx_cv_POLL = yes; then
560     AC_DEFINE(HAVE_POLL)
561   fi
562 ])
563
564
565 dnl
566 dnl Check whether writev is available in <sys/uio.h>, and define HAVE_WRITEV.
567 dnl
568 AC_DEFUN(GLIBCXX_CHECK_WRITEV, [
569   AC_CACHE_VAL(glibcxx_cv_WRITEV, [
570     AC_TRY_COMPILE(
571       [#include <sys/uio.h>],
572       [struct iovec iov[2];
573        writev(0, iov, 0);],
574       [glibcxx_cv_WRITEV=yes],
575       [glibcxx_cv_WRITEV=no])
576   ])
577   if test $glibcxx_cv_WRITEV = yes; then
578     AC_DEFINE(HAVE_WRITEV)
579   fi
580 ])
581
582
583 dnl
584 dnl Does any necessary configuration of the testsuite directory.  Generates
585 dnl the testsuite_hooks.h header.
586 dnl
587 dnl GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE must be done before this.
588 dnl
589 dnl Sets:
590 dnl  enable_abi_check / GLIBCXX_TEST_ABI
591 dnl Substs:
592 dnl  baseline_dir
593 dnl
594 AC_DEFUN(GLIBCXX_CONFIGURE_TESTSUITE, [
595   if $GLIBCXX_IS_NATIVE && test $is_hosted = yes; then
596     # Do checks for memory limit functions.
597     GLIBCXX_CHECK_SETRLIMIT
598
599     # Look for setenv, so that extended locale tests can be performed.
600     GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
601
602     if test $enable_symvers = no; then
603       enable_abi_check=no
604     else
605       case "$host" in
606         *-*-cygwin*)
607           enable_abi_check=no ;;
608         *)
609           enable_abi_check=yes ;;
610       esac
611     fi
612   else
613     # Only build this as native, since automake does not understand
614     # CXX_FOR_BUILD.
615     enable_abi_check=no
616   fi
617
618   # Export file names for ABI checking.
619   baseline_dir="$glibcxx_srcdir/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
620   AC_SUBST(baseline_dir)
621
622   GLIBCXX_CONDITIONAL(GLIBCXX_TEST_WCHAR_T, test $enable_wchar_t = yes)
623   GLIBCXX_CONDITIONAL(GLIBCXX_TEST_ABI, test $enable_abi_check = yes)
624 ])
625
626
627 dnl
628 dnl Set up *_INCLUDES variables for all sundry Makefile.am's.
629 dnl
630 dnl Substs:
631 dnl  GLIBCXX_INCLUDES
632 dnl  TOPLEVEL_INCLUDES
633 dnl
634 AC_DEFUN(GLIBCXX_EXPORT_INCLUDES, [
635   # Used for every C++ compile we perform.
636   GLIBCXX_INCLUDES="\
637 -I$glibcxx_builddir/include/$host_alias \
638 -I$glibcxx_builddir/include \
639 -I$glibcxx_srcdir/libsupc++"
640
641   # For Canadian crosses, pick this up too.
642   if test $CANADIAN = yes; then
643     GLIBCXX_INCLUDES="$GLIBCXX_INCLUDES -I\${includedir}"
644   fi
645
646   # Stuff in the actual top level.  Currently only used by libsupc++ to
647   # get unwind* headers from the gcc dir.
648   #TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include'
649   TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc'
650
651   # Now, export this to all the little Makefiles....
652   AC_SUBST(GLIBCXX_INCLUDES)
653   AC_SUBST(TOPLEVEL_INCLUDES)
654 ])
655
656
657 dnl
658 dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
659 dnl (SECTION_FLAGS is done under CHECK_COMPILER_FEATURES.)
660 dnl
661 dnl Substs:
662 dnl  OPTIMIZE_CXXFLAGS
663 dnl  WARN_FLAGS
664 dnl
665 AC_DEFUN(GLIBCXX_EXPORT_FLAGS, [
666   # Optimization flags that are probably a good idea for thrill-seekers. Just
667   # uncomment the lines below and make, everything else is ready to go...
668   # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
669   OPTIMIZE_CXXFLAGS=
670   AC_SUBST(OPTIMIZE_CXXFLAGS)
671
672   WARN_FLAGS='-Wall -W -Wwrite-strings -Wcast-qual'
673   AC_SUBST(WARN_FLAGS)
674 ])
675
676
677 dnl
678 dnl All installation directory information is determined here.
679 dnl
680 dnl Substs:
681 dnl  gxx_install_dir
682 dnl  glibcxx_prefixdir
683 dnl  glibcxx_toolexecdir
684 dnl  glibcxx_toolexeclibdir
685 dnl
686 dnl Assumes cross_compiling bits already done, and with_cross_host in
687 dnl particular.
688 dnl
689 AC_DEFUN(GLIBCXX_EXPORT_INSTALL_INFO, [
690   glibcxx_toolexecdir=no
691   glibcxx_toolexeclibdir=no
692   glibcxx_prefixdir=$prefix
693
694   AC_MSG_CHECKING([for gxx-include-dir])
695   AC_ARG_WITH([gxx-include-dir],
696     AC_HELP_STRING([--with-gxx-include-dir=DIR],
697                    [installation directory for include files]),
698     [case "$withval" in
699       yes) AC_MSG_ERROR([Missing directory for --with-gxx-include-dir]) ;;
700       no)  gxx_include_dir=no ;;
701       *)   gxx_include_dir=$withval ;;
702      esac],
703     [gxx_include_dir=no])
704   AC_MSG_RESULT($gxx_include_dir)
705
706   AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
707   AC_ARG_ENABLE([version-specific-runtime-libs],
708     AC_HELP_STRING([--enable-version-specific-runtime-libs],
709                    [Specify that runtime libraries should be installed in a compiler-specific directory]),
710     [case "$enableval" in
711       yes) version_specific_libs=yes ;;
712       no)  version_specific_libs=no ;;
713       *)   AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
714      esac],
715     [version_specific_libs=no])
716   AC_MSG_RESULT($version_specific_libs)
717
718   # Default case for install directory for include files.
719   if test $version_specific_libs = no && test $gxx_include_dir = no; then
720     gxx_include_dir='${prefix}'/include/c++/${gcc_version}
721   fi
722
723   # Version-specific runtime libs processing.
724   if test $version_specific_libs = yes; then
725     # Need the gcc compiler version to know where to install libraries
726     # and header files if --enable-version-specific-runtime-libs option
727     # is selected.
728     if test x"$gxx_include_dir" = x"no"; then
729       gxx_include_dir='${libdir}/gcc-lib/${host_alias}/'$gcc_version/include/c++
730     fi
731     glibcxx_toolexecdir='${libdir}/gcc-lib/${host_alias}'
732     glibcxx_toolexeclibdir='${toolexecdir}/'$gcc_version'$(MULTISUBDIR)'
733   fi
734
735   # Calculate glibcxx_toolexecdir, glibcxx_toolexeclibdir
736   # Install a library built with a cross compiler in tooldir, not libdir.
737   if test x"$glibcxx_toolexecdir" = x"no"; then
738     if test -n "$with_cross_host" &&
739        test x"$with_cross_host" != x"no"; then
740       glibcxx_toolexecdir='${exec_prefix}/${host_alias}'
741       glibcxx_toolexeclibdir='${toolexecdir}/lib'
742     else
743       glibcxx_toolexecdir='${libdir}/gcc-lib/${host_alias}'
744       glibcxx_toolexeclibdir='${libdir}'
745     fi
746     multi_os_directory=`$CXX -print-multi-os-directory`
747     case $multi_os_directory in
748       .) ;; # Avoid trailing /.
749       *) glibcxx_toolexeclibdir=$glibcxx_toolexeclibdir/$multi_os_directory ;;
750     esac
751   fi
752
753   AC_MSG_CHECKING([for install location])
754   AC_MSG_RESULT($gxx_include_dir)
755
756   AC_SUBST(glibcxx_prefixdir)
757   AC_SUBST(gxx_include_dir)
758   AC_SUBST(glibcxx_toolexecdir)
759   AC_SUBST(glibcxx_toolexeclibdir)
760 ])
761
762
763 dnl
764 dnl GLIBCXX_ENABLE
765 dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING)
766 dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c)
767 dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER)
768 dnl
769 dnl See docs/html/17_intro/configury.html#enable for documentation.
770 dnl
771 m4_define([GLIBCXX_ENABLE],[dnl
772 m4_define([_g_switch],[--enable-$1])dnl
773 m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl
774  AC_ARG_ENABLE($1,_g_help,
775   m4_bmatch([$5],
776    [^permit ],
777      [[
778       case "$enableval" in
779        m4_bpatsubst([$5],[permit ])) ;;
780        *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;;
781           dnl Idea for future:  generate a URL pointing to
782           dnl "onlinedocs/configopts.html#whatever"
783       esac
784      ]],
785    [^$],
786      [[
787       case "$enableval" in
788        yes|no) ;;
789        *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;;
790       esac
791      ]],
792    [[$5]]),
793   [enable_]m4_bpatsubst([$1],-,_)[=][$2])
794 m4_undefine([_g_switch])dnl
795 m4_undefine([_g_help])dnl
796 ])
797
798
799 dnl
800 dnl Check for ISO/IEC 9899:1999 "C99" support.
801 dnl
802 dnl --enable-c99 defines _GLIBCXX_USE_C99
803 dnl --disable-c99 leaves _GLIBCXX_USE_C99 undefined
804 dnl  +  Usage:  GLIBCXX_ENABLE_C99[(DEFAULT)]
805 dnl       Where DEFAULT is either `yes' or `no'.
806 dnl  +  If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
807 dnl
808 AC_DEFUN(GLIBCXX_ENABLE_C99, [
809   GLIBCXX_ENABLE(c99,$1,,[turns on ISO/IEC 9899:1999 support])
810
811   AC_LANG_SAVE
812   AC_LANG_CPLUSPLUS
813
814   # Check for the existence of <math.h> functions used if C99 is enabled.
815   ac_c99_math=yes;
816   AC_MSG_CHECKING([for ISO C99 support in <math.h>])
817   AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
818   AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
819   AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
820   AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
821   AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
822   AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
823   AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
824   AC_TRY_COMPILE([#include <math.h>],
825                  [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
826   AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
827   AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
828   AC_TRY_COMPILE([#include <math.h>],
829                  [islessgreater(0.0,0.0);],, [ac_c99_math=no])
830   AC_TRY_COMPILE([#include <math.h>],
831                  [isunordered(0.0,0.0);],, [ac_c99_math=no])
832   AC_MSG_RESULT($ac_c99_math)
833
834   # Check for the existence in <stdio.h> of vscanf, et. al.
835   ac_c99_stdio=yes;
836   AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
837   AC_TRY_COMPILE([#include <stdio.h>],
838                  [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
839   AC_TRY_COMPILE([#include <stdio.h>
840                   #include <stdarg.h>
841                   void foo(char* fmt, ...)
842                   {va_list args; va_start(args, fmt);
843                   vfscanf(stderr, "%i", args);}],
844                   [],, [ac_c99_stdio=no])
845   AC_TRY_COMPILE([#include <stdio.h>
846                   #include <stdarg.h>
847                   void foo(char* fmt, ...)
848                   {va_list args; va_start(args, fmt);
849                   vscanf("%i", args);}],
850                   [],, [ac_c99_stdio=no])
851   AC_TRY_COMPILE([#include <stdio.h>
852                   #include <stdarg.h>
853                   void foo(char* fmt, ...)
854                   {va_list args; va_start(args, fmt);
855                   vsnprintf(fmt, 0, "%i", args);}],
856                   [],, [ac_c99_stdio=no])
857   AC_TRY_COMPILE([#include <stdio.h>
858                   #include <stdarg.h>
859                   void foo(char* fmt, ...)
860                   {va_list args; va_start(args, fmt);
861                   vsscanf(fmt, "%i", args);}],
862                   [],, [ac_c99_stdio=no])
863   AC_MSG_RESULT($ac_c99_stdio)
864
865   # Check for the existence in <stdlib.h> of lldiv_t, et. al.
866   ac_c99_stdlib=yes;
867   AC_MSG_CHECKING([for lldiv_t declaration])
868   AC_CACHE_VAL(ac_c99_lldiv_t, [
869   AC_TRY_COMPILE([#include <stdlib.h>],
870                    [ lldiv_t mydivt;],
871                    [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
872   ])
873   AC_MSG_RESULT($ac_c99_lldiv_t)
874
875   AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
876   AC_TRY_COMPILE([#include <stdlib.h>],
877                  [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
878   AC_TRY_COMPILE([#include <stdlib.h>],
879                  [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
880   AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
881   AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
882   AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
883   AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
884   if test x"$ac_c99_lldiv_t" = x"no"; then
885     ac_c99_stdlib=no;
886   fi;
887   AC_MSG_RESULT($ac_c99_stdlib)
888
889   # Check for the existence of <wchar.h> functions used if C99 is enabled.
890   # XXX the wchar.h checks should be rolled into the general C99 bits.
891   ac_c99_wchar=yes;
892   AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
893   AC_TRY_COMPILE([#include <wchar.h>],
894                  [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
895   AC_TRY_COMPILE([#include <wchar.h>],
896                  [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
897   AC_TRY_COMPILE([#include <wchar.h>],
898                  [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
899   AC_MSG_RESULT($ac_c99_wchar)
900
901   AC_MSG_CHECKING([for enabled ISO C99 support])
902   if test x"$ac_c99_math" = x"no" ||
903      test x"$ac_c99_stdio" = x"no" ||
904      test x"$ac_c99_stdlib" = x"no" ||
905      test x"$ac_c99_wchar" = x"no"; then
906     enable_c99=no;
907   fi;
908   AC_MSG_RESULT($enable_c99)
909
910   # Option parsed, now set things appropriately
911   if test x"$enable_c99" = x"yes"; then
912     AC_DEFINE(_GLIBCXX_USE_C99)
913   fi
914
915   AC_LANG_RESTORE
916 ])
917
918
919 dnl
920 dnl Check for what type of C headers to use.
921 dnl
922 dnl --enable-cheaders= [does stuff].
923 dnl --disable-cheaders [does not do anything, really].
924 dnl  +  Usage:  GLIBCXX_ENABLE_CHEADERS[(DEFAULT)]
925 dnl       Where DEFAULT is either `c' or `c_std'.
926 dnl
927 AC_DEFUN(GLIBCXX_ENABLE_CHEADERS, [
928   GLIBCXX_ENABLE(cheaders,$1,[=KIND],
929     [construct "C" headers for g++], [permit c|c_std])
930   AC_MSG_NOTICE("C" header strategy set to $enable_cheaders)
931
932   C_INCLUDE_DIR='${glibcxx_srcdir}/include/'$enable_cheaders
933
934   AC_SUBST(C_INCLUDE_DIR)
935   GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_C, test $enable_cheaders = c)
936   GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_C_STD, test $enable_cheaders = c_std)
937   GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_COMPATIBILITY, test $c_compatibility = yes)
938 ])
939
940
941 dnl
942 dnl Check for which locale library to use.  The choice is mapped to
943 dnl a subdirectory of config/locale.
944 dnl
945 dnl Default is generic.
946 dnl
947 AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
948   AC_MSG_CHECKING([for C locale to use])
949   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
950     [use MODEL for target locale package],
951     [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
952   
953   # If they didn't use this option switch, or if they specified --enable
954   # with no specific model, we'll have to look for one.  If they
955   # specified --disable (???), do likewise.
956   if test $enable_clocale = no || test $enable_clocale = yes; then
957      enable_clocale=auto
958   fi
959
960   # Either a known package, or "auto"
961   enable_clocale_flag=$enable_clocale
962
963   # Probe for locale support if no specific model is specified.
964   # Default to "generic".
965   if test $enable_clocale_flag = auto; then
966     case x${target_os} in
967       xlinux* | xgnu*)
968         AC_EGREP_CPP([_GLIBCXX_ok], [
969         #include <features.h>
970         #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
971           _GLIBCXX_ok
972         #endif
973         ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
974
975         # Test for bugs early in glibc-2.2.x series
976           if test x$enable_clocale_flag = xgnu; then
977           AC_TRY_RUN([
978           #define _GNU_SOURCE 1
979           #include <locale.h>
980           #include <string.h>
981           #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
982           extern __typeof(newlocale) __newlocale;
983           extern __typeof(duplocale) __duplocale;
984           extern __typeof(strcoll_l) __strcoll_l;
985           #endif
986           int main()
987           {
988               const char __one[] = "Äuglein Augmen";
989               const char __two[] = "Äuglein";
990               int i;
991               int j;
992               __locale_t        loc;
993                __locale_t        loc_dup;
994               loc = __newlocale(1 << LC_ALL, "de_DE", 0);
995               loc_dup = __duplocale(loc);
996               i = __strcoll_l(__one, __two, loc);
997               j = __strcoll_l(__one, __two, loc_dup);
998               return 0;
999           }
1000           ],
1001           [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
1002           [enable_clocale_flag=generic])
1003           fi
1004
1005         # ... at some point put __strxfrm_l tests in as well.
1006         ;;
1007       *)
1008         enable_clocale_flag=generic
1009         ;;
1010     esac
1011   fi
1012
1013   # Deal with gettext issues.  Default to not using it (=no) until we detect
1014   # support for it later.  Let the user turn it off via --e/d, but let that
1015   # default to on for easier handling.
1016   USE_NLS=no
1017   AC_ARG_ENABLE(nls,
1018     AC_HELP_STRING([--enable-nls],[use Native Language Support (default)]),
1019     [],
1020     [enable_nls=yes])
1021
1022   # Set configure bits for specified locale package
1023   case ${enable_clocale_flag} in
1024     generic)
1025       AC_MSG_RESULT(generic)
1026
1027       CLOCALE_H=config/locale/generic/c_locale.h
1028       CLOCALE_CC=config/locale/generic/c_locale.cc
1029       CCODECVT_H=config/locale/generic/codecvt_specializations.h
1030       CCODECVT_CC=config/locale/generic/codecvt_members.cc
1031       CCOLLATE_CC=config/locale/generic/collate_members.cc
1032       CCTYPE_CC=config/locale/generic/ctype_members.cc
1033       CMESSAGES_H=config/locale/generic/messages_members.h
1034       CMESSAGES_CC=config/locale/generic/messages_members.cc
1035       CMONEY_CC=config/locale/generic/monetary_members.cc
1036       CNUMERIC_CC=config/locale/generic/numeric_members.cc
1037       CTIME_H=config/locale/generic/time_members.h
1038       CTIME_CC=config/locale/generic/time_members.cc
1039       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
1040       ;;
1041     gnu)
1042       AC_MSG_RESULT(gnu)
1043
1044       # Declare intention to use gettext, and add support for specific
1045       # languages.
1046       # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
1047       ALL_LINGUAS="de fr"
1048
1049       # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
1050       AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
1051       if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
1052         USE_NLS=yes
1053       fi
1054       # Export the build objects.
1055       for ling in $ALL_LINGUAS; do \
1056         glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
1057         glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
1058       done
1059       AC_SUBST(glibcxx_MOFILES)
1060       AC_SUBST(glibcxx_POFILES)
1061
1062       CLOCALE_H=config/locale/gnu/c_locale.h
1063       CLOCALE_CC=config/locale/gnu/c_locale.cc
1064       CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
1065       CCODECVT_CC=config/locale/gnu/codecvt_members.cc
1066       CCOLLATE_CC=config/locale/gnu/collate_members.cc
1067       CCTYPE_CC=config/locale/gnu/ctype_members.cc
1068       CMESSAGES_H=config/locale/gnu/messages_members.h
1069       CMESSAGES_CC=config/locale/gnu/messages_members.cc
1070       CMONEY_CC=config/locale/gnu/monetary_members.cc
1071       CNUMERIC_CC=config/locale/gnu/numeric_members.cc
1072       CTIME_H=config/locale/gnu/time_members.h
1073       CTIME_CC=config/locale/gnu/time_members.cc
1074       CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
1075       ;;
1076     ieee_1003.1-2001)
1077       AC_MSG_RESULT(IEEE 1003.1)
1078
1079       CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
1080       CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc
1081       CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
1082       CCODECVT_CC=config/locale/generic/codecvt_members.cc
1083       CCOLLATE_CC=config/locale/generic/collate_members.cc
1084       CCTYPE_CC=config/locale/generic/ctype_members.cc
1085       CMESSAGES_H=config/locale/ieee_1003.1-2001/messages_members.h
1086       CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc
1087       CMONEY_CC=config/locale/generic/monetary_members.cc
1088       CNUMERIC_CC=config/locale/generic/numeric_members.cc
1089       CTIME_H=config/locale/generic/time_members.h
1090       CTIME_CC=config/locale/generic/time_members.cc
1091       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
1092       ;;
1093   esac
1094
1095   # This is where the testsuite looks for locale catalogs, using the
1096   # -DLOCALEDIR define during testsuite compilation.
1097   glibcxx_localedir=${glibcxx_builddir}/po/share/locale
1098   AC_SUBST(glibcxx_localedir)
1099
1100   # A standalone libintl (e.g., GNU libintl) may be in use.
1101   if test $USE_NLS = yes; then
1102     AC_CHECK_HEADERS([libintl.h], [], USE_NLS=no)
1103     AC_SEARCH_LIBS(gettext, intl, [], USE_NLS=no)
1104   fi
1105   if test $USE_NLS = yes; then
1106     AC_DEFINE(_GLIBCXX_USE_NLS)
1107   fi
1108
1109   AC_SUBST(USE_NLS)
1110   AC_SUBST(CLOCALE_H)
1111   AC_SUBST(CCODECVT_H)
1112   AC_SUBST(CMESSAGES_H)
1113   AC_SUBST(CCODECVT_CC)
1114   AC_SUBST(CCOLLATE_CC)
1115   AC_SUBST(CCTYPE_CC)
1116   AC_SUBST(CMESSAGES_CC)
1117   AC_SUBST(CMONEY_CC)
1118   AC_SUBST(CNUMERIC_CC)
1119   AC_SUBST(CTIME_H)
1120   AC_SUBST(CTIME_CC)
1121   AC_SUBST(CLOCALE_CC)
1122   AC_SUBST(CLOCALE_INTERNAL_H)
1123 ])
1124
1125
1126 dnl
1127 dnl Check for whether the Boost-derived checks should be turned on.
1128 dnl
1129 dnl --enable-concept-checks turns them on.
1130 dnl --disable-concept-checks leaves them off.
1131 dnl  +  Usage:  GLIBCXX_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
1132 dnl       Where DEFAULT is either `yes' or `no'.
1133 dnl
1134 AC_DEFUN(GLIBCXX_ENABLE_CONCEPT_CHECKS, [
1135   GLIBCXX_ENABLE(concept-checks,$1,,[use Boost-derived template checks])
1136   if test $enable_concept_checks = yes; then
1137     AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS)
1138   fi
1139 ])
1140
1141
1142 dnl
1143 dnl Check for which I/O library to use:  stdio, or something specific.
1144 dnl
1145 dnl Default is stdio.
1146 dnl
1147 AC_DEFUN(GLIBCXX_ENABLE_CSTDIO, [
1148   AC_MSG_CHECKING([for underlying I/O to use])
1149   GLIBCXX_ENABLE(cstdio,stdio,[=PACKAGE],
1150     [use target-specific I/O package], [permit stdio])
1151
1152   # Now that libio has been removed, you can have any color you want as long
1153   # as it's black.  This is one big no-op until other packages are added, but
1154   # showing the framework never hurts.
1155   case ${enable_cstdio} in
1156     stdio)
1157       CSTDIO_H=config/io/c_io_stdio.h
1158       BASIC_FILE_H=config/io/basic_file_stdio.h
1159       BASIC_FILE_CC=config/io/basic_file_stdio.cc
1160       AC_MSG_RESULT(stdio)
1161       ;;
1162   esac
1163
1164   dnl Set directory for fpos.h
1165   FPOS_H=$fpos_include_dir
1166
1167   AC_SUBST(CSTDIO_H)
1168   AC_SUBST(FPOS_H)
1169   AC_SUBST(BASIC_FILE_H)
1170   AC_SUBST(BASIC_FILE_CC)
1171 ])
1172
1173
1174 dnl
1175 dnl Check for "unusual" flags to pass to the compiler while building.
1176 dnl
1177 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
1178 dnl     experimental flags such as -fpch, -fIMI, -Dfloat=char, etc.
1179 dnl --disable-cxx-flags passes nothing.
1180 dnl  +  See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
1181 dnl         http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
1182 dnl         http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
1183 dnl  +  Usage:  GLIBCXX_ENABLE_CXX_FLAGS(default flags)
1184 dnl       If "default flags" is an empty string, the effect is the same
1185 dnl       as --disable or --enable=no.
1186 dnl
1187 AC_DEFUN(GLIBCXX_ENABLE_CXX_FLAGS, [dnl
1188   AC_MSG_CHECKING([for extra compiler flags for building])
1189   GLIBCXX_ENABLE(cxx-flags,$1,[=FLAGS],
1190     [pass compiler FLAGS when building library],
1191     [case "x$enable_cxx_flags" in
1192       xno | x)   enable_cxx_flags= ;;
1193       x-*)       ;;
1194       *)         AC_MSG_ERROR(_g_switch needs compiler flags as arguments) ;;
1195      esac])
1196
1197   # Run through flags (either default or command-line) and set anything
1198   # extra (e.g., #defines) that must accompany particular g++ options.
1199   if test -n "$enable_cxx_flags"; then
1200     for f in $enable_cxx_flags; do
1201       case "$f" in
1202         -fhonor-std)  ;;
1203         -*)  ;;
1204         *)   # and we're trying to pass /what/ exactly?
1205              AC_MSG_ERROR([compiler flags start with a -]) ;;
1206       esac
1207     done
1208   fi
1209
1210   EXTRA_CXX_FLAGS="$enable_cxx_flags"
1211   AC_MSG_RESULT($EXTRA_CXX_FLAGS)
1212   AC_SUBST(EXTRA_CXX_FLAGS)
1213 ])
1214
1215
1216 dnl
1217 dnl Check for wide character support.  Has the same effect as the option
1218 dnl in gcc's configure, but in a form that autoconf can mess with.
1219 dnl
1220 dnl --enable-c-mbchar requests all the wchar_t stuff.
1221 dnl --disable-c-mbchar doesn't.
1222 dnl  +  Usage:  GLIBCXX_ENABLE_C_MBCHAR[(DEFAULT)]
1223 dnl       Where DEFAULT is either `yes' or `no'.
1224 dnl
1225 AC_DEFUN(GLIBCXX_ENABLE_C_MBCHAR, [
1226   GLIBCXX_ENABLE(c-mbchar,$1,,[enable multibyte (wide) characters])
1227   # Option parsed, now other scripts can test enable_c_mbchar for yes/no.
1228 ])
1229
1230
1231 dnl
1232 dnl Check to see if debugging libraries are to be built.
1233 dnl
1234 dnl --enable-libstdcxx-debug
1235 dnl builds a separate set of debugging libraries in addition to the
1236 dnl normal (shared, static) libstdc++ binaries.
1237 dnl
1238 dnl --disable-libstdcxx-debug
1239 dnl builds only one (non-debug) version of libstdc++.
1240 dnl
1241 dnl --enable-libstdcxx-debug-flags=FLAGS
1242 dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
1243 dnl
1244 dnl  +  Usage:  GLIBCXX_ENABLE_DEBUG[(DEFAULT)]
1245 dnl       Where DEFAULT is either `yes' or `no'.
1246 dnl
1247 AC_DEFUN(GLIBCXX_ENABLE_DEBUG, [
1248   AC_MSG_CHECKING([for additional debug build])
1249   GLIBCXX_ENABLE(libstdcxx-debug,$1,,[build extra debug library])
1250   AC_MSG_RESULT($enable_libstdcxx_debug)
1251   GLIBCXX_CONDITIONAL(GLIBCXX_BUILD_DEBUG, test $enable_libstdcxx_debug = yes)
1252 ])
1253
1254
1255 dnl
1256 dnl Check for explicit debug flags.
1257 dnl
1258 dnl --enable-libstdcxx-debug-flags='-O1'
1259 dnl is a general method for passing flags to be used when
1260 dnl building debug libraries with --enable-debug.
1261 dnl
1262 dnl --disable-libstdcxx-debug-flags does nothing.
1263 dnl  +  Usage:  GLIBCXX_ENABLE_DEBUG_FLAGS(default flags)
1264 dnl       If "default flags" is an empty string, the effect is the same
1265 dnl       as --disable or --enable=no.
1266 dnl
1267 AC_DEFUN(GLIBCXX_ENABLE_DEBUG_FLAGS, [
1268   GLIBCXX_ENABLE(libstdcxx-debug-flags,[$1],[=FLAGS],
1269     [pass compiler FLAGS when building debug library],
1270     [case "x$enable_libstdcxx_debug_flags" in
1271       xno | x)    enable_libstdcxx_debug_flags= ;;
1272       x-*)        ;;
1273       *)          AC_MSG_ERROR(_g_switch needs compiler flags as arguments) ;;
1274      esac])
1275
1276   # Option parsed, now set things appropriately
1277   DEBUG_FLAGS="$enable_libstdcxx_debug_flags"
1278   AC_SUBST(DEBUG_FLAGS)
1279
1280   AC_MSG_NOTICE([Debug build flags set to $DEBUG_FLAGS])
1281 ])
1282
1283
1284 dnl
1285 dnl Check if the user only wants a freestanding library implementation.
1286 dnl
1287 dnl --disable-hosted-libstdcxx will turn off most of the library build,
1288 dnl installing only the headers required by [17.4.1.3] and the language
1289 dnl support library.  More than that will be built (to keep the Makefiles
1290 dnl conveniently clean), but not installed.
1291 dnl
1292 dnl Sets:
1293 dnl  is_hosted  (yes/no)
1294 dnl
1295 dnl Defines:
1296 dnl  _GLIBCXX_HOSTED   (always defined, either to 1 or 0)
1297 dnl
1298 AC_DEFUN(GLIBCXX_ENABLE_HOSTED, [
1299   AC_ARG_ENABLE([hosted-libstdcxx],
1300     AC_HELP_STRING([--disable-hosted-libstdcxx],
1301                    [only build freestanding C++ runtime support]),,
1302     [enable_hosted_libstdcxx=yes])
1303   if test "$enable_hosted_libstdcxx" = no; then
1304     AC_MSG_NOTICE([Only freestanding libraries will be built])
1305     is_hosted=no
1306     hosted_define=0
1307     enable_abi_check=no
1308     enable_libstdcxx_pch=no
1309   else
1310     is_hosted=yes
1311     hosted_define=1
1312   fi
1313   GLIBCXX_CONDITIONAL(GLIBCXX_HOSTED, test $is_hosted = yes)
1314   AC_DEFINE_UNQUOTED(_GLIBCXX_HOSTED, $hosted_define,
1315     [Define to 1 if a full hosted library is built, or 0 if freestanding.])
1316 ])
1317
1318
1319 dnl
1320 dnl Check for libunwind exception handling support.  If enabled, then
1321 dnl we assume that the _Unwind_* functions that make up the Unwind ABI
1322 dnl (_Unwind_RaiseException, _Unwind_Resume, etc.) are defined by
1323 dnl libunwind instead of libgcc, and that libstdc++ has a dependency
1324 dnl on libunwind as well as libgcc.
1325 dnl
1326 dnl --enable-libunwind-exceptions forces the use of libunwind.
1327 dnl --disable-libunwind-exceptions assumes there is no libunwind.
1328 dnl
1329 dnl Substs:
1330 dnl  LIBUNWIND_FLAG
1331 dnl
1332 AC_DEFUN(GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS, [
1333   AC_MSG_CHECKING([for use of libunwind])
1334   GLIBCXX_ENABLE(libunwind-exceptions,no,,
1335     [force use of libunwind for exceptions])
1336   AC_MSG_RESULT($use_libunwind_exceptions)
1337   if test $enable_libunwind_exceptions = yes; then
1338     LIBUNWIND_FLAG="-lunwind"
1339   else
1340     LIBUNWIND_FLAG=""
1341   fi
1342   AC_SUBST(LIBUNWIND_FLAG)
1343 ])
1344
1345
1346 dnl
1347 dnl Check for template specializations for the 'long long' type extension.
1348 dnl The result determines only whether 'long long' I/O is enabled; things
1349 dnl like numeric_limits<> specializations are always available.
1350 dnl
1351 dnl --enable-long-long defines _GLIBCXX_USE_LONG_LONG
1352 dnl --disable-long-long leaves _GLIBCXX_USE_LONG_LONG undefined
1353 dnl  +  Usage:  GLIBCXX_ENABLE_LONG_LONG[(DEFAULT)]
1354 dnl       Where DEFAULT is either `yes' or `no'.
1355 dnl  +  If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
1356 dnl
1357 AC_DEFUN(GLIBCXX_ENABLE_LONG_LONG, [
1358   GLIBCXX_ENABLE(long-long,$1,,[enables I/O support for 'long long'])
1359
1360   AC_LANG_SAVE
1361   AC_LANG_CPLUSPLUS
1362
1363   AC_MSG_CHECKING([for enabled long long I/O support])
1364   # iostreams require strtoll, strtoull to compile
1365   AC_TRY_COMPILE([#include <stdlib.h>],
1366                  [char* tmp; strtoll("gnu", &tmp, 10);],,[enable_long_long=no])
1367   AC_TRY_COMPILE([#include <stdlib.h>],
1368                  [char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
1369
1370   # Option parsed, now set things appropriately
1371   if test $enable_long_long = yes; then
1372     AC_DEFINE(_GLIBCXX_USE_LONG_LONG)
1373   fi
1374   AC_MSG_RESULT($enable_long_long)
1375
1376   AC_LANG_RESTORE
1377 ])
1378
1379
1380 dnl
1381 dnl Check to see if building and using a C++ precompiled header can be done.
1382 dnl
1383 dnl --enable-libstdcxx-pch=yes
1384 dnl default, this shows intent to use stdc++.h.gch If it looks like it
1385 dnl may work, after some light-hearted attempts to puzzle out compiler
1386 dnl support, flip bits on in include/Makefile.am
1387 dnl
1388 dnl --disable-libstdcxx-pch
1389 dnl turns off attempts to use or build stdc++.h.gch.
1390 dnl
1391 dnl Substs:
1392 dnl  glibcxx_PCHFLAGS
1393 dnl
1394 AC_DEFUN(GLIBCXX_ENABLE_PCH, [
1395   AC_MSG_CHECKING([for enabled PCH])
1396   GLIBCXX_ENABLE(libstdcxx-pch,$1,,[build pre-compiled libstdc++ headers])
1397   AC_MSG_RESULT([$enable_libstdcxx_pch])
1398
1399   if test $enable_libstdcxx_pch = yes; then
1400     AC_CACHE_CHECK([for compiler with PCH support],
1401       [glibcxx_cv_prog_CXX_pch],
1402       [ac_save_CXXFLAGS="$CXXFLAGS"
1403        CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated"
1404        AC_LANG_SAVE
1405        AC_LANG_CPLUSPLUS
1406        echo '#include <math.h>' > conftest.h
1407        if $CXX $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \
1408                           -o conftest.h.gch 1>&5 2>&1 &&
1409                 echo '#error "pch failed"' > conftest.h &&
1410           echo '#include "conftest.h"' > conftest.cc &&
1411                $CXX -c $CXXFLAGS $CPPFLAGS conftest.cc 1>&5 2>&1 ;
1412        then
1413          glibcxx_cv_prog_CXX_pch=yes
1414        else
1415          glibcxx_cv_prog_CXX_pch=no
1416        fi
1417        rm -f conftest*
1418        CXXFLAGS=$ac_save_CXXFLAGS
1419        AC_LANG_RESTORE
1420       ])
1421     enable_libstdcxx_pch=$glibcxx_cv_prog_CXX_pch
1422   fi
1423
1424   GLIBCXX_CONDITIONAL(GLIBCXX_BUILD_PCH, test $enable_libstdcxx_pch = yes)
1425   if test $enable_libstdcxx_pch = yes; then
1426     glibcxx_PCHFLAGS="-include bits/stdc++.h"
1427   else
1428     glibcxx_PCHFLAGS=""
1429   fi
1430   AC_SUBST(glibcxx_PCHFLAGS)
1431 ])
1432
1433
1434 dnl
1435 dnl Check for exception handling support.  If an explicit enable/disable
1436 dnl sjlj exceptions is given, we don't have to detect.  Otherwise the
1437 dnl target may or may not support call frame exceptions.
1438 dnl
1439 dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
1440 dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
1441 dnl Neither one forces an attempt at detection.
1442 dnl
1443 dnl Defines:
1444 dnl  _GLIBCXX_SJLJ_EXCEPTIONS if the compiler is configured for it
1445 dnl
1446 AC_DEFUN(GLIBCXX_ENABLE_SJLJ_EXCEPTIONS, [
1447   AC_MSG_CHECKING([for exception model to use])
1448   AC_LANG_SAVE
1449   AC_LANG_CPLUSPLUS
1450   GLIBCXX_ENABLE(sjlj-exceptions,auto,,
1451     [force use of builtin_setjmp for exceptions],
1452     [permit yes|no|auto])
1453
1454   if test $enable_sjlj_exceptions = auto; then
1455     # Botheration.  Now we've got to detect the exception model.  Link tests
1456     # against libgcc.a are problematic since we've not been given proper -L
1457     # bits for single-tree newlib and libgloss.
1458     #
1459     # Fake what AC_TRY_COMPILE does.  XXX Look at redoing this new-style.
1460     cat > conftest.$ac_ext << EOF
1461 [#]line __oline__ "configure"
1462 struct S { ~S(); };
1463 void bar();
1464 void foo()
1465 {
1466   S s;
1467   bar();
1468 }
1469 EOF
1470     old_CXXFLAGS="$CXXFLAGS"
1471     CXXFLAGS=-S
1472     if AC_TRY_EVAL(ac_compile); then
1473       if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
1474         enable_sjlj_exceptions=yes
1475       elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
1476         enable_sjlj_exceptions=no
1477       fi
1478     fi
1479     CXXFLAGS="$old_CXXFLAGS"
1480     rm -f conftest*
1481   fi
1482
1483   # This is a tad weird, for hysterical raisins.  We have to map enable/disable 
1484   # to two different models.
1485   case $enable_sjlj_exceptions in
1486     yes)
1487       AC_DEFINE(_GLIBCXX_SJLJ_EXCEPTIONS, 1,
1488         [Define if the compiler is configured for setjmp/longjmp exceptions.])
1489       ac_exception_model_name=sjlj
1490       ;;
1491     no)
1492       ac_exception_model_name="call frame"
1493       ;;
1494     *)
1495       AC_MSG_ERROR([unable to detect exception model])
1496       ;;
1497   esac
1498  AC_LANG_RESTORE
1499  AC_MSG_RESULT($ac_exception_model_name)
1500 ])
1501
1502
1503 dnl
1504 dnl Add version tags to symbols in shared library (or not), additionally
1505 dnl marking other symbols as private/local (or not).
1506 dnl
1507 dnl --enable-symvers=style adds a version script to the linker call when
1508 dnl       creating the shared library.  The choice of version script is
1509 dnl       controlled by 'style'.
1510 dnl --disable-symvers does not.
1511 dnl  +  Usage:  GLIBCXX_ENABLE_SYMVERS[(DEFAULT)]
1512 dnl       Where DEFAULT is either 'yes' or 'no'.  Passing `yes' tries to
1513 dnl       choose a default style based on linker characteristics.  Passing
1514 dnl       'no' disables versioning.
1515 dnl
1516 AC_DEFUN(GLIBCXX_ENABLE_SYMVERS, [
1517
1518 GLIBCXX_ENABLE(symvers,$1,[=STYLE],
1519   [enables symbol versioning of the shared library],
1520   [permit yes|no|gnu])
1521
1522 # If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we
1523 # don't know enough about $LD to do tricks...
1524 AC_REQUIRE([GLIBCXX_CHECK_LINKER_FEATURES])
1525 # FIXME  The following test is too strict, in theory.
1526 if test $enable_shared = no ||
1527         test "x$LD" = x ||
1528         test x$glibcxx_gnu_ld_version = x; then
1529   enable_symvers=no
1530 fi
1531
1532 # Check to see if libgcc_s exists, indicating that shared libgcc is possible.
1533 if test $enable_symvers != no; then
1534   AC_MSG_CHECKING([for shared libgcc])
1535   ac_save_CFLAGS="$CFLAGS"
1536   CFLAGS=' -lgcc_s'
1537   AC_TRY_LINK(, [return 0;], glibcxx_shared_libgcc=yes, glibcxx_shared_libgcc=no)
1538   CFLAGS="$ac_save_CFLAGS"
1539   AC_MSG_RESULT($glibcxx_shared_libgcc)
1540 fi
1541
1542 # For GNU ld, we need at least this version.  The format is described in
1543 # GLIBCXX_CHECK_LINKER_FEATURES above.
1544 glibcxx_min_gnu_ld_version=21400
1545 # XXXXXXXXXXX glibcxx_gnu_ld_version=21390
1546
1547 # Check to see if unspecified "yes" value can win, given results above.
1548 # Change "yes" into either "no" or a style name.
1549 if test $enable_symvers = yes; then
1550   if test $with_gnu_ld = yes &&
1551      test $glibcxx_shared_libgcc = yes;
1552   then
1553     if test $glibcxx_gnu_ld_version -ge $glibcxx_min_gnu_ld_version ; then
1554       enable_symvers=gnu
1555     else
1556       # The right tools, the right setup, but too old.  Fallbacks?
1557       AC_MSG_WARN(=== Linker version $glibcxx_gnu_ld_version is too old for)
1558       AC_MSG_WARN(=== full symbol versioning support in this release of GCC.)
1559       AC_MSG_WARN(=== You would need to upgrade your binutils to version)
1560       AC_MSG_WARN(=== $glibcxx_min_gnu_ld_version or later and rebuild GCC.)
1561       if test $glibcxx_gnu_ld_version -ge 21200 ; then
1562         # Globbing fix is present, proper block support is not.
1563         dnl AC_MSG_WARN([=== Dude, you are soooo close.  Maybe we can fake it.])
1564         dnl enable_symvers=???
1565         AC_MSG_WARN([=== Symbol versioning will be disabled.])
1566         enable_symvers=no
1567       else
1568         # 2.11 or older.
1569         AC_MSG_WARN([=== Symbol versioning will be disabled.])
1570         enable_symvers=no
1571       fi
1572     fi
1573   else
1574     # just fail for now
1575     AC_MSG_WARN([=== You have requested some kind of symbol versioning, but])
1576     AC_MSG_WARN([=== either you are not using a supported linker, or you are])
1577     AC_MSG_WARN([=== not building a shared libgcc_s (which is required).])
1578     AC_MSG_WARN([=== Symbol versioning will be disabled.])
1579     enable_symvers=no
1580   fi
1581 fi
1582
1583 # Everything parsed; figure out what file to use.
1584 case $enable_symvers in
1585   no)
1586     SYMVER_MAP=config/linker-map.dummy
1587     ;;
1588   gnu)
1589     SYMVER_MAP=config/linker-map.gnu
1590     AC_DEFINE(_GLIBCXX_SYMVER)
1591     ;;
1592 esac
1593
1594 AC_SUBST(SYMVER_MAP)
1595 AC_SUBST(port_specific_symbol_files)
1596 GLIBCXX_CONDITIONAL(GLIBCXX_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
1597 AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
1598 ])
1599
1600
1601 dnl
1602 dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
1603 dnl We must stage the required headers so that they will be installed
1604 dnl with the library (unlike libgcc, the STL implementation is provided
1605 dnl solely within headers).  Since we must not inject random user-space
1606 dnl macro names into user-provided C++ code, we first stage into <file>-in
1607 dnl and process to <file> with an output command.  The reason for a two-
1608 dnl stage process here is to correctly handle $srcdir!=$objdir without
1609 dnl having to write complex code (the sed commands to clean the macro
1610 dnl namespace are complex and fragile enough as it is).  We must also
1611 dnl add a relative path so that -I- is supported properly.
1612 dnl
1613 dnl Substs:
1614 dnl  glibcxx_thread_h
1615 dnl
1616 dnl Defines:
1617 dnl  HAVE_GTHR_DEFAULT
1618 dnl  _GLIBCXX_SUPPORTS_WEAK
1619 dnl
1620 AC_DEFUN(GLIBCXX_ENABLE_THREADS, [
1621   AC_MSG_CHECKING([for thread model used by GCC])
1622   target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
1623   AC_MSG_RESULT([$target_thread_file])
1624
1625   if test $target_thread_file != single; then
1626     AC_DEFINE(HAVE_GTHR_DEFAULT)
1627     AC_DEFINE(_GLIBCXX_SUPPORTS_WEAK, __GXX_WEAK__)
1628   fi
1629
1630   glibcxx_thread_h=gthr-$target_thread_file.h
1631   AC_SUBST(glibcxx_thread_h)
1632 ])
1633
1634
1635 # Check whether LC_MESSAGES is available in <locale.h>.
1636 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1637 #
1638 # This file file be copied and used freely without restrictions.  It can
1639 # be used in projects which are not available under the GNU Public License
1640 # but which still want to provide support for the GNU gettext functionality.
1641 # Please note that the actual code is *not* freely available.
1642
1643 # serial 1
1644 AC_DEFUN(AC_LC_MESSAGES, [
1645   AC_CHECK_HEADER(locale.h, [
1646     AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1647       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1648        ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1649     if test $ac_cv_val_LC_MESSAGES = yes; then
1650       AC_DEFINE(HAVE_LC_MESSAGES)
1651     fi
1652   ])
1653 ])
1654
1655
1656 sinclude([../libtool.m4])
1657 dnl The lines below arrange for aclocal not to bring an installed
1658 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
1659 dnl add a definition of LIBTOOL to Makefile.in.
1660 ifelse(,,,[AC_SUBST(LIBTOOL)
1661 AC_DEFUN([AM_PROG_LIBTOOL])
1662 AC_DEFUN([AC_LIBTOOL_DLOPEN])
1663 AC_DEFUN([AC_PROG_LD])
1664 ])
1665
1666 dnl vim:et:ts=2:sw=2
1667
1668 # AM_CONDITIONAL                                              -*- Autoconf -*-
1669
1670 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
1671
1672 # This program is free software; you can redistribute it and/or modify
1673 # it under the terms of the GNU General Public License as published by
1674 # the Free Software Foundation; either version 2, or (at your option)
1675 # any later version.
1676
1677 # This program is distributed in the hope that it will be useful,
1678 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1679 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1680 # GNU General Public License for more details.
1681
1682 # You should have received a copy of the GNU General Public License
1683 # along with this program; if not, write to the Free Software
1684 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1685 # 02111-1307, USA.
1686
1687 # serial 5
1688
1689 AC_PREREQ(2.52)
1690
1691 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1692 # -------------------------------------
1693 # Define a conditional.
1694 AC_DEFUN([AM_CONDITIONAL],
1695 [ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1696         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1697 AC_SUBST([$1_TRUE])
1698 AC_SUBST([$1_FALSE])
1699 if $2; then
1700   $1_TRUE=
1701   $1_FALSE='#'
1702 else
1703   $1_TRUE='#'
1704   $1_FALSE=
1705 fi
1706 AC_CONFIG_COMMANDS_PRE(
1707 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1708   AC_MSG_ERROR([conditional "$1" was never defined.
1709 Usually this means the macro was only invoked conditionally.])
1710 fi])])
1711
1712 # Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
1713
1714 # This program is free software; you can redistribute it and/or modify
1715 # it under the terms of the GNU General Public License as published by
1716 # the Free Software Foundation; either version 2, or (at your option)
1717 # any later version.
1718
1719 # This program is distributed in the hope that it will be useful,
1720 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1721 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1722 # GNU General Public License for more details.
1723
1724 # You should have received a copy of the GNU General Public License
1725 # along with this program; if not, write to the Free Software
1726 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1727 # 02111-1307, USA.
1728
1729 # serial 3
1730
1731 # AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR])
1732 # ---------------------------------------------------
1733 # Add --enable-multilib to configure.
1734 AC_DEFUN([AM_ENABLE_MULTILIB],
1735 [# Default to --enable-multilib
1736 AC_ARG_ENABLE(multilib,
1737 [  --enable-multilib         build many library versions (default)],
1738 [case "$enableval" in
1739   yes) multilib=yes ;;
1740   no)  multilib=no ;;
1741   *)   AC_MSG_ERROR([bad value $enableval for multilib option]) ;;
1742  esac],
1743               [multilib=yes])
1744
1745 # We may get other options which we leave undocumented:
1746 # --with-target-subdir, --with-multisrctop, --with-multisubdir
1747 # See config-ml.in if you want the gory details.
1748
1749 if test "$srcdir" = "."; then
1750   if test "$with_target_subdir" != "."; then
1751     multi_basedir="$srcdir/$with_multisrctop../$2"
1752   else
1753     multi_basedir="$srcdir/$with_multisrctop$2"
1754   fi
1755 else
1756   multi_basedir="$srcdir/$2"
1757 fi
1758 AC_SUBST(multi_basedir)
1759
1760 AC_OUTPUT_COMMANDS([
1761 # Only add multilib support code if we just rebuilt the top-level
1762 # Makefile.
1763 case " $CONFIG_FILES " in
1764  *" ]m4_default([$1],Makefile)[ "*)
1765    ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in
1766    ;;
1767 esac],
1768                    [
1769 srcdir="$srcdir"
1770 host="$host"
1771 target="$target"
1772 with_multisubdir="$with_multisubdir"
1773 with_multisrctop="$with_multisrctop"
1774 with_target_subdir="$with_target_subdir"
1775 ac_configure_args="${multilib_arg} ${ac_configure_args}"
1776 multi_basedir="$multi_basedir"
1777 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1778 CC="$CC"])])dnl
1779
1780 # Add --enable-maintainer-mode option to configure.
1781 # From Jim Meyering
1782
1783 # Copyright 1996, 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
1784
1785 # This program is free software; you can redistribute it and/or modify
1786 # it under the terms of the GNU General Public License as published by
1787 # the Free Software Foundation; either version 2, or (at your option)
1788 # any later version.
1789
1790 # This program is distributed in the hope that it will be useful,
1791 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1792 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1793 # GNU General Public License for more details.
1794
1795 # You should have received a copy of the GNU General Public License
1796 # along with this program; if not, write to the Free Software
1797 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1798 # 02111-1307, USA.
1799
1800 # serial 2
1801
1802 AC_DEFUN([AM_MAINTAINER_MODE],
1803 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1804   dnl maintainer-mode is disabled by default
1805   AC_ARG_ENABLE(maintainer-mode,
1806 [  --enable-maintainer-mode enable make rules and dependencies not useful
1807                           (and sometimes confusing) to the casual installer],
1808       USE_MAINTAINER_MODE=$enableval,
1809       USE_MAINTAINER_MODE=no)
1810   AC_MSG_RESULT([$USE_MAINTAINER_MODE])
1811   AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
1812   MAINT=$MAINTAINER_MODE_TRUE
1813   AC_SUBST(MAINT)dnl
1814 ]
1815 )
1816
1817 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
1818
1819 # Do all the work for Automake.                            -*- Autoconf -*-
1820
1821 # This macro actually does too much some checks are only needed if
1822 # your package does certain things.  But this isn't really a big deal.
1823
1824 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
1825 # Free Software Foundation, Inc.
1826
1827 # This program is free software; you can redistribute it and/or modify
1828 # it under the terms of the GNU General Public License as published by
1829 # the Free Software Foundation; either version 2, or (at your option)
1830 # any later version.
1831
1832 # This program is distributed in the hope that it will be useful,
1833 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1834 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1835 # GNU General Public License for more details.
1836
1837 # You should have received a copy of the GNU General Public License
1838 # along with this program; if not, write to the Free Software
1839 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1840 # 02111-1307, USA.
1841
1842 # serial 10
1843
1844 AC_PREREQ([2.54])
1845
1846 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
1847 # the ones we care about.
1848 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1849
1850 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1851 # AM_INIT_AUTOMAKE([OPTIONS])
1852 # -----------------------------------------------
1853 # The call with PACKAGE and VERSION arguments is the old style
1854 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
1855 # and VERSION should now be passed to AC_INIT and removed from
1856 # the call to AM_INIT_AUTOMAKE.
1857 # We support both call styles for the transition.  After
1858 # the next Automake release, Autoconf can make the AC_INIT
1859 # arguments mandatory, and then we can depend on a new Autoconf
1860 # release and drop the old call support.
1861 AC_DEFUN([AM_INIT_AUTOMAKE],
1862 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1863  AC_REQUIRE([AC_PROG_INSTALL])dnl
1864 # test to see if srcdir already configured
1865 if test "`cd $srcdir && pwd`" != "`pwd`" &&
1866    test -f $srcdir/config.status; then
1867   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1868 fi
1869
1870 # test whether we have cygpath
1871 if test -z "$CYGPATH_W"; then
1872   if (cygpath --version) >/dev/null 2>/dev/null; then
1873     CYGPATH_W='cygpath -w'
1874   else
1875     CYGPATH_W=echo
1876   fi
1877 fi
1878 AC_SUBST([CYGPATH_W])
1879
1880 # Define the identity of the package.
1881 dnl Distinguish between old-style and new-style calls.
1882 m4_ifval([$2],
1883 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1884  AC_SUBST([PACKAGE], [$1])dnl
1885  AC_SUBST([VERSION], [$2])],
1886 [_AM_SET_OPTIONS([$1])dnl
1887  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1888  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1889
1890 _AM_IF_OPTION([no-define],,
1891 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1892  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1893
1894 # Some tools Automake needs.
1895 AC_REQUIRE([AM_SANITY_CHECK])dnl
1896 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1897 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1898 AM_MISSING_PROG(AUTOCONF, autoconf)
1899 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1900 AM_MISSING_PROG(AUTOHEADER, autoheader)
1901 AM_MISSING_PROG(MAKEINFO, makeinfo)
1902 AM_MISSING_PROG(AMTAR, tar)
1903 AM_PROG_INSTALL_SH
1904 AM_PROG_INSTALL_STRIP
1905 # We need awk for the "check" target.  The system "awk" is bad on
1906 # some platforms.
1907 AC_REQUIRE([AC_PROG_AWK])dnl
1908 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1909 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1910
1911 _AM_IF_OPTION([no-dependencies],,
1912 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1913                   [_AM_DEPENDENCIES(CC)],
1914                   [define([AC_PROG_CC],
1915                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1916 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1917                   [_AM_DEPENDENCIES(CXX)],
1918                   [define([AC_PROG_CXX],
1919                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1920 ])
1921 ])
1922
1923
1924 # When config.status generates a header, we must update the stamp-h file.
1925 # This file resides in the same directory as the config header
1926 # that is generated.  The stamp files are numbered to have different names.
1927
1928 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1929 # loop where config.status creates the headers, so we can generate
1930 # our stamp files there.
1931 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1932 [# Compute $1's index in $config_headers.
1933 _am_stamp_count=1
1934 for _am_header in $config_headers :; do
1935   case $_am_header in
1936     $1 | $1:* )
1937       break ;;
1938     * )
1939       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1940   esac
1941 done
1942 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
1943
1944 # Copyright 2002  Free Software Foundation, Inc.
1945
1946 # This program is free software; you can redistribute it and/or modify
1947 # it under the terms of the GNU General Public License as published by
1948 # the Free Software Foundation; either version 2, or (at your option)
1949 # any later version.
1950
1951 # This program is distributed in the hope that it will be useful,
1952 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1953 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1954 # GNU General Public License for more details.
1955
1956 # You should have received a copy of the GNU General Public License
1957 # along with this program; if not, write to the Free Software
1958 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1959
1960 # AM_AUTOMAKE_VERSION(VERSION)
1961 # ----------------------------
1962 # Automake X.Y traces this macro to ensure aclocal.m4 has been
1963 # generated from the m4 files accompanying Automake X.Y.
1964 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
1965
1966 # AM_SET_CURRENT_AUTOMAKE_VERSION
1967 # -------------------------------
1968 # Call AM_AUTOMAKE_VERSION so it can be traced.
1969 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
1970 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1971          [AM_AUTOMAKE_VERSION([1.7.6])])
1972
1973 # Helper functions for option handling.                    -*- Autoconf -*-
1974
1975 # Copyright 2001, 2002  Free Software Foundation, Inc.
1976
1977 # This program is free software; you can redistribute it and/or modify
1978 # it under the terms of the GNU General Public License as published by
1979 # the Free Software Foundation; either version 2, or (at your option)
1980 # any later version.
1981
1982 # This program is distributed in the hope that it will be useful,
1983 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1984 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1985 # GNU General Public License for more details.
1986
1987 # You should have received a copy of the GNU General Public License
1988 # along with this program; if not, write to the Free Software
1989 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1990 # 02111-1307, USA.
1991
1992 # serial 2
1993
1994 # _AM_MANGLE_OPTION(NAME)
1995 # -----------------------
1996 AC_DEFUN([_AM_MANGLE_OPTION],
1997 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1998
1999 # _AM_SET_OPTION(NAME)
2000 # ------------------------------
2001 # Set option NAME.  Presently that only means defining a flag for this option.
2002 AC_DEFUN([_AM_SET_OPTION],
2003 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
2004
2005 # _AM_SET_OPTIONS(OPTIONS)
2006 # ----------------------------------
2007 # OPTIONS is a space-separated list of Automake options.
2008 AC_DEFUN([_AM_SET_OPTIONS],
2009 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2010
2011 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2012 # -------------------------------------------
2013 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2014 AC_DEFUN([_AM_IF_OPTION],
2015 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2016
2017 #
2018 # Check to make sure that the build environment is sane.
2019 #
2020
2021 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
2022
2023 # This program is free software; you can redistribute it and/or modify
2024 # it under the terms of the GNU General Public License as published by
2025 # the Free Software Foundation; either version 2, or (at your option)
2026 # any later version.
2027
2028 # This program is distributed in the hope that it will be useful,
2029 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2030 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2031 # GNU General Public License for more details.
2032
2033 # You should have received a copy of the GNU General Public License
2034 # along with this program; if not, write to the Free Software
2035 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2036 # 02111-1307, USA.
2037
2038 # serial 3
2039
2040 # AM_SANITY_CHECK
2041 # ---------------
2042 AC_DEFUN([AM_SANITY_CHECK],
2043 [AC_MSG_CHECKING([whether build environment is sane])
2044 # Just in case
2045 sleep 1
2046 echo timestamp > conftest.file
2047 # Do `set' in a subshell so we don't clobber the current shell's
2048 # arguments.  Must try -L first in case configure is actually a
2049 # symlink; some systems play weird games with the mod time of symlinks
2050 # (eg FreeBSD returns the mod time of the symlink's containing
2051 # directory).
2052 if (
2053    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
2054    if test "$[*]" = "X"; then
2055       # -L didn't work.
2056       set X `ls -t $srcdir/configure conftest.file`
2057    fi
2058    rm -f conftest.file
2059    if test "$[*]" != "X $srcdir/configure conftest.file" \
2060       && test "$[*]" != "X conftest.file $srcdir/configure"; then
2061
2062       # If neither matched, then we have a broken ls.  This can happen
2063       # if, for instance, CONFIG_SHELL is bash and it inherits a
2064       # broken ls alias from the environment.  This has actually
2065       # happened.  Such a system could not be considered "sane".
2066       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
2067 alias in your environment])
2068    fi
2069
2070    test "$[2]" = conftest.file
2071    )
2072 then
2073    # Ok.
2074    :
2075 else
2076    AC_MSG_ERROR([newly created file is older than distributed files!
2077 Check your system clock])
2078 fi
2079 AC_MSG_RESULT(yes)])
2080
2081 #  -*- Autoconf -*-
2082
2083
2084 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
2085
2086 # This program is free software; you can redistribute it and/or modify
2087 # it under the terms of the GNU General Public License as published by
2088 # the Free Software Foundation; either version 2, or (at your option)
2089 # any later version.
2090
2091 # This program is distributed in the hope that it will be useful,
2092 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2093 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2094 # GNU General Public License for more details.
2095
2096 # You should have received a copy of the GNU General Public License
2097 # along with this program; if not, write to the Free Software
2098 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2099 # 02111-1307, USA.
2100
2101 # serial 3
2102
2103 # AM_MISSING_PROG(NAME, PROGRAM)
2104 # ------------------------------
2105 AC_DEFUN([AM_MISSING_PROG],
2106 [AC_REQUIRE([AM_MISSING_HAS_RUN])
2107 $1=${$1-"${am_missing_run}$2"}
2108 AC_SUBST($1)])
2109
2110
2111 # AM_MISSING_HAS_RUN
2112 # ------------------
2113 # Define MISSING if not defined so far and test if it supports --run.
2114 # If it does, set am_missing_run to use it, otherwise, to nothing.
2115 AC_DEFUN([AM_MISSING_HAS_RUN],
2116 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2117 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
2118 # Use eval to expand $SHELL
2119 if eval "$MISSING --run true"; then
2120   am_missing_run="$MISSING --run "
2121 else
2122   am_missing_run=
2123   AC_MSG_WARN([`missing' script is too old or missing])
2124 fi
2125 ])
2126
2127 # AM_AUX_DIR_EXPAND
2128
2129 # Copyright 2001 Free Software Foundation, Inc.
2130
2131 # This program is free software; you can redistribute it and/or modify
2132 # it under the terms of the GNU General Public License as published by
2133 # the Free Software Foundation; either version 2, or (at your option)
2134 # any later version.
2135
2136 # This program is distributed in the hope that it will be useful,
2137 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2138 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2139 # GNU General Public License for more details.
2140
2141 # You should have received a copy of the GNU General Public License
2142 # along with this program; if not, write to the Free Software
2143 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2144 # 02111-1307, USA.
2145
2146 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
2147 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
2148 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
2149 #
2150 # Of course, Automake must honor this variable whenever it calls a
2151 # tool from the auxiliary directory.  The problem is that $srcdir (and
2152 # therefore $ac_aux_dir as well) can be either absolute or relative,
2153 # depending on how configure is run.  This is pretty annoying, since
2154 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
2155 # source directory, any form will work fine, but in subdirectories a
2156 # relative path needs to be adjusted first.
2157 #
2158 # $ac_aux_dir/missing
2159 #    fails when called from a subdirectory if $ac_aux_dir is relative
2160 # $top_srcdir/$ac_aux_dir/missing
2161 #    fails if $ac_aux_dir is absolute,
2162 #    fails when called from a subdirectory in a VPATH build with
2163 #          a relative $ac_aux_dir
2164 #
2165 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
2166 # are both prefixed by $srcdir.  In an in-source build this is usually
2167 # harmless because $srcdir is `.', but things will broke when you
2168 # start a VPATH build or use an absolute $srcdir.
2169 #
2170 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
2171 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
2172 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
2173 # and then we would define $MISSING as
2174 #   MISSING="\${SHELL} $am_aux_dir/missing"
2175 # This will work as long as MISSING is not called from configure, because
2176 # unfortunately $(top_srcdir) has no meaning in configure.
2177 # However there are other variables, like CC, which are often used in
2178 # configure, and could therefore not use this "fixed" $ac_aux_dir.
2179 #
2180 # Another solution, used here, is to always expand $ac_aux_dir to an
2181 # absolute PATH.  The drawback is that using absolute paths prevent a
2182 # configured tree to be moved without reconfiguration.
2183
2184 # Rely on autoconf to set up CDPATH properly.
2185 AC_PREREQ([2.50])
2186
2187 AC_DEFUN([AM_AUX_DIR_EXPAND], [
2188 # expand $ac_aux_dir to an absolute path
2189 am_aux_dir=`cd $ac_aux_dir && pwd`
2190 ])
2191
2192 # AM_PROG_INSTALL_SH
2193 # ------------------
2194 # Define $install_sh.
2195
2196 # Copyright 2001 Free Software Foundation, Inc.
2197
2198 # This program is free software; you can redistribute it and/or modify
2199 # it under the terms of the GNU General Public License as published by
2200 # the Free Software Foundation; either version 2, or (at your option)
2201 # any later version.
2202
2203 # This program is distributed in the hope that it will be useful,
2204 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2205 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2206 # GNU General Public License for more details.
2207
2208 # You should have received a copy of the GNU General Public License
2209 # along with this program; if not, write to the Free Software
2210 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2211 # 02111-1307, USA.
2212
2213 AC_DEFUN([AM_PROG_INSTALL_SH],
2214 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2215 install_sh=${install_sh-"$am_aux_dir/install-sh"}
2216 AC_SUBST(install_sh)])
2217
2218 # AM_PROG_INSTALL_STRIP
2219
2220 # Copyright 2001 Free Software Foundation, Inc.
2221
2222 # This program is free software; you can redistribute it and/or modify
2223 # it under the terms of the GNU General Public License as published by
2224 # the Free Software Foundation; either version 2, or (at your option)
2225 # any later version.
2226
2227 # This program is distributed in the hope that it will be useful,
2228 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2229 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2230 # GNU General Public License for more details.
2231
2232 # You should have received a copy of the GNU General Public License
2233 # along with this program; if not, write to the Free Software
2234 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2235 # 02111-1307, USA.
2236
2237 # One issue with vendor `install' (even GNU) is that you can't
2238 # specify the program used to strip binaries.  This is especially
2239 # annoying in cross-compiling environments, where the build's strip
2240 # is unlikely to handle the host's binaries.
2241 # Fortunately install-sh will honor a STRIPPROG variable, so we
2242 # always use install-sh in `make install-strip', and initialize
2243 # STRIPPROG with the value of the STRIP variable (set by the user).
2244 AC_DEFUN([AM_PROG_INSTALL_STRIP],
2245 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2246 # Installed binaries are usually stripped using `strip' when the user
2247 # run `make install-strip'.  However `strip' might not be the right
2248 # tool to use in cross-compilation environments, therefore Automake
2249 # will honor the `STRIP' environment variable to overrule this program.
2250 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
2251 if test "$cross_compiling" != no; then
2252   AC_CHECK_TOOL([STRIP], [strip], :)
2253 fi
2254 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
2255 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2256
2257 #                                                          -*- Autoconf -*-
2258 # Copyright (C) 2003  Free Software Foundation, Inc.
2259
2260 # This program is free software; you can redistribute it and/or modify
2261 # it under the terms of the GNU General Public License as published by
2262 # the Free Software Foundation; either version 2, or (at your option)
2263 # any later version.
2264
2265 # This program is distributed in the hope that it will be useful,
2266 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2267 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2268 # GNU General Public License for more details.
2269
2270 # You should have received a copy of the GNU General Public License
2271 # along with this program; if not, write to the Free Software
2272 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2273 # 02111-1307, USA.
2274
2275 # serial 1
2276
2277 # Check whether the underlying file-system supports filenames
2278 # with a leading dot.  For instance MS-DOS doesn't.
2279 AC_DEFUN([AM_SET_LEADING_DOT],
2280 [rm -rf .tst 2>/dev/null
2281 mkdir .tst 2>/dev/null
2282 if test -d .tst; then
2283   am__leading_dot=.
2284 else
2285   am__leading_dot=_
2286 fi
2287 rmdir .tst 2>/dev/null
2288 AC_SUBST([am__leading_dot])])
2289
2290 # serial 5                                              -*- Autoconf -*-
2291
2292 # Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
2293
2294 # This program is free software; you can redistribute it and/or modify
2295 # it under the terms of the GNU General Public License as published by
2296 # the Free Software Foundation; either version 2, or (at your option)
2297 # any later version.
2298
2299 # This program is distributed in the hope that it will be useful,
2300 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2301 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2302 # GNU General Public License for more details.
2303
2304 # You should have received a copy of the GNU General Public License
2305 # along with this program; if not, write to the Free Software
2306 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2307 # 02111-1307, USA.
2308
2309
2310 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
2311 # written in clear, in which case automake, when reading aclocal.m4,
2312 # will think it sees a *use*, and therefore will trigger all it's
2313 # C support machinery.  Also note that it means that autoscan, seeing
2314 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
2315
2316
2317
2318 # _AM_DEPENDENCIES(NAME)
2319 # ----------------------
2320 # See how the compiler implements dependency checking.
2321 # NAME is "CC", "CXX", "GCJ", or "OBJC".
2322 # We try a few techniques and use that to set a single cache variable.
2323 #
2324 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
2325 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
2326 # dependency, and given that the user is not expected to run this macro,
2327 # just rely on AC_PROG_CC.
2328 AC_DEFUN([_AM_DEPENDENCIES],
2329 [AC_REQUIRE([AM_SET_DEPDIR])dnl
2330 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
2331 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
2332 AC_REQUIRE([AM_DEP_TRACK])dnl
2333
2334 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
2335        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
2336        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
2337        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
2338                    [depcc="$$1"   am_compiler_list=])
2339
2340 AC_CACHE_CHECK([dependency style of $depcc],
2341                [am_cv_$1_dependencies_compiler_type],
2342 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
2343   # We make a subdir and do the tests there.  Otherwise we can end up
2344   # making bogus files that we don't know about and never remove.  For
2345   # instance it was reported that on HP-UX the gcc test will end up
2346   # making a dummy file named `D' -- because `-MD' means `put the output
2347   # in D'.
2348   mkdir conftest.dir
2349   # Copy depcomp to subdir because otherwise we won't find it if we're
2350   # using a relative directory.
2351   cp "$am_depcomp" conftest.dir
2352   cd conftest.dir
2353   # We will build objects and dependencies in a subdirectory because
2354   # it helps to detect inapplicable dependency modes.  For instance
2355   # both Tru64's cc and ICC support -MD to output dependencies as a
2356   # side effect of compilation, but ICC will put the dependencies in
2357   # the current directory while Tru64 will put them in the object
2358   # directory.
2359   mkdir sub
2360
2361   am_cv_$1_dependencies_compiler_type=none
2362   if test "$am_compiler_list" = ""; then
2363      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2364   fi
2365   for depmode in $am_compiler_list; do
2366     # Setup a source with many dependencies, because some compilers
2367     # like to wrap large dependency lists on column 80 (with \), and
2368     # we should not choose a depcomp mode which is confused by this.
2369     #
2370     # We need to recreate these files for each test, as the compiler may
2371     # overwrite some of them when testing with obscure command lines.
2372     # This happens at least with the AIX C compiler.
2373     : > sub/conftest.c
2374     for i in 1 2 3 4 5 6; do
2375       echo '#include "conftst'$i'.h"' >> sub/conftest.c
2376       : > sub/conftst$i.h
2377     done
2378     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2379
2380     case $depmode in
2381     nosideeffect)
2382       # after this tag, mechanisms are not by side-effect, so they'll
2383       # only be used when explicitly requested
2384       if test "x$enable_dependency_tracking" = xyes; then
2385         continue
2386       else
2387         break
2388       fi
2389       ;;
2390     none) break ;;
2391     esac
2392     # We check with `-c' and `-o' for the sake of the "dashmstdout"
2393     # mode.  It turns out that the SunPro C++ compiler does not properly
2394     # handle `-M -o', and we need to detect this.
2395     if depmode=$depmode \
2396        source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
2397        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2398        $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
2399          >/dev/null 2>conftest.err &&
2400        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2401        grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
2402        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2403       # icc doesn't choke on unknown options, it will just issue warnings
2404       # (even with -Werror).  So we grep stderr for any message
2405       # that says an option was ignored.
2406       if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
2407         am_cv_$1_dependencies_compiler_type=$depmode
2408         break
2409       fi
2410     fi
2411   done
2412
2413   cd ..
2414   rm -rf conftest.dir
2415 else
2416   am_cv_$1_dependencies_compiler_type=none
2417 fi
2418 ])
2419 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2420 AM_CONDITIONAL([am__fastdep$1], [
2421   test "x$enable_dependency_tracking" != xno \
2422   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2423 ])
2424
2425
2426 # AM_SET_DEPDIR
2427 # -------------
2428 # Choose a directory name for dependency files.
2429 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
2430 AC_DEFUN([AM_SET_DEPDIR],
2431 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2432 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2433 ])
2434
2435
2436 # AM_DEP_TRACK
2437 # ------------
2438 AC_DEFUN([AM_DEP_TRACK],
2439 [AC_ARG_ENABLE(dependency-tracking,
2440 [  --disable-dependency-tracking Speeds up one-time builds
2441   --enable-dependency-tracking  Do not reject slow dependency extractors])
2442 if test "x$enable_dependency_tracking" != xno; then
2443   am_depcomp="$ac_aux_dir/depcomp"
2444   AMDEPBACKSLASH='\'
2445 fi
2446 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2447 AC_SUBST([AMDEPBACKSLASH])
2448 ])
2449
2450 # Generate code to set up dependency tracking.   -*- Autoconf -*-
2451
2452 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
2453
2454 # This program is free software; you can redistribute it and/or modify
2455 # it under the terms of the GNU General Public License as published by
2456 # the Free Software Foundation; either version 2, or (at your option)
2457 # any later version.
2458
2459 # This program is distributed in the hope that it will be useful,
2460 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2461 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2462 # GNU General Public License for more details.
2463
2464 # You should have received a copy of the GNU General Public License
2465 # along with this program; if not, write to the Free Software
2466 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2467 # 02111-1307, USA.
2468
2469 #serial 2
2470
2471 # _AM_OUTPUT_DEPENDENCY_COMMANDS
2472 # ------------------------------
2473 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
2474 [for mf in $CONFIG_FILES; do
2475   # Strip MF so we end up with the name of the file.
2476   mf=`echo "$mf" | sed -e 's/:.*$//'`
2477   # Check whether this is an Automake generated Makefile or not.
2478   # We used to match only the files named `Makefile.in', but
2479   # some people rename them; so instead we look at the file content.
2480   # Grep'ing the first line is not enough: some people post-process
2481   # each Makefile.in and add a new line on top of each file to say so.
2482   # So let's grep whole file.
2483   if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
2484     dirpart=`AS_DIRNAME("$mf")`
2485   else
2486     continue
2487   fi
2488   grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
2489   # Extract the definition of DEP_FILES from the Makefile without
2490   # running `make'.
2491   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
2492   test -z "$DEPDIR" && continue
2493   # When using ansi2knr, U may be empty or an underscore; expand it
2494   U=`sed -n -e '/^U = / s///p' < "$mf"`
2495   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
2496   # We invoke sed twice because it is the simplest approach to
2497   # changing $(DEPDIR) to its actual value in the expansion.
2498   for file in `sed -n -e '
2499     /^DEP_FILES = .*\\\\$/ {
2500       s/^DEP_FILES = //
2501       :loop
2502         s/\\\\$//
2503         p
2504         n
2505         /\\\\$/ b loop
2506       p
2507     }
2508     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
2509        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
2510     # Make sure the directory exists.
2511     test -f "$dirpart/$file" && continue
2512     fdir=`AS_DIRNAME(["$file"])`
2513     AS_MKDIR_P([$dirpart/$fdir])
2514     # echo "creating $dirpart/$file"
2515     echo '# dummy' > "$dirpart/$file"
2516   done
2517 done
2518 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
2519
2520
2521 # AM_OUTPUT_DEPENDENCY_COMMANDS
2522 # -----------------------------
2523 # This macro should only be invoked once -- use via AC_REQUIRE.
2524 #
2525 # This code is only required when automatic dependency tracking
2526 # is enabled.  FIXME.  This creates each `.P' file that we will
2527 # need in order to bootstrap the dependency handling code.
2528 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
2529 [AC_CONFIG_COMMANDS([depfiles],
2530      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
2531      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
2532 ])
2533
2534 # Check to see how 'make' treats includes.      -*- Autoconf -*-
2535
2536 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
2537
2538 # This program is free software; you can redistribute it and/or modify
2539 # it under the terms of the GNU General Public License as published by
2540 # the Free Software Foundation; either version 2, or (at your option)
2541 # any later version.
2542
2543 # This program is distributed in the hope that it will be useful,
2544 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2545 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2546 # GNU General Public License for more details.
2547
2548 # You should have received a copy of the GNU General Public License
2549 # along with this program; if not, write to the Free Software
2550 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2551 # 02111-1307, USA.
2552
2553 # serial 2
2554
2555 # AM_MAKE_INCLUDE()
2556 # -----------------
2557 # Check to see how make treats includes.
2558 AC_DEFUN([AM_MAKE_INCLUDE],
2559 [am_make=${MAKE-make}
2560 cat > confinc << 'END'
2561 am__doit:
2562         @echo done
2563 .PHONY: am__doit
2564 END
2565 # If we don't find an include directive, just comment out the code.
2566 AC_MSG_CHECKING([for style of include used by $am_make])
2567 am__include="#"
2568 am__quote=
2569 _am_result=none
2570 # First try GNU make style include.
2571 echo "include confinc" > confmf
2572 # We grep out `Entering directory' and `Leaving directory'
2573 # messages which can occur if `w' ends up in MAKEFLAGS.
2574 # In particular we don't look at `^make:' because GNU make might
2575 # be invoked under some other name (usually "gmake"), in which
2576 # case it prints its new name instead of `make'.
2577 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
2578    am__include=include
2579    am__quote=
2580    _am_result=GNU
2581 fi
2582 # Now try BSD make style include.
2583 if test "$am__include" = "#"; then
2584    echo '.include "confinc"' > confmf
2585    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
2586       am__include=.include
2587       am__quote="\""
2588       _am_result=BSD
2589    fi
2590 fi
2591 AC_SUBST([am__include])
2592 AC_SUBST([am__quote])
2593 AC_MSG_RESULT([$_am_result])
2594 rm -f confinc confmf
2595 ])
2596