summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorJan Maria Matejka <mq@ucw.cz>2019-05-23 11:27:24 +0000
committerJan Maria Matejka <mq@ucw.cz>2019-05-23 11:27:24 +0000
commit6479e403ef7398f48c0e1c0f1a71aa112938a357 (patch)
tree1f8d85be642df05ad5cbbaa80a9fc27b289f7ba3 /aclocal.m4
parent23e3b1e6652bac4a003a7eb1e074bdaf7ebb4900 (diff)
Filters: If somebody doesn't like _Thread_local, don't fail for now, just be a little slower.
When the parallel execution comes into place, we'll likely enforce this C11 feature. It's much simpler and also faster than pthread_[sg]etspecific().
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m421
1 files changed, 20 insertions, 1 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 0044adf9..746d5df5 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,25 @@
dnl ** Additional Autoconf tests for BIRD configure script
dnl ** (c) 1999 Martin Mares <mj@ucw.cz>
+AC_DEFUN([BIRD_CHECK_THREAD_LOCAL],
+[
+ AC_CACHE_CHECK(
+ [whether _Thread_local is known],
+ [bird_cv_thread_local],
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [
+ _Thread_local static int x = 42;
+ ],
+ []
+ )
+ ],
+ [bird_cv_thread_local=yes],
+ [bird_cv_thread_local=no]
+ )
+ )
+])
+
AC_DEFUN([BIRD_CHECK_PTHREADS],
[
bird_tmp_cflags="$CFLAGS"
@@ -134,7 +153,7 @@ AC_DEFUN([BIRD_CHECK_ANDROID_LOG],
AC_DEFUN([BIRD_CHECK_LTO],
[
bird_tmp_cflags="$CFLAGS"
- bird_tmp_ldflags="$CFLAGS"
+ bird_tmp_ldflags="$LDFLAGS"
CFLAGS="-flto"
LDFLAGS="-flto"