summaryrefslogtreecommitdiff
path: root/tool/m4
diff options
context:
space:
mode:
authorYuta Saito <kateinoigakukun@gmail.com>2021-10-28 21:08:35 +0900
committerYusuke Endoh <mame@ruby-lang.org>2021-10-30 10:18:33 +0900
commit4e0747a8a29e4d61744a802aee2c15289c2f9d19 (patch)
treeea1ccc1172d6aaf9bad0d5efa6aaab8dc9209ddc /tool/m4
parent8590d61ea9b6b91c89a14a8d0f6829c8a3a8c6c8 (diff)
downloadruby-4e0747a8a29e4d61744a802aee2c15289c2f9d19.tar.gz
Allow the thread-model to be switched by configure option
This change adds --with-thread=IMPL option to the configure. If not supplied, default implementation for each platform will be used.
Diffstat (limited to 'tool/m4')
-rw-r--r--tool/m4/ruby_thread.m425
1 files changed, 15 insertions, 10 deletions
diff --git a/tool/m4/ruby_thread.m4 b/tool/m4/ruby_thread.m4
index 6f1e3960b1..3831bc4c06 100644
--- a/tool/m4/ruby_thread.m4
+++ b/tool/m4/ruby_thread.m4
@@ -1,15 +1,20 @@
dnl -*- Autoconf -*-
AC_DEFUN([RUBY_THREAD], [
-AS_CASE(["$target_os"],
- [mingw*], [
- THREAD_MODEL=win32
- ],
- [
- AS_IF([test "$rb_with_pthread" = "yes"], [
- THREAD_MODEL=pthread
- ])
- ]
-)
+AC_ARG_WITH(thread,
+ AS_HELP_STRING([--with-thread=IMPLEMENTATION], [specify the thread implementation to use]),
+ [THREAD_MODEL=$withval], [
+ THREAD_MODEL=
+ AS_CASE(["$target_os"],
+ [mingw*], [
+ THREAD_MODEL=win32
+ ],
+ [
+ AS_IF([test "$rb_with_pthread" = "yes"], [
+ THREAD_MODEL=pthread
+ ])
+ ]
+ )
+])
AS_CASE(["$THREAD_MODEL"],
[pthread], [AC_CHECK_HEADERS(pthread.h)],