Commit 1cb6d5cb authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Define NOTHREADS to 1 if thread_local keyword is not available

parent 38177989
...@@ -197,6 +197,21 @@ std::vector<std::future<int>> v; ...@@ -197,6 +197,21 @@ std::vector<std::future<int>> v;
[have_std_future=no [have_std_future=no
AC_MSG_RESULT([no])]) AC_MSG_RESULT([no])])
# Check that thread_local is available.
AC_MSG_CHECKING([whether thread_local is available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[
]],
[[
thread_local int n;
]])],
[AC_DEFINE([HAVE_THREAD_LOCAL], [1],
[Define to 1 if you have the `thread_local`.])
have_thread_local=yes
AC_MSG_RESULT([yes])],
[have_thread_local=no
AC_MSG_RESULT([no])])
# Check that std::map::emplace is available for g++-4.7. # Check that std::map::emplace is available for g++-4.7.
AC_MSG_CHECKING([whether std::map::emplace is available]) AC_MSG_CHECKING([whether std::map::emplace is available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM( AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
...@@ -608,9 +623,13 @@ if test "x$debug" != "xno"; then ...@@ -608,9 +623,13 @@ if test "x$debug" != "xno"; then
AC_DEFINE([DEBUGBUILD], [1], [Define to 1 to enable debug output.]) AC_DEFINE([DEBUGBUILD], [1], [Define to 1 to enable debug output.])
fi fi
# Some platform does not have working std::future. We disable enable_threads=yes
# threading for those platforms to exclude std::future use. # Some platform does not have working std::future or thread_local. We
if test "x$threads" != "xyes" || test "x$have_std_future" != "xyes"; then # disable threading for those platforms.
if test "x$threads" != "xyes" ||
test "x$have_std_future" != "xyes" ||
test "x$have_thread_local" != "xyes"; then
enable_threads=no
AC_DEFINE([NOTHREADS], [1], [Define to 1 if you want to disable threads.]) AC_DEFINE([NOTHREADS], [1], [Define to 1 if you want to disable threads.])
fi fi
...@@ -698,4 +717,5 @@ AC_MSG_NOTICE([summary of build options: ...@@ -698,4 +717,5 @@ AC_MSG_NOTICE([summary of build options:
Libnghttp2_asio:${enable_asio_lib} Libnghttp2_asio:${enable_asio_lib}
Examples: ${enable_examples} Examples: ${enable_examples}
Python bindings:${enable_python_bindings} Python bindings:${enable_python_bindings}
Threading: ${enable_threads}
]) ])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment