--- a/coroutine/copy/Context.h +++ b/coroutine/copy/Context.h @@ -13,6 +13,7 @@ #include #include #include +#include #define COROUTINE __attribute__((noreturn)) void --- a/configure.ac +++ b/configure.ac @@ -2347,7 +2347,10 @@ AS_CASE([$rb_cv_coroutine], [yes|''], [ rb_cv_coroutine=copy ], [*], [ - rb_cv_coroutine=ucontext + AC_CHECK_FUNCS([getcontext swapcontext makecontext], + [rb_cv_coroutine=ucontext], + [rb_cv_coroutine=copy; break] + ) ] ) AC_MSG_RESULT(${rb_cv_coroutine})