Skip to content

Commit 9f7ab93

Browse files
nobudenofevil
authored andcommitted
build RUBY_REVISION may differ from target.
1 parent 5b468c9 commit 9f7ab93

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

ext/ruby_debug/extconf.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,21 @@
1212
end and
1313
have_header("vm_core.h") and have_header("iseq.h") and have_header("insns.inc") and
1414
have_header("insns_info.inc") and have_header("eval_intern.h")
15-
}
16-
17-
if RUBY_REVISION >= 26959 # rb_iseq_compile_with_option was added an argument filepath
15+
if checking_for(checking_message("if rb_iseq_compile_with_option was added an argument filepath")) do
16+
try_compile(<<SRC)
17+
#include <ruby.h>
18+
#include "vm_core.h"
19+
extern VALUE rb_iseq_new_main(NODE *node, VALUE filename, VALUE filepath);
20+
SRC
21+
end
1822
$defs << '-DRB_ISEQ_COMPILE_5ARGS'
19-
end
23+
end
24+
}
2025

2126
dir_config("ruby")
2227
name = "ruby_debug"
2328
if (ENV['rvm_ruby_string'])
24-
dest_dir = Config::CONFIG["rubyhdrdir"]
29+
dest_dir = RbConfig::CONFIG["rubyhdrdir"]
2530
with_cppflags("-I" + dest_dir) {
2631
if hdrs.call
2732
create_makefile(name)

0 commit comments

Comments
 (0)