Differences From Artifact [ba69b79b62]:
- File configure.ac — part of check-in [7326a487c0] at 2014-05-14 18:26:24 on branch trunk — Try -std=c1x when -std=c11 is unavailable (user: js, size: 26177) [annotate] [blame] [check-ins using]
To Artifact [c1957ea278]:
- File
configure.ac
— part of check-in
[c701e89b83]
at
2014-05-14 20:19:05
on branch trunk
— Use thread_local instead of __thread
If threads.h exists, the thread_local from there is used. If it doesn't,
but _Thread_local exists, it's defined to that. As a last fallback, it
is defined to __thread. (user: js, size: 26910) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 | AC_SUBST(USE_SRCS_THREADS, '${SRCS_THREADS}') AC_SUBST(USE_INCLUDES_THREADS, '${INCLUDES_THREADS}') AC_ARG_ENABLE(compiler-tls, AS_HELP_STRING([--disable-compiler-tls], [disable compiler thread local storage])) AS_IF([test x"$enable_compiler_tls" != x"no"], [ AC_MSG_CHECKING(whether __thread works) AC_TRY_LINK([ /* It seems __thread is buggy with GCC 4.1 */ #if __GNUC__ == 4 && __GNUC_MINOR__ < 2 # error buggy #endif __thread int x = 0; ], [ x++; ], [ AS_IF([test x"$enable_shared" != x"no"], [ old_OBJCFLAGS="$OBJCFLAGS" OBJCFLAGS="$OBJCFLAGS -fPIC" AC_TRY_COMPILE([ __thread int x = 0; ], [ x++; ], [ AC_MSG_RESULT(yes) | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 | AC_SUBST(USE_SRCS_THREADS, '${SRCS_THREADS}') AC_SUBST(USE_INCLUDES_THREADS, '${INCLUDES_THREADS}') AC_ARG_ENABLE(compiler-tls, AS_HELP_STRING([--disable-compiler-tls], [disable compiler thread local storage])) AS_IF([test x"$enable_compiler_tls" != x"no"], [ AC_CHECK_HEADERS(threads.h, [ AC_DEFINE(OF_HAVE_THREADS_H, 1, [Whether we have threads.h]) ]) AC_MSG_CHECKING(whether _Thread_local works) AC_TRY_LINK([ static _Thread_local int x = 0; ], [ x++; ], [ AS_IF([test x"$enable_shared" != x"no"], [ old_OBJCFLAGS="$OBJCFLAGS" OBJCFLAGS="$OBJCFLAGS -fPIC" AC_TRY_COMPILE([ static _Thread_local int x = 0; ], [ x++; ], [ AC_MSG_RESULT(yes) AC_DEFINE(OF_HAVE__THREAD_LOCAL, 1, [Whether _Thread_local works]) ], [ AC_MSG_RESULT(no) ]) OBJCFLAGS="$old_OBJCFLAGS" ], [ AC_MSG_RESULT(yes) AC_DEFINE(OF_HAVE__THREAD_LOCAL, 1, [Whether _Thread_local works]) ]) ], [ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING(whether __thread works) AC_TRY_LINK([ /* It seems __thread is buggy with GCC 4.1 */ #if __GNUC__ == 4 && __GNUC_MINOR__ < 2 # error buggy #endif __thread int x = 0; ], [ x++; ], [ AS_IF([test x"$enable_shared" != x"no"], [ old_OBJCFLAGS="$OBJCFLAGS" OBJCFLAGS="$OBJCFLAGS -fPIC" AC_TRY_COMPILE([ __thread int x = 0; ], [ x++; ], [ AC_MSG_RESULT(yes) AC_DEFINE(OF_HAVE___THREAD, 1, [Whether __thread works]) ], [ AC_MSG_RESULT(no) ]) OBJCFLAGS="$old_OBJCFLAGS" ], [ AC_MSG_RESULT(yes) AC_DEFINE(OF_HAVE___THREAD, 1, [Whether __thread works]) ]) ], [ AC_MSG_RESULT(no) ]) ]) |
︙ | ︙ |