Allow variables in modular_gc_dir

Such as `$(ruby_version)`, `$(arch)` and so on.
This commit is contained in:
Nobuyoshi Nakada 2024-12-20 16:41:58 +09:00
parent 626037e143
commit 2f2530b195
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
Notes: git 2024-12-22 13:42:57 +00:00
3 changed files with 5 additions and 1 deletions

1
gc.c
View File

@ -707,6 +707,7 @@ typedef struct gc_function_map {
static rb_gc_function_map_t rb_gc_functions;
# define RUBY_GC_LIBRARY "RUBY_GC_LIBRARY"
# define MODULAR_GC_DIR STRINGIZE(modular_gc_dir)
static void
ruby_modular_gc_init(void)

View File

@ -97,7 +97,7 @@ cppflags = @cppflags@
incflags = @incflags@
RUBY_DEVEL = @RUBY_DEVEL@ # "yes" or empty
_RUBY_DEVEL_enabled = $(RUBY_DEVEL:no=)
XCFLAGS = @XCFLAGS@ $(INCFLAGS) $(_RUBY_DEVEL_enabled:yes=-DRUBY_DEVEL=1)
XCFLAGS = @XCFLAGS@ $(INCFLAGS) $(_RUBY_DEVEL_enabled:yes=-DRUBY_DEVEL=1) -Dmodular_gc_dir="$(modular_gc_dir)"
USE_RUBYGEMS = @USE_RUBYGEMS@
USE_RUBYGEMS_ = $(USE_RUBYGEMS:yes=)
CPPFLAGS = @CPPFLAGS@ $(USE_RUBYGEMS_:no=-DDISABLE_RUBYGEMS=1)

View File

@ -156,6 +156,9 @@ DEBUGFLAGS = -Zi
!if "$(RUBY_DEVEL)" == "yes"
XCFLAGS = $(XCFLAGS) -DRUBY_DEVEL=1
!endif
!if "$(modular_gc_dir)" != ""
XCFLAGS = $(XCFLAGS) -Dmodular_gc_dir="$(modular_gc_dir)"
!endif
!if !defined(OPTFLAGS)
!if $(MSC_VER) < 1400
OPTFLAGS = -O2b2xg-