OSDN Git Service

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