1dnl 2dnl GLIBCXX_CONDITIONAL (NAME, SHELL-TEST) 3dnl 4dnl Exactly like AM_CONDITIONAL, but delays evaluation of the test until the 5dnl end of configure. This lets tested variables be reassigned, and the 6dnl conditional will depend on the final state of the variable. For a simple 7dnl example of why this is needed, see GLIBCXX_ENABLE_HOSTED. 8dnl 9m4_define([_m4_divert(glibcxx_diversion)], 8000)dnl 10AC_DEFUN([GLIBCXX_CONDITIONAL], [dnl 11 m4_divert_text([glibcxx_diversion],dnl 12 AM_CONDITIONAL([$1],[$2]) 13 )dnl 14])dnl 15AC_DEFUN([GLIBCXX_EVALUATE_CONDITIONALS], [m4_undivert([glibcxx_diversion])])dnl 16 17 18dnl 19dnl Check to see what architecture and operating system we are compiling 20dnl for. Also, if architecture- or OS-specific flags are required for 21dnl compilation, pick them up here. 22dnl 23AC_DEFUN([GLIBCXX_CHECK_HOST], [ 24 . $glibcxx_srcdir/configure.host 25 AC_MSG_NOTICE([CPU config directory is $cpu_include_dir]) 26 AC_MSG_NOTICE([OS config directory is $os_include_dir]) 27]) 28 29dnl 30dnl Initialize the rest of the library configury. At this point we have 31dnl variables like $host. 32dnl 33dnl Sets: 34dnl SUBDIRS 35dnl Substs: 36dnl glibcxx_builddir (absolute path) 37dnl glibcxx_srcdir (absolute path) 38dnl toplevel_builddir (absolute path) 39dnl toplevel_srcdir (absolute path) 40dnl with_cross_host 41dnl with_newlib 42dnl with_target_subdir 43dnl plus 44dnl - the variables in GLIBCXX_CHECK_HOST / configure.host 45dnl - default settings for all AM_CONFITIONAL test variables 46dnl - lots of tools, like CC and CXX 47dnl 48AC_DEFUN([GLIBCXX_CONFIGURE], [ 49 # Keep these sync'd with the list in Makefile.am. The first provides an 50 # expandable list at autoconf time; the second provides an expandable list 51 # (i.e., shell variable) at configure time. 52 m4_define([glibcxx_SUBDIRS],[include libsupc++ src src/c++98 src/c++11 src/c++17 src/filesystem doc po testsuite python]) 53 SUBDIRS='glibcxx_SUBDIRS' 54 55 # These need to be absolute paths, yet at the same time need to 56 # canonicalize only relative paths, because then amd will not unmount 57 # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd. 58 glibcxx_builddir=`${PWDCMD-pwd}` 59 case $srcdir in 60 [\\/$]* | ?:[\\/]*) glibcxx_srcdir=${srcdir} ;; 61 *) glibcxx_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;; 62 esac 63 toplevel_builddir=${glibcxx_builddir}/.. 64 toplevel_srcdir=${glibcxx_srcdir}/.. 65 AC_SUBST(glibcxx_builddir) 66 AC_SUBST(glibcxx_srcdir) 67 AC_SUBST(toplevel_builddir) 68 AC_SUBST(toplevel_srcdir) 69 70 # We use these options to decide which functions to include. They are 71 # set from the top level. 72 AC_ARG_WITH([target-subdir], 73 AC_HELP_STRING([--with-target-subdir=SUBDIR], 74 [configuring in a subdirectory])) 75 76 AC_ARG_WITH([cross-host], 77 AC_HELP_STRING([--with-cross-host=HOST], 78 [configuring with a cross compiler])) 79 80 AC_ARG_WITH([newlib], 81 AC_HELP_STRING([--with-newlib], 82 [assume newlib as a system C library])) 83 84 # Will set LN_S to either 'ln -s', 'ln', or 'cp -p' (if linking isn't 85 # available). Uncomment the next line to force a particular method. 86 AC_PROG_LN_S 87 #LN_S='cp -p' 88 89 AC_CHECK_TOOL(AS, as) 90 AC_CHECK_TOOL(AR, ar) 91 AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error) 92 93 AM_MAINTAINER_MODE 94 95 # Set up safe default values for all subsequent AM_CONDITIONAL tests 96 # which are themselves conditionally expanded. 97 ## (Right now, this only matters for enable_wchar_t, but nothing prevents 98 ## other macros from doing the same. This should be automated.) -pme 99 100 # Check for C library flavor since GNU/Linux platforms use different 101 # configuration directories depending on the C library in use. 102 AC_EGREP_CPP([_using_uclibc], [ 103 #include <stdio.h> 104 #if __UCLIBC__ 105 _using_uclibc 106 #endif 107 ], uclibc=yes, uclibc=no) 108 109 AC_EGREP_CPP([_using_bionic], [ 110 #include <stdio.h> 111 #if __BIONIC__ 112 _using_bionic 113 #endif 114 ], bionic=yes, bionic=no) 115 116 # Find platform-specific directories containing configuration info. 117 # Also possibly modify flags used elsewhere, as needed by the platform. 118 GLIBCXX_CHECK_HOST 119]) 120 121 122dnl 123dnl Tests for newer compiler features, or features that are present in newer 124dnl compiler versions but not older compiler versions still in use, should 125dnl be placed here. 126dnl 127dnl Defines: 128dnl WERROR='-Werror' if requested and possible; g++'s that lack the 129dnl new inlining code or the new system_header pragma will die on -Werror. 130dnl Leave it out by default and use maint-mode to use it. 131dnl SECTION_FLAGS='-ffunction-sections -fdata-sections' if 132dnl compiler supports it and the user has not requested debug mode. 133dnl 134AC_DEFUN([GLIBCXX_CHECK_COMPILER_FEATURES], [ 135 # All these tests are for C++; save the language and the compiler flags. 136 # The CXXFLAGS thing is suspicious, but based on similar bits previously 137 # found in GLIBCXX_CONFIGURE. 138 AC_LANG_SAVE 139 AC_LANG_CPLUSPLUS 140 ac_test_CXXFLAGS="${CXXFLAGS+set}" 141 ac_save_CXXFLAGS="$CXXFLAGS" 142 143 # Check for -ffunction-sections -fdata-sections 144 AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections]) 145 CXXFLAGS='-g -Werror -ffunction-sections -fdata-sections' 146 AC_TRY_COMPILE([int foo; void bar() { };],, [ac_fdsections=yes], [ac_fdsections=no]) 147 if test "$ac_test_CXXFLAGS" = set; then 148 CXXFLAGS="$ac_save_CXXFLAGS" 149 else 150 # this is the suspicious part 151 CXXFLAGS='' 152 fi 153 if test x"$ac_fdsections" = x"yes"; then 154 SECTION_FLAGS='-ffunction-sections -fdata-sections' 155 fi 156 AC_MSG_RESULT($ac_fdsections) 157 158 AC_LANG_RESTORE 159 AC_SUBST(SECTION_FLAGS) 160]) 161 162 163dnl 164dnl If GNU ld is in use, check to see if tricky linker opts can be used. If 165dnl the native linker is in use, all variables will be defined to something 166dnl safe (like an empty string). 167dnl 168dnl Defines: 169dnl SECTION_LDFLAGS='-Wl,--gc-sections' if possible 170dnl OPT_LDFLAGS='-Wl,-O1' and '-z,relro' if possible 171dnl LD (as a side effect of testing) 172dnl Sets: 173dnl with_gnu_ld 174dnl glibcxx_ld_is_gold (set to "no" or "yes") 175dnl glibcxx_gnu_ld_version (possibly) 176dnl 177dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will 178dnl set glibcxx_gnu_ld_version to 12345. Zeros cause problems. 179dnl 180AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [ 181 # If we're not using GNU ld, then there's no point in even trying these 182 # tests. Check for that first. We should have already tested for gld 183 # by now (in libtool), but require it now just to be safe... 184 test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS='' 185 test -z "$OPT_LDFLAGS" && OPT_LDFLAGS='' 186 AC_REQUIRE([AC_PROG_LD]) 187 AC_REQUIRE([AC_PROG_AWK]) 188 189 # The name set by libtool depends on the version of libtool. Shame on us 190 # for depending on an impl detail, but c'est la vie. Older versions used 191 # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on 192 # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually 193 # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't 194 # set (hence we're using an older libtool), then set it. 195 if test x${with_gnu_ld+set} != xset; then 196 if test x${ac_cv_prog_gnu_ld+set} != xset; then 197 # We got through "ac_require(ac_prog_ld)" and still not set? Huh? 198 with_gnu_ld=no 199 else 200 with_gnu_ld=$ac_cv_prog_gnu_ld 201 fi 202 fi 203 204 # Start by getting the version number. I think the libtool test already 205 # does some of this, but throws away the result. 206 glibcxx_ld_is_gold=no 207 if test x"$with_gnu_ld" = x"yes"; then 208 AC_MSG_CHECKING([for ld version]) 209 changequote(,) 210 if $LD --version 2>/dev/null | grep 'GNU gold' >/dev/null 2>&1; then 211 glibcxx_ld_is_gold=yes 212 fi 213 ldver=`$LD --version 2>/dev/null | 214 sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'` 215 changequote([,]) 216 glibcxx_gnu_ld_version=`echo $ldver | \ 217 $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'` 218 AC_MSG_RESULT($glibcxx_gnu_ld_version) 219 fi 220 221 # Set --gc-sections. 222 glibcxx_have_gc_sections=no 223 if test "$glibcxx_ld_is_gold" = "yes"; then 224 if $LD --help 2>/dev/null | grep gc-sections >/dev/null 2>&1; then 225 glibcxx_have_gc_sections=yes 226 fi 227 else 228 glibcxx_gcsections_min_ld=21602 229 if test x"$with_gnu_ld" = x"yes" && 230 test $glibcxx_gnu_ld_version -gt $glibcxx_gcsections_min_ld ; then 231 glibcxx_have_gc_sections=yes 232 fi 233 fi 234 if test "$glibcxx_have_gc_sections" = "yes"; then 235 # Sufficiently young GNU ld it is! Joy and bunny rabbits! 236 # NB: This flag only works reliably after 2.16.1. Configure tests 237 # for this are difficult, so hard wire a value that should work. 238 239 ac_test_CFLAGS="${CFLAGS+set}" 240 ac_save_CFLAGS="$CFLAGS" 241 CFLAGS='-Wl,--gc-sections' 242 243 # Check for -Wl,--gc-sections 244 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections]) 245 AC_TRY_LINK([ int one(void) { return 1; } 246 int two(void) { return 2; } 247 ], [ two(); ] , [ac_gcsections=yes], [ac_gcsections=no]) 248 if test "$ac_gcsections" = "yes"; then 249 rm -f conftest.c 250 touch conftest.c 251 if $CC -c conftest.c; then 252 if $LD --gc-sections -o conftest conftest.o 2>&1 | \ 253 grep "Warning: gc-sections option ignored" > /dev/null; then 254 ac_gcsections=no 255 fi 256 fi 257 rm -f conftest.c conftest.o conftest 258 fi 259 if test "$ac_gcsections" = "yes"; then 260 SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS" 261 fi 262 AC_MSG_RESULT($ac_gcsections) 263 264 if test "$ac_test_CFLAGS" = set; then 265 CFLAGS="$ac_save_CFLAGS" 266 else 267 # this is the suspicious part 268 CFLAGS='' 269 fi 270 fi 271 272 # Set -z,relro. 273 # Note this is only for shared objects. 274 ac_ld_relro=no 275 if test x"$with_gnu_ld" = x"yes"; then 276 AC_MSG_CHECKING([for ld that supports -Wl,-z,relro]) 277 cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"` 278 if test -n "$cxx_z_relo"; then 279 OPT_LDFLAGS="-Wl,-z,relro" 280 ac_ld_relro=yes 281 fi 282 AC_MSG_RESULT($ac_ld_relro) 283 fi 284 285 # Set linker optimization flags. 286 if test x"$with_gnu_ld" = x"yes"; then 287 OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" 288 fi 289 290 AC_SUBST(SECTION_LDFLAGS) 291 AC_SUBST(OPT_LDFLAGS) 292]) 293 294 295dnl 296dnl Check for headers for, and arguments to, the setrlimit() function. 297dnl Used only in testsuite_hooks.h. Called from GLIBCXX_CONFIGURE_TESTSUITE. 298dnl 299dnl Defines: 300dnl _GLIBCXX_RES_LIMITS if we can set artificial resource limits 301dnl various HAVE_LIMIT_* for individual limit names 302dnl 303AC_DEFUN([GLIBCXX_CHECK_SETRLIMIT_ancilliary], [ 304 AC_MSG_CHECKING([for RLIMIT_$1]) 305 AC_TRY_COMPILE( 306 [#include <unistd.h> 307 #include <sys/time.h> 308 #include <sys/resource.h> 309 ], 310 [ int f = RLIMIT_$1 ; ], 311 [glibcxx_mresult=1], [glibcxx_mresult=0]) 312 AC_DEFINE_UNQUOTED(HAVE_LIMIT_$1, $glibcxx_mresult, 313 [Only used in build directory testsuite_hooks.h.]) 314 if test $glibcxx_mresult = 1 ; then res=yes ; else res=no ; fi 315 AC_MSG_RESULT($res) 316]) 317 318AC_DEFUN([GLIBCXX_CHECK_SETRLIMIT], [ 319 setrlimit_have_headers=yes 320 AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h, 321 [], 322 [setrlimit_have_headers=no]) 323 # If don't have the headers, then we can't run the tests now, and we 324 # won't be seeing any of these during testsuite compilation. 325 if test $setrlimit_have_headers = yes; then 326 # Can't do these in a loop, else the resulting syntax is wrong. 327 GLIBCXX_CHECK_SETRLIMIT_ancilliary(DATA) 328 GLIBCXX_CHECK_SETRLIMIT_ancilliary(RSS) 329 GLIBCXX_CHECK_SETRLIMIT_ancilliary(VMEM) 330 GLIBCXX_CHECK_SETRLIMIT_ancilliary(AS) 331 GLIBCXX_CHECK_SETRLIMIT_ancilliary(FSIZE) 332 333 # Check for rlimit, setrlimit. 334 AC_CACHE_VAL(glibcxx_cv_setrlimit, [ 335 AC_TRY_COMPILE( 336 [#include <unistd.h> 337 #include <sys/time.h> 338 #include <sys/resource.h> 339 ], 340 [struct rlimit r; 341 setrlimit(0, &r);], 342 [glibcxx_cv_setrlimit=yes], [glibcxx_cv_setrlimit=no]) 343 ]) 344 fi 345 346 AC_MSG_CHECKING([for testsuite resource limits support]) 347 if test $setrlimit_have_headers = yes && test $glibcxx_cv_setrlimit = yes; then 348 ac_res_limits=yes 349 AC_DEFINE(_GLIBCXX_RES_LIMITS, 1, 350 [Define if using setrlimit to set resource limits during 351 "make check"]) 352 else 353 ac_res_limits=no 354 fi 355 AC_MSG_RESULT($ac_res_limits) 356]) 357 358 359dnl 360dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>. 361dnl Define HAVE_S_ISREG / HAVE_S_IFREG appropriately. 362dnl 363AC_DEFUN([GLIBCXX_CHECK_S_ISREG_OR_S_IFREG], [ 364 365 AC_LANG_SAVE 366 AC_LANG_CPLUSPLUS 367 ac_save_CXXFLAGS="$CXXFLAGS" 368 CXXFLAGS="$CXXFLAGS -fno-exceptions" 369 370 AC_MSG_CHECKING([for S_ISREG or S_IFREG]) 371 AC_CACHE_VAL(glibcxx_cv_S_ISREG, [ 372 GCC_TRY_COMPILE_OR_LINK( 373 [#include <sys/stat.h>], 374 [struct stat buffer; 375 fstat(0, &buffer); 376 S_ISREG(buffer.st_mode);], 377 [glibcxx_cv_S_ISREG=yes], 378 [glibcxx_cv_S_ISREG=no]) 379 ]) 380 AC_CACHE_VAL(glibcxx_cv_S_IFREG, [ 381 GCC_TRY_COMPILE_OR_LINK( 382 [#include <sys/stat.h>], 383 [struct stat buffer; 384 fstat(0, &buffer); 385 S_IFREG & buffer.st_mode;], 386 [glibcxx_cv_S_IFREG=yes], 387 [glibcxx_cv_S_IFREG=no]) 388 ]) 389 res=no 390 if test $glibcxx_cv_S_ISREG = yes; then 391 AC_DEFINE(HAVE_S_ISREG, 1, 392 [Define if S_ISREG is available in <sys/stat.h>.]) 393 res=S_ISREG 394 elif test $glibcxx_cv_S_IFREG = yes; then 395 AC_DEFINE(HAVE_S_IFREG, 1, 396 [Define if S_IFREG is available in <sys/stat.h>.]) 397 res=S_IFREG 398 fi 399 AC_MSG_RESULT($res) 400 401 CXXFLAGS="$ac_save_CXXFLAGS" 402 AC_LANG_RESTORE 403]) 404 405 406dnl 407dnl Check whether poll is available in <poll.h>, and define HAVE_POLL. 408dnl 409AC_DEFUN([GLIBCXX_CHECK_POLL], [ 410 411 AC_LANG_SAVE 412 AC_LANG_CPLUSPLUS 413 ac_save_CXXFLAGS="$CXXFLAGS" 414 CXXFLAGS="$CXXFLAGS -fno-exceptions" 415 416 AC_MSG_CHECKING([for poll]) 417 AC_CACHE_VAL(glibcxx_cv_POLL, [ 418 GCC_TRY_COMPILE_OR_LINK( 419 [#include <poll.h>], 420 [struct pollfd pfd[1]; 421 pfd[0].events = POLLIN; 422 poll(pfd, 1, 0);], 423 [glibcxx_cv_POLL=yes], 424 [glibcxx_cv_POLL=no]) 425 ]) 426 if test $glibcxx_cv_POLL = yes; then 427 AC_DEFINE(HAVE_POLL, 1, [Define if poll is available in <poll.h>.]) 428 fi 429 AC_MSG_RESULT($glibcxx_cv_POLL) 430 431 CXXFLAGS="$ac_save_CXXFLAGS" 432 AC_LANG_RESTORE 433]) 434 435 436dnl 437dnl Check whether writev is available in <sys/uio.h>, and define HAVE_WRITEV. 438dnl 439AC_DEFUN([GLIBCXX_CHECK_WRITEV], [ 440 441 AC_LANG_SAVE 442 AC_LANG_CPLUSPLUS 443 ac_save_CXXFLAGS="$CXXFLAGS" 444 CXXFLAGS="$CXXFLAGS -fno-exceptions" 445 446 AC_MSG_CHECKING([for writev]) 447 AC_CACHE_VAL(glibcxx_cv_WRITEV, [ 448 GCC_TRY_COMPILE_OR_LINK( 449 [#include <sys/uio.h>], 450 [struct iovec iov[2]; 451 writev(0, iov, 0);], 452 [glibcxx_cv_WRITEV=yes], 453 [glibcxx_cv_WRITEV=no]) 454 ]) 455 if test $glibcxx_cv_WRITEV = yes; then 456 AC_DEFINE(HAVE_WRITEV, 1, [Define if writev is available in <sys/uio.h>.]) 457 fi 458 AC_MSG_RESULT($glibcxx_cv_WRITEV) 459 460 CXXFLAGS="$ac_save_CXXFLAGS" 461 AC_LANG_RESTORE 462]) 463 464 465dnl 466dnl Check whether int64_t is available in <stdint.h>, and define HAVE_INT64_T. 467dnl Also check whether int64_t is actually a typedef to long or long long. 468dnl 469AC_DEFUN([GLIBCXX_CHECK_INT64_T], [ 470 471 AC_LANG_SAVE 472 AC_LANG_CPLUSPLUS 473 474 AC_MSG_CHECKING([for int64_t]) 475 AC_CACHE_VAL(glibcxx_cv_INT64_T, [ 476 AC_TRY_COMPILE( 477 [#include <stdint.h>], 478 [int64_t var;], 479 [glibcxx_cv_INT64_T=yes], 480 [glibcxx_cv_INT64_T=no]) 481 ]) 482 483 if test $glibcxx_cv_INT64_T = yes; then 484 AC_DEFINE(HAVE_INT64_T, 1, [Define if int64_t is available in <stdint.h>.]) 485 AC_MSG_RESULT($glibcxx_cv_INT64_T) 486 487 AC_MSG_CHECKING([for int64_t as long]) 488 AC_CACHE_VAL(glibcxx_cv_int64_t_long, [ 489 AC_TRY_COMPILE( 490 [#include <stdint.h> 491 template<typename, typename> struct same { enum { value = -1 }; }; 492 template<typename Tp> struct same<Tp, Tp> { enum { value = 1 }; }; 493 int array[same<int64_t, long>::value];], [], 494 [glibcxx_cv_int64_t_long=yes], [glibcxx_cv_int64_t_long=no]) 495 ]) 496 497 if test $glibcxx_cv_int64_t_long = yes; then 498 AC_DEFINE(HAVE_INT64_T_LONG, 1, [Define if int64_t is a long.]) 499 AC_MSG_RESULT($glibcxx_cv_int64_t_long) 500 fi 501 502 AC_MSG_CHECKING([for int64_t as long long]) 503 AC_CACHE_VAL(glibcxx_cv_int64_t_long_long, [ 504 AC_TRY_COMPILE( 505 [#include <stdint.h> 506 template<typename, typename> struct same { enum { value = -1 }; }; 507 template<typename Tp> struct same<Tp, Tp> { enum { value = 1 }; }; 508 int array[same<int64_t, long long>::value];], [], 509 [glibcxx_cv_int64_t_long_long=yes], [glibcxx_cv_int64_t_long_long=no]) 510 ]) 511 512 if test $glibcxx_cv_int64_t_long_long = yes; then 513 AC_DEFINE(HAVE_INT64_T_LONG_LONG, 1, [Define if int64_t is a long long.]) 514 AC_MSG_RESULT($glibcxx_cv_int64_t_long_long) 515 fi 516 fi 517 518 AC_LANG_RESTORE 519]) 520 521 522dnl 523dnl Check whether LFS support is available. 524dnl 525AC_DEFUN([GLIBCXX_CHECK_LFS], [ 526 AC_LANG_SAVE 527 AC_LANG_CPLUSPLUS 528 ac_save_CXXFLAGS="$CXXFLAGS" 529 CXXFLAGS="$CXXFLAGS -fno-exceptions" 530 AC_MSG_CHECKING([for LFS support]) 531 AC_CACHE_VAL(glibcxx_cv_LFS, [ 532 GCC_TRY_COMPILE_OR_LINK( 533 [#include <unistd.h> 534 #include <stdio.h> 535 #include <sys/stat.h> 536 ], 537 [FILE* fp; 538 fopen64("t", "w"); 539 fseeko64(fp, 0, SEEK_CUR); 540 ftello64(fp); 541 lseek64(1, 0, SEEK_CUR); 542 struct stat64 buf; 543 fstat64(1, &buf);], 544 [glibcxx_cv_LFS=yes], 545 [glibcxx_cv_LFS=no]) 546 ]) 547 if test $glibcxx_cv_LFS = yes; then 548 AC_DEFINE(_GLIBCXX_USE_LFS, 1, [Define if LFS support is available.]) 549 fi 550 AC_MSG_RESULT($glibcxx_cv_LFS) 551 CXXFLAGS="$ac_save_CXXFLAGS" 552 AC_LANG_RESTORE 553]) 554 555 556dnl 557dnl Check for whether a fully dynamic basic_string implementation should 558dnl be turned on, that does not put empty objects in per-process static 559dnl memory (mostly useful together with shared memory allocators, see PR 560dnl libstdc++/16612 for details). 561dnl 562dnl --enable-fully-dynamic-string defines _GLIBCXX_FULLY_DYNAMIC_STRING to 1 563dnl --disable-fully-dynamic-string defines _GLIBCXX_FULLY_DYNAMIC_STRING to 0 564dnl otherwise undefined 565dnl + Usage: GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING[(DEFAULT)] 566dnl Where DEFAULT is either `yes' or `no'. 567dnl 568AC_DEFUN([GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING], [ 569 GLIBCXX_ENABLE(fully-dynamic-string,$1,,[do not put empty strings in per-process static memory]) 570 if test $enable_fully_dynamic_string = yes; then 571 enable_fully_dynamic_string_def=1 572 else 573 enable_fully_dynamic_string_def=0 574 fi 575 AC_DEFINE_UNQUOTED([_GLIBCXX_FULLY_DYNAMIC_STRING], [${enable_fully_dynamic_string_def}], 576 [Define to 1 if a fully dynamic basic_string is wanted, 0 to disable, undefined for platform defaults]) 577]) 578 579 580dnl 581dnl Does any necessary configuration of the testsuite directory. Generates 582dnl the testsuite_hooks.h header. 583dnl 584dnl GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE must be done before this. 585dnl 586dnl Sets: 587dnl enable_abi_check 588dnl GLIBCXX_TEST_WCHAR_T 589dnl GLIBCXX_TEST_THREAD 590dnl Substs: 591dnl baseline_dir 592dnl baseline_subdir_switch 593dnl 594AC_DEFUN([GLIBCXX_CONFIGURE_TESTSUITE], [ 595 # Do checks for resource limit functions. 596 GLIBCXX_CHECK_SETRLIMIT 597 598 if $GLIBCXX_IS_NATIVE ; then 599 # Look for setenv, so that extended locale tests can be performed. 600 GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv) 601 fi 602 603 if $GLIBCXX_IS_NATIVE && test $is_hosted = yes && 604 test $enable_symvers != no; then 605 case "$host" in 606 *-*-cygwin*) 607 enable_abi_check=no ;; 608 *) 609 enable_abi_check=yes ;; 610 esac 611 else 612 # Only build this as native, since automake does not understand 613 # CXX_FOR_BUILD. 614 enable_abi_check=no 615 fi 616 617 # Export file names for ABI checking. 618 baseline_dir="$glibcxx_srcdir/config/abi/post/${abi_baseline_pair}" 619 AC_SUBST(baseline_dir) 620 baseline_subdir_switch="$abi_baseline_subdir_switch" 621 AC_SUBST(baseline_subdir_switch) 622]) 623 624 625dnl 626dnl Does any necessary configuration for docbook in the docs directory. 627dnl 628dnl XSLTPROC must be set before this 629dnl 630dnl Sets: 631dnl glibcxx_stylesheets 632dnl Substs: 633dnl XSL_STYLE_DIR 634dnl 635AC_DEFUN([GLIBCXX_CONFIGURE_DOCBOOK], [ 636 637glibcxx_docbook_url=http://docbook.sourceforge.net/release/xsl-ns/current/ 638 639AC_MSG_CHECKING([for local stylesheet directory]) 640glibcxx_local_stylesheets=no 641if test x${XMLCATALOG} = xyes && xsl_style_dir=`xmlcatalog "" $glibcxx_docbook_url 2>/dev/null` 642then 643 XSL_STYLE_DIR=`echo $xsl_style_dir | sed -n 's;^file://;;p'` 644 glibcxx_local_stylesheets=yes 645else 646 for dir in \ 647 /usr/share/sgml/docbook/xsl-ns-stylesheets \ 648 /usr/share/xml/docbook/stylesheet/docbook-xsl-ns \ 649 /usr/share/xml/docbook/stylesheet/nwalsh5/current \ 650 /usr/share/xml/docbook/stylesheet/nwalsh/current 651 do 652 if test -d $dir; then 653 glibcxx_local_stylesheets=yes 654 XSL_STYLE_DIR=$dir 655 break 656 fi 657 done 658fi 659AC_MSG_RESULT($glibcxx_local_stylesheets) 660 661if test x"$glibcxx_local_stylesheets" = x"yes"; then 662 AC_SUBST(XSL_STYLE_DIR) 663 AC_MSG_NOTICE($XSL_STYLE_DIR) 664 665 AC_MSG_CHECKING([for docbook stylesheets for documentation creation]) 666 glibcxx_stylesheets=no 667 if test x${XMLCATALOG} = xno || xmlcatalog "" $glibcxx_docbook_url/xhtml/docbook.xsl >/dev/null 2>&1; then 668 if test x${XSLTPROC} = xyes && echo '<title/>' | xsltproc --noout --nonet --xinclude $glibcxx_docbook_url/xhtml/docbook.xsl - 2>/dev/null; then 669 glibcxx_stylesheets=yes 670 fi 671 fi 672 AC_MSG_RESULT($glibcxx_stylesheets) 673 674else 675 glibcxx_stylesheets=no 676fi 677 678# Check for epub3 dependencies. 679AC_MSG_CHECKING([for epub3 stylesheets for documentation creation]) 680glibcxx_epub_stylesheets=no 681if test x"$glibcxx_local_stylesheets" = x"yes"; then 682 if test -f "$XSL_STYLE_DIR/epub3/chunk.xsl"; then 683 glibcxx_epub_stylesheets=yes 684 fi 685fi 686AC_MSG_RESULT($glibcxx_epub_stylesheets) 687AM_CONDITIONAL(BUILD_EPUB, test x"$glibcxx_epub_stylesheets" = x"yes") 688 689]) 690 691 692dnl 693dnl Set up *_INCLUDES variables for all sundry Makefile.am's. 694dnl 695dnl Substs: 696dnl GLIBCXX_INCLUDES 697dnl TOPLEVEL_INCLUDES 698dnl 699AC_DEFUN([GLIBCXX_EXPORT_INCLUDES], [ 700 # Used for every C++ compile we perform. 701 GLIBCXX_INCLUDES="\ 702-I$glibcxx_builddir/include/$host_alias \ 703-I$glibcxx_builddir/include \ 704-I$glibcxx_srcdir/libsupc++" 705 706 # For Canadian crosses, pick this up too. 707 if test $CANADIAN = yes; then 708 GLIBCXX_INCLUDES="$GLIBCXX_INCLUDES -I\${includedir}" 709 fi 710 711 # Stuff in the actual top level. Currently only used by libsupc++ to 712 # get unwind* headers from the libgcc dir. 713 #TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/libgcc -I$(toplevel_srcdir)/include' 714 TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/libgcc' 715 716 # Now, export this to all the little Makefiles.... 717 AC_SUBST(GLIBCXX_INCLUDES) 718 AC_SUBST(TOPLEVEL_INCLUDES) 719]) 720 721 722dnl 723dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's. 724dnl (SECTION_FLAGS is done under CHECK_COMPILER_FEATURES.) 725dnl 726dnl Substs: 727dnl OPTIMIZE_CXXFLAGS 728dnl WARN_FLAGS 729dnl 730AC_DEFUN([GLIBCXX_EXPORT_FLAGS], [ 731 # Optimization flags that are probably a good idea for thrill-seekers. Just 732 # uncomment the lines below and make, everything else is ready to go... 733 # Alternatively OPTIMIZE_CXXFLAGS can be set in configure.host. 734 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc 735 AC_SUBST(OPTIMIZE_CXXFLAGS) 736 737 WARN_FLAGS="-Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2" 738 AC_SUBST(WARN_FLAGS) 739]) 740 741 742dnl 743dnl All installation directory information is determined here. 744dnl 745dnl Substs: 746dnl gxx_install_dir 747dnl glibcxx_prefixdir 748dnl glibcxx_toolexecdir 749dnl glibcxx_toolexeclibdir 750dnl 751dnl Assumes cross_compiling bits already done, and with_cross_host in 752dnl particular. 753dnl 754dnl This logic must match gcc/configure.ac's setting of gcc_gxx_include_dir. 755dnl config/gxx-include-dir.m4 must be kept consistant with this as well. 756AC_DEFUN([GLIBCXX_EXPORT_INSTALL_INFO], [ 757 glibcxx_toolexecdir=no 758 glibcxx_toolexeclibdir=no 759 glibcxx_prefixdir=$prefix 760 761 AC_MSG_CHECKING([for gxx-include-dir]) 762 AC_ARG_WITH([gxx-include-dir], 763 AC_HELP_STRING([--with-gxx-include-dir=DIR], 764 [installation directory for include files]), 765 [case "$withval" in 766 yes) AC_MSG_ERROR([Missing directory for --with-gxx-include-dir]) ;; 767 no) gxx_include_dir=no ;; 768 *) gxx_include_dir=$withval ;; 769 esac], 770 [gxx_include_dir=no]) 771 AC_MSG_RESULT($gxx_include_dir) 772 773 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) 774 AC_ARG_ENABLE([version-specific-runtime-libs], 775 AC_HELP_STRING([--enable-version-specific-runtime-libs], 776 [Specify that runtime libraries should be installed in a compiler-specific directory]), 777 [case "$enableval" in 778 yes) version_specific_libs=yes ;; 779 no) version_specific_libs=no ;; 780 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; 781 esac], 782 [version_specific_libs=no]) 783 AC_MSG_RESULT($version_specific_libs) 784 785 # Default case for install directory for include files. 786 if test $version_specific_libs = no && test $gxx_include_dir = no; then 787 gxx_include_dir='include/c++/${gcc_version}' 788 if test -n "$with_cross_host" && 789 test x"$with_cross_host" != x"no"; then 790 gxx_include_dir='${prefix}/${target_alias}/'"$gxx_include_dir" 791 else 792 gxx_include_dir='${prefix}/'"$gxx_include_dir" 793 fi 794 fi 795 796 # Version-specific runtime libs processing. 797 if test $version_specific_libs = yes; then 798 # Need the gcc compiler version to know where to install libraries 799 # and header files if --enable-version-specific-runtime-libs option 800 # is selected. FIXME: these variables are misnamed, there are 801 # no executables installed in _toolexecdir or _toolexeclibdir. 802 if test x"$gxx_include_dir" = x"no"; then 803 gxx_include_dir='${libdir}/gcc/${host_alias}/${gcc_version}/include/c++' 804 fi 805 glibcxx_toolexecdir='${libdir}/gcc/${host_alias}' 806 glibcxx_toolexeclibdir='${toolexecdir}/${gcc_version}$(MULTISUBDIR)' 807 fi 808 809 # Calculate glibcxx_toolexecdir, glibcxx_toolexeclibdir 810 # Install a library built with a cross compiler in tooldir, not libdir. 811 if test x"$glibcxx_toolexecdir" = x"no"; then 812 if test -n "$with_cross_host" && 813 test x"$with_cross_host" != x"no"; then 814 glibcxx_toolexecdir='${exec_prefix}/${host_alias}' 815 glibcxx_toolexeclibdir='${toolexecdir}/lib' 816 else 817 glibcxx_toolexecdir='${libdir}/gcc/${host_alias}' 818 glibcxx_toolexeclibdir='${libdir}' 819 fi 820 multi_os_directory=`$CXX -print-multi-os-directory` 821 case $multi_os_directory in 822 .) ;; # Avoid trailing /. 823 *) glibcxx_toolexeclibdir=$glibcxx_toolexeclibdir/$multi_os_directory ;; 824 esac 825 fi 826 827 AC_MSG_CHECKING([for install location]) 828 AC_MSG_RESULT($gxx_include_dir) 829 830 AC_SUBST(glibcxx_prefixdir) 831 AC_SUBST(gxx_include_dir) 832 AC_SUBST(glibcxx_toolexecdir) 833 AC_SUBST(glibcxx_toolexeclibdir) 834]) 835 836 837dnl 838dnl GLIBCXX_ENABLE 839dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING) 840dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c) 841dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER) 842dnl 843dnl See manual/appendix_porting.html#appendix.porting.build_hacking for 844dnl documentation. 845dnl 846m4_define([GLIBCXX_ENABLE],[dnl 847m4_define([_g_switch],[--enable-$1])dnl 848m4_define([_g_help],[AC_HELP_STRING([_g_switch$3],[$4 @<:@default=$2@:>@])])dnl 849 AC_ARG_ENABLE([$1],m4_dquote(_g_help), 850 m4_bmatch([$5], 851 [^permit ], 852 [[ 853 case "$enableval" in 854 m4_bpatsubst([$5],[permit ])) ;; 855 *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;; 856 dnl Idea for future: generate a URL pointing to 857 dnl "onlinedocs/configopts.html#whatever" 858 esac 859 ]], 860 [^$], 861 [[ 862 case "$enableval" in 863 yes|no) ;; 864 *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;; 865 esac 866 ]], 867 [[$5]]), 868 [enable_]m4_bpatsubst([$1],-,_)[=][$2]) 869m4_undefine([_g_switch])dnl 870m4_undefine([_g_help])dnl 871]) 872 873 874dnl 875dnl Check for ISO/IEC 9899:1999 "C99" support. 876dnl 877dnl --enable-c99 defines _GLIBCXX_USE_C99 878dnl --disable-c99 leaves _GLIBCXX_USE_C99 undefined 879dnl + Usage: GLIBCXX_ENABLE_C99[(DEFAULT)] 880dnl Where DEFAULT is either `yes' or `no'. 881dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'. 882dnl 883AC_DEFUN([GLIBCXX_ENABLE_C99], [ 884 GLIBCXX_ENABLE(c99,$1,,[turns on ISO/IEC 9899:1999 support]) 885 886 if test x"$enable_c99" = x"yes"; then 887 AC_LANG_SAVE 888 AC_LANG_CPLUSPLUS 889 890 # Use -std=c++98 (instead of -std=gnu++98) because leaving __STRICT_ANSI__ 891 # undefined may cause fake C99 facilities, like pre-standard snprintf, 892 # to be spuriously enabled. 893 ac_save_CXXFLAGS="$CXXFLAGS" 894 CXXFLAGS="$CXXFLAGS -std=c++98" 895 ac_save_LIBS="$LIBS" 896 ac_save_gcc_no_link="$gcc_no_link" 897 898 if test x$gcc_no_link != xyes; then 899 # Use -fno-exceptions to that the C driver can link these tests without 900 # hitting undefined references to personality routines. 901 CXXFLAGS="$CXXFLAGS -fno-exceptions" 902 AC_CHECK_LIB(m, sin, [LIBS="$LIBS -lm"], [ 903 # Use the default compile-only tests in GCC_TRY_COMPILE_OR_LINK 904 gcc_no_link=yes 905 ]) 906 fi 907 908 # Check for the existence of <math.h> functions used if C99 is enabled. 909 AC_MSG_CHECKING([for ISO C99 support in <math.h> for C++98]) 910 AC_CACHE_VAL(glibcxx_cv_c99_math_cxx98, [ 911 GCC_TRY_COMPILE_OR_LINK( 912 [#include <math.h> 913 volatile double d1, d2; 914 volatile int i;], 915 [i = fpclassify(d1); 916 i = isfinite(d1); 917 i = isinf(d1); 918 i = isnan(d1); 919 i = isnormal(d1); 920 i = signbit(d1); 921 i = isgreater(d1, d2); 922 i = isgreaterequal(d1, d2); 923 i = isless(d1, d2); 924 i = islessequal(d1, d2); 925 i = islessgreater(d1, d2); 926 i = islessgreater(d1, d2); 927 i = isunordered(d1, d2); 928 ], [glibcxx_cv_c99_math_cxx98=yes], [glibcxx_cv_c99_math_cxx98=no]) 929 ]) 930 AC_MSG_RESULT($glibcxx_cv_c99_math_cxx98) 931 if test x"$glibcxx_cv_c99_math_cxx98" = x"yes"; then 932 AC_DEFINE(_GLIBCXX98_USE_C99_MATH, 1, 933 [Define if C99 functions or macros in <math.h> should be imported 934 in <cmath> in namespace std for C++98.]) 935 fi 936 937 # Check for the existence of <complex.h> complex math functions. 938 # This is necessary even though libstdc++ uses the builtin versions 939 # of these functions, because if the builtin cannot be used, a reference 940 # to the library function is emitted. 941 AC_CHECK_HEADERS(tgmath.h, ac_has_tgmath_h=yes, ac_has_tgmath_h=no) 942 AC_CHECK_HEADERS(complex.h, ac_has_complex_h=yes, ac_has_complex_h=no) 943 if test x"$ac_has_complex_h" = x"yes"; then 944 AC_MSG_CHECKING([for ISO C99 support in <complex.h> for C++98]) 945 AC_CACHE_VAL(glibcxx_cv_c99_complex_cxx98, [ 946 GCC_TRY_COMPILE_OR_LINK( 947 [#include <complex.h> 948 typedef __complex__ float float_type; 949 typedef __complex__ double double_type; 950 typedef __complex__ long double ld_type; 951 volatile float_type tmpf; 952 volatile double_type tmpd; 953 volatile ld_type tmpld; 954 volatile float f; 955 volatile double d; 956 volatile long double ld;], 957 [f = cabsf(tmpf); 958 f = cargf(tmpf); 959 tmpf = ccosf(tmpf); 960 tmpf = ccoshf(tmpf); 961 tmpf = cexpf(tmpf); 962 tmpf = clogf(tmpf); 963 tmpf = csinf(tmpf); 964 tmpf = csinhf(tmpf); 965 tmpf = csqrtf(tmpf); 966 tmpf = ctanf(tmpf); 967 tmpf = ctanhf(tmpf); 968 tmpf = cpowf(tmpf, tmpf); 969 tmpf = cprojf(tmpf); 970 d = cabs(tmpd); 971 d = carg(tmpd); 972 tmpd = ccos(tmpd); 973 tmpd = ccosh(tmpd); 974 tmpd = cexp(tmpd); 975 tmpd = clog(tmpd); 976 tmpd = csin(tmpd); 977 tmpd = csinh(tmpd); 978 tmpd = csqrt(tmpd); 979 tmpd = ctan(tmpd); 980 tmpd = ctanh(tmpd); 981 tmpd = cpow(tmpd, tmpd); 982 tmpd = cproj(tmpd); 983 ld = cabsl(tmpld); 984 ld = cargl(tmpld); 985 tmpld = ccosl(tmpld); 986 tmpld = ccoshl(tmpld); 987 tmpld = cexpl(tmpld); 988 tmpld = clogl(tmpld); 989 tmpld = csinl(tmpld); 990 tmpld = csinhl(tmpld); 991 tmpld = csqrtl(tmpld); 992 tmpld = ctanl(tmpld); 993 tmpld = ctanhl(tmpld); 994 tmpld = cpowl(tmpld, tmpld); 995 tmpld = cprojl(tmpld); 996 ], [glibcxx_cv_c99_complex_cxx98=yes], [glibcxx_cv_c99_complex_cxx98=no]) 997 ]) 998 fi 999 AC_MSG_RESULT($glibcxx_cv_c99_complex_cxx98) 1000 if test x"$glibcxx_cv_c99_complex_cxx98" = x"yes"; then 1001 AC_DEFINE(_GLIBCXX98_USE_C99_COMPLEX, 1, 1002 [Define if C99 functions in <complex.h> should be used in 1003 <complex> for C++98. Using compiler builtins for these functions 1004 requires corresponding C99 library functions to be present.]) 1005 fi 1006 1007 # Check for the existence in <stdio.h> of vscanf, et. al. 1008 AC_MSG_CHECKING([for ISO C99 support in <stdio.h> for C++98]) 1009 AC_CACHE_VAL(glibcxx_cv_c99_stdio_cxx98, [ 1010 GCC_TRY_COMPILE_OR_LINK( 1011 [#include <stdio.h> 1012 #include <stdarg.h> 1013 void foo(char* fmt, ...) 1014 { 1015 va_list args; va_start(args, fmt); 1016 vfscanf(stderr, "%i", args); 1017 vscanf("%i", args); 1018 vsnprintf(fmt, 0, "%i", args); 1019 vsscanf(fmt, "%i", args); 1020 snprintf(fmt, 0, "%i"); 1021 }], [], 1022 [glibcxx_cv_c99_stdio_cxx98=yes], [glibcxx_cv_c99_stdio_cxx98=no]) 1023 ]) 1024 AC_MSG_RESULT($glibcxx_cv_c99_stdio_cxx98) 1025 if test x"$glibcxx_cv_c99_stdio_cxx98" = x"yes"; then 1026 AC_DEFINE(_GLIBCXX98_USE_C99_STDIO, 1, 1027 [Define if C99 functions or macros in <stdio.h> should be imported 1028 in <cstdio> in namespace std for C++98.]) 1029 fi 1030 1031 # Check for the existence in <stdlib.h> of lldiv_t, et. al. 1032 AC_MSG_CHECKING([for ISO C99 support in <stdlib.h> for C++98]) 1033 AC_CACHE_VAL(glibcxx_cv_c99_stdlib_cxx98, [ 1034 GCC_TRY_COMPILE_OR_LINK( 1035 [#include <stdlib.h> 1036 volatile float f; 1037 volatile long double ld; 1038 volatile unsigned long long ll; 1039 lldiv_t mydivt;], 1040 [char* tmp; 1041 f = strtof("gnu", &tmp); 1042 ld = strtold("gnu", &tmp); 1043 ll = strtoll("gnu", &tmp, 10); 1044 ll = strtoull("gnu", &tmp, 10); 1045 ll = llabs(10); 1046 mydivt = lldiv(10,1); 1047 ll = mydivt.quot; 1048 ll = mydivt.rem; 1049 ll = atoll("10"); 1050 _Exit(0); 1051 ], [glibcxx_cv_c99_stdlib_cxx98=yes], [glibcxx_cv_c99_stdlib_cxx98=no]) 1052 ]) 1053 AC_MSG_RESULT($glibcxx_cv_c99_stdlib_cxx98) 1054 if test x"$glibcxx_cv_c99_stdlib_cxx98" = x"yes"; then 1055 AC_DEFINE(_GLIBCXX98_USE_C99_STDLIB, 1, 1056 [Define if C99 functions or macros in <stdlib.h> should be imported 1057 in <cstdlib> in namespace std for C++98.]) 1058 fi 1059 1060 # Check for the existence in <wchar.h> of wcstold, etc. 1061 if test x"$ac_has_wchar_h" = xyes && 1062 test x"$ac_has_wctype_h" = xyes; then 1063 AC_MSG_CHECKING([for ISO C99 support in <wchar.h> for C++98]) 1064 AC_CACHE_VAL(glibcxx_cv_c99_wchar_cxx98, [ 1065 AC_TRY_COMPILE([#include <wchar.h> 1066 namespace test 1067 { 1068 using ::wcstold; 1069 using ::wcstoll; 1070 using ::wcstoull; 1071 } 1072 ], [], [glibcxx_cv_c99_wchar_cxx98=yes], [glibcxx_cv_c99_wchar_cxx98=no]) 1073 ]) 1074 1075 # Checks for wide character functions that may not be present. 1076 # Injection of these is wrapped with guard macros. 1077 # NB: only put functions here, instead of immediately above, if 1078 # absolutely necessary. 1079 AC_TRY_COMPILE([#include <wchar.h> 1080 namespace test { using ::vfwscanf; }], [], 1081 [AC_DEFINE(HAVE_VFWSCANF, 1, [Defined if vfwscanf exists.])], []) 1082 1083 AC_TRY_COMPILE([#include <wchar.h> 1084 namespace test { using ::vswscanf; }], [], 1085 [AC_DEFINE(HAVE_VSWSCANF, 1, [Defined if vswscanf exists.])], []) 1086 1087 AC_TRY_COMPILE([#include <wchar.h> 1088 namespace test { using ::vwscanf; }], [], 1089 [AC_DEFINE(HAVE_VWSCANF, 1, [Defined if vwscanf exists.])], []) 1090 1091 AC_TRY_COMPILE([#include <wchar.h> 1092 namespace test { using ::wcstof; }], [], 1093 [AC_DEFINE(HAVE_WCSTOF, 1, [Defined if wcstof exists.])], []) 1094 1095 AC_TRY_COMPILE([#include <wctype.h>], 1096 [wint_t t; int i = iswblank(t);], 1097 [AC_DEFINE(HAVE_ISWBLANK, 1, [Defined if iswblank exists.])], []) 1098 1099 AC_MSG_RESULT($glibcxx_cv_c99_wchar_cxx98) 1100 if test x"$glibcxx_cv_c99_wchar_cxx98" = x"yes"; then 1101 AC_DEFINE(_GLIBCXX98_USE_C99_WCHAR, 1, 1102 [Define if C99 functions or macros in <wchar.h> should be imported 1103 in <cwchar> in namespace std for C++98.]) 1104 fi 1105 fi 1106 1107 # Option parsed, now set things appropriately. 1108 if test x"$glibcxx_cv_c99_math_cxx98" = x"no" || 1109 test x"$glibcxx_cv_c99_complex_cxx98" = x"no" || 1110 test x"$glibcxx_cv_c99_stdio_cxx98" = x"no" || 1111 test x"$glibcxx_cv_c99_stdlib_cxx98" = x"no" || 1112 test x"$glibcxx_cv_c99_wchar_cxx98" = x"no"; then 1113 enable_c99=no; 1114 else 1115 AC_DEFINE(_GLIBCXX_USE_C99, 1, 1116 [Define if C99 functions or macros from <wchar.h>, <math.h>, 1117 <complex.h>, <stdio.h>, and <stdlib.h> can be used or exposed.]) 1118 fi 1119 1120 gcc_no_link="$ac_save_gcc_no_link" 1121 LIBS="$ac_save_LIBS" 1122 CXXFLAGS="$ac_save_CXXFLAGS" 1123 AC_LANG_RESTORE 1124 1125 AC_LANG_SAVE 1126 AC_LANG_CPLUSPLUS 1127 1128 # Use -std=c++11 and test again for C99 library feature in C++11 mode. 1129 # For the reasons given above we use -std=c++11 not -std=gnu++11. 1130 ac_save_CXXFLAGS="$CXXFLAGS" 1131 CXXFLAGS="$CXXFLAGS -std=c++11" 1132 ac_save_LIBS="$LIBS" 1133 ac_save_gcc_no_link="$gcc_no_link" 1134 1135 if test x$gcc_no_link != xyes; then 1136 # Use -fno-exceptions to that the C driver can link these tests without 1137 # hitting undefined references to personality routines. 1138 CXXFLAGS="$CXXFLAGS -fno-exceptions" 1139 AC_CHECK_LIB(m, sin, [LIBS="$LIBS -lm"], [ 1140 # Use the default compile-only tests in GCC_TRY_COMPILE_OR_LINK 1141 gcc_no_link=yes 1142 ]) 1143 fi 1144 1145 # Check for the existence of <math.h> functions used if C99 is enabled. 1146 AC_MSG_CHECKING([for ISO C99 support in <math.h> for C++11]) 1147 AC_CACHE_VAL(glibcxx_cv_c99_math_cxx11, [ 1148 GCC_TRY_COMPILE_OR_LINK( 1149 [#include <math.h> 1150 volatile double d1, d2; 1151 volatile int i;], 1152 [i = fpclassify(d1); 1153 i = isfinite(d1); 1154 i = isinf(d1); 1155 i = isnan(d1); 1156 i = isnormal(d1); 1157 i = signbit(d1); 1158 i = isgreater(d1, d2); 1159 i = isgreaterequal(d1, d2); 1160 i = isless(d1, d2); 1161 i = islessequal(d1, d2); 1162 i = islessgreater(d1, d2); 1163 i = islessgreater(d1, d2); 1164 i = isunordered(d1, d2); 1165 ], [glibcxx_cv_c99_math_cxx11=yes], [glibcxx_cv_c99_math_cxx11=no]) 1166 ]) 1167 AC_MSG_RESULT($glibcxx_cv_c99_math_cxx11) 1168 if test x"$glibcxx_cv_c99_math_cxx11" = x"yes"; then 1169 AC_DEFINE(_GLIBCXX11_USE_C99_MATH, 1, 1170 [Define if C99 functions or macros in <math.h> should be imported 1171 in <cmath> in namespace std for C++11.]) 1172 fi 1173 1174 # Check for the existence of <complex.h> complex math functions. 1175 # This is necessary even though libstdc++ uses the builtin versions 1176 # of these functions, because if the builtin cannot be used, a reference 1177 # to the library function is emitted. 1178 AC_CHECK_HEADERS(tgmath.h, ac_has_tgmath_h=yes, ac_has_tgmath_h=no) 1179 AC_CHECK_HEADERS(complex.h, ac_has_complex_h=yes, ac_has_complex_h=no) 1180 if test x"$ac_has_complex_h" = x"yes"; then 1181 AC_MSG_CHECKING([for ISO C99 support in <complex.h> for C++11]) 1182 AC_CACHE_VAL(glibcxx_cv_c99_complex_cxx11, [ 1183 GCC_TRY_COMPILE_OR_LINK( 1184 [#include <complex.h> 1185 typedef __complex__ float float_type; 1186 typedef __complex__ double double_type; 1187 typedef __complex__ long double ld_type; 1188 volatile float_type tmpf; 1189 volatile double_type tmpd; 1190 volatile ld_type tmpld; 1191 volatile float f; 1192 volatile double d; 1193 volatile long double ld;], 1194 [f = cabsf(tmpf); 1195 f = cargf(tmpf); 1196 tmpf = ccosf(tmpf); 1197 tmpf = ccoshf(tmpf); 1198 tmpf = cexpf(tmpf); 1199 tmpf = clogf(tmpf); 1200 tmpf = csinf(tmpf); 1201 tmpf = csinhf(tmpf); 1202 tmpf = csqrtf(tmpf); 1203 tmpf = ctanf(tmpf); 1204 tmpf = ctanhf(tmpf); 1205 tmpf = cpowf(tmpf, tmpf); 1206 tmpf = cprojf(tmpf); 1207 d = cabs(tmpd); 1208 d = carg(tmpd); 1209 tmpd = ccos(tmpd); 1210 tmpd = ccosh(tmpd); 1211 tmpd = cexp(tmpd); 1212 tmpd = clog(tmpd); 1213 tmpd = csin(tmpd); 1214 tmpd = csinh(tmpd); 1215 tmpd = csqrt(tmpd); 1216 tmpd = ctan(tmpd); 1217 tmpd = ctanh(tmpd); 1218 tmpd = cpow(tmpd, tmpd); 1219 tmpd = cproj(tmpd); 1220 ld = cabsl(tmpld); 1221 ld = cargl(tmpld); 1222 tmpld = ccosl(tmpld); 1223 tmpld = ccoshl(tmpld); 1224 tmpld = cexpl(tmpld); 1225 tmpld = clogl(tmpld); 1226 tmpld = csinl(tmpld); 1227 tmpld = csinhl(tmpld); 1228 tmpld = csqrtl(tmpld); 1229 tmpld = ctanl(tmpld); 1230 tmpld = ctanhl(tmpld); 1231 tmpld = cpowl(tmpld, tmpld); 1232 tmpld = cprojl(tmpld); 1233 ], [glibcxx_cv_c99_complex_cxx11=yes], [glibcxx_cv_c99_complex_cxx11=no]) 1234 ]) 1235 fi 1236 AC_MSG_RESULT($glibcxx_cv_c99_complex_cxx11) 1237 if test x"$glibcxx_cv_c99_complex_cxx11" = x"yes"; then 1238 AC_DEFINE(_GLIBCXX11_USE_C99_COMPLEX, 1, 1239 [Define if C99 functions in <complex.h> should be used in 1240 <complex> for C++11. Using compiler builtins for these functions 1241 requires corresponding C99 library functions to be present.]) 1242 fi 1243 1244 # Check for the existence in <stdio.h> of vscanf, et. al. 1245 AC_MSG_CHECKING([for ISO C99 support in <stdio.h> for C++11]) 1246 AC_CACHE_VAL(glibcxx_cv_c99_stdio_cxx11, [ 1247 GCC_TRY_COMPILE_OR_LINK( 1248 [#include <stdio.h> 1249 #include <stdarg.h> 1250 void foo(char* fmt, ...) 1251 { 1252 va_list args; va_start(args, fmt); 1253 vfscanf(stderr, "%i", args); 1254 vscanf("%i", args); 1255 vsnprintf(fmt, 0, "%i", args); 1256 vsscanf(fmt, "%i", args); 1257 snprintf(fmt, 0, "%i"); 1258 }], [], 1259 [glibcxx_cv_c99_stdio_cxx11=yes], [glibcxx_cv_c99_stdio_cxx11=no]) 1260 ]) 1261 AC_MSG_RESULT($glibcxx_cv_c99_stdio_cxx11) 1262 if test x"$glibcxx_cv_c99_stdio_cxx11" = x"yes"; then 1263 AC_DEFINE(_GLIBCXX11_USE_C99_STDIO, 1, 1264 [Define if C99 functions or macros in <stdio.h> should be imported 1265 in <cstdio> in namespace std for C++11.]) 1266 fi 1267 1268 # Check for the existence in <stdlib.h> of lldiv_t, et. al. 1269 AC_MSG_CHECKING([for ISO C99 support in <stdlib.h> for C++11]) 1270 AC_CACHE_VAL(glibcxx_cv_c99_stdlib_cxx11, [ 1271 GCC_TRY_COMPILE_OR_LINK( 1272 [#include <stdlib.h> 1273 volatile float f; 1274 volatile long double ld; 1275 volatile unsigned long long ll; 1276 lldiv_t mydivt;], 1277 [char* tmp; 1278 f = strtof("gnu", &tmp); 1279 ld = strtold("gnu", &tmp); 1280 ll = strtoll("gnu", &tmp, 10); 1281 ll = strtoull("gnu", &tmp, 10); 1282 ll = llabs(10); 1283 mydivt = lldiv(10,1); 1284 ll = mydivt.quot; 1285 ll = mydivt.rem; 1286 ll = atoll("10"); 1287 _Exit(0); 1288 ], [glibcxx_cv_c99_stdlib_cxx11=yes], [glibcxx_cv_c99_stdlib_cxx11=no]) 1289 ]) 1290 AC_MSG_RESULT($glibcxx_cv_c99_stdlib_cxx11) 1291 if test x"$glibcxx_cv_c99_stdlib_cxx11" = x"yes"; then 1292 AC_DEFINE(_GLIBCXX11_USE_C99_STDLIB, 1, 1293 [Define if C99 functions or macros in <stdlib.h> should be imported 1294 in <cstdlib> in namespace std for C++11.]) 1295 fi 1296 1297 # Check for the existence in <wchar.h> of wcstold, etc. 1298 if test x"$ac_has_wchar_h" = xyes && 1299 test x"$ac_has_wctype_h" = xyes; then 1300 AC_MSG_CHECKING([for ISO C99 support in <wchar.h> for C++11]) 1301 AC_CACHE_VAL(glibcxx_cv_c99_wchar_cxx11, [ 1302 AC_TRY_COMPILE([#include <wchar.h> 1303 namespace test 1304 { 1305 using ::wcstold; 1306 using ::wcstoll; 1307 using ::wcstoull; 1308 } 1309 ], [], [glibcxx_cv_c99_wchar_cxx11=yes], [glibcxx_cv_c99_wchar_cxx11=no]) 1310 ]) 1311 1312 # Checks for wide character functions that may not be present. 1313 # Injection of these is wrapped with guard macros. 1314 # NB: only put functions here, instead of immediately above, if 1315 # absolutely necessary. 1316 AC_TRY_COMPILE([#include <wchar.h> 1317 namespace test { using ::vfwscanf; }], [], 1318 [AC_DEFINE(HAVE_VFWSCANF, 1, [Defined if vfwscanf exists.])], []) 1319 1320 AC_TRY_COMPILE([#include <wchar.h> 1321 namespace test { using ::vswscanf; }], [], 1322 [AC_DEFINE(HAVE_VSWSCANF, 1, [Defined if vswscanf exists.])], []) 1323 1324 AC_TRY_COMPILE([#include <wchar.h> 1325 namespace test { using ::vwscanf; }], [], 1326 [AC_DEFINE(HAVE_VWSCANF, 1, [Defined if vwscanf exists.])], []) 1327 1328 AC_TRY_COMPILE([#include <wchar.h> 1329 namespace test { using ::wcstof; }], [], 1330 [AC_DEFINE(HAVE_WCSTOF, 1, [Defined if wcstof exists.])], []) 1331 1332 AC_TRY_COMPILE([#include <wctype.h>], 1333 [wint_t t; int i = iswblank(t);], 1334 [AC_DEFINE(HAVE_ISWBLANK, 1, [Defined if iswblank exists.])], []) 1335 1336 AC_MSG_RESULT($glibcxx_cv_c99_wchar_cxx11) 1337 if test x"$glibcxx_cv_c99_wchar_cxx11" = x"yes"; then 1338 AC_DEFINE(_GLIBCXX11_USE_C99_WCHAR, 1, 1339 [Define if C99 functions or macros in <wchar.h> should be imported 1340 in <cwchar> in namespace std for C++11.]) 1341 fi 1342 fi 1343 1344 gcc_no_link="$ac_save_gcc_no_link" 1345 LIBS="$ac_save_LIBS" 1346 CXXFLAGS="$ac_save_CXXFLAGS" 1347 AC_LANG_RESTORE 1348 fi 1349 1350 AC_MSG_CHECKING([for fully enabled ISO C99 support]) 1351 AC_MSG_RESULT($enable_c99) 1352]) 1353 1354 1355dnl 1356dnl Check for clock_gettime, nanosleep and sched_yield, used in the 1357dnl implementation of 20.11.7 [time.clock], and 30.3.2 [thread.thread.this] 1358dnl in the C++11 standard. 1359dnl 1360dnl --enable-libstdcxx-time 1361dnl --enable-libstdcxx-time=yes 1362dnl checks for the availability of monotonic and realtime clocks, 1363dnl nanosleep and sched_yield in libc and libposix4 and, if needed, 1364dnl links in the latter. 1365dnl --enable-libstdcxx-time=rt 1366dnl also searches (and, if needed, links) librt. Note that this is 1367dnl not always desirable because, in glibc 2.16 and earlier, for 1368dnl example, in turn it triggers the linking of libpthread too, 1369dnl which activates locking, 1370dnl a large overhead for single-thread programs. 1371dnl --enable-libstdcxx-time=no 1372dnl --disable-libstdcxx-time 1373dnl disables the checks completely 1374dnl 1375dnl N.B. Darwin provides nanosleep but doesn't support the whole POSIX 1376dnl Timers option, so doesn't define _POSIX_TIMERS. Because the test 1377dnl below fails Darwin unconditionally defines _GLIBCXX_USE_NANOSLEEP in 1378dnl os_defines.h and also defines _GLIBCXX_USE_SCHED_YIELD. 1379dnl 1380AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [ 1381 1382 GLIBCXX_ENABLE(libstdcxx-time,auto,[[[=KIND]]], 1383 [use KIND for check type], 1384 [permit yes|no|rt]) 1385 1386 AC_LANG_SAVE 1387 AC_LANG_CPLUSPLUS 1388 ac_save_CXXFLAGS="$CXXFLAGS" 1389 CXXFLAGS="$CXXFLAGS -fno-exceptions" 1390 ac_save_LIBS="$LIBS" 1391 1392 ac_has_clock_monotonic=no 1393 ac_has_clock_realtime=no 1394 ac_has_nanosleep=no 1395 ac_has_sched_yield=no 1396 1397 if test x"$enable_libstdcxx_time" = x"auto"; then 1398 1399 case "${target_os}" in 1400 cygwin*) 1401 ac_has_nanosleep=yes 1402 ;; 1403 darwin*) 1404 ac_has_nanosleep=yes 1405 ac_has_sched_yield=yes 1406 ;; 1407 gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) 1408 # Don't use link test for freestanding library, in case gcc_no_link=yes 1409 if test x"$is_hosted" = xyes; then 1410 # Versions of glibc before 2.17 needed -lrt for clock_gettime. 1411 AC_SEARCH_LIBS(clock_gettime, [rt]) 1412 if test x"$ac_cv_search_clock_gettime" = x"none required"; then 1413 ac_has_clock_monotonic=yes 1414 ac_has_clock_realtime=yes 1415 fi 1416 fi 1417 ac_has_nanosleep=yes 1418 ac_has_sched_yield=yes 1419 ;; 1420 freebsd*|netbsd*|dragonfly*|rtems*) 1421 ac_has_clock_monotonic=yes 1422 ac_has_clock_realtime=yes 1423 ac_has_nanosleep=yes 1424 ac_has_sched_yield=yes 1425 ;; 1426 openbsd*) 1427 ac_has_clock_monotonic=yes 1428 ac_has_clock_realtime=yes 1429 ac_has_nanosleep=yes 1430 ;; 1431 solaris*) 1432 GLIBCXX_LIBS="$GLIBCXX_LIBS -lrt" 1433 ac_has_clock_monotonic=yes 1434 ac_has_clock_realtime=yes 1435 ac_has_nanosleep=yes 1436 ac_has_sched_yield=yes 1437 ;; 1438 esac 1439 1440 elif test x"$enable_libstdcxx_time" != x"no"; then 1441 1442 if test x"$enable_libstdcxx_time" = x"rt"; then 1443 AC_SEARCH_LIBS(clock_gettime, [rt posix4]) 1444 AC_SEARCH_LIBS(nanosleep, [rt posix4]) 1445 else 1446 AC_SEARCH_LIBS(clock_gettime, [posix4]) 1447 AC_SEARCH_LIBS(nanosleep, [posix4]) 1448 fi 1449 1450 case "$ac_cv_search_clock_gettime" in 1451 -l*) GLIBCXX_LIBS=$ac_cv_search_clock_gettime 1452 ;; 1453 esac 1454 case "$ac_cv_search_nanosleep" in 1455 -l*) GLIBCXX_LIBS="$GLIBCXX_LIBS $ac_cv_search_nanosleep" 1456 ;; 1457 esac 1458 1459 AC_SEARCH_LIBS(sched_yield, [rt posix4]) 1460 1461 case "$ac_cv_search_sched_yield" in 1462 -lposix4*) 1463 GLIBCXX_LIBS="$GLIBCXX_LIBS $ac_cv_search_sched_yield" 1464 ac_has_sched_yield=yes 1465 ;; 1466 -lrt*) 1467 if test x"$enable_libstdcxx_time" = x"rt"; then 1468 GLIBCXX_LIBS="$GLIBCXX_LIBS $ac_cv_search_sched_yield" 1469 ac_has_sched_yield=yes 1470 fi 1471 ;; 1472 *) 1473 ac_has_sched_yield=yes 1474 ;; 1475 esac 1476 1477 AC_CHECK_HEADERS(unistd.h, ac_has_unistd_h=yes, ac_has_unistd_h=no) 1478 1479 if test x"$ac_has_unistd_h" = x"yes"; then 1480 AC_MSG_CHECKING([for monotonic clock]) 1481 AC_TRY_LINK( 1482 [#include <unistd.h> 1483 #include <time.h> 1484 ], 1485 [#if _POSIX_TIMERS > 0 && defined(_POSIX_MONOTONIC_CLOCK) 1486 timespec tp; 1487 #endif 1488 clock_gettime(CLOCK_MONOTONIC, &tp); 1489 ], [ac_has_clock_monotonic=yes], [ac_has_clock_monotonic=no]) 1490 1491 AC_MSG_RESULT($ac_has_clock_monotonic) 1492 1493 AC_MSG_CHECKING([for realtime clock]) 1494 AC_TRY_LINK( 1495 [#include <unistd.h> 1496 #include <time.h> 1497 ], 1498 [#if _POSIX_TIMERS > 0 1499 timespec tp; 1500 #endif 1501 clock_gettime(CLOCK_REALTIME, &tp); 1502 ], [ac_has_clock_realtime=yes], [ac_has_clock_realtime=no]) 1503 1504 AC_MSG_RESULT($ac_has_clock_realtime) 1505 1506 AC_MSG_CHECKING([for nanosleep]) 1507 AC_TRY_LINK( 1508 [#include <unistd.h> 1509 #include <time.h> 1510 ], 1511 [#if _POSIX_TIMERS > 0 1512 timespec tp; 1513 #endif 1514 nanosleep(&tp, 0); 1515 ], [ac_has_nanosleep=yes], [ac_has_nanosleep=no]) 1516 1517 AC_MSG_RESULT($ac_has_nanosleep) 1518 fi 1519 fi 1520 1521 if test x"$ac_has_clock_monotonic" != x"yes"; then 1522 case ${target_os} in 1523 linux*) 1524 AC_MSG_CHECKING([for clock_gettime syscall]) 1525 AC_TRY_COMPILE( 1526 [#include <unistd.h> 1527 #include <time.h> 1528 #include <sys/syscall.h> 1529 ], 1530 [#if _POSIX_TIMERS > 0 && defined(_POSIX_MONOTONIC_CLOCK) 1531 timespec tp; 1532 #endif 1533 syscall(SYS_clock_gettime, CLOCK_MONOTONIC, &tp); 1534 syscall(SYS_clock_gettime, CLOCK_REALTIME, &tp); 1535 ], [ac_has_clock_monotonic_syscall=yes], [ac_has_clock_monotonic_syscall=no]) 1536 AC_MSG_RESULT($ac_has_clock_monotonic_syscall) 1537 if test x"$ac_has_clock_monotonic_syscall" = x"yes"; then 1538 AC_DEFINE(_GLIBCXX_USE_CLOCK_GETTIME_SYSCALL, 1, 1539 [ Defined if clock_gettime syscall has monotonic and realtime clock support. ]) 1540 ac_has_clock_monotonic=yes 1541 ac_has_clock_realtime=yes 1542 fi;; 1543 esac 1544 fi 1545 1546 if test x"$ac_has_clock_monotonic" = x"yes"; then 1547 AC_DEFINE(_GLIBCXX_USE_CLOCK_MONOTONIC, 1, 1548 [ Defined if clock_gettime has monotonic clock support. ]) 1549 fi 1550 1551 if test x"$ac_has_clock_realtime" = x"yes"; then 1552 AC_DEFINE(_GLIBCXX_USE_CLOCK_REALTIME, 1, 1553 [ Defined if clock_gettime has realtime clock support. ]) 1554 fi 1555 1556 if test x"$ac_has_sched_yield" = x"yes"; then 1557 AC_DEFINE(_GLIBCXX_USE_SCHED_YIELD, 1, 1558 [ Defined if sched_yield is available. ]) 1559 fi 1560 1561 if test x"$ac_has_nanosleep" = x"yes"; then 1562 AC_DEFINE(_GLIBCXX_USE_NANOSLEEP, 1, 1563 [ Defined if nanosleep is available. ]) 1564 else 1565 AC_MSG_CHECKING([for sleep]) 1566 AC_TRY_COMPILE([#include <unistd.h>], 1567 [sleep(1)], 1568 [ac_has_sleep=yes],[ac_has_sleep=no]) 1569 if test x"$ac_has_sleep" = x"yes"; then 1570 AC_DEFINE(HAVE_SLEEP,1, [Defined if sleep exists.]) 1571 fi 1572 AC_MSG_RESULT($ac_has_sleep) 1573 AC_MSG_CHECKING([for usleep]) 1574 AC_TRY_COMPILE([#include <unistd.h>], 1575 [sleep(1); 1576 usleep(100);], 1577 [ac_has_usleep=yes],[ac_has_usleep=no]) 1578 if test x"$ac_has_usleep" = x"yes"; then 1579 AC_DEFINE(HAVE_USLEEP,1, [Defined if usleep exists.]) 1580 fi 1581 AC_MSG_RESULT($ac_has_usleep) 1582 fi 1583 1584 if test x"$ac_has_nanosleep$ac_has_sleep" = x"nono"; then 1585 AC_MSG_CHECKING([for Sleep]) 1586 AC_TRY_COMPILE([#include <windows.h>], 1587 [Sleep(1)], 1588 [ac_has_win32_sleep=yes],[ac_has_win32_sleep=no]) 1589 if test x"$ac_has_win32_sleep" = x"yes"; then 1590 AC_DEFINE(HAVE_WIN32_SLEEP,1, [Defined if Sleep exists.]) 1591 fi 1592 AC_MSG_RESULT($ac_has_win32_sleep) 1593 fi 1594 1595 AC_SUBST(GLIBCXX_LIBS) 1596 1597 CXXFLAGS="$ac_save_CXXFLAGS" 1598 LIBS="$ac_save_LIBS" 1599 AC_LANG_RESTORE 1600]) 1601 1602dnl 1603dnl Check for gettimeofday, used in the implementation of 20.11.7 1604dnl [time.clock] in the C++11 standard. 1605dnl 1606AC_DEFUN([GLIBCXX_CHECK_GETTIMEOFDAY], [ 1607 1608 AC_MSG_CHECKING([for gettimeofday]) 1609 1610 AC_LANG_SAVE 1611 AC_LANG_CPLUSPLUS 1612 ac_save_CXXFLAGS="$CXXFLAGS" 1613 CXXFLAGS="$CXXFLAGS -fno-exceptions" 1614 1615 ac_has_gettimeofday=no; 1616 AC_CHECK_HEADERS(sys/time.h, ac_has_sys_time_h=yes, ac_has_sys_time_h=no) 1617 if test x"$ac_has_sys_time_h" = x"yes"; then 1618 AC_MSG_CHECKING([for gettimeofday]) 1619 GCC_TRY_COMPILE_OR_LINK([#include <sys/time.h>], 1620 [timeval tv; gettimeofday(&tv, 0);], 1621 [ac_has_gettimeofday=yes], [ac_has_gettimeofday=no]) 1622 1623 AC_MSG_RESULT($ac_has_gettimeofday) 1624 fi 1625 1626 if test x"$ac_has_gettimeofday" = x"yes"; then 1627 AC_DEFINE(_GLIBCXX_USE_GETTIMEOFDAY, 1, 1628 [ Defined if gettimeofday is available. ]) 1629 fi 1630 1631 CXXFLAGS="$ac_save_CXXFLAGS" 1632 AC_LANG_RESTORE 1633]) 1634 1635dnl 1636dnl Check for ISO/IEC 9899:1999 "C99" support to ISO/IEC DTR 19768 "TR1" 1637dnl facilities in Chapter 8, "C compatibility". 1638dnl 1639AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ 1640 1641 AC_LANG_SAVE 1642 AC_LANG_CPLUSPLUS 1643 1644 # Use -std=c++98 because the default (-std=gnu++98) leaves __STRICT_ANSI__ 1645 # undefined and fake C99 facilities may be spuriously enabled. 1646 ac_save_CXXFLAGS="$CXXFLAGS" 1647 CXXFLAGS="$CXXFLAGS -std=c++98" 1648 1649 # Check for the existence of <complex.h> complex math functions used 1650 # by tr1/complex. 1651 AC_CHECK_HEADERS(complex.h, ac_has_complex_h=yes, ac_has_complex_h=no) 1652 ac_c99_complex_tr1=no; 1653 if test x"$ac_has_complex_h" = x"yes"; then 1654 AC_MSG_CHECKING([for ISO C99 support to TR1 in <complex.h>]) 1655 AC_TRY_COMPILE([#include <complex.h>], 1656 [typedef __complex__ float float_type; float_type tmpf; 1657 cacosf(tmpf); 1658 casinf(tmpf); 1659 catanf(tmpf); 1660 cacoshf(tmpf); 1661 casinhf(tmpf); 1662 catanhf(tmpf); 1663 typedef __complex__ double double_type; double_type tmpd; 1664 cacos(tmpd); 1665 casin(tmpd); 1666 catan(tmpd); 1667 cacosh(tmpd); 1668 casinh(tmpd); 1669 catanh(tmpd); 1670 typedef __complex__ long double ld_type; ld_type tmpld; 1671 cacosl(tmpld); 1672 casinl(tmpld); 1673 catanl(tmpld); 1674 cacoshl(tmpld); 1675 casinhl(tmpld); 1676 catanhl(tmpld); 1677 ],[ac_c99_complex_tr1=yes], [ac_c99_complex_tr1=no]) 1678 fi 1679 AC_MSG_RESULT($ac_c99_complex_tr1) 1680 if test x"$ac_c99_complex_tr1" = x"yes"; then 1681 AC_DEFINE(_GLIBCXX_USE_C99_COMPLEX_TR1, 1, 1682 [Define if C99 functions in <complex.h> should be used in 1683 <tr1/complex>. Using compiler builtins for these functions 1684 requires corresponding C99 library functions to be present.]) 1685 fi 1686 1687 # Check for the existence of <ctype.h> functions. 1688 AC_MSG_CHECKING([for ISO C99 support to TR1 in <ctype.h>]) 1689 AC_CACHE_VAL(glibcxx_cv_c99_ctype_tr1, [ 1690 AC_TRY_COMPILE([#include <ctype.h>], 1691 [int ch; 1692 int ret; 1693 ret = isblank(ch); 1694 ],[glibcxx_cv_c99_ctype_tr1=yes], 1695 [glibcxx_cv_c99_ctype_tr1=no]) 1696 ]) 1697 AC_MSG_RESULT($glibcxx_cv_c99_ctype_tr1) 1698 if test x"$glibcxx_cv_c99_ctype_tr1" = x"yes"; then 1699 AC_DEFINE(_GLIBCXX_USE_C99_CTYPE_TR1, 1, 1700 [Define if C99 functions in <ctype.h> should be imported in 1701 <tr1/cctype> in namespace std::tr1.]) 1702 fi 1703 1704 # Check for the existence of <fenv.h> functions. 1705 AC_CHECK_HEADERS(fenv.h, ac_has_fenv_h=yes, ac_has_fenv_h=no) 1706 ac_c99_fenv_tr1=no; 1707 if test x"$ac_has_fenv_h" = x"yes"; then 1708 AC_MSG_CHECKING([for ISO C99 support to TR1 in <fenv.h>]) 1709 AC_TRY_COMPILE([#include <fenv.h>], 1710 [int except, mode; 1711 fexcept_t* pflag; 1712 fenv_t* penv; 1713 int ret; 1714 ret = feclearexcept(except); 1715 ret = fegetexceptflag(pflag, except); 1716 ret = feraiseexcept(except); 1717 ret = fesetexceptflag(pflag, except); 1718 ret = fetestexcept(except); 1719 ret = fegetround(); 1720 ret = fesetround(mode); 1721 ret = fegetenv(penv); 1722 ret = feholdexcept(penv); 1723 ret = fesetenv(penv); 1724 ret = feupdateenv(penv); 1725 ],[ac_c99_fenv_tr1=yes], [ac_c99_fenv_tr1=no]) 1726 fi 1727 AC_MSG_RESULT($ac_c99_fenv_tr1) 1728 if test x"$ac_c99_fenv_tr1" = x"yes"; then 1729 AC_DEFINE(_GLIBCXX_USE_C99_FENV_TR1, 1, 1730 [Define if C99 functions in <fenv.h> should be imported in 1731 <tr1/cfenv> in namespace std::tr1.]) 1732 fi 1733 1734 # Check for the existence of <stdint.h> types. 1735 AC_MSG_CHECKING([for ISO C99 support to TR1 in <stdint.h>]) 1736 AC_CACHE_VAL(glibcxx_cv_c99_stdint_tr1, [ 1737 AC_TRY_COMPILE([#define __STDC_LIMIT_MACROS 1738 #define __STDC_CONSTANT_MACROS 1739 #include <stdint.h>], 1740 [typedef int8_t my_int8_t; 1741 my_int8_t i8 = INT8_MIN; 1742 i8 = INT8_MAX; 1743 typedef int16_t my_int16_t; 1744 my_int16_t i16 = INT16_MIN; 1745 i16 = INT16_MAX; 1746 typedef int32_t my_int32_t; 1747 my_int32_t i32 = INT32_MIN; 1748 i32 = INT32_MAX; 1749 typedef int64_t my_int64_t; 1750 my_int64_t i64 = INT64_MIN; 1751 i64 = INT64_MAX; 1752 typedef int_fast8_t my_int_fast8_t; 1753 my_int_fast8_t if8 = INT_FAST8_MIN; 1754 if8 = INT_FAST8_MAX; 1755 typedef int_fast16_t my_int_fast16_t; 1756 my_int_fast16_t if16 = INT_FAST16_MIN; 1757 if16 = INT_FAST16_MAX; 1758 typedef int_fast32_t my_int_fast32_t; 1759 my_int_fast32_t if32 = INT_FAST32_MIN; 1760 if32 = INT_FAST32_MAX; 1761 typedef int_fast64_t my_int_fast64_t; 1762 my_int_fast64_t if64 = INT_FAST64_MIN; 1763 if64 = INT_FAST64_MAX; 1764 typedef int_least8_t my_int_least8_t; 1765 my_int_least8_t il8 = INT_LEAST8_MIN; 1766 il8 = INT_LEAST8_MAX; 1767 typedef int_least16_t my_int_least16_t; 1768 my_int_least16_t il16 = INT_LEAST16_MIN; 1769 il16 = INT_LEAST16_MAX; 1770 typedef int_least32_t my_int_least32_t; 1771 my_int_least32_t il32 = INT_LEAST32_MIN; 1772 il32 = INT_LEAST32_MAX; 1773 typedef int_least64_t my_int_least64_t; 1774 my_int_least64_t il64 = INT_LEAST64_MIN; 1775 il64 = INT_LEAST64_MAX; 1776 typedef intmax_t my_intmax_t; 1777 my_intmax_t im = INTMAX_MAX; 1778 im = INTMAX_MIN; 1779 typedef intptr_t my_intptr_t; 1780 my_intptr_t ip = INTPTR_MAX; 1781 ip = INTPTR_MIN; 1782 typedef uint8_t my_uint8_t; 1783 my_uint8_t ui8 = UINT8_MAX; 1784 ui8 = UINT8_MAX; 1785 typedef uint16_t my_uint16_t; 1786 my_uint16_t ui16 = UINT16_MAX; 1787 ui16 = UINT16_MAX; 1788 typedef uint32_t my_uint32_t; 1789 my_uint32_t ui32 = UINT32_MAX; 1790 ui32 = UINT32_MAX; 1791 typedef uint64_t my_uint64_t; 1792 my_uint64_t ui64 = UINT64_MAX; 1793 ui64 = UINT64_MAX; 1794 typedef uint_fast8_t my_uint_fast8_t; 1795 my_uint_fast8_t uif8 = UINT_FAST8_MAX; 1796 uif8 = UINT_FAST8_MAX; 1797 typedef uint_fast16_t my_uint_fast16_t; 1798 my_uint_fast16_t uif16 = UINT_FAST16_MAX; 1799 uif16 = UINT_FAST16_MAX; 1800 typedef uint_fast32_t my_uint_fast32_t; 1801 my_uint_fast32_t uif32 = UINT_FAST32_MAX; 1802 uif32 = UINT_FAST32_MAX; 1803 typedef uint_fast64_t my_uint_fast64_t; 1804 my_uint_fast64_t uif64 = UINT_FAST64_MAX; 1805 uif64 = UINT_FAST64_MAX; 1806 typedef uint_least8_t my_uint_least8_t; 1807 my_uint_least8_t uil8 = UINT_LEAST8_MAX; 1808 uil8 = UINT_LEAST8_MAX; 1809 typedef uint_least16_t my_uint_least16_t; 1810 my_uint_least16_t uil16 = UINT_LEAST16_MAX; 1811 uil16 = UINT_LEAST16_MAX; 1812 typedef uint_least32_t my_uint_least32_t; 1813 my_uint_least32_t uil32 = UINT_LEAST32_MAX; 1814 uil32 = UINT_LEAST32_MAX; 1815 typedef uint_least64_t my_uint_least64_t; 1816 my_uint_least64_t uil64 = UINT_LEAST64_MAX; 1817 uil64 = UINT_LEAST64_MAX; 1818 typedef uintmax_t my_uintmax_t; 1819 my_uintmax_t uim = UINTMAX_MAX; 1820 uim = UINTMAX_MAX; 1821 typedef uintptr_t my_uintptr_t; 1822 my_uintptr_t uip = UINTPTR_MAX; 1823 uip = UINTPTR_MAX; 1824 ],[glibcxx_cv_c99_stdint_tr1=yes], 1825 [glibcxx_cv_c99_stdint_tr1=no]) 1826 ]) 1827 AC_MSG_RESULT($glibcxx_cv_c99_stdint_tr1) 1828 if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then 1829 AC_DEFINE(_GLIBCXX_USE_C99_STDINT_TR1, 1, 1830 [Define if C99 types in <stdint.h> should be imported in 1831 <tr1/cstdint> in namespace std::tr1.]) 1832 fi 1833 1834 # Check for the existence of <math.h> functions. 1835 AC_MSG_CHECKING([for ISO C99 support to TR1 in <math.h>]) 1836 AC_CACHE_VAL(glibcxx_cv_c99_math_tr1, [ 1837 AC_TRY_COMPILE([#include <math.h>], 1838 [typedef double_t my_double_t; 1839 typedef float_t my_float_t; 1840 acosh(0.0); 1841 acoshf(0.0f); 1842 acoshl(0.0l); 1843 asinh(0.0); 1844 asinhf(0.0f); 1845 asinhl(0.0l); 1846 atanh(0.0); 1847 atanhf(0.0f); 1848 atanhl(0.0l); 1849 cbrt(0.0); 1850 cbrtf(0.0f); 1851 cbrtl(0.0l); 1852 copysign(0.0, 0.0); 1853 copysignf(0.0f, 0.0f); 1854 copysignl(0.0l, 0.0l); 1855 erf(0.0); 1856 erff(0.0f); 1857 erfl(0.0l); 1858 erfc(0.0); 1859 erfcf(0.0f); 1860 erfcl(0.0l); 1861 exp2(0.0); 1862 exp2f(0.0f); 1863 exp2l(0.0l); 1864 expm1(0.0); 1865 expm1f(0.0f); 1866 expm1l(0.0l); 1867 fdim(0.0, 0.0); 1868 fdimf(0.0f, 0.0f); 1869 fdiml(0.0l, 0.0l); 1870 fma(0.0, 0.0, 0.0); 1871 fmaf(0.0f, 0.0f, 0.0f); 1872 fmal(0.0l, 0.0l, 0.0l); 1873 fmax(0.0, 0.0); 1874 fmaxf(0.0f, 0.0f); 1875 fmaxl(0.0l, 0.0l); 1876 fmin(0.0, 0.0); 1877 fminf(0.0f, 0.0f); 1878 fminl(0.0l, 0.0l); 1879 hypot(0.0, 0.0); 1880 hypotf(0.0f, 0.0f); 1881 hypotl(0.0l, 0.0l); 1882 ilogb(0.0); 1883 ilogbf(0.0f); 1884 ilogbl(0.0l); 1885 lgamma(0.0); 1886 lgammaf(0.0f); 1887 lgammal(0.0l); 1888 #ifndef __APPLE__ /* see below */ 1889 llrint(0.0); 1890 llrintf(0.0f); 1891 llrintl(0.0l); 1892 llround(0.0); 1893 llroundf(0.0f); 1894 llroundl(0.0l); 1895 #endif 1896 log1p(0.0); 1897 log1pf(0.0f); 1898 log1pl(0.0l); 1899 log2(0.0); 1900 log2f(0.0f); 1901 log2l(0.0l); 1902 logb(0.0); 1903 logbf(0.0f); 1904 logbl(0.0l); 1905 lrint(0.0); 1906 lrintf(0.0f); 1907 lrintl(0.0l); 1908 lround(0.0); 1909 lroundf(0.0f); 1910 lroundl(0.0l); 1911 nan(0); 1912 nanf(0); 1913 nanl(0); 1914 nearbyint(0.0); 1915 nearbyintf(0.0f); 1916 nearbyintl(0.0l); 1917 nextafter(0.0, 0.0); 1918 nextafterf(0.0f, 0.0f); 1919 nextafterl(0.0l, 0.0l); 1920 nexttoward(0.0, 0.0); 1921 nexttowardf(0.0f, 0.0f); 1922 nexttowardl(0.0l, 0.0l); 1923 remainder(0.0, 0.0); 1924 remainderf(0.0f, 0.0f); 1925 remainderl(0.0l, 0.0l); 1926 remquo(0.0, 0.0, 0); 1927 remquof(0.0f, 0.0f, 0); 1928 remquol(0.0l, 0.0l, 0); 1929 rint(0.0); 1930 rintf(0.0f); 1931 rintl(0.0l); 1932 round(0.0); 1933 roundf(0.0f); 1934 roundl(0.0l); 1935 scalbln(0.0, 0l); 1936 scalblnf(0.0f, 0l); 1937 scalblnl(0.0l, 0l); 1938 scalbn(0.0, 0); 1939 scalbnf(0.0f, 0); 1940 scalbnl(0.0l, 0); 1941 tgamma(0.0); 1942 tgammaf(0.0f); 1943 tgammal(0.0l); 1944 trunc(0.0); 1945 truncf(0.0f); 1946 truncl(0.0l); 1947 ],[glibcxx_cv_c99_math_tr1=yes], [glibcxx_cv_c99_math_tr1=no]) 1948 ]) 1949 AC_MSG_RESULT($glibcxx_cv_c99_math_tr1) 1950 if test x"$glibcxx_cv_c99_math_tr1" = x"yes"; then 1951 AC_DEFINE(_GLIBCXX_USE_C99_MATH_TR1, 1, 1952 [Define if C99 functions or macros in <math.h> should be imported 1953 in <tr1/cmath> in namespace std::tr1.]) 1954 1955 case "${target_os}" in 1956 darwin*) 1957 AC_MSG_CHECKING([for ISO C99 rounding functions in <math.h>]) 1958 AC_CACHE_VAL(glibcxx_cv_c99_math_llround, [ 1959 AC_TRY_COMPILE([#include <math.h>], 1960 [llrint(0.0); 1961 llrintf(0.0f); 1962 llrintl(0.0l); 1963 llround(0.0); 1964 llroundf(0.0f); 1965 llroundl(0.0l); 1966 ], 1967 [glibcxx_cv_c99_math_llround=yes], 1968 [glibcxx_cv_c99_math_llround=no]) 1969 ]) 1970 AC_MSG_RESULT($glibcxx_cv_c99_math_llround) 1971 ;; 1972 esac 1973 if test x"$glibcxx_cv_c99_math_llround" = x"no"; then 1974 AC_DEFINE(_GLIBCXX_NO_C99_ROUNDING_FUNCS, 1, 1975 [Define if C99 llrint and llround functions are missing from <math.h>.]) 1976 fi 1977 fi 1978 1979 # Check for the existence of <inttypes.h> functions (NB: doesn't make 1980 # sense if the glibcxx_cv_c99_stdint_tr1 check fails, per C99, 7.8/1). 1981 ac_c99_inttypes_tr1=no; 1982 if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then 1983 AC_MSG_CHECKING([for ISO C99 support to TR1 in <inttypes.h>]) 1984 AC_TRY_COMPILE([#include <inttypes.h>], 1985 [intmax_t i, numer, denom, base; 1986 const char* s; 1987 char** endptr; 1988 intmax_t ret = imaxabs(i); 1989 imaxdiv_t dret = imaxdiv(numer, denom); 1990 ret = strtoimax(s, endptr, base); 1991 uintmax_t uret = strtoumax(s, endptr, base); 1992 ],[ac_c99_inttypes_tr1=yes], [ac_c99_inttypes_tr1=no]) 1993 fi 1994 AC_MSG_RESULT($ac_c99_inttypes_tr1) 1995 if test x"$ac_c99_inttypes_tr1" = x"yes"; then 1996 AC_DEFINE(_GLIBCXX_USE_C99_INTTYPES_TR1, 1, 1997 [Define if C99 functions in <inttypes.h> should be imported in 1998 <tr1/cinttypes> in namespace std::tr1.]) 1999 fi 2000 2001 # Check for the existence of wchar_t <inttypes.h> functions (NB: doesn't 2002 # make sense if the glibcxx_cv_c99_stdint_tr1 check fails, per C99, 7.8/1). 2003 ac_c99_inttypes_wchar_t_tr1=no; 2004 if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then 2005 AC_MSG_CHECKING([for wchar_t ISO C99 support to TR1 in <inttypes.h>]) 2006 AC_TRY_COMPILE([#include <inttypes.h>], 2007 [intmax_t base; 2008 const wchar_t* s; 2009 wchar_t** endptr; 2010 intmax_t ret = wcstoimax(s, endptr, base); 2011 uintmax_t uret = wcstoumax(s, endptr, base); 2012 ],[ac_c99_inttypes_wchar_t_tr1=yes], 2013 [ac_c99_inttypes_wchar_t_tr1=no]) 2014 fi 2015 AC_MSG_RESULT($ac_c99_inttypes_wchar_t_tr1) 2016 if test x"$ac_c99_inttypes_wchar_t_tr1" = x"yes"; then 2017 AC_DEFINE(_GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1, 1, 2018 [Define if wchar_t C99 functions in <inttypes.h> should be 2019 imported in <tr1/cinttypes> in namespace std::tr1.]) 2020 fi 2021 2022 # Check for the existence of the <stdbool.h> header. 2023 AC_CHECK_HEADERS(stdbool.h) 2024 2025 # Check for the existence of the <stdalign.h> header. 2026 AC_CHECK_HEADERS(stdalign.h) 2027 2028 CXXFLAGS="$ac_save_CXXFLAGS" 2029 AC_LANG_RESTORE 2030]) 2031 2032dnl 2033dnl Check for uchar.h and usability. 2034dnl 2035AC_DEFUN([GLIBCXX_CHECK_UCHAR_H], [ 2036 2037 # Test uchar.h. 2038 AC_CHECK_HEADERS(uchar.h, ac_has_uchar_h=yes, ac_has_uchar_h=no) 2039 2040 AC_LANG_SAVE 2041 AC_LANG_CPLUSPLUS 2042 ac_save_CXXFLAGS="$CXXFLAGS" 2043 CXXFLAGS="$CXXFLAGS -std=c++11" 2044 2045 if test x"$ac_has_uchar_h" = x"yes"; then 2046 AC_MSG_CHECKING([for ISO C11 support for <uchar.h>]) 2047 AC_TRY_COMPILE([#include <uchar.h> 2048 #ifdef __STDC_UTF_16__ 2049 long i = __STDC_UTF_16__; 2050 #endif 2051 #ifdef __STDC_UTF_32__ 2052 long j = __STDC_UTF_32__; 2053 #endif 2054 namespace test 2055 { 2056 using ::c16rtomb; 2057 using ::c32rtomb; 2058 using ::mbrtoc16; 2059 using ::mbrtoc32; 2060 } 2061 ], 2062 [], [ac_c11_uchar_cxx11=yes], [ac_c11_uchar_cxx11=no]) 2063 else 2064 ac_c11_uchar_cxx11=no 2065 fi 2066 AC_MSG_RESULT($ac_c11_uchar_cxx11) 2067 if test x"$ac_c11_uchar_cxx11" = x"yes"; then 2068 AC_DEFINE(_GLIBCXX_USE_C11_UCHAR_CXX11, 1, 2069 [Define if C11 functions in <uchar.h> should be imported into 2070 namespace std in <cuchar>.]) 2071 fi 2072 2073 CXXFLAGS="$ac_save_CXXFLAGS" 2074 AC_LANG_RESTORE 2075]) 2076 2077 2078dnl 2079dnl Check whether "/dev/random" and "/dev/urandom" are available for 2080dnl class std::random_device from C++ 2011 [rand.device], and 2081dnl random_device of "TR1" (Chapter 5.1, "Random number generation"). 2082dnl 2083AC_DEFUN([GLIBCXX_CHECK_DEV_RANDOM], [ 2084 2085 AC_MSG_CHECKING([for "/dev/random" and "/dev/urandom" for std::random_device]) 2086 AC_CACHE_VAL(glibcxx_cv_dev_random, [ 2087 if test -r /dev/random && test -r /dev/urandom; then 2088 ## For MSys environment the test above is detected as false-positive 2089 ## on mingw-targets. So disable it explicitly for them. 2090 case ${target_os} in 2091 *mingw*) glibcxx_cv_dev_random=no ;; 2092 *) glibcxx_cv_dev_random=yes ;; 2093 esac 2094 else 2095 glibcxx_cv_dev_random=no; 2096 fi 2097 ]) 2098 AC_MSG_RESULT($glibcxx_cv_dev_random) 2099 2100 if test x"$glibcxx_cv_dev_random" = x"yes"; then 2101 AC_DEFINE(_GLIBCXX_USE_DEV_RANDOM, 1, 2102 [Define if /dev/random and /dev/urandom are available for 2103 std::random_device.]) 2104 AC_DEFINE(_GLIBCXX_USE_RANDOM_TR1, 1, 2105 [Define if /dev/random and /dev/urandom are available for 2106 the random_device of TR1 (Chapter 5.1).]) 2107 fi 2108 2109]) 2110 2111dnl 2112dnl Compute the EOF, SEEK_CUR, and SEEK_END integer constants. 2113dnl 2114AC_DEFUN([GLIBCXX_COMPUTE_STDIO_INTEGER_CONSTANTS], [ 2115 2116 AC_CACHE_CHECK([for the value of EOF], glibcxx_cv_stdio_eof, [ 2117 AC_COMPUTE_INT([glibcxx_cv_stdio_eof], [[EOF]], 2118 [#include <stdio.h>], 2119 [AC_MSG_ERROR([computing EOF failed])]) 2120 ]) 2121 AC_DEFINE_UNQUOTED(_GLIBCXX_STDIO_EOF, $glibcxx_cv_stdio_eof, 2122 [Define to the value of the EOF integer constant.]) 2123 2124 AC_CACHE_CHECK([for the value of SEEK_CUR], glibcxx_cv_stdio_seek_cur, [ 2125 AC_COMPUTE_INT([glibcxx_cv_stdio_seek_cur], [[SEEK_CUR]], 2126 [#include <stdio.h>], 2127 [AC_MSG_ERROR([computing SEEK_CUR failed])]) 2128 ]) 2129 AC_DEFINE_UNQUOTED(_GLIBCXX_STDIO_SEEK_CUR, $glibcxx_cv_stdio_seek_cur, 2130 [Define to the value of the SEEK_CUR integer constant.]) 2131 2132 AC_CACHE_CHECK([for the value of SEEK_END], glibcxx_cv_stdio_seek_end, [ 2133 AC_COMPUTE_INT([glibcxx_cv_stdio_seek_end], [[SEEK_END]], 2134 [#include <stdio.h>], 2135 [AC_MSG_ERROR([computing SEEK_END failed])]) 2136 ]) 2137 AC_DEFINE_UNQUOTED(_GLIBCXX_STDIO_SEEK_END, $glibcxx_cv_stdio_seek_end, 2138 [Define to the value of the SEEK_END integer constant.]) 2139]) 2140 2141dnl 2142dnl Check whether required C++ overloads are present in <stdio.h>. 2143dnl 2144AC_DEFUN([GLIBCXX_CHECK_STDIO_PROTO], [ 2145 2146 AC_LANG_SAVE 2147 AC_LANG_CPLUSPLUS 2148 # Use C++11 because a conforming <stdio.h> won't define gets for C++14, 2149 # and we don't need a declaration for C++14 anyway. 2150 ac_save_CXXFLAGS="$CXXFLAGS" 2151 CXXFLAGS="$CXXFLAGS -std=gnu++11" 2152 2153 AC_MSG_CHECKING([for gets declaration]) 2154 AC_CACHE_VAL(glibcxx_cv_gets, [ 2155 AC_COMPILE_IFELSE([AC_LANG_SOURCE( 2156 [#include <stdio.h> 2157 namespace test 2158 { 2159 using ::gets; 2160 } 2161 ])], 2162 [glibcxx_cv_gets=yes], 2163 [glibcxx_cv_gets=no] 2164 )]) 2165 2166 if test $glibcxx_cv_gets = yes; then 2167 AC_DEFINE(HAVE_GETS, 1, [Define if gets is available in <stdio.h> before C++14.]) 2168 fi 2169 AC_MSG_RESULT($glibcxx_cv_gets) 2170 2171 CXXFLAGS="$ac_save_CXXFLAGS" 2172 AC_LANG_RESTORE 2173]) 2174 2175dnl 2176dnl Check whether required C++11 overloads for floating point and integral 2177dnl types are present in <math.h>. 2178dnl 2179AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [ 2180 2181 AC_LANG_SAVE 2182 AC_LANG_CPLUSPLUS 2183 ac_save_CXXFLAGS="$CXXFLAGS" 2184 CXXFLAGS="$CXXFLAGS -std=c++11" 2185 2186 case "$host" in 2187 *-*-solaris2.*) 2188 # Solaris 12 Build 86, Solaris 11.3 SRU 3.6, and Solaris 10 Patch 2189 # 11996[67]-02 introduced the C++11 <math.h> floating point overloads. 2190 AC_MSG_CHECKING([for C++11 <math.h> floating point overloads]) 2191 AC_CACHE_VAL(glibcxx_cv_math11_fp_overload, [ 2192 AC_COMPILE_IFELSE([AC_LANG_SOURCE( 2193 [#include <math.h> 2194 #undef isfinite 2195 namespace std { 2196 inline bool isfinite(float __x) 2197 { return __builtin_isfinite(__x); } 2198 } 2199 ])], 2200 [glibcxx_cv_math11_fp_overload=no], 2201 [glibcxx_cv_math11_fp_overload=yes] 2202 )]) 2203 2204 # autoheader cannot handle indented templates. 2205 AH_VERBATIM([__CORRECT_ISO_CPP11_MATH_H_PROTO_FP], 2206 [/* Define if all C++11 floating point overloads are available in <math.h>. */ 2207#if __cplusplus >= 201103L 2208#undef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 2209#endif]) 2210 2211 if test $glibcxx_cv_math11_fp_overload = yes; then 2212 AC_DEFINE(__CORRECT_ISO_CPP11_MATH_H_PROTO_FP) 2213 fi 2214 AC_MSG_RESULT([$glibcxx_cv_math11_fp_overload]) 2215 2216 # Solaris 12 Build 90, Solaris 11.3 SRU 5.6, and Solaris 10 Patch 2217 # 11996[67]-02 introduced the C++11 <math.h> integral type overloads. 2218 AC_MSG_CHECKING([for C++11 <math.h> integral type overloads]) 2219 AC_CACHE_VAL(glibcxx_cv_math11_int_overload, [ 2220 AC_COMPILE_IFELSE([AC_LANG_SOURCE( 2221 [#include <math.h> 2222 namespace std { 2223 template<typename _Tp> 2224 struct __is_integer; 2225 template<> 2226 struct __is_integer<int> 2227 { 2228 enum { __value = 1 }; 2229 }; 2230 } 2231 namespace __gnu_cxx { 2232 template<bool, typename> 2233 struct __enable_if; 2234 template<typename _Tp> 2235 struct __enable_if<true, _Tp> 2236 { typedef _Tp __type; }; 2237 } 2238 namespace std { 2239 template<typename _Tp> 2240 constexpr typename __gnu_cxx::__enable_if 2241 <__is_integer<_Tp>::__value, double>::__type 2242 log2(_Tp __x) 2243 { return __builtin_log2(__x); } 2244 } 2245 int 2246 main (void) 2247 { 2248 int i = 1000; 2249 return std::log2(i); 2250 } 2251 ])], 2252 [glibcxx_cv_math11_int_overload=no], 2253 [glibcxx_cv_math11_int_overload=yes] 2254 )]) 2255 2256 # autoheader cannot handle indented templates. 2257 AH_VERBATIM([__CORRECT_ISO_CPP11_MATH_H_PROTO_INT], 2258 [/* Define if all C++11 integral type overloads are available in <math.h>. */ 2259#if __cplusplus >= 201103L 2260#undef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT 2261#endif]) 2262 2263 if test $glibcxx_cv_math11_int_overload = yes; then 2264 AC_DEFINE(__CORRECT_ISO_CPP11_MATH_H_PROTO_INT) 2265 fi 2266 AC_MSG_RESULT([$glibcxx_cv_math11_int_overload]) 2267 ;; 2268 *) 2269 # If <math.h> defines the obsolete isinf(double) and isnan(double) 2270 # functions (instead of or as well as the C99 generic macros) then we 2271 # can't define std::isinf(double) and std::isnan(double) in <cmath> 2272 # and must use the ones from <math.h> instead. 2273 AC_MSG_CHECKING([for obsolete isinf function in <math.h>]) 2274 AC_CACHE_VAL(glibcxx_cv_obsolete_isinf, [ 2275 AC_COMPILE_IFELSE([AC_LANG_SOURCE( 2276 [#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS 2277 #include <math.h> 2278 #undef isinf 2279 namespace std { 2280 using ::isinf; 2281 bool isinf(float); 2282 bool isinf(long double); 2283 } 2284 using std::isinf; 2285 bool b = isinf(0.0); 2286 ])], 2287 [glibcxx_cv_obsolete_isinf=yes], 2288 [glibcxx_cv_obsolete_isinf=no] 2289 )]) 2290 AC_MSG_RESULT([$glibcxx_cv_obsolete_isinf]) 2291 if test $glibcxx_cv_obsolete_isinf = yes; then 2292 AC_DEFINE(HAVE_OBSOLETE_ISINF, 1, 2293 [Define if <math.h> defines obsolete isinf function.]) 2294 fi 2295 2296 AC_MSG_CHECKING([for obsolete isnan function in <math.h>]) 2297 AC_CACHE_VAL(glibcxx_cv_obsolete_isnan, [ 2298 AC_COMPILE_IFELSE([AC_LANG_SOURCE( 2299 [#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS 2300 #include <math.h> 2301 #undef isnan 2302 namespace std { 2303 using ::isnan; 2304 bool isnan(float); 2305 bool isnan(long double); 2306 } 2307 using std::isnan; 2308 bool b = isnan(0.0); 2309 ])], 2310 [glibcxx_cv_obsolete_isnan=yes], 2311 [glibcxx_cv_obsolete_isnan=no] 2312 )]) 2313 AC_MSG_RESULT([$glibcxx_cv_obsolete_isnan]) 2314 if test $glibcxx_cv_obsolete_isnan = yes; then 2315 AC_DEFINE(HAVE_OBSOLETE_ISNAN, 1, 2316 [Define if <math.h> defines obsolete isnan function.]) 2317 fi 2318 ;; 2319 esac 2320 2321 CXXFLAGS="$ac_save_CXXFLAGS" 2322 AC_LANG_RESTORE 2323]) 2324 2325dnl 2326dnl Check whether macros, etc are present for <system_error> 2327dnl 2328AC_DEFUN([GLIBCXX_CHECK_SYSTEM_ERROR], [ 2329 2330m4_pushdef([n_syserr], [1])dnl 2331m4_foreach([syserr], [EOWNERDEAD, ENOTRECOVERABLE, ENOLINK, EPROTO, ENODATA, 2332 ENOSR, ENOSTR, ETIME, EBADMSG, ECANCELED, 2333 EOVERFLOW, ENOTSUP, EIDRM, ETXTBSY, 2334 ECHILD, ENOSPC, EPERM, 2335 ETIMEDOUT, EWOULDBLOCK], 2336[m4_pushdef([SYSERR], m4_toupper(syserr))dnl 2337AC_MSG_CHECKING([for syserr]) 2338AC_CACHE_VAL([glibcxx_cv_system_error[]n_syserr], [ 2339AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]], 2340 [int i = syserr;])], 2341 [glibcxx_cv_system_error[]n_syserr=yes], 2342 [glibcxx_cv_system_error[]n_syserr=no]) 2343]) 2344AC_MSG_RESULT([$glibcxx_cv_system_error[]n_syserr]) 2345if test x"$glibcxx_cv_system_error[]n_syserr" = x"yes"; then 2346 AC_DEFINE([HAVE_]SYSERR, 1, [Define if ]syserr[ exists.]) 2347fi 2348m4_define([n_syserr], m4_incr(n_syserr))dnl 2349m4_popdef([SYSERR])dnl 2350]) 2351m4_popdef([n_syserr])dnl 2352]) 2353 2354dnl 2355dnl Check for what type of C headers to use. 2356dnl 2357dnl --enable-cheaders= [does stuff]. 2358dnl --disable-cheaders [does not do anything, really]. 2359dnl + Usage: GLIBCXX_ENABLE_CHEADERS[(DEFAULT)] 2360dnl Where DEFAULT is either 'c' or 'c_std' or 'c_global'. 2361dnl 2362AC_DEFUN([GLIBCXX_ENABLE_CHEADERS], [ 2363 GLIBCXX_ENABLE(cheaders,$1,[[[=KIND]]], 2364 [construct "C" headers for g++], [permit c|c_std|c_global]) 2365 AC_MSG_NOTICE("C" header strategy set to $enable_cheaders) 2366 2367 C_INCLUDE_DIR='${glibcxx_srcdir}/include/'$enable_cheaders 2368 2369 # Allow overrides to configure.host here. 2370 if test $enable_cheaders = c_global; then 2371 c_compatibility=yes 2372 fi 2373 2374 AC_SUBST(C_INCLUDE_DIR) 2375 GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_C, test $enable_cheaders = c) 2376 GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_C_STD, test $enable_cheaders = c_std) 2377 GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_C_GLOBAL, test $enable_cheaders = c_global) 2378 GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_COMPATIBILITY, test $c_compatibility = yes) 2379]) 2380 2381 2382dnl 2383dnl Check for which locale library to use. The choice is mapped to 2384dnl a subdirectory of config/locale. 2385dnl 2386dnl Default is generic. 2387dnl 2388AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ 2389 GLIBCXX_ENABLE(clocale,auto,[[[=MODEL]]], 2390 [use MODEL for target locale package], 2391 [permit generic|gnu|ieee_1003.1-2001|newlib|yes|no|auto]) 2392 2393 # Deal with gettext issues. Default to not using it (=no) until we detect 2394 # support for it later. Let the user turn it off via --e/d, but let that 2395 # default to on for easier handling. 2396 USE_NLS=no 2397 AC_ARG_ENABLE(nls, 2398 AC_HELP_STRING([--enable-nls],[use Native Language Support (default)]), 2399 [], 2400 [enable_nls=yes]) 2401 2402 # Either a known package, or "auto" 2403 if test $enable_clocale = no || test $enable_clocale = yes; then 2404 enable_clocale=auto 2405 fi 2406 enable_clocale_flag=$enable_clocale 2407 2408 # Probe for locale model to use if none specified. 2409 # Default to "generic". 2410 if test $enable_clocale_flag = auto; then 2411 case ${target_os} in 2412 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) 2413 enable_clocale_flag=gnu 2414 ;; 2415 darwin*) 2416 enable_clocale_flag=darwin 2417 ;; 2418 dragonfly* | freebsd*) 2419 enable_clocale_flag=dragonfly 2420 ;; 2421 openbsd*) 2422 enable_clocale_flag=newlib 2423 ;; 2424 *) 2425 if test x"$with_newlib" = x"yes"; then 2426 enable_clocale_flag=newlib 2427 else 2428 enable_clocale_flag=generic 2429 fi 2430 ;; 2431 esac 2432 fi 2433 2434 # Sanity check model, and test for special functionality. 2435 if test $enable_clocale_flag = gnu; then 2436 AC_EGREP_CPP([_GLIBCXX_ok], [ 2437 #include <features.h> 2438 #if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined(__UCLIBC__) 2439 _GLIBCXX_ok 2440 #endif 2441 ], enable_clocale_flag=gnu, enable_clocale_flag=generic) 2442 2443 # Set it to scream when it hurts. 2444 ac_save_CFLAGS="$CFLAGS" 2445 CFLAGS="-Wimplicit-function-declaration -Werror" 2446 2447 # Use strxfrm_l if available. 2448 AC_TRY_COMPILE([#define _GNU_SOURCE 1 2449 #include <string.h> 2450 #include <locale.h>], 2451 [char s[128]; __locale_t loc; strxfrm_l(s, "C", 5, loc);], 2452 AC_DEFINE(HAVE_STRXFRM_L, 1, 2453 [Define if strxfrm_l is available in <string.h>.]),) 2454 2455 # Use strerror_l if available. 2456 AC_TRY_COMPILE([#define _GNU_SOURCE 1 2457 #include <string.h> 2458 #include <locale.h>], 2459 [__locale_t loc; strerror_l(5, loc);], 2460 AC_DEFINE(HAVE_STRERROR_L, 1, 2461 [Define if strerror_l is available in <string.h>.]),) 2462 2463 CFLAGS="$ac_save_CFLAGS" 2464 fi 2465 2466 # Perhaps use strerror_r if available, and strerror_l isn't. 2467 ac_save_CFLAGS="$CFLAGS" 2468 CFLAGS="-Wimplicit-function-declaration -Werror" 2469 AC_TRY_COMPILE([#define _GNU_SOURCE 1 2470 #include <string.h> 2471 #include <locale.h>], 2472 [char s[128]; strerror_r(5, s, 128);], 2473 AC_DEFINE(HAVE_STRERROR_R, 1, 2474 [Define if strerror_r is available in <string.h>.]),) 2475 CFLAGS="$ac_save_CFLAGS" 2476 2477 # Set configure bits for specified locale package 2478 AC_MSG_CHECKING([for C locale to use]) 2479 case ${enable_clocale_flag} in 2480 generic) 2481 AC_MSG_RESULT(generic) 2482 2483 CLOCALE_H=config/locale/generic/c_locale.h 2484 CLOCALE_CC=config/locale/generic/c_locale.cc 2485 CCODECVT_CC=config/locale/generic/codecvt_members.cc 2486 CCOLLATE_CC=config/locale/generic/collate_members.cc 2487 CCTYPE_CC=config/locale/generic/ctype_members.cc 2488 CMESSAGES_H=config/locale/generic/messages_members.h 2489 CMESSAGES_CC=config/locale/generic/messages_members.cc 2490 CMONEY_CC=config/locale/generic/monetary_members.cc 2491 CNUMERIC_CC=config/locale/generic/numeric_members.cc 2492 CTIME_H=config/locale/generic/time_members.h 2493 CTIME_CC=config/locale/generic/time_members.cc 2494 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h 2495 ;; 2496 darwin) 2497 AC_MSG_RESULT(darwin) 2498 2499 CLOCALE_H=config/locale/generic/c_locale.h 2500 CLOCALE_CC=config/locale/generic/c_locale.cc 2501 CCODECVT_CC=config/locale/generic/codecvt_members.cc 2502 CCOLLATE_CC=config/locale/generic/collate_members.cc 2503 CCTYPE_CC=config/locale/darwin/ctype_members.cc 2504 CMESSAGES_H=config/locale/generic/messages_members.h 2505 CMESSAGES_CC=config/locale/generic/messages_members.cc 2506 CMONEY_CC=config/locale/generic/monetary_members.cc 2507 CNUMERIC_CC=config/locale/generic/numeric_members.cc 2508 CTIME_H=config/locale/generic/time_members.h 2509 CTIME_CC=config/locale/generic/time_members.cc 2510 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h 2511 ;; 2512 2513 dragonfly) 2514 AC_MSG_RESULT(dragonfly or freebsd) 2515 2516 CLOCALE_H=config/locale/dragonfly/c_locale.h 2517 CLOCALE_CC=config/locale/dragonfly/c_locale.cc 2518 CCODECVT_CC=config/locale/dragonfly/codecvt_members.cc 2519 CCOLLATE_CC=config/locale/dragonfly/collate_members.cc 2520 CCTYPE_CC=config/locale/dragonfly/ctype_members.cc 2521 CMESSAGES_H=config/locale/generic/messages_members.h 2522 CMESSAGES_CC=config/locale/generic/messages_members.cc 2523 CMONEY_CC=config/locale/dragonfly/monetary_members.cc 2524 CNUMERIC_CC=config/locale/dragonfly/numeric_members.cc 2525 CTIME_H=config/locale/dragonfly/time_members.h 2526 CTIME_CC=config/locale/dragonfly/time_members.cc 2527 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h 2528 ;; 2529 2530 gnu) 2531 AC_MSG_RESULT(gnu) 2532 2533 # Declare intention to use gettext, and add support for specific 2534 # languages. 2535 # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT 2536 ALL_LINGUAS="de fr" 2537 2538 # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. 2539 AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no) 2540 if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then 2541 USE_NLS=yes 2542 fi 2543 # Export the build objects. 2544 for ling in $ALL_LINGUAS; do \ 2545 glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ 2546 glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ 2547 done 2548 AC_SUBST(glibcxx_MOFILES) 2549 AC_SUBST(glibcxx_POFILES) 2550 2551 CLOCALE_H=config/locale/gnu/c_locale.h 2552 CLOCALE_CC=config/locale/gnu/c_locale.cc 2553 CCODECVT_CC=config/locale/gnu/codecvt_members.cc 2554 CCOLLATE_CC=config/locale/gnu/collate_members.cc 2555 CCTYPE_CC=config/locale/gnu/ctype_members.cc 2556 CMESSAGES_H=config/locale/gnu/messages_members.h 2557 CMESSAGES_CC=config/locale/gnu/messages_members.cc 2558 CMONEY_CC=config/locale/gnu/monetary_members.cc 2559 CNUMERIC_CC=config/locale/gnu/numeric_members.cc 2560 CTIME_H=config/locale/gnu/time_members.h 2561 CTIME_CC=config/locale/gnu/time_members.cc 2562 CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h 2563 ;; 2564 ieee_1003.1-2001) 2565 AC_MSG_RESULT(IEEE 1003.1) 2566 2567 CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h 2568 CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc 2569 CCODECVT_CC=config/locale/generic/codecvt_members.cc 2570 CCOLLATE_CC=config/locale/generic/collate_members.cc 2571 CCTYPE_CC=config/locale/generic/ctype_members.cc 2572 CMESSAGES_H=config/locale/ieee_1003.1-2001/messages_members.h 2573 CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc 2574 CMONEY_CC=config/locale/generic/monetary_members.cc 2575 CNUMERIC_CC=config/locale/generic/numeric_members.cc 2576 CTIME_H=config/locale/generic/time_members.h 2577 CTIME_CC=config/locale/generic/time_members.cc 2578 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h 2579 ;; 2580 newlib) 2581 AC_MSG_RESULT(newlib) 2582 2583 CLOCALE_H=config/locale/generic/c_locale.h 2584 CLOCALE_CC=config/locale/generic/c_locale.cc 2585 CCODECVT_CC=config/locale/generic/codecvt_members.cc 2586 CCOLLATE_CC=config/locale/generic/collate_members.cc 2587 CCTYPE_CC=config/locale/newlib/ctype_members.cc 2588 CMESSAGES_H=config/locale/generic/messages_members.h 2589 CMESSAGES_CC=config/locale/generic/messages_members.cc 2590 CMONEY_CC=config/locale/generic/monetary_members.cc 2591 CNUMERIC_CC=config/locale/generic/numeric_members.cc 2592 CTIME_H=config/locale/generic/time_members.h 2593 CTIME_CC=config/locale/generic/time_members.cc 2594 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h 2595 ;; 2596 esac 2597 2598 # This is where the testsuite looks for locale catalogs, using the 2599 # -DLOCALEDIR define during testsuite compilation. 2600 glibcxx_localedir=${glibcxx_builddir}/po/share/locale 2601 AC_SUBST(glibcxx_localedir) 2602 2603 # A standalone libintl (e.g., GNU libintl) may be in use. 2604 if test $USE_NLS = yes; then 2605 AC_CHECK_HEADERS([libintl.h], [], USE_NLS=no) 2606 AC_SEARCH_LIBS(gettext, intl, [], USE_NLS=no) 2607 fi 2608 if test $USE_NLS = yes; then 2609 AC_DEFINE(_GLIBCXX_USE_NLS, 1, 2610 [Define if NLS translations are to be used.]) 2611 fi 2612 2613 AC_SUBST(USE_NLS) 2614 AC_SUBST(CLOCALE_H) 2615 AC_SUBST(CMESSAGES_H) 2616 AC_SUBST(CCODECVT_CC) 2617 AC_SUBST(CCOLLATE_CC) 2618 AC_SUBST(CCTYPE_CC) 2619 AC_SUBST(CMESSAGES_CC) 2620 AC_SUBST(CMONEY_CC) 2621 AC_SUBST(CNUMERIC_CC) 2622 AC_SUBST(CTIME_H) 2623 AC_SUBST(CTIME_CC) 2624 AC_SUBST(CLOCALE_CC) 2625 AC_SUBST(CLOCALE_INTERNAL_H) 2626]) 2627 2628 2629dnl 2630dnl Check for which std::allocator base class to use. The choice is 2631dnl mapped from a subdirectory of include/ext. 2632dnl 2633dnl Default is new. 2634dnl 2635AC_DEFUN([GLIBCXX_ENABLE_ALLOCATOR], [ 2636 AC_MSG_CHECKING([for std::allocator base class]) 2637 GLIBCXX_ENABLE(libstdcxx-allocator,auto,[[[=KIND]]], 2638 [use KIND for target std::allocator base], 2639 [permit new|malloc|mt|bitmap|pool|yes|no|auto]) 2640 2641 # If they didn't use this option switch, or if they specified --enable 2642 # with no specific model, we'll have to look for one. If they 2643 # specified --disable (???), do likewise. 2644 if test $enable_libstdcxx_allocator = no || 2645 test $enable_libstdcxx_allocator = yes; 2646 then 2647 enable_libstdcxx_allocator=auto 2648 fi 2649 2650 # Either a known package, or "auto". Auto implies the default choice 2651 # for a particular platform. 2652 enable_libstdcxx_allocator_flag=$enable_libstdcxx_allocator 2653 2654 # Probe for host-specific support if no specific model is specified. 2655 # Default to "new". 2656 if test $enable_libstdcxx_allocator_flag = auto; then 2657 case ${target_os} in 2658 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) 2659 enable_libstdcxx_allocator_flag=new 2660 ;; 2661 *) 2662 enable_libstdcxx_allocator_flag=new 2663 ;; 2664 esac 2665 fi 2666 AC_MSG_RESULT($enable_libstdcxx_allocator_flag) 2667 2668 2669 # Set configure bits for specified locale package 2670 case ${enable_libstdcxx_allocator_flag} in 2671 bitmap) 2672 ALLOCATOR_H=config/allocator/bitmap_allocator_base.h 2673 ALLOCATOR_NAME=__gnu_cxx::bitmap_allocator 2674 ;; 2675 malloc) 2676 ALLOCATOR_H=config/allocator/malloc_allocator_base.h 2677 ALLOCATOR_NAME=__gnu_cxx::malloc_allocator 2678 ;; 2679 mt) 2680 ALLOCATOR_H=config/allocator/mt_allocator_base.h 2681 ALLOCATOR_NAME=__gnu_cxx::__mt_alloc 2682 ;; 2683 new) 2684 ALLOCATOR_H=config/allocator/new_allocator_base.h 2685 ALLOCATOR_NAME=__gnu_cxx::new_allocator 2686 ;; 2687 pool) 2688 ALLOCATOR_H=config/allocator/pool_allocator_base.h 2689 ALLOCATOR_NAME=__gnu_cxx::__pool_alloc 2690 ;; 2691 esac 2692 2693 GLIBCXX_CONDITIONAL(ENABLE_ALLOCATOR_NEW, 2694 test $enable_libstdcxx_allocator_flag = new) 2695 AC_SUBST(ALLOCATOR_H) 2696 AC_SUBST(ALLOCATOR_NAME) 2697]) 2698 2699 2700dnl 2701dnl Check for whether the Boost-derived checks should be turned on. 2702dnl 2703dnl --enable-concept-checks turns them on. 2704dnl --disable-concept-checks leaves them off. 2705dnl + Usage: GLIBCXX_ENABLE_CONCEPT_CHECKS[(DEFAULT)] 2706dnl Where DEFAULT is either `yes' or `no'. 2707dnl 2708AC_DEFUN([GLIBCXX_ENABLE_CONCEPT_CHECKS], [ 2709 GLIBCXX_ENABLE(concept-checks,$1,,[use Boost-derived template checks]) 2710 if test $enable_concept_checks = yes; then 2711 AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS, 1, 2712 [Define to use concept checking code from the boost libraries.]) 2713 fi 2714]) 2715 2716dnl 2717dnl Use extern templates. 2718dnl 2719dnl --enable-extern-template defines _GLIBCXX_EXTERN_TEMPLATE to 1 2720dnl --disable-extern-template defines _GLIBCXX_EXTERN_TEMPLATE to 0 2721 2722dnl + Usage: GLIBCXX_ENABLE_TEMPLATE[(DEFAULT)] 2723dnl Where DEFAULT is `yes' or `no'. 2724dnl 2725AC_DEFUN([GLIBCXX_ENABLE_EXTERN_TEMPLATE], [ 2726 2727 GLIBCXX_ENABLE(extern-template,$1,,[enable extern template]) 2728 2729 AC_MSG_CHECKING([for extern template support]) 2730 AC_MSG_RESULT([$enable_extern_template]) 2731 2732 GLIBCXX_CONDITIONAL(ENABLE_EXTERN_TEMPLATE, test $enable_extern_template = yes) 2733]) 2734 2735dnl 2736dnl Use vtable verification. 2737dnl 2738dnl --enable-vtable-verify defines _GLIBCXX_VTABLE_VERIFY to 1 2739dnl --disable-vtable-verify defines _GLIBCXX_VTABLE_VERIFY to 0 2740 2741dnl + Usage: GLIBCXX_ENABLE_VTABLE_VERIFY[(DEFAULT)] 2742dnl Where DEFAULT is `yes' or `no'. 2743dnl 2744AC_DEFUN([GLIBCXX_ENABLE_VTABLE_VERIFY], [ 2745 2746 GLIBCXX_ENABLE(vtable-verify,$1,,[enable vtable verify]) 2747 2748 AC_MSG_CHECKING([for vtable verify support]) 2749 AC_MSG_RESULT([$enable_vtable_verify]) 2750 2751 vtv_cygmin=no 2752 if test $enable_vtable_verify = yes; then 2753 case ${target_os} in 2754 cygwin*|mingw32*) 2755 VTV_CXXFLAGS="-fvtable-verify=std -Wl,-lvtv,-u_vtable_map_vars_start,-u_vtable_map_vars_end" 2756 VTV_CXXLINKFLAGS="-L${toplevel_builddir}/libvtv/.libs -Wl,--rpath -Wl,${toplevel_builddir}/libvtv/.libs" 2757 vtv_cygmin=yes 2758 ;; 2759 darwin*) 2760 VTV_CXXFLAGS="-fvtable-verify=std -Wl,-u,_vtable_map_vars_start -Wl,-u,_vtable_map_vars_end" 2761 VTV_CXXLINKFLAGS="-L${toplevel_builddir}/libvtv/.libs -Wl,-rpath,${toplevel_builddir}/libvtv/.libs" 2762 ;; 2763 solaris2*) 2764 VTV_CXXFLAGS="-fvtable-verify=std -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end" 2765 VTV_CXXLINKFLAGS="-L${toplevel_builddir}/libvtv/.libs -Wl,-R -Wl,${toplevel_builddir}/libvtv/.libs" 2766 ;; 2767 *) 2768 VTV_CXXFLAGS="-fvtable-verify=std -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end" 2769 VTV_CXXLINKFLAGS="-L${toplevel_builddir}/libvtv/.libs -Wl,--rpath -Wl,${toplevel_builddir}/libvtv/.libs" 2770 ;; 2771 esac 2772 VTV_PCH_CXXFLAGS="-fvtable-verify=std" 2773 else 2774 VTV_CXXFLAGS= 2775 VTV_PCH_CXXFLAGS= 2776 VTV_CXXLINKFLAGS= 2777 fi 2778 2779 AC_SUBST(VTV_CXXFLAGS) 2780 AC_SUBST(VTV_PCH_CXXFLAGS) 2781 AC_SUBST(VTV_CXXLINKFLAGS) 2782 AM_CONDITIONAL(VTV_CYGMIN, test x$vtv_cygmin = xyes) 2783 GLIBCXX_CONDITIONAL(ENABLE_VTABLE_VERIFY, test $enable_vtable_verify = yes) 2784]) 2785 2786dnl 2787dnl Check for parallel mode pre-requisites, including OpenMP support. 2788dnl 2789dnl + Usage: GLIBCXX_ENABLE_PARALLEL 2790dnl 2791AC_DEFUN([GLIBCXX_ENABLE_PARALLEL], [ 2792 2793 enable_parallel=no; 2794 2795 # See if configured libgomp/omp.h exists. (libgomp may be in 2796 # noconfigdirs but not explicitly disabled.) 2797 if echo " ${TARGET_CONFIGDIRS} " | grep " libgomp " > /dev/null 2>&1 ; then 2798 enable_parallel=yes; 2799 else 2800 AC_MSG_NOTICE([target-libgomp not built]) 2801 fi 2802 2803 AC_MSG_CHECKING([for parallel mode support]) 2804 AC_MSG_RESULT([$enable_parallel]) 2805]) 2806 2807 2808dnl 2809dnl Check for which I/O library to use: stdio, or something specific. 2810dnl 2811dnl Default is stdio. 2812dnl 2813AC_DEFUN([GLIBCXX_ENABLE_CSTDIO], [ 2814 AC_MSG_CHECKING([for underlying I/O to use]) 2815 GLIBCXX_ENABLE(cstdio,stdio,[[[=PACKAGE]]], 2816 [use target-specific I/O package], [permit stdio]) 2817 2818 # Now that libio has been removed, you can have any color you want as long 2819 # as it's black. This is one big no-op until other packages are added, but 2820 # showing the framework never hurts. 2821 case ${enable_cstdio} in 2822 stdio) 2823 CSTDIO_H=config/io/c_io_stdio.h 2824 BASIC_FILE_H=config/io/basic_file_stdio.h 2825 BASIC_FILE_CC=config/io/basic_file_stdio.cc 2826 AC_MSG_RESULT(stdio) 2827 ;; 2828 esac 2829 2830 AC_SUBST(CSTDIO_H) 2831 AC_SUBST(BASIC_FILE_H) 2832 AC_SUBST(BASIC_FILE_CC) 2833]) 2834 2835 2836dnl 2837dnl Check for "unusual" flags to pass to the compiler while building. 2838dnl 2839dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing 2840dnl experimental flags such as -fpch, -fIMI, -Dfloat=char, etc. 2841dnl --disable-cxx-flags passes nothing. 2842dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html 2843dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html 2844dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html 2845dnl + Usage: GLIBCXX_ENABLE_CXX_FLAGS(default flags) 2846dnl If "default flags" is an empty string, the effect is the same 2847dnl as --disable or --enable=no. 2848dnl 2849AC_DEFUN([GLIBCXX_ENABLE_CXX_FLAGS], [dnl 2850 AC_MSG_CHECKING([for extra compiler flags for building]) 2851 GLIBCXX_ENABLE(cxx-flags,$1,[=FLAGS], 2852 [pass compiler FLAGS when building library], 2853 [case "x$enable_cxx_flags" in 2854 xno | x) enable_cxx_flags= ;; 2855 x-*) ;; 2856 *) AC_MSG_ERROR(_g_switch needs compiler flags as arguments) ;; 2857 esac]) 2858 2859 # Run through flags (either default or command-line) and set anything 2860 # extra (e.g., #defines) that must accompany particular g++ options. 2861 if test -n "$enable_cxx_flags"; then 2862 for f in $enable_cxx_flags; do 2863 case "$f" in 2864 -fhonor-std) ;; 2865 -*) ;; 2866 *) # and we're trying to pass /what/ exactly? 2867 AC_MSG_ERROR([compiler flags start with a -]) ;; 2868 esac 2869 done 2870 fi 2871 2872 EXTRA_CXX_FLAGS="$enable_cxx_flags" 2873 AC_MSG_RESULT($EXTRA_CXX_FLAGS) 2874 AC_SUBST(EXTRA_CXX_FLAGS) 2875]) 2876 2877 2878dnl 2879dnl Check to see if debugging libraries are to be built. 2880dnl 2881dnl --enable-libstdcxx-debug 2882dnl builds a separate set of debugging libraries in addition to the 2883dnl normal (shared, static) libstdc++ binaries. 2884dnl 2885dnl --disable-libstdcxx-debug 2886dnl builds only one (non-debug) version of libstdc++. 2887dnl 2888dnl --enable-libstdcxx-debug-flags=FLAGS 2889dnl iff --enable-debug == yes, then use FLAGS to build the debug library. 2890dnl 2891dnl + Usage: GLIBCXX_ENABLE_DEBUG[(DEFAULT)] 2892dnl Where DEFAULT is either `yes' or `no'. 2893dnl 2894AC_DEFUN([GLIBCXX_ENABLE_DEBUG], [ 2895 AC_MSG_CHECKING([for additional debug build]) 2896 GLIBCXX_ENABLE(libstdcxx-debug,$1,,[build extra debug library]) 2897 AC_MSG_RESULT($enable_libstdcxx_debug) 2898 GLIBCXX_CONDITIONAL(GLIBCXX_BUILD_DEBUG, test $enable_libstdcxx_debug = yes) 2899]) 2900 2901 2902dnl 2903dnl Check for explicit debug flags. 2904dnl 2905dnl --enable-libstdcxx-debug-flags='-O1' 2906dnl is a general method for passing flags to be used when 2907dnl building debug libraries with --enable-libstdcxx-debug. 2908dnl 2909dnl --disable-libstdcxx-debug-flags does nothing. 2910dnl + Usage: GLIBCXX_ENABLE_DEBUG_FLAGS(default flags) 2911dnl If "default flags" is an empty string, the effect is the same 2912dnl as --disable or --enable=no. 2913dnl 2914AC_DEFUN([GLIBCXX_ENABLE_DEBUG_FLAGS], [ 2915 GLIBCXX_ENABLE(libstdcxx-debug-flags,[$1],[=FLAGS], 2916 [pass compiler FLAGS when building debug library], 2917 [case "x$enable_libstdcxx_debug_flags" in 2918 xno | x) enable_libstdcxx_debug_flags= ;; 2919 x-*) ;; 2920 *) AC_MSG_ERROR(_g_switch needs compiler flags as arguments) ;; 2921 esac]) 2922 2923 # Option parsed, now set things appropriately 2924 DEBUG_FLAGS="$enable_libstdcxx_debug_flags" 2925 AC_SUBST(DEBUG_FLAGS) 2926 2927 AC_MSG_NOTICE([Debug build flags set to $DEBUG_FLAGS]) 2928]) 2929 2930 2931dnl 2932dnl Check if the user only wants a freestanding library implementation. 2933dnl 2934dnl --disable-hosted-libstdcxx will turn off most of the library build, 2935dnl installing only the headers required by [17.4.1.3] and the language 2936dnl support library. More than that will be built (to keep the Makefiles 2937dnl conveniently clean), but not installed. 2938dnl 2939dnl Sets: 2940dnl is_hosted (yes/no) 2941dnl 2942dnl Defines: 2943dnl _GLIBCXX_HOSTED (always defined, either to 1 or 0) 2944dnl 2945AC_DEFUN([GLIBCXX_ENABLE_HOSTED], [ 2946 AC_ARG_ENABLE([hosted-libstdcxx], 2947 AC_HELP_STRING([--disable-hosted-libstdcxx], 2948 [only build freestanding C++ runtime support]),, 2949 [case "$host" in 2950 arm*-*-symbianelf*) 2951 enable_hosted_libstdcxx=no 2952 ;; 2953 *) 2954 enable_hosted_libstdcxx=yes 2955 ;; 2956 esac]) 2957 if test "$enable_hosted_libstdcxx" = no; then 2958 AC_MSG_NOTICE([Only freestanding libraries will be built]) 2959 is_hosted=no 2960 hosted_define=0 2961 enable_abi_check=no 2962 enable_libstdcxx_pch=no 2963 else 2964 is_hosted=yes 2965 hosted_define=1 2966 fi 2967 GLIBCXX_CONDITIONAL(GLIBCXX_HOSTED, test $is_hosted = yes) 2968 AC_DEFINE_UNQUOTED(_GLIBCXX_HOSTED, $hosted_define, 2969 [Define to 1 if a full hosted library is built, or 0 if freestanding.]) 2970]) 2971 2972 2973dnl 2974dnl Check if the user wants a non-verbose library implementation. 2975dnl 2976dnl --disable-libstdcxx-verbose will turn off descriptive messages to 2977dnl standard error on termination. 2978dnl 2979dnl Defines: 2980dnl _GLIBCXX_VERBOSE (always defined, either to 1 or 0) 2981dnl 2982AC_DEFUN([GLIBCXX_ENABLE_VERBOSE], [ 2983 AC_ARG_ENABLE([libstdcxx-verbose], 2984 AC_HELP_STRING([--disable-libstdcxx-verbose], 2985 [disable termination messages to standard error]),, 2986 [enable_libstdcxx_verbose=yes]) 2987 if test x"$enable_libstdcxx_verbose" = xyes; then 2988 verbose_define=1 2989 else 2990 AC_MSG_NOTICE([verbose termination messages are disabled]) 2991 verbose_define=0 2992 fi 2993 AC_DEFINE_UNQUOTED(_GLIBCXX_VERBOSE, $verbose_define, 2994 [Define to 1 if a verbose library is built, or 0 otherwise.]) 2995]) 2996 2997 2998dnl 2999dnl Check for template specializations for the 'long long' type. 3000dnl The result determines only whether 'long long' I/O is enabled; things 3001dnl like numeric_limits<> specializations are always available. 3002dnl 3003dnl --enable-long-long defines _GLIBCXX_USE_LONG_LONG 3004dnl --disable-long-long leaves _GLIBCXX_USE_LONG_LONG undefined 3005dnl + Usage: GLIBCXX_ENABLE_LONG_LONG[(DEFAULT)] 3006dnl Where DEFAULT is either `yes' or `no'. 3007dnl 3008AC_DEFUN([GLIBCXX_ENABLE_LONG_LONG], [ 3009 GLIBCXX_ENABLE(long-long,$1,,[enable template specializations for 'long long']) 3010 if test $enable_long_long = yes; then 3011 AC_DEFINE(_GLIBCXX_USE_LONG_LONG, 1, 3012 [Define if code specialized for long long should be used.]) 3013 fi 3014 AC_MSG_CHECKING([for enabled long long specializations]) 3015 AC_MSG_RESULT([$enable_long_long]) 3016]) 3017 3018 3019dnl 3020dnl Check for decimal floating point. 3021dnl See: 3022dnl http://gcc.gnu.org/onlinedocs/gcc/Decimal-Float.html#Decimal-Float 3023dnl 3024dnl This checks to see if the host supports decimal floating point types. 3025dnl 3026dnl Defines: 3027dnl _GLIBCXX_USE_DECIMAL_FLOAT 3028dnl 3029AC_DEFUN([GLIBCXX_ENABLE_DECIMAL_FLOAT], [ 3030 3031 # Fake what AC_TRY_COMPILE does, without linking as this is 3032 # unnecessary for this test. 3033 3034 cat > conftest.$ac_ext << EOF 3035[#]line __oline__ "configure" 3036int main() 3037{ 3038 _Decimal32 d1; 3039 _Decimal64 d2; 3040 _Decimal128 d3; 3041 return 0; 3042} 3043EOF 3044 3045 AC_MSG_CHECKING([for ISO/IEC TR 24733 ]) 3046 if AC_TRY_EVAL(ac_compile); then 3047 AC_DEFINE(_GLIBCXX_USE_DECIMAL_FLOAT, 1, 3048 [Define if ISO/IEC TR 24733 decimal floating point types are supported on this host.]) 3049 enable_dfp=yes 3050 else 3051 enable_dfp=no 3052 fi 3053 AC_MSG_RESULT($enable_dfp) 3054 rm -f conftest* 3055]) 3056 3057dnl 3058dnl Check for GNU 128-bit integer and floating point types. 3059dnl 3060dnl Note: also checks that the types aren't standard types. 3061dnl 3062dnl Defines: 3063dnl _GLIBCXX_USE_INT128 3064dnl ENABLE_FLOAT128 3065dnl 3066AC_DEFUN([GLIBCXX_ENABLE_INT128_FLOAT128], [ 3067 3068 AC_LANG_SAVE 3069 AC_LANG_CPLUSPLUS 3070 3071 # Fake what AC_TRY_COMPILE does, without linking as this is 3072 # unnecessary for this test. 3073 3074 cat > conftest.$ac_ext << EOF 3075[#]line __oline__ "configure" 3076template<typename T1, typename T2> 3077 struct same 3078 { typedef T2 type; }; 3079 3080template<typename T> 3081 struct same<T, T>; 3082 3083int main() 3084{ 3085 typename same<long, __int128>::type i1; 3086 typename same<long long, __int128>::type i2; 3087} 3088EOF 3089 3090 AC_MSG_CHECKING([for __int128]) 3091 if AC_TRY_EVAL(ac_compile); then 3092 AC_DEFINE(_GLIBCXX_USE_INT128, 1, 3093 [Define if __int128 is supported on this host.]) 3094 enable_int128=yes 3095 else 3096 enable_int128=no 3097 fi 3098 AC_MSG_RESULT($enable_int128) 3099 rm -f conftest* 3100 3101 cat > conftest.$ac_ext << EOF 3102[#]line __oline__ "configure" 3103template<typename T1, typename T2> 3104 struct same 3105 { typedef T2 type; }; 3106 3107template<typename T> 3108 struct same<T, T>; 3109 3110int main() 3111{ 3112 typename same<double, __float128>::type f1; 3113 typename same<long double, __float128>::type f2; 3114} 3115EOF 3116 3117 AC_MSG_CHECKING([for __float128]) 3118 if AC_TRY_EVAL(ac_compile); then 3119 enable_float128=yes 3120 else 3121 enable_float128=no 3122 fi 3123 AC_MSG_RESULT($enable_float128) 3124 GLIBCXX_CONDITIONAL(ENABLE_FLOAT128, test $enable_float128 = yes) 3125 rm -f conftest* 3126 3127 AC_LANG_RESTORE 3128]) 3129 3130dnl 3131dnl Check for template specializations for the 'wchar_t' type. 3132dnl 3133dnl --enable-wchar_t defines _GLIBCXX_USE_WCHAR_T 3134dnl --disable-wchar_t leaves _GLIBCXX_USE_WCHAR_T undefined 3135dnl + Usage: GLIBCXX_ENABLE_WCHAR_T[(DEFAULT)] 3136dnl Where DEFAULT is either `yes' or `no'. 3137dnl 3138dnl Necessary support must also be present. 3139dnl 3140AC_DEFUN([GLIBCXX_ENABLE_WCHAR_T], [ 3141 GLIBCXX_ENABLE(wchar_t,$1,,[enable template specializations for 'wchar_t']) 3142 3143 # Test wchar.h for mbstate_t, which is needed for char_traits and fpos. 3144 AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no) 3145 AC_MSG_CHECKING([for mbstate_t]) 3146 AC_TRY_COMPILE([#include <wchar.h>], 3147 [mbstate_t teststate;], 3148 have_mbstate_t=yes, have_mbstate_t=no) 3149 AC_MSG_RESULT($have_mbstate_t) 3150 if test x"$have_mbstate_t" = xyes; then 3151 AC_DEFINE(HAVE_MBSTATE_T,1,[Define if mbstate_t exists in wchar.h.]) 3152 fi 3153 3154 # Test it always, for use in GLIBCXX_ENABLE_C99, together with 3155 # ac_has_wchar_h. 3156 AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no) 3157 3158 if test x"$enable_wchar_t" = x"yes"; then 3159 3160 AC_LANG_SAVE 3161 AC_LANG_CPLUSPLUS 3162 3163 if test x"$ac_has_wchar_h" = xyes && 3164 test x"$ac_has_wctype_h" = xyes; then 3165 AC_TRY_COMPILE([#include <wchar.h> 3166 #include <stddef.h> 3167 wint_t i; 3168 long l = WEOF; 3169 long j = WCHAR_MIN; 3170 long k = WCHAR_MAX; 3171 namespace test 3172 { 3173 using ::btowc; 3174 using ::fgetwc; 3175 using ::fgetws; 3176 using ::fputwc; 3177 using ::fputws; 3178 using ::fwide; 3179 using ::fwprintf; 3180 using ::fwscanf; 3181 using ::getwc; 3182 using ::getwchar; 3183 using ::mbrlen; 3184 using ::mbrtowc; 3185 using ::mbsinit; 3186 using ::mbsrtowcs; 3187 using ::putwc; 3188 using ::putwchar; 3189 using ::swprintf; 3190 using ::swscanf; 3191 using ::ungetwc; 3192 using ::vfwprintf; 3193 using ::vswprintf; 3194 using ::vwprintf; 3195 using ::wcrtomb; 3196 using ::wcscat; 3197 using ::wcschr; 3198 using ::wcscmp; 3199 using ::wcscoll; 3200 using ::wcscpy; 3201 using ::wcscspn; 3202 using ::wcsftime; 3203 using ::wcslen; 3204 using ::wcsncat; 3205 using ::wcsncmp; 3206 using ::wcsncpy; 3207 using ::wcspbrk; 3208 using ::wcsrchr; 3209 using ::wcsrtombs; 3210 using ::wcsspn; 3211 using ::wcsstr; 3212 using ::wcstod; 3213 using ::wcstok; 3214 using ::wcstol; 3215 using ::wcstoul; 3216 using ::wcsxfrm; 3217 using ::wctob; 3218 using ::wmemchr; 3219 using ::wmemcmp; 3220 using ::wmemcpy; 3221 using ::wmemmove; 3222 using ::wmemset; 3223 using ::wprintf; 3224 using ::wscanf; 3225 } 3226 ],[],[], [enable_wchar_t=no]) 3227 else 3228 enable_wchar_t=no 3229 fi 3230 3231 AC_LANG_RESTORE 3232 fi 3233 3234 if test x"$enable_wchar_t" = x"yes"; then 3235 AC_DEFINE(_GLIBCXX_USE_WCHAR_T, 1, 3236 [Define if code specialized for wchar_t should be used.]) 3237 fi 3238 3239 AC_MSG_CHECKING([for enabled wchar_t specializations]) 3240 AC_MSG_RESULT([$enable_wchar_t]) 3241]) 3242 3243 3244dnl 3245dnl Check to see if building and using a C++ precompiled header can be done. 3246dnl 3247dnl --enable-libstdcxx-pch=yes 3248dnl default, this shows intent to use stdc++.h.gch If it looks like it 3249dnl may work, after some light-hearted attempts to puzzle out compiler 3250dnl support, flip bits on in include/Makefile.am 3251dnl 3252dnl --disable-libstdcxx-pch 3253dnl turns off attempts to use or build stdc++.h.gch. 3254dnl 3255dnl Substs: 3256dnl glibcxx_PCHFLAGS 3257dnl 3258AC_DEFUN([GLIBCXX_ENABLE_PCH], [ 3259 GLIBCXX_ENABLE(libstdcxx-pch,$1,,[build pre-compiled libstdc++ headers]) 3260 if test $enable_libstdcxx_pch = yes; then 3261 AC_CACHE_CHECK([for compiler with PCH support], 3262 [glibcxx_cv_prog_CXX_pch], 3263 [ac_save_CXXFLAGS="$CXXFLAGS" 3264 CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated" 3265 AC_LANG_SAVE 3266 AC_LANG_CPLUSPLUS 3267 echo '#include <math.h>' > conftest.h 3268 if $CXX $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \ 3269 -o conftest.h.gch 1>&5 2>&1 && 3270 echo '#error "pch failed"' > conftest.h && 3271 echo '#include "conftest.h"' > conftest.cc && 3272 $CXX -c $CXXFLAGS $CPPFLAGS conftest.cc 1>&5 2>&1 ; 3273 then 3274 glibcxx_cv_prog_CXX_pch=yes 3275 else 3276 glibcxx_cv_prog_CXX_pch=no 3277 fi 3278 rm -f conftest* 3279 CXXFLAGS=$ac_save_CXXFLAGS 3280 AC_LANG_RESTORE 3281 ]) 3282 enable_libstdcxx_pch=$glibcxx_cv_prog_CXX_pch 3283 fi 3284 3285 AC_MSG_CHECKING([for enabled PCH]) 3286 AC_MSG_RESULT([$enable_libstdcxx_pch]) 3287 3288 GLIBCXX_CONDITIONAL(GLIBCXX_BUILD_PCH, test $enable_libstdcxx_pch = yes) 3289 if test $enable_libstdcxx_pch = yes; then 3290 glibcxx_PCHFLAGS="-include bits/stdc++.h" 3291 else 3292 glibcxx_PCHFLAGS="" 3293 fi 3294 AC_SUBST(glibcxx_PCHFLAGS) 3295]) 3296 3297 3298dnl 3299dnl Check for atomic builtins. 3300dnl See: 3301dnl http://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html 3302dnl 3303dnl This checks to see if the host supports the compiler-generated 3304dnl builtins for atomic operations for various integral sizes. Note, this 3305dnl is intended to be an all-or-nothing switch, so all the atomic operations 3306dnl that are used should be checked. 3307dnl 3308dnl Note: 3309dnl libgomp and libgfortran use a link test, see CHECK_SYNC_FETCH_AND_ADD. 3310dnl 3311AC_DEFUN([GLIBCXX_ENABLE_ATOMIC_BUILTINS], [ 3312 AC_LANG_SAVE 3313 AC_LANG_CPLUSPLUS 3314 old_CXXFLAGS="$CXXFLAGS" 3315 3316 # Do link tests if possible, instead asm tests, limited to some platforms 3317 # see discussion in PR target/40134, PR libstdc++/40133 and the thread 3318 # starting at http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00322.html 3319 atomic_builtins_link_tests=no 3320 if test x$gcc_no_link != xyes; then 3321 # Can do link tests. Limit to some tested platforms 3322 case "$host" in 3323 *-*-linux* | *-*-uclinux* | *-*-kfreebsd*-gnu | *-*-gnu*) 3324 atomic_builtins_link_tests=yes 3325 ;; 3326 esac 3327 fi 3328 3329 if test x$atomic_builtins_link_tests = xyes; then 3330 3331 # Do link tests. 3332 3333 CXXFLAGS="$CXXFLAGS -fno-exceptions" 3334 3335 AC_MSG_CHECKING([for atomic builtins for bool]) 3336 AC_CACHE_VAL(glibcxx_cv_atomic_bool, [ 3337 AC_TRY_LINK( 3338 [ ], 3339 [typedef bool atomic_type; 3340 atomic_type c1; 3341 atomic_type c2; 3342 atomic_type c3(0); 3343 // N.B. __atomic_fetch_add is not supported for bool. 3344 __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, 3345 __ATOMIC_RELAXED); 3346 __atomic_test_and_set(&c1, __ATOMIC_RELAXED); 3347 __atomic_load_n(&c1, __ATOMIC_RELAXED); 3348 ], 3349 [glibcxx_cv_atomic_bool=yes], 3350 [glibcxx_cv_atomic_bool=no]) 3351 ]) 3352 AC_MSG_RESULT($glibcxx_cv_atomic_bool) 3353 3354 AC_MSG_CHECKING([for atomic builtins for short]) 3355 AC_CACHE_VAL(glibcxx_cv_atomic_short, [ 3356 AC_TRY_LINK( 3357 [ ], 3358 [typedef short atomic_type; 3359 atomic_type c1; 3360 atomic_type c2; 3361 atomic_type c3(0); 3362 __atomic_fetch_add(&c1, c2, __ATOMIC_RELAXED); 3363 __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, 3364 __ATOMIC_RELAXED); 3365 __atomic_test_and_set(&c1, __ATOMIC_RELAXED); 3366 __atomic_load_n(&c1, __ATOMIC_RELAXED); 3367 ], 3368 [glibcxx_cv_atomic_short=yes], 3369 [glibcxx_cv_atomic_short=no]) 3370 ]) 3371 AC_MSG_RESULT($glibcxx_cv_atomic_short) 3372 3373 AC_MSG_CHECKING([for atomic builtins for int]) 3374 AC_CACHE_VAL(glibcxx_cv_atomic_int, [ 3375 AC_TRY_LINK( 3376 [ ], 3377 [typedef int atomic_type; 3378 atomic_type c1; 3379 atomic_type c2; 3380 atomic_type c3(0); 3381 __atomic_fetch_add(&c1, c2, __ATOMIC_RELAXED); 3382 __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, 3383 __ATOMIC_RELAXED); 3384 __atomic_test_and_set(&c1, __ATOMIC_RELAXED); 3385 __atomic_load_n(&c1, __ATOMIC_RELAXED); 3386 ], 3387 [glibcxx_cv_atomic_int=yes], 3388 [glibcxx_cv_atomic_int=no]) 3389 ]) 3390 AC_MSG_RESULT($glibcxx_cv_atomic_int) 3391 3392 AC_MSG_CHECKING([for atomic builtins for long long]) 3393 AC_CACHE_VAL(glibcxx_cv_atomic_long_long, [ 3394 AC_TRY_LINK( 3395 [ ], 3396 [typedef long long atomic_type; 3397 atomic_type c1; 3398 atomic_type c2; 3399 atomic_type c3(0); 3400 __atomic_fetch_add(&c1, c2, __ATOMIC_RELAXED); 3401 __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, 3402 __ATOMIC_RELAXED); 3403 __atomic_test_and_set(&c1, __ATOMIC_RELAXED); 3404 __atomic_load_n(&c1, __ATOMIC_RELAXED); 3405 ], 3406 [glibcxx_cv_atomic_long_long=yes], 3407 [glibcxx_cv_atomic_long_long=no]) 3408 ]) 3409 AC_MSG_RESULT($glibcxx_cv_atomic_long_long) 3410 3411 else 3412 3413 # Do asm tests. 3414 3415 # Compile unoptimized. 3416 CXXFLAGS='-O0 -S' 3417 3418 # Fake what AC_TRY_COMPILE does. 3419 3420 cat > conftest.$ac_ext << EOF 3421[#]line __oline__ "configure" 3422int main() 3423{ 3424 typedef bool atomic_type; 3425 atomic_type c1; 3426 atomic_type c2; 3427 atomic_type c3(0); 3428 // N.B. __atomic_fetch_add is not supported for bool. 3429 __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, 3430 __ATOMIC_RELAXED); 3431 __atomic_test_and_set(&c1, __ATOMIC_RELAXED); 3432 __atomic_load_n(&c1, __ATOMIC_RELAXED); 3433 3434 return 0; 3435} 3436EOF 3437 3438 AC_MSG_CHECKING([for atomic builtins for bool]) 3439 if AC_TRY_EVAL(ac_compile); then 3440 if grep __atomic_ conftest.s >/dev/null 2>&1 ; then 3441 glibcxx_cv_atomic_bool=no 3442 else 3443 glibcxx_cv_atomic_bool=yes 3444 fi 3445 fi 3446 AC_MSG_RESULT($glibcxx_cv_atomic_bool) 3447 rm -f conftest* 3448 3449 cat > conftest.$ac_ext << EOF 3450[#]line __oline__ "configure" 3451int main() 3452{ 3453 typedef short atomic_type; 3454 atomic_type c1; 3455 atomic_type c2; 3456 atomic_type c3(0); 3457 __atomic_fetch_add(&c1, c2, __ATOMIC_RELAXED); 3458 __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, 3459 __ATOMIC_RELAXED); 3460 __atomic_test_and_set(&c1, __ATOMIC_RELAXED); 3461 __atomic_load_n(&c1, __ATOMIC_RELAXED); 3462 3463 return 0; 3464} 3465EOF 3466 3467 AC_MSG_CHECKING([for atomic builtins for short]) 3468 if AC_TRY_EVAL(ac_compile); then 3469 if grep __atomic_ conftest.s >/dev/null 2>&1 ; then 3470 glibcxx_cv_atomic_short=no 3471 else 3472 glibcxx_cv_atomic_short=yes 3473 fi 3474 fi 3475 AC_MSG_RESULT($glibcxx_cv_atomic_short) 3476 rm -f conftest* 3477 3478 cat > conftest.$ac_ext << EOF 3479[#]line __oline__ "configure" 3480int main() 3481{ 3482 // NB: _Atomic_word not necessarily int. 3483 typedef int atomic_type; 3484 atomic_type c1; 3485 atomic_type c2; 3486 atomic_type c3(0); 3487 __atomic_fetch_add(&c1, c2, __ATOMIC_RELAXED); 3488 __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, 3489 __ATOMIC_RELAXED); 3490 __atomic_test_and_set(&c1, __ATOMIC_RELAXED); 3491 __atomic_load_n(&c1, __ATOMIC_RELAXED); 3492 3493 return 0; 3494} 3495EOF 3496 3497 AC_MSG_CHECKING([for atomic builtins for int]) 3498 if AC_TRY_EVAL(ac_compile); then 3499 if grep __atomic_ conftest.s >/dev/null 2>&1 ; then 3500 glibcxx_cv_atomic_int=no 3501 else 3502 glibcxx_cv_atomic_int=yes 3503 fi 3504 fi 3505 AC_MSG_RESULT($glibcxx_cv_atomic_int) 3506 rm -f conftest* 3507 3508 cat > conftest.$ac_ext << EOF 3509[#]line __oline__ "configure" 3510int main() 3511{ 3512 typedef long long atomic_type; 3513 atomic_type c1; 3514 atomic_type c2; 3515 atomic_type c3(0); 3516 __atomic_fetch_add(&c1, c2, __ATOMIC_RELAXED); 3517 __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, 3518 __ATOMIC_RELAXED); 3519 __atomic_test_and_set(&c1, __ATOMIC_RELAXED); 3520 __atomic_load_n(&c1, __ATOMIC_RELAXED); 3521 3522 return 0; 3523} 3524EOF 3525 3526 AC_MSG_CHECKING([for atomic builtins for long long]) 3527 if AC_TRY_EVAL(ac_compile); then 3528 if grep __atomic_ conftest.s >/dev/null 2>&1 ; then 3529 glibcxx_cv_atomic_long_long=no 3530 else 3531 glibcxx_cv_atomic_long_long=yes 3532 fi 3533 fi 3534 AC_MSG_RESULT($glibcxx_cv_atomic_long_long) 3535 rm -f conftest* 3536 3537 fi 3538 3539 CXXFLAGS="$old_CXXFLAGS" 3540 AC_LANG_RESTORE 3541 3542 # Set atomicity_dir to builtins if all but the long long test above passes, 3543 # or if the builtins were already chosen (e.g. by configure.host). 3544 if { test "$glibcxx_cv_atomic_bool" = yes \ 3545 && test "$glibcxx_cv_atomic_short" = yes \ 3546 && test "$glibcxx_cv_atomic_int" = yes; } \ 3547 || test "$atomicity_dir" = "cpu/generic/atomicity_builtins"; then 3548 AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS, 1, 3549 [Define if the compiler supports C++11 atomics.]) 3550 atomicity_dir=cpu/generic/atomicity_builtins 3551 fi 3552 3553 # If still generic, set to mutex. 3554 if test $atomicity_dir = "cpu/generic" ; then 3555 atomicity_dir=cpu/generic/atomicity_mutex 3556 AC_MSG_WARN([No native atomic operations are provided for this platform.]) 3557 if test "x$target_thread_file" = xsingle; then 3558 AC_MSG_WARN([They cannot be faked when thread support is disabled.]) 3559 AC_MSG_WARN([Thread-safety of certain classes is not guaranteed.]) 3560 else 3561 AC_MSG_WARN([They will be faked using a mutex.]) 3562 AC_MSG_WARN([Performance of certain classes will degrade as a result.]) 3563 fi 3564 fi 3565 3566]) 3567 3568dnl 3569dnl Set default lock policy for synchronizing shared_ptr reference counting. 3570dnl 3571dnl --with-libstdcxx-lock-policy=auto 3572dnl Use atomic operations for shared_ptr reference counting only if 3573dnl the default target supports atomic compare-and-swap. 3574dnl --with-libstdcxx-lock-policy=atomic 3575dnl Use atomic operations for shared_ptr reference counting. 3576dnl --with-libstdcxx-lock-policy=mutex 3577dnl Use a mutex to synchronize shared_ptr reference counting. 3578dnl 3579dnl This controls the value of __gnu_cxx::__default_lock_policy, which 3580dnl determines how shared_ptr reference counts are synchronized. 3581dnl The option "atomic" means that atomic operations should be used, 3582dnl "mutex" means that a mutex will be used. The default option, "auto", 3583dnl will check if the target supports the compiler-generated builtins 3584dnl for atomic compare-and-swap operations for 2-byte and 4-byte integers, 3585dnl and will use "atomic" if supported, "mutex" otherwise. 3586dnl This option is ignored if the thread model used by GCC is "single", 3587dnl as no synchronization is used at all in that case. 3588dnl This option affects the library ABI (except in the "single" thread model). 3589dnl 3590dnl Defines _GLIBCXX_HAVE_ATOMIC_LOCK_POLICY to 1 if atomics should be used. 3591dnl 3592AC_DEFUN([GLIBCXX_ENABLE_LOCK_POLICY], [ 3593 3594 AC_ARG_WITH([libstdcxx-lock-policy], 3595 AC_HELP_STRING([--with-libstdcxx-lock-policy={atomic,mutex,auto}], 3596 [synchronization policy for shared_ptr reference counting [default=auto]]), 3597 [libstdcxx_atomic_lock_policy=$withval], 3598 [libstdcxx_atomic_lock_policy=auto]) 3599 3600 case "$libstdcxx_atomic_lock_policy" in 3601 atomic|mutex|auto) ;; 3602 *) AC_MSG_ERROR([Invalid argument for --with-libstdcxx-lock-policy]) ;; 3603 esac 3604 AC_MSG_CHECKING([for lock policy for shared_ptr reference counts]) 3605 3606 if test x"$libstdcxx_atomic_lock_policy" = x"auto"; then 3607 AC_LANG_SAVE 3608 AC_LANG_CPLUSPLUS 3609 ac_save_CXXFLAGS="$CXXFLAGS" 3610 3611 dnl Why do we care about 2-byte CAS on targets with 4-byte _Atomic_word?! 3612 AC_TRY_COMPILE([ 3613 #if ! defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 3614 # error "No 2-byte compare-and-swap" 3615 #elif ! defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 3616 # error "No 4-byte compare-and-swap" 3617 #endif 3618 ],, 3619 [libstdcxx_atomic_lock_policy=atomic], 3620 [libstdcxx_atomic_lock_policy=mutex]) 3621 AC_LANG_RESTORE 3622 CXXFLAGS="$ac_save_CXXFLAGS" 3623 fi 3624 3625 if test x"$libstdcxx_atomic_lock_policy" = x"atomic"; then 3626 AC_MSG_RESULT(atomic) 3627 AC_DEFINE(HAVE_ATOMIC_LOCK_POLICY,1, 3628 [Defined if shared_ptr reference counting should use atomic operations.]) 3629 else 3630 AC_MSG_RESULT(mutex) 3631 fi 3632 3633]) 3634 3635dnl 3636dnl Allow visibility attributes to be used on namespaces, objects, etc. 3637dnl 3638dnl --enable-libstdcxx-visibility enables attempt to use visibility attributes. 3639dnl --disable-libstdcxx-visibility turns off all use of visibility attributes. 3640dnl + Usage: GLIBCXX_ENABLE_LIBSTDCXX_VISIBILITY[(DEFAULT)] 3641dnl Where DEFAULT is 'yes'. 3642dnl 3643AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_VISIBILITY], [ 3644GLIBCXX_ENABLE(libstdcxx-visibility,$1,,[enables visibility safe usage]) 3645 3646if test x$enable_libstdcxx_visibility = xyes ; then 3647 dnl all hail libgfortran 3648 dnl Check whether the target supports hidden visibility. 3649 AC_CACHE_CHECK([whether the target supports hidden visibility], 3650 glibcxx_cv_have_attribute_visibility, [ 3651 save_CFLAGS="$CFLAGS" 3652 CFLAGS="$CFLAGS -Werror" 3653 AC_TRY_COMPILE([void __attribute__((visibility("hidden"))) foo(void) { }], 3654 [], glibcxx_cv_have_attribute_visibility=yes, 3655 glibcxx_cv_have_attribute_visibility=no) 3656 CFLAGS="$save_CFLAGS"]) 3657 if test $glibcxx_cv_have_attribute_visibility = no; then 3658 enable_libstdcxx_visibility=no 3659 fi 3660fi 3661 3662GLIBCXX_CONDITIONAL(ENABLE_VISIBILITY, test $enable_libstdcxx_visibility = yes) 3663AC_MSG_NOTICE([visibility supported: $enable_libstdcxx_visibility]) 3664]) 3665 3666 3667dnl 3668dnl Add version tags to symbols in shared library (or not), additionally 3669dnl marking other symbols as private/local (or not). 3670dnl 3671dnl Sets libtool_VERSION, and determines shared library SONAME. 3672dnl 3673dnl This depends on GLIBCXX CHECK_LINKER_FEATURES, but without it assumes no. 3674dnl 3675dnl --enable-symvers=style adds a version script to the linker call when 3676dnl creating the shared library. The choice of version script is 3677dnl controlled by 'style'. 3678dnl --disable-symvers does not. 3679dnl 3680dnl + Usage: GLIBCXX_ENABLE_SYMVERS[(DEFAULT)] 3681dnl Where DEFAULT is either 'yes' or 'no'. Passing `yes' tries to 3682dnl choose a default style based on linker characteristics. Passing 3683dnl 'no' disables versioning. 3684dnl 3685AC_DEFUN([GLIBCXX_ENABLE_SYMVERS], [ 3686 3687GLIBCXX_ENABLE(symvers,$1,[[[=STYLE]]], 3688 [enables symbol versioning of the shared library], 3689 [permit yes|no|gnu|gnu-versioned-namespace|darwin|darwin-export|sun]) 3690 3691# If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we 3692# don't know enough about $LD to do tricks... 3693AC_REQUIRE([GLIBCXX_CHECK_LINKER_FEATURES]) 3694# Sun style symbol versions needs GNU c++filt for make_sunver.pl to work 3695# with extern "C++" in version scripts. 3696AC_REQUIRE([GCC_PROG_GNU_CXXFILT]) 3697 3698# Turn a 'yes' into a suitable default. 3699if test x$enable_symvers = xyes ; then 3700 if test $enable_shared = no || test "x$LD" = x || test x$gcc_no_link = xyes; then 3701 enable_symvers=no 3702 else 3703 if test $with_gnu_ld = yes ; then 3704 case ${target_os} in 3705 hpux*) 3706 enable_symvers=no ;; 3707 *) 3708 enable_symvers=gnu ;; 3709 esac 3710 else 3711 case ${target_os} in 3712 darwin*) 3713 enable_symvers=darwin ;; 3714 # Sun symbol versioning exists since Solaris 2.5. 3715 solaris2.[[5-9]]* | solaris2.1[[0-9]]*) 3716 # make_sunver.pl needs GNU c++filt to support extern "C++" in 3717 # version scripts, so disable symbol versioning if none can be 3718 # found. 3719 if test -z "$ac_cv_path_CXXFILT"; then 3720 AC_MSG_WARN([=== You have requested Sun symbol versioning, but]) 3721 AC_MSG_WARN([=== no GNU c++filt could be found.]) 3722 AC_MSG_WARN([=== Symbol versioning will be disabled.]) 3723 enable_symvers=no 3724 else 3725 enable_symvers=sun 3726 fi 3727 ;; 3728 *) 3729 enable_symvers=no ;; 3730 esac 3731 fi 3732 fi 3733fi 3734 3735# Check to see if 'darwin' or 'darwin-export' can win. 3736if test x$enable_symvers = xdarwin-export ; then 3737 enable_symvers=darwin 3738fi 3739 3740# Check if 'sun' was requested on non-Solaris 2 platforms. 3741if test x$enable_symvers = xsun ; then 3742 case ${target_os} in 3743 solaris2*) 3744 # All fine. 3745 ;; 3746 *) 3747 # Unlikely to work. 3748 AC_MSG_WARN([=== You have requested Sun symbol versioning, but]) 3749 AC_MSG_WARN([=== you are not targetting Solaris 2.]) 3750 AC_MSG_WARN([=== Symbol versioning will be disabled.]) 3751 enable_symvers=no 3752 ;; 3753 esac 3754fi 3755 3756# Check to see if 'gnu' can win. 3757if test $enable_symvers = gnu || 3758 test $enable_symvers = gnu-versioned-namespace || 3759 test $enable_symvers = sun; then 3760 # Check to see if libgcc_s exists, indicating that shared libgcc is possible. 3761 AC_MSG_CHECKING([for shared libgcc]) 3762 ac_save_CFLAGS="$CFLAGS" 3763 CFLAGS=' -lgcc_s' 3764 AC_TRY_LINK(, [return 0;], glibcxx_shared_libgcc=yes, glibcxx_shared_libgcc=no) 3765 CFLAGS="$ac_save_CFLAGS" 3766 if test $glibcxx_shared_libgcc = no; then 3767 cat > conftest.c <<EOF 3768int main (void) { return 0; } 3769EOF 3770changequote(,)dnl 3771 glibcxx_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ 3772 -shared -shared-libgcc -o conftest.so \ 3773 conftest.c -v 2>&1 >/dev/null \ 3774 | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'` 3775changequote([,])dnl 3776 rm -f conftest.c conftest.so 3777 if test x${glibcxx_libgcc_s_suffix+set} = xset; then 3778 CFLAGS=" -lgcc_s$glibcxx_libgcc_s_suffix" 3779 AC_TRY_LINK(, [return 0;], glibcxx_shared_libgcc=yes) 3780 CFLAGS="$ac_save_CFLAGS" 3781 fi 3782 fi 3783 AC_MSG_RESULT($glibcxx_shared_libgcc) 3784 3785 # For GNU ld, we need at least this version. The format is described in 3786 # GLIBCXX_CHECK_LINKER_FEATURES above. 3787 glibcxx_min_gnu_ld_version=21400 3788 3789 # If no shared libgcc, can't win. 3790 if test $glibcxx_shared_libgcc != yes; then 3791 AC_MSG_WARN([=== You have requested GNU symbol versioning, but]) 3792 AC_MSG_WARN([=== you are not building a shared libgcc_s.]) 3793 AC_MSG_WARN([=== Symbol versioning will be disabled.]) 3794 enable_symvers=no 3795 elif test $with_gnu_ld != yes && test $enable_symvers = sun; then 3796 : All interesting versions of Sun ld support sun style symbol versioning. 3797 elif test $with_gnu_ld != yes ; then 3798 # just fail for now 3799 AC_MSG_WARN([=== You have requested GNU symbol versioning, but]) 3800 AC_MSG_WARN([=== you are not using the GNU linker.]) 3801 AC_MSG_WARN([=== Symbol versioning will be disabled.]) 3802 enable_symvers=no 3803 elif test $glibcxx_ld_is_gold = yes ; then 3804 : All versions of gold support symbol versioning. 3805 elif test $glibcxx_gnu_ld_version -lt $glibcxx_min_gnu_ld_version ; then 3806 # The right tools, the right setup, but too old. Fallbacks? 3807 AC_MSG_WARN(=== Linker version $glibcxx_gnu_ld_version is too old for) 3808 AC_MSG_WARN(=== full symbol versioning support in this release of GCC.) 3809 AC_MSG_WARN(=== You would need to upgrade your binutils to version) 3810 AC_MSG_WARN(=== $glibcxx_min_gnu_ld_version or later and rebuild GCC.) 3811 AC_MSG_WARN([=== Symbol versioning will be disabled.]) 3812 enable_symvers=no 3813 fi 3814fi 3815 3816# For libtool versioning info, format is CURRENT:REVISION:AGE 3817libtool_VERSION=6:28:0 3818 3819# Everything parsed; figure out what files and settings to use. 3820case $enable_symvers in 3821 no) 3822 SYMVER_FILE=config/abi/pre/none.ver 3823 ;; 3824 gnu) 3825 SYMVER_FILE=config/abi/pre/gnu.ver 3826 AC_DEFINE(_GLIBCXX_SYMVER_GNU, 1, 3827 [Define to use GNU versioning in the shared library.]) 3828 ;; 3829 gnu-versioned-namespace) 3830 libtool_VERSION=8:0:0 3831 SYMVER_FILE=config/abi/pre/gnu-versioned-namespace.ver 3832 AC_DEFINE(_GLIBCXX_SYMVER_GNU_NAMESPACE, 1, 3833 [Define to use GNU namespace versioning in the shared library.]) 3834 ;; 3835 darwin) 3836 SYMVER_FILE=config/abi/pre/gnu.ver 3837 AC_DEFINE(_GLIBCXX_SYMVER_DARWIN, 1, 3838 [Define to use darwin versioning in the shared library.]) 3839 ;; 3840 sun) 3841 SYMVER_FILE=config/abi/pre/gnu.ver 3842 AC_DEFINE(_GLIBCXX_SYMVER_SUN, 1, 3843 [Define to use Sun versioning in the shared library.]) 3844 ;; 3845esac 3846 3847if test x$enable_symvers != xno ; then 3848 AC_DEFINE(_GLIBCXX_SYMVER, 1, 3849 [Define to use symbol versioning in the shared library.]) 3850fi 3851 3852AC_CACHE_CHECK([whether the target supports .symver directive], 3853 glibcxx_cv_have_as_symver_directive, [ 3854 AC_TRY_COMPILE([void foo (void); __asm (".symver foo, bar@SYMVER");], 3855 [], glibcxx_cv_have_as_symver_directive=yes, 3856 glibcxx_cv_have_as_symver_directive=no)]) 3857if test $glibcxx_cv_have_as_symver_directive = yes; then 3858 AC_DEFINE(HAVE_AS_SYMVER_DIRECTIVE, 1, 3859 [Define to 1 if the target assembler supports .symver directive.]) 3860fi 3861 3862AC_SUBST(SYMVER_FILE) 3863AC_SUBST(port_specific_symbol_files) 3864GLIBCXX_CONDITIONAL(ENABLE_SYMVERS, test $enable_symvers != no) 3865GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_GNU, test $enable_symvers = gnu) 3866GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_GNU_NAMESPACE, test $enable_symvers = gnu-versioned-namespace) 3867GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_DARWIN, test $enable_symvers = darwin) 3868GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_SUN, test $enable_symvers = sun) 3869AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers) 3870 3871if test $enable_symvers != no ; then 3872 case ${target_os} in 3873 # The Solaris 2 runtime linker doesn't support the GNU extension of 3874 # binding the same symbol to different versions 3875 solaris2*) 3876 ;; 3877 # Other platforms with GNU symbol versioning (GNU/Linux, more?) do. 3878 *) 3879 AC_DEFINE(HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT, 1, 3880 [Define to 1 if the target runtime linker supports binding the same symbol to different versions.]) 3881 ;; 3882 esac 3883fi 3884 3885# Now, set up compatibility support, if any. 3886# In addition, need this to deal with std::size_t mangling in 3887# src/compatibility.cc. In a perfect world, could use 3888# typeid(std::size_t).name()[0] to do direct substitution. 3889AC_MSG_CHECKING([for size_t as unsigned int]) 3890ac_save_CFLAGS="$CFLAGS" 3891CFLAGS="-Werror" 3892AC_TRY_COMPILE(, [__SIZE_TYPE__* stp; unsigned int* uip; stp = uip;], 3893 [glibcxx_size_t_is_i=yes], [glibcxx_size_t_is_i=no]) 3894CFLAGS=$ac_save_CFLAGS 3895if test "$glibcxx_size_t_is_i" = yes; then 3896 AC_DEFINE(_GLIBCXX_SIZE_T_IS_UINT, 1, [Define if size_t is unsigned int.]) 3897fi 3898AC_MSG_RESULT([$glibcxx_size_t_is_i]) 3899 3900AC_MSG_CHECKING([for ptrdiff_t as int]) 3901ac_save_CFLAGS="$CFLAGS" 3902CFLAGS="-Werror" 3903AC_TRY_COMPILE(, [__PTRDIFF_TYPE__* ptp; int* ip; ptp = ip;], 3904 [glibcxx_ptrdiff_t_is_i=yes], [glibcxx_ptrdiff_t_is_i=no]) 3905CFLAGS=$ac_save_CFLAGS 3906if test "$glibcxx_ptrdiff_t_is_i" = yes; then 3907 AC_DEFINE(_GLIBCXX_PTRDIFF_T_IS_INT, 1, [Define if ptrdiff_t is int.]) 3908fi 3909AC_MSG_RESULT([$glibcxx_ptrdiff_t_is_i]) 3910]) 3911 3912 3913dnl 3914dnl Setup to use the gcc gthr.h thread-specific memory and mutex model. 3915dnl We must stage the required headers so that they will be installed 3916dnl with the library (unlike libgcc, the STL implementation is provided 3917dnl solely within headers). Since we must not inject random user-space 3918dnl macro names into user-provided C++ code, we first stage into <file>-in 3919dnl and process to <file> with an output command. The reason for a two- 3920dnl stage process here is to correctly handle $srcdir!=$objdir without 3921dnl having to write complex code (the sed commands to clean the macro 3922dnl namespace are complex and fragile enough as it is). We must also 3923dnl add a relative path so that -I- is supported properly. 3924dnl 3925dnl Substs: 3926dnl thread_header 3927dnl 3928AC_DEFUN([GLIBCXX_ENABLE_THREADS], [ 3929 AC_MSG_CHECKING([for thread model used by GCC]) 3930 target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'` 3931 AC_MSG_RESULT([$target_thread_file]) 3932 GCC_AC_THREAD_HEADER([$target_thread_file]) 3933]) 3934 3935 3936dnl 3937dnl Check if gthread implementation defines the types and functions 3938dnl required by the c++0x thread library. Conforming gthread 3939dnl implementations can define __GTHREADS_CXX0X to enable use with c++0x. 3940dnl 3941dnl GLIBCXX_ENABLE_SYMVERS must be done before this. 3942dnl 3943AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [ 3944 GLIBCXX_ENABLE(libstdcxx-threads,auto,,[enable C++11 threads support]) 3945 3946 if test x$enable_libstdcxx_threads = xauto || 3947 test x$enable_libstdcxx_threads = xyes; then 3948 3949 AC_LANG_SAVE 3950 AC_LANG_CPLUSPLUS 3951 3952 ac_save_CXXFLAGS="$CXXFLAGS" 3953 CXXFLAGS="$CXXFLAGS -fno-exceptions \ 3954 -I${toplevel_srcdir}/libgcc -I${toplevel_builddir}/libgcc" 3955 3956 target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'` 3957 case $target_thread_file in 3958 posix) 3959 CXXFLAGS="$CXXFLAGS -DSUPPORTS_WEAK -DGTHREAD_USE_WEAK -D_PTHREADS" 3960 esac 3961 3962 AC_MSG_CHECKING([whether it can be safely assumed that mutex_timedlock is available]) 3963 3964 AC_TRY_COMPILE([#include <unistd.h>], 3965 [ 3966 // In case of POSIX threads check _POSIX_TIMEOUTS. 3967 #if (defined(_PTHREADS) \ 3968 && (!defined(_POSIX_TIMEOUTS) || _POSIX_TIMEOUTS <= 0)) 3969 #error 3970 #endif 3971 ], [ac_gthread_use_mutex_timedlock=1], [ac_gthread_use_mutex_timedlock=0]) 3972 3973 AC_DEFINE_UNQUOTED(_GTHREAD_USE_MUTEX_TIMEDLOCK, $ac_gthread_use_mutex_timedlock, 3974 [Define to 1 if mutex_timedlock is available.]) 3975 3976 if test $ac_gthread_use_mutex_timedlock = 1 ; then res_mutex_timedlock=yes ; 3977 else res_mutex_timedlock=no ; fi 3978 AC_MSG_RESULT([$res_mutex_timedlock]) 3979 3980 AC_MSG_CHECKING([for gthreads library]) 3981 3982 AC_TRY_COMPILE([#include "gthr.h"], 3983 [ 3984 #ifndef __GTHREADS_CXX0X 3985 #error 3986 #endif 3987 ], [ac_has_gthreads=yes], [ac_has_gthreads=no]) 3988 else 3989 ac_has_gthreads=no 3990 fi 3991 3992 AC_MSG_RESULT([$ac_has_gthreads]) 3993 3994 if test x"$ac_has_gthreads" = x"yes"; then 3995 AC_DEFINE(_GLIBCXX_HAS_GTHREADS, 1, 3996 [Define if gthreads library is available.]) 3997 3998 # Also check for pthread_rwlock_t for std::shared_timed_mutex in C++14 3999 AC_CHECK_TYPE([pthread_rwlock_t], 4000 [AC_DEFINE([_GLIBCXX_USE_PTHREAD_RWLOCK_T], 1, 4001 [Define if POSIX read/write locks are available in <gthr.h>.])], 4002 [], 4003 [#include "gthr.h"]) 4004 fi 4005 4006 CXXFLAGS="$ac_save_CXXFLAGS" 4007 AC_LANG_RESTORE 4008]) 4009 4010 4011# Check whether LC_MESSAGES is available in <locale.h>. 4012# Ulrich Drepper <drepper@cygnus.com>, 1995. 4013# 4014# This file file be copied and used freely without restrictions. It can 4015# be used in projects which are not available under the GNU Public License 4016# but which still want to provide support for the GNU gettext functionality. 4017# Please note that the actual code is *not* freely available. 4018AC_DEFUN([AC_LC_MESSAGES], [ 4019 AC_CHECK_HEADER(locale.h, [ 4020 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES, 4021 [AC_TRY_COMPILE([#include <locale.h>], [return LC_MESSAGES], 4022 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)]) 4023 if test $ac_cv_val_LC_MESSAGES = yes; then 4024 AC_DEFINE(HAVE_LC_MESSAGES, 1, 4025 [Define if LC_MESSAGES is available in <locale.h>.]) 4026 fi 4027 ]) 4028]) 4029 4030dnl 4031dnl Check whether rdrand is supported in the assembler. 4032AC_DEFUN([GLIBCXX_CHECK_X86_RDRAND], [ 4033 AC_MSG_CHECKING([for rdrand support in assembler]) 4034 AC_CACHE_VAL(ac_cv_x86_rdrand, [ 4035 ac_cv_x86_rdrand=no 4036 case "$target" in 4037 i?86-*-* | \ 4038 x86_64-*-*) 4039 AC_TRY_COMPILE(, [asm("rdrand %eax");], 4040 [ac_cv_x86_rdrand=yes], [ac_cv_x86_rdrand=no]) 4041 esac 4042 ]) 4043 if test $ac_cv_x86_rdrand = yes; then 4044 AC_DEFINE(_GLIBCXX_X86_RDRAND, 1, 4045 [ Defined if as can handle rdrand. ]) 4046 fi 4047 AC_MSG_RESULT($ac_cv_x86_rdrand) 4048]) 4049 4050dnl 4051dnl Check whether get_nprocs is available in <sys/sysinfo.h>, and define _GLIBCXX_USE_GET_NPROCS. 4052dnl 4053AC_DEFUN([GLIBCXX_CHECK_GET_NPROCS], [ 4054 4055 AC_LANG_SAVE 4056 AC_LANG_CPLUSPLUS 4057 ac_save_CXXFLAGS="$CXXFLAGS" 4058 CXXFLAGS="$CXXFLAGS -fno-exceptions" 4059 4060 AC_MSG_CHECKING([for get_nprocs]) 4061 AC_CACHE_VAL(glibcxx_cv_GET_NPROCS, [ 4062 GCC_TRY_COMPILE_OR_LINK( 4063 [#include <sys/sysinfo.h>], 4064 [int n = get_nprocs();], 4065 [glibcxx_cv_GET_NPROCS=yes], 4066 [glibcxx_cv_GET_NPROCS=no]) 4067 ]) 4068 if test $glibcxx_cv_GET_NPROCS = yes; then 4069 AC_DEFINE(_GLIBCXX_USE_GET_NPROCS, 1, [Define if get_nprocs is available in <sys/sysinfo.h>.]) 4070 fi 4071 AC_MSG_RESULT($glibcxx_cv_GET_NPROCS) 4072 4073 CXXFLAGS="$ac_save_CXXFLAGS" 4074 AC_LANG_RESTORE 4075]) 4076 4077dnl 4078dnl Check whether sysconf(_SC_NPROCESSORS_ONLN) is available in <unistd.h>, and define _GLIBCXX_USE_SC_NPROCESSORS_ONLN. 4079dnl 4080AC_DEFUN([GLIBCXX_CHECK_SC_NPROCESSORS_ONLN], [ 4081 4082 AC_LANG_SAVE 4083 AC_LANG_CPLUSPLUS 4084 ac_save_CXXFLAGS="$CXXFLAGS" 4085 CXXFLAGS="$CXXFLAGS -fno-exceptions" 4086 4087 AC_MSG_CHECKING([for _SC_NPROCESSORS_ONLN]) 4088 AC_CACHE_VAL(glibcxx_cv_SC_NPROCESSORS_ONLN, [ 4089 GCC_TRY_COMPILE_OR_LINK( 4090 [#include <unistd.h>], 4091 [int n = sysconf(_SC_NPROCESSORS_ONLN);], 4092 [glibcxx_cv_SC_NPROCESSORS_ONLN=yes], 4093 [glibcxx_cv_SC_NPROCESSORS_ONLN=no]) 4094 ]) 4095 if test $glibcxx_cv_SC_NPROCESSORS_ONLN = yes; then 4096 AC_DEFINE(_GLIBCXX_USE_SC_NPROCESSORS_ONLN, 1, [Define if _SC_NPROCESSORS_ONLN is available in <unistd.h>.]) 4097 fi 4098 AC_MSG_RESULT($glibcxx_cv_SC_NPROCESSORS_ONLN) 4099 4100 CXXFLAGS="$ac_save_CXXFLAGS" 4101 AC_LANG_RESTORE 4102]) 4103 4104dnl 4105dnl Check whether sysconf(_SC_NPROC_ONLN) is available in <unistd.h>, and define _GLIBCXX_USE_SC_NPROC_ONLN. 4106dnl 4107AC_DEFUN([GLIBCXX_CHECK_SC_NPROC_ONLN], [ 4108 4109 AC_LANG_SAVE 4110 AC_LANG_CPLUSPLUS 4111 ac_save_CXXFLAGS="$CXXFLAGS" 4112 CXXFLAGS="$CXXFLAGS -fno-exceptions" 4113 4114 AC_MSG_CHECKING([for _SC_NPROC_ONLN]) 4115 AC_CACHE_VAL(glibcxx_cv_SC_NPROC_ONLN, [ 4116 GCC_TRY_COMPILE_OR_LINK( 4117 [#include <unistd.h>], 4118 [int n = sysconf(_SC_NPROC_ONLN);], 4119 [glibcxx_cv_SC_NPROC_ONLN=yes], 4120 [glibcxx_cv_SC_NPROC_ONLN=no]) 4121 ]) 4122 if test $glibcxx_cv_SC_NPROC_ONLN = yes; then 4123 AC_DEFINE(_GLIBCXX_USE_SC_NPROC_ONLN, 1, [Define if _SC_NPROC_ONLN is available in <unistd.h>.]) 4124 fi 4125 AC_MSG_RESULT($glibcxx_cv_SC_NPROC_ONLN) 4126 4127 CXXFLAGS="$ac_save_CXXFLAGS" 4128 AC_LANG_RESTORE 4129]) 4130 4131dnl 4132dnl Check whether pthread_num_processors_np is available in <pthread.h>, and define _GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP. 4133dnl 4134AC_DEFUN([GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP], [ 4135 4136 AC_LANG_SAVE 4137 AC_LANG_CPLUSPLUS 4138 ac_save_CXXFLAGS="$CXXFLAGS" 4139 CXXFLAGS="$CXXFLAGS -fno-exceptions" 4140 4141 AC_MSG_CHECKING([for pthreads_num_processors_np]) 4142 AC_CACHE_VAL(glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP, [ 4143 GCC_TRY_COMPILE_OR_LINK( 4144 [#include <pthread.h>], 4145 [int n = pthread_num_processors_np();], 4146 [glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP=yes], 4147 [glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP=no]) 4148 ]) 4149 if test $glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP = yes; then 4150 AC_DEFINE(_GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP, 1, [Define if pthreads_num_processors_np is available in <pthread.h>.]) 4151 fi 4152 AC_MSG_RESULT($glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP) 4153 4154 CXXFLAGS="$ac_save_CXXFLAGS" 4155 AC_LANG_RESTORE 4156]) 4157 4158dnl 4159dnl Check whether sysctl is available in <pthread.h>, and define _GLIBCXX_USE_SYSCTL_HW_NCPU. 4160dnl 4161AC_DEFUN([GLIBCXX_CHECK_SYSCTL_HW_NCPU], [ 4162 4163 AC_LANG_SAVE 4164 AC_LANG_CPLUSPLUS 4165 ac_save_CXXFLAGS="$CXXFLAGS" 4166 CXXFLAGS="$CXXFLAGS -fno-exceptions" 4167 4168 AC_MSG_CHECKING([for hw.ncpu sysctl]) 4169 AC_CACHE_VAL(glibcxx_cv_SYSCTL_HW_NCPU, [ 4170 GCC_TRY_COMPILE_OR_LINK( 4171 [ 4172 #include <stddef.h> 4173 #include <sys/sysctl.h> 4174 ], 4175 [ 4176 int count; 4177 size_t size = sizeof(count); 4178 int mib[] = { CTL_HW, HW_NCPU }; 4179 sysctl(mib, 2, &count, &size, NULL, 0); 4180 ], 4181 [glibcxx_cv_SYSCTL_HW_NCPU=yes], 4182 [glibcxx_cv_SYSCTL_HW_NCPU=no]) 4183 ]) 4184 if test $glibcxx_cv_SYSCTL_HW_NCPU = yes; then 4185 AC_DEFINE(_GLIBCXX_USE_SYSCTL_HW_NCPU, 1, [Define if sysctl(), CTL_HW and HW_NCPU are available in <sys/sysctl.h>.]) 4186 fi 4187 AC_MSG_RESULT($glibcxx_cv_SYSCTL_HW_NCPU) 4188 4189 CXXFLAGS="$ac_save_CXXFLAGS" 4190 AC_LANG_RESTORE 4191]) 4192 4193dnl 4194dnl Check to see if python pretty printing can be activated. 4195dnl 4196dnl --with-python-dir=dir 4197dnl installs directory into $prefix/dir 4198AC_DEFUN([GLIBCXX_ENABLE_PYTHON], [ 4199 4200AC_MSG_CHECKING([for custom python install directory]) 4201AC_ARG_WITH([python-dir], 4202 AS_HELP_STRING([--with-python-dir], 4203 [the location to install Python modules. This path is relative starting from the prefix.]), 4204 [with_python_dir=$withval], [with_python_dir="no"]) 4205AC_MSG_RESULT(${with_python_dir}) 4206 4207# Needed for installing Python modules during make install. 4208python_mod_dir="${with_python_dir}" 4209AC_SUBST(python_mod_dir) 4210GLIBCXX_CONDITIONAL(ENABLE_PYTHONDIR, test $python_mod_dir != no) 4211]) 4212 4213dnl 4214dnl Check to see if -Werror is disabled. 4215dnl 4216dnl --enable-werror/--disable-werror 4217AC_DEFUN([GLIBCXX_ENABLE_WERROR], [ 4218 AC_MSG_CHECKING([for -Werror]) 4219 GLIBCXX_ENABLE(werror,$1,,[turns on -Werror]) 4220 AC_MSG_RESULT($enable_werror) 4221 GLIBCXX_CONDITIONAL(ENABLE_WERROR, test $enable_werror = yes) 4222]) 4223 4224dnl 4225dnl Check whether obsolescent tmpnam is available in <stdio.h>, 4226dnl and define _GLIBCXX_USE_TMPNAM. 4227dnl 4228AC_DEFUN([GLIBCXX_CHECK_TMPNAM], [dnl 4229dnl 4230 AC_LANG_SAVE 4231 AC_LANG_CPLUSPLUS 4232 ac_save_CXXFLAGS="$CXXFLAGS" 4233 CXXFLAGS="$CXXFLAGS -fno-exceptions" 4234dnl 4235 AC_MSG_CHECKING([for tmpnam]) 4236 AC_CACHE_VAL(glibcxx_cv_TMPNAM, [dnl 4237 GCC_TRY_COMPILE_OR_LINK( 4238 [#include <stdio.h>], 4239 [char *tmp = tmpnam(NULL);], 4240 [glibcxx_cv_TMPNAM=yes], 4241 [glibcxx_cv_TMPNAM=no]) 4242 ]) 4243 if test $glibcxx_cv_TMPNAM = yes; then 4244 AC_DEFINE(_GLIBCXX_USE_TMPNAM, 1, [Define if obsolescent tmpnam is available in <stdio.h>.]) 4245 fi 4246 AC_MSG_RESULT($glibcxx_cv_TMPNAM) 4247dnl 4248 CXXFLAGS="$ac_save_CXXFLAGS" 4249 AC_LANG_RESTORE 4250]) 4251 4252dnl 4253dnl Check to see if sys/sdt.h exists and that it is suitable for use. 4254dnl Some versions of sdt.h were not compatible with C++11. 4255dnl 4256AC_DEFUN([GLIBCXX_CHECK_SDT_H], [ 4257 AC_MSG_CHECKING([for suitable sys/sdt.h]) 4258 # Note that this test has to be run with the C language. 4259 # Otherwise, sdt.h will try to include some headers from 4260 # libstdc++ itself. 4261 AC_LANG_SAVE 4262 AC_LANG_C 4263 AC_CACHE_VAL(glibcxx_cv_sys_sdt_h, [ 4264 # Because we have to run the test in C, we use grep rather 4265 # than the compiler to check for the bug. The bug is that 4266 # were strings without trailing whitespace, causing g++ 4267 # to look for operator"". The pattern searches for the fixed 4268 # output. 4269 AC_EGREP_CPP([ \",\" ], [ 4270 #include <sys/sdt.h> 4271 int f() { STAP_PROBE(hi, bob); } 4272 ], [glibcxx_cv_sys_sdt_h=yes], [glibcxx_cv_sys_sdt_h=no]) 4273 ]) 4274 AC_LANG_RESTORE 4275 if test $glibcxx_cv_sys_sdt_h = yes; then 4276 AC_DEFINE(HAVE_SYS_SDT_H, 1, 4277 [Define to 1 if you have a suitable <sys/sdt.h> header file]) 4278 fi 4279 AC_MSG_RESULT($glibcxx_cv_sys_sdt_h) 4280]) 4281 4282dnl 4283dnl Control whether the library should define symbols for old and new ABIs. 4284dnl This affects definitions of strings, stringstreams and locale facets. 4285dnl 4286dnl --disable-libstdcxx-dual-abi will use old ABI for all types. 4287dnl 4288dnl Defines: 4289dnl _GLIBCXX_USE_DUAL_ABI (always defined, either to 1 or 0) 4290dnl 4291AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_DUAL_ABI], [ 4292 GLIBCXX_ENABLE(libstdcxx-dual-abi,$1,,[support two versions of std::string]) 4293 if test x$enable_symvers = xgnu-versioned-namespace; then 4294 # gnu-versioned-namespace is incompatible with the dual ABI. 4295 enable_libstdcxx_dual_abi="no" 4296 fi 4297 if test x"$enable_libstdcxx_dual_abi" != xyes; then 4298 AC_MSG_NOTICE([dual ABI is disabled]) 4299 default_libstdcxx_abi="gcc4-compatible" 4300 fi 4301 GLIBCXX_CONDITIONAL(ENABLE_DUAL_ABI, test $enable_libstdcxx_dual_abi = yes) 4302]) 4303 4304dnl 4305dnl Check to see which ABI should be enabled by default. 4306dnl 4307dnl --with-default-libstdcxx-abi={gcc4-compatible,new} 4308dnl 4309dnl Defines: 4310dnl _GLIBCXX_USE_CXX11_ABI (always defined, either to 1 or 0) 4311dnl 4312AC_DEFUN([GLIBCXX_DEFAULT_ABI], [ 4313 if test x$enable_libstdcxx_dual_abi = xyes; then 4314 AC_MSG_CHECKING([for default std::string ABI to use]) 4315 AC_ARG_WITH([default-libstdcxx-abi], 4316 AS_HELP_STRING([--with-default-libstdcxx-abi], 4317 [set the std::string ABI to use by default]), 4318 [case "$withval" in 4319 gcc4-compatible) default_libstdcxx_abi="gcc4-compatible" ;; 4320 new|cxx11) default_libstdcxx_abi="new" ;; 4321 c++*|gnu++*) AC_MSG_ERROR([Supported arguments for --with-default-libstdcxx-abi have changed, use "new" or "gcc4-compatible"]) ;; 4322 *) AC_MSG_ERROR([Invalid argument for --with-default-libstdcxx-abi]) ;; 4323 esac 4324 ], 4325 [default_libstdcxx_abi="new"]) 4326 AC_MSG_RESULT(${default_libstdcxx_abi}) 4327 fi 4328 if test $default_libstdcxx_abi = "new"; then 4329 glibcxx_cxx11_abi=1 4330 glibcxx_cxx98_abi=0 4331 else 4332 glibcxx_cxx11_abi=0 4333 glibcxx_cxx98_abi=1 4334 fi 4335 AC_SUBST(glibcxx_cxx98_abi) 4336 GLIBCXX_CONDITIONAL(ENABLE_CXX11_ABI, test $glibcxx_cxx11_abi = 1) 4337]) 4338 4339dnl 4340dnl Check to see whether to build libstdc++fs.a 4341dnl 4342dnl --enable-libstdcxx-filesystem-ts 4343dnl 4344AC_DEFUN([GLIBCXX_ENABLE_FILESYSTEM_TS], [ 4345 GLIBCXX_ENABLE(libstdcxx-filesystem-ts,auto,, 4346 [turns on ISO/IEC TS 18822 support], 4347 [permit yes|no|auto]) 4348 4349 AC_MSG_CHECKING([whether to build Filesystem TS support]) 4350 if test x"$ac_cv_header_dirent_h" != x"yes"; then 4351 enable_libstdcxx_filesystem_ts=no 4352 fi 4353 if test x"$enable_libstdcxx_filesystem_ts" = x"auto"; then 4354 case "${target_os}" in 4355 freebsd*|netbsd*|openbsd*|dragonfly*|darwin*) 4356 enable_libstdcxx_filesystem_ts=yes 4357 ;; 4358 gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) 4359 enable_libstdcxx_filesystem_ts=yes 4360 ;; 4361 rtems*) 4362 enable_libstdcxx_filesystem_ts=yes 4363 ;; 4364 solaris*) 4365 enable_libstdcxx_filesystem_ts=yes 4366 ;; 4367 *) 4368 enable_libstdcxx_filesystem_ts=no 4369 ;; 4370 esac 4371 fi 4372 AC_MSG_RESULT($enable_libstdcxx_filesystem_ts) 4373 GLIBCXX_CONDITIONAL(ENABLE_FILESYSTEM_TS, test $enable_libstdcxx_filesystem_ts = yes) 4374]) 4375 4376dnl 4377dnl Check whether the library calls required by the C++17 Filesystem library 4378dnl and the Filesystem TS are present. 4379dnl Defines: 4380dnl HAVE_STRUCT_DIRENT_D_TYPE 4381dnl _GLIBCXX_USE_REALPATH 4382dnl _GLIBCXX_USE_UTIMENSAT 4383dnl _GLIBCXX_USE_ST_MTIM 4384dnl _GLIBCXX_USE_FCHMOD 4385dnl _GLIBCXX_USE_FCHMODAT 4386dnl _GLIBCXX_USE_SENDFILE 4387dnl HAVE_LINK 4388dnl HAVE_READLINK 4389dnl HAVE_SYMLINK 4390dnl 4391AC_DEFUN([GLIBCXX_CHECK_FILESYSTEM_DEPS], [dnl 4392dnl 4393 AC_LANG_SAVE 4394 AC_LANG_CPLUSPLUS 4395 ac_save_CXXFLAGS="$CXXFLAGS" 4396 CXXFLAGS="$CXXFLAGS -fno-exceptions" 4397dnl 4398 AC_MSG_CHECKING([for struct dirent.d_type]) 4399 AC_CACHE_VAL(glibcxx_cv_dirent_d_type, [dnl 4400 GCC_TRY_COMPILE_OR_LINK( 4401 [#include <dirent.h>], 4402 [ 4403 struct dirent d; 4404 if (sizeof d.d_type) return 0; 4405 ], 4406 [glibcxx_cv_dirent_d_type=yes], 4407 [glibcxx_cv_dirent_d_type=no]) 4408 ]) 4409 if test $glibcxx_cv_dirent_d_type = yes; then 4410 AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1, [Define to 1 if `d_type' is a member of `struct dirent'.]) 4411 fi 4412 AC_MSG_RESULT($glibcxx_cv_dirent_d_type) 4413dnl 4414 AC_MSG_CHECKING([for realpath]) 4415 AC_CACHE_VAL(glibcxx_cv_realpath, [dnl 4416 GCC_TRY_COMPILE_OR_LINK( 4417 [ 4418 #include <limits.h> 4419 #include <stdlib.h> 4420 #include <unistd.h> 4421 ], 4422 [ 4423 #if _XOPEN_VERSION < 500 4424 #error 4425 #elif _XOPEN_VERSION >= 700 || defined(PATH_MAX) 4426 char *tmp = realpath((const char*)NULL, (char*)NULL); 4427 #else 4428 #error 4429 #endif 4430 ], 4431 [glibcxx_cv_realpath=yes], 4432 [glibcxx_cv_realpath=no]) 4433 ]) 4434 if test $glibcxx_cv_realpath = yes; then 4435 AC_DEFINE(_GLIBCXX_USE_REALPATH, 1, [Define if usable realpath is available in <stdlib.h>.]) 4436 fi 4437 AC_MSG_RESULT($glibcxx_cv_realpath) 4438dnl 4439 AC_MSG_CHECKING([for utimensat]) 4440 AC_CACHE_VAL(glibcxx_cv_utimensat, [dnl 4441 GCC_TRY_COMPILE_OR_LINK( 4442 [ 4443 #include <fcntl.h> 4444 #include <sys/stat.h> 4445 ], 4446 [ 4447 struct timespec ts[2] = { { 0, UTIME_OMIT }, { 1, 1 } }; 4448 int i = utimensat(AT_FDCWD, "path", ts, 0); 4449 ], 4450 [glibcxx_cv_utimensat=yes], 4451 [glibcxx_cv_utimensat=no]) 4452 ]) 4453 if test $glibcxx_cv_utimensat = yes; then 4454 AC_DEFINE(_GLIBCXX_USE_UTIMENSAT, 1, [Define if utimensat and UTIME_OMIT are available in <sys/stat.h> and AT_FDCWD in <fcntl.h>.]) 4455 fi 4456 AC_MSG_RESULT($glibcxx_cv_utimensat) 4457dnl 4458 AC_MSG_CHECKING([for utime]) 4459 AC_CACHE_VAL(glibcxx_cv_utime, [dnl 4460 GCC_TRY_COMPILE_OR_LINK( 4461 [ 4462 #include <utime.h> 4463 ], 4464 [ 4465 struct utimbuf t = { 1, 1 }; 4466 int i = utime("path", &t); 4467 ], 4468 [glibcxx_cv_utime=yes], 4469 [glibcxx_cv_utime=no]) 4470 ]) 4471 if test $glibcxx_cv_utime = yes; then 4472 AC_DEFINE(_GLIBCXX_USE_UTIME, 1, [Define if utime is available in <utime.h>.]) 4473 fi 4474 AC_MSG_RESULT($glibcxx_cv_utime) 4475dnl 4476 AC_MSG_CHECKING([for lstat]) 4477 AC_CACHE_VAL(glibcxx_cv_lstat, [dnl 4478 GCC_TRY_COMPILE_OR_LINK( 4479 [ #include <sys/stat.h> ], 4480 [ 4481 struct stat st; 4482 int i = lstat("path", &st); 4483 ], 4484 [glibcxx_cv_lstat=yes], 4485 [glibcxx_cv_lstat=no]) 4486 ]) 4487 if test $glibcxx_cv_lstat = yes; then 4488 AC_DEFINE(_GLIBCXX_USE_LSTAT, 1, [Define if lstat is available in <sys/stat.h>.]) 4489 fi 4490 AC_MSG_RESULT($glibcxx_cv_lstat) 4491dnl 4492 AC_MSG_CHECKING([for struct stat.st_mtim.tv_nsec]) 4493 AC_CACHE_VAL(glibcxx_cv_st_mtim, [dnl 4494 GCC_TRY_COMPILE_OR_LINK( 4495 [ #include <sys/stat.h> ], 4496 [ 4497 struct stat st; 4498 return st.st_mtim.tv_nsec; 4499 ], 4500 [glibcxx_cv_st_mtim=yes], 4501 [glibcxx_cv_st_mtim=no]) 4502 ]) 4503 if test $glibcxx_cv_st_mtim = yes; then 4504 AC_DEFINE(_GLIBCXX_USE_ST_MTIM, 1, [Define if struct stat has timespec members.]) 4505 fi 4506 AC_MSG_RESULT($glibcxx_cv_st_mtim) 4507dnl 4508 AC_MSG_CHECKING([for fchmod]) 4509 AC_CACHE_VAL(glibcxx_cv_fchmod, [dnl 4510 GCC_TRY_COMPILE_OR_LINK( 4511 [#include <sys/stat.h>], 4512 [fchmod(1, S_IWUSR);], 4513 [glibcxx_cv_fchmod=yes], 4514 [glibcxx_cv_fchmod=no]) 4515 ]) 4516 if test $glibcxx_cv_fchmod = yes; then 4517 AC_DEFINE(_GLIBCXX_USE_FCHMOD, 1, [Define if fchmod is available in <sys/stat.h>.]) 4518 fi 4519 AC_MSG_RESULT($glibcxx_cv_fchmod) 4520dnl 4521 AC_MSG_CHECKING([for fchmodat]) 4522 AC_CACHE_VAL(glibcxx_cv_fchmodat, [dnl 4523 GCC_TRY_COMPILE_OR_LINK( 4524 [ 4525 #include <fcntl.h> 4526 #include <sys/stat.h> 4527 ], 4528 [fchmodat(AT_FDCWD, "", 0, AT_SYMLINK_NOFOLLOW);], 4529 [glibcxx_cv_fchmodat=yes], 4530 [glibcxx_cv_fchmodat=no]) 4531 ]) 4532 if test $glibcxx_cv_fchmodat = yes; then 4533 AC_DEFINE(_GLIBCXX_USE_FCHMODAT, 1, [Define if fchmodat is available in <sys/stat.h>.]) 4534 fi 4535 AC_MSG_RESULT($glibcxx_cv_fchmodat) 4536dnl 4537 AC_MSG_CHECKING([for sendfile that can copy files]) 4538 AC_CACHE_VAL(glibcxx_cv_sendfile, [dnl 4539 case "${target_os}" in 4540 gnu* | linux* | solaris*) 4541 GCC_TRY_COMPILE_OR_LINK( 4542 [#include <sys/sendfile.h>], 4543 [sendfile(1, 2, (off_t*)0, sizeof 1);], 4544 [glibcxx_cv_sendfile=yes], 4545 [glibcxx_cv_sendfile=no]) 4546 ;; 4547 *) 4548 glibcxx_cv_sendfile=no 4549 ;; 4550 esac 4551 ]) 4552 if test $glibcxx_cv_sendfile = yes; then 4553 AC_DEFINE(_GLIBCXX_USE_SENDFILE, 1, [Define if sendfile is available in <sys/sendfile.h>.]) 4554 fi 4555 AC_MSG_RESULT($glibcxx_cv_sendfile) 4556dnl 4557 AC_MSG_CHECKING([for link]) 4558 AC_CACHE_VAL(glibcxx_cv_link, [dnl 4559 GCC_TRY_COMPILE_OR_LINK( 4560 [#include <unistd.h>], 4561 [link("", "");], 4562 [glibcxx_cv_link=yes], 4563 [glibcxx_cv_link=no]) 4564 ]) 4565 if test $glibcxx_cv_link = yes; then 4566 AC_DEFINE(HAVE_LINK, 1, [Define if link is available in <unistd.h>.]) 4567 fi 4568 AC_MSG_RESULT($glibcxx_cv_link) 4569dnl 4570 AC_MSG_CHECKING([for readlink]) 4571 AC_CACHE_VAL(glibcxx_cv_readlink, [dnl 4572 GCC_TRY_COMPILE_OR_LINK( 4573 [#include <unistd.h>], 4574 [char buf[32]; readlink("", buf, sizeof(buf));], 4575 [glibcxx_cv_readlink=yes], 4576 [glibcxx_cv_readlink=no]) 4577 ]) 4578 if test $glibcxx_cv_readlink = yes; then 4579 AC_DEFINE(HAVE_READLINK, 1, [Define if readlink is available in <unistd.h>.]) 4580 fi 4581 AC_MSG_RESULT($glibcxx_cv_readlink) 4582dnl 4583 AC_MSG_CHECKING([for symlink]) 4584 AC_CACHE_VAL(glibcxx_cv_symlink, [dnl 4585 GCC_TRY_COMPILE_OR_LINK( 4586 [#include <unistd.h>], 4587 [symlink("", "");], 4588 [glibcxx_cv_symlink=yes], 4589 [glibcxx_cv_symlink=no]) 4590 ]) 4591 if test $glibcxx_cv_symlink = yes; then 4592 AC_DEFINE(HAVE_SYMLINK, 1, [Define if symlink is available in <unistd.h>.]) 4593 fi 4594 AC_MSG_RESULT($glibcxx_cv_symlink) 4595dnl 4596 AC_MSG_CHECKING([for truncate]) 4597 AC_CACHE_VAL(glibcxx_cv_truncate, [dnl 4598 GCC_TRY_COMPILE_OR_LINK( 4599 [#include <unistd.h>], 4600 [truncate("", 99);], 4601 [glibcxx_cv_truncate=yes], 4602 [glibcxx_cv_truncate=no]) 4603 ]) 4604 if test $glibcxx_cv_truncate = yes; then 4605 AC_DEFINE(HAVE_TRUNCATE, 1, [Define if truncate is available in <unistd.h>.]) 4606 fi 4607 AC_MSG_RESULT($glibcxx_cv_truncate) 4608dnl 4609 CXXFLAGS="$ac_save_CXXFLAGS" 4610 AC_LANG_RESTORE 4611]) 4612 4613dnl 4614dnl Check how size_t is mangled. Copied from libitm. 4615dnl 4616AC_DEFUN([GLIBCXX_CHECK_SIZE_T_MANGLING], [ 4617 AC_CACHE_CHECK([how size_t is mangled], 4618 glibcxx_cv_size_t_mangling, [ 4619 AC_TRY_COMPILE([], [extern __SIZE_TYPE__ x; extern unsigned long x;], 4620 [glibcxx_cv_size_t_mangling=m], [ 4621 AC_TRY_COMPILE([], [extern __SIZE_TYPE__ x; extern unsigned int x;], 4622 [glibcxx_cv_size_t_mangling=j], [ 4623 AC_TRY_COMPILE([], 4624 [extern __SIZE_TYPE__ x; extern unsigned long long x;], 4625 [glibcxx_cv_size_t_mangling=y], [ 4626 AC_TRY_COMPILE([], 4627 [extern __SIZE_TYPE__ x; extern unsigned short x;], 4628 [glibcxx_cv_size_t_mangling=t], [ 4629 AC_TRY_COMPILE([], 4630 [extern __SIZE_TYPE__ x; extern __int20 unsigned x;], 4631 [glibcxx_cv_size_t_mangling=u6uint20], 4632 [glibcxx_cv_size_t_mangling=x]) 4633 ]) 4634 ]) 4635 ]) 4636 ]) 4637 ]) 4638 if test $glibcxx_cv_size_t_mangling = x; then 4639 AC_MSG_ERROR([Unknown underlying type for size_t]) 4640 fi 4641 AC_DEFINE_UNQUOTED(_GLIBCXX_MANGLE_SIZE_T, [$glibcxx_cv_size_t_mangling], 4642 [Define to the letter to which size_t is mangled.]) 4643]) 4644 4645dnl 4646dnl Determine whether std::exception_ptr symbols should be exported with 4647dnl the symbol versions from GCC 4.6.0 or GCC 7.1.0, depending on which 4648dnl release first added support for std::exception_ptr. Originally it was 4649dnl only supported for targets with always-lock-free atomics for int, but 4650dnl since GCC 7.1 it is supported for all targets. 4651dnl 4652AC_DEFUN([GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER], [ 4653 if test $enable_symvers != no; then 4654 AC_MSG_CHECKING([for first version to support std::exception_ptr]) 4655 case ${target} in 4656 aarch64-*-* | alpha-*-* | hppa*-*-* | i?86-*-* | x86_64-*-* | \ 4657 m68k-*-* | powerpc*-*-* | s390*-*-* | *-*-solaris* ) 4658 ac_exception_ptr_since_gcc46=yes 4659 ;; 4660 *) 4661 # If the value of this macro changes then we will need to hardcode 4662 # yes/no here for additional targets based on the original value. 4663 AC_TRY_COMPILE([], [ 4664 #if __GCC_ATOMIC_INT_LOCK_FREE <= 1 4665 # error atomic int not always lock free 4666 #endif 4667 ], 4668 [ac_exception_ptr_since_gcc46=yes], 4669 [ac_exception_ptr_since_gcc46=no]) 4670 ;; 4671 esac 4672 if test x"$ac_exception_ptr_since_gcc46" = x"yes" ; then 4673 AC_DEFINE(HAVE_EXCEPTION_PTR_SINCE_GCC46, 1, 4674 [Define to 1 if GCC 4.6 supported std::exception_ptr for the target]) 4675 AC_MSG_RESULT([4.6.0]) 4676 else 4677 AC_MSG_RESULT([7.1.0]) 4678 fi 4679 fi 4680]) 4681 4682# Macros from the top-level gcc directory. 4683m4_include([../config/gc++filt.m4]) 4684m4_include([../config/tls.m4]) 4685m4_include([../config/gthr.m4]) 4686m4_include([../config/cet.m4]) 4687