From 7988efdf8d4a6450d413c17c812524fb4c82f895 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Thu, 19 Dec 2024 02:56:37 +0900 Subject: [PATCH] Set `$have_devel = true` for static build Previously, mkmf failed with --disable-component-model build, because it attempted to link during have_devel check but ruby is not installed yet. This change reverts 70068a6140534f693eb895a4cb2c0b88769dd3fd partially. Setting `$have_devel = true` skips have_devel check. --- lib/ruby_wasm/build/product/crossruby.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/ruby_wasm/build/product/crossruby.rb b/lib/ruby_wasm/build/product/crossruby.rb index 73ec915507..df0a8887b8 100644 --- a/lib/ruby_wasm/build/product/crossruby.rb +++ b/lib/ruby_wasm/build/product/crossruby.rb @@ -90,10 +90,15 @@ def do_legacy_extconf(executor, crossruby) "--disable=gems", # HACK: top_srcdir is required to find ruby headers "-e", - %Q($top_srcdir="#{source.src_dir}"), + %Q($top_srcdir=ENV["top_srcdir"]="#{source.src_dir}"), # HACK: extout is required to find config.h "-e", - %Q($extout="#{crossruby.build_dir}/.ext"), + %Q($extout=ENV["extout"]="#{crossruby.build_dir}/.ext"), + *(@features.support_component_model? ? [] : [ + # HACK: skip have_devel check since ruby is not installed yet + "-e", + "$have_devel = true", + ]), # HACK: force static ext build by imitating extmk "-e", "$static = true; trace_var(:$static) {|v| $static = true }",