OSDN Git Service

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