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