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