diff --git a/configure.ac b/configure.ac index 2bbce78fd05c25..6787e9b3067572 100644 --- a/configure.ac +++ b/configure.ac @@ -84,7 +84,7 @@ AC_ARG_WITH(baseruby, AC_PATH_PROG([BASERUBY], [ruby], [false]) ]) AS_IF([test "$HAVE_BASERUBY" != no], [ - RUBYOPT=- $BASERUBY --disable=gems -rerb -rfileutils -rtempfile "${tooldir}/missing-baseruby.bat" || HAVE_BASERUBY=no + RUBYOPT=- $BASERUBY --disable=gems "${tooldir}/missing-baseruby.bat" --verbose || HAVE_BASERUBY=no ]) AS_IF([test "${HAVE_BASERUBY:=no}" != no], [ AS_CASE(["$build_os"], [mingw*], [ diff --git a/tool/missing-baseruby.bat b/tool/missing-baseruby.bat index 45cee8c8788ed0..d39568fe86a7b9 100755 --- a/tool/missing-baseruby.bat +++ b/tool/missing-baseruby.bat @@ -21,5 +21,10 @@ call :warn "executable host ruby is required. use --with-baseruby option." call :warn "Note that BASERUBY must be Ruby 3.1.0 or later." call :abort (goto :eof ^;) -abort unless defined?(RubyVM::InstructionSequence) -abort if RUBY_VERSION < s[%r"warn .*Ruby ([\d.]+)(?:\.0)?",1] +verbose = true if ARGV[0] == "--verbose" +case +when !defined?(RubyVM::InstructionSequence) + abort(*(["BASERUBY must be CRuby"] if verbose)) +when RUBY_VERSION < s[%r[warn .*\KBASERUBY .*Ruby ([\d.]+)(?:\.0)?.*(?=\")],1] + abort(*(["#{$&}. Found: #{RUBY_VERSION}"] if verbose)) +end diff --git a/win32/setup.mak b/win32/setup.mak index 50090094552811..b06081cab99d98 100644 --- a/win32/setup.mak +++ b/win32/setup.mak @@ -47,7 +47,7 @@ prefix = $(prefix:\=/) @type $(config_make) >>$(MAKEFILE) @del $(config_make) > nul !if "$(HAVE_BASERUBY)" != "no" && "$(BASERUBY)" != "" - $(BASERUBY:/=\) "$(srcdir)/tool/missing-baseruby.bat" + $(BASERUBY:/=\) "$(srcdir)/tool/missing-baseruby.bat" --verbose !endif !if "$(WITH_GMP)" != "no" @($(CC) $(XINCFLAGS) < nul && (echo USE_GMP = yes) || exit /b 0) >>$(MAKEFILE)