[前][次][番号順一覧][スレッド一覧]

ruby-changes:62158

From: Nobuyoshi <ko1@a...>
Date: Thu, 9 Jul 2020 13:56:03 +0900 (JST)
Subject: [ruby-changes:62158] a0a5eec0e7 (master): Bail out when unsupported coroutine target

https://git.ruby-lang.org/ruby.git/commit/?id=a0a5eec0e7

From a0a5eec0e70aa5bd6ba170b89f6ecb2b7c16fbbd Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 8 Jul 2020 23:52:41 +0900
Subject: Bail out when unsupported coroutine target


diff --git a/configure.ac b/configure.ac
index 1b14816..dc4ab53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2386,6 +2386,7 @@ AC_ARG_WITH(coroutine, https://github.com/ruby/ruby/blob/trunk/configure.ac#L2386
     [rb_cv_coroutine=$withval])
 AS_CASE([$rb_cv_coroutine], [yes|''], [
     AC_MSG_CHECKING(native coroutine implementation for ${target_cpu}-${target_os})
+    rb_cv_coroutine=
     AS_CASE(["$target_cpu-$target_os"],
         [x*64-darwin*], [
             rb_cv_coroutine=amd64
@@ -2397,7 +2398,7 @@ AS_CASE([$rb_cv_coroutine], [yes|''], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L2398
             AS_CASE(["$ac_cv_sizeof_voidp"],
                 [8], [ rb_cv_coroutine=amd64 ],
                 [4], [ rb_cv_coroutine=x86 ],
-                [*], [ rb_cv_coroutine= ]
+                dnl unknown pointer size, bail out as no Context.h soon.
             )
         ],
         [*86-linux*], [
@@ -2427,20 +2428,22 @@ AS_CASE([$rb_cv_coroutine], [yes|''], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L2428
         [*-openbsd*], [
             rb_cv_coroutine=copy
         ],
-        [*], [
+        [
             rb_cv_coroutine=ucontext
         ]
     )
     AC_MSG_RESULT(${rb_cv_coroutine})
 ])
 COROUTINE_H=coroutine/$rb_cv_coroutine/Context.h
+AS_IF([test ! -f "$srcdir/$COROUTINE_H"],
+      [AC_MSG_ERROR('$rb_cv_coroutine' is not supported as coroutine)])
 AS_CASE([$rb_cv_coroutine],
     [copy|ucontext], [
         COROUTINE_SRC=coroutine/$rb_cv_coroutine/Context.c
     ],
-    [*], [
+    [
         COROUTINE_SRC=coroutine/$rb_cv_coroutine/Context.'$(ASMEXT)'
-    ],
+    ]
 )
 AC_DEFINE_UNQUOTED(COROUTINE_H, ["$COROUTINE_H"])
 AC_SUBST(X_COROUTINE_H, [$COROUTINE_H])
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]