OSDN Git Service

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