Skip to content

Commit

Permalink
Add --with-shared-gc build flag
Browse files Browse the repository at this point in the history
  • Loading branch information
eightbitraptor committed Apr 15, 2024
1 parent f86fb1e commit a2ea4ec
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions configure.ac
Expand Up @@ -38,6 +38,7 @@ m4_include([tool/m4/ruby_replace_type.m4])dnl
m4_include([tool/m4/ruby_require_funcs.m4])dnl
m4_include([tool/m4/ruby_rm_recursive.m4])dnl
m4_include([tool/m4/ruby_setjmp_type.m4])dnl
m4_include([tool/m4/ruby_shared_gc.m4])dnl
m4_include([tool/m4/ruby_stack_grow_direction.m4])dnl
m4_include([tool/m4/ruby_thread.m4])dnl
m4_include([tool/m4/ruby_try_cflags.m4])dnl
Expand Down Expand Up @@ -3750,6 +3751,7 @@ AS_IF([test x"$gcov" = xyes], [
])

RUBY_SETJMP_TYPE
RUBY_SHARED_GC
}

[begin]_group "installation section" && {
Expand Down Expand Up @@ -4656,6 +4658,7 @@ config_summary "target OS" "$target_os"
config_summary "compiler" "$CC"
config_summary "with thread" "$THREAD_MODEL"
config_summary "with coroutine" "$coroutine_type"
config_summary "with shared GC" "$with_shared_gc"
config_summary "enable shared libs" "$ENABLE_SHARED"
config_summary "dynamic library ext" "$DLEXT"
config_summary "CFLAGS" "$cflags"
Expand Down
19 changes: 19 additions & 0 deletions tool/m4/ruby_shared_gc.m4
@@ -0,0 +1,19 @@
dnl -*- Autoconf -*-
AC_DEFUN([RUBY_SHARED_GC],[
AC_ARG_WITH(shared-gc,
AS_HELP_STRING([--with-shared-gc],
[Enable replacement of Ruby's GC from a shared library.]),
[with_shared_gc=$withval], [unset with_shared_gc]
)
AC_SUBST([with_shared_gc])
AC_MSG_CHECKING([if Ruby is build with shared GC support])
AS_IF([test "$with_shared_gc" = "yes"], [
AC_MSG_RESULT([yes])
AC_DEFINE([USE_SHARED_GC], [1])
], [
AC_MSG_RESULT([no])
with_shared_gc="no"
AC_DEFINE([USE_SHARED_GC], [0])
])
])dnl

0 comments on commit a2ea4ec

Please sign in to comment.