summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-12-10 04:24:01 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-12-10 13:58:20 +0900
commitfc8d22f89124d2b7f1df5de87274e86ccefadbd2 (patch)
tree3755815b772590a703aa7c6d2a910e62c7052f18 /win32
parent7a976c106030f37d6ab72b1abaef10e575bb8809 (diff)
downloadruby-fc8d22f89124d2b7f1df5de87274e86ccefadbd2.tar.gz
Win32: Move fallback BASERUBY definition
Diffstat (limited to 'win32')
-rw-r--r--win32/Makefile.sub17
-rw-r--r--win32/setup.mak12
2 files changed, 17 insertions, 12 deletions
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 0f4dd62ac0..814681e8d8 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -16,6 +16,23 @@ empty =
MFLAGS=-l
!endif
+!if "$(BASERUBY)" == ""
+! if [for %I in (ruby.exe) do @echo BASERUBY = %~s$$PATH:I > baseruby.mk]
+! else
+! include baseruby.mk
+! endif
+! if [del baseruby.mk]
+! endif
+!else if "$(BASERUBY)" == "no" || [($(BASERUBY) -eexit) > nul 2> nul]
+BASERUBY =
+!endif
+!if "$(BASERUBY)" == ""
+BASERUBY = echo executable host ruby is required. use --with-baseruby option.^& exit 1
+HAVE_BASERUBY = no
+!else
+HAVE_BASERUBY = yes
+!endif
+
!ifndef REVISION_FORCE
!if "$(HAVE_BASERUBY)" == "yes"
REVISION_FORCE = PHONY
diff --git a/win32/setup.mak b/win32/setup.mak
index ddad061442..2ae4e1cfd5 100644
--- a/win32/setup.mak
+++ b/win32/setup.mak
@@ -67,19 +67,7 @@ MJIT_SUPPORT = $(MJIT_SUPPORT)
<<
!if defined(BASERUBY)
@echo BASERUBY = $(BASERUBY:/=\)>> $(MAKEFILE)
-!else
- @for %I in (ruby.exe) do @echo BASERUBY = %~s$$PATH:I --disable=gems>> $(MAKEFILE)
!endif
- @type << >> $(MAKEFILE)
-$(BANG)if "$$(BASERUBY)" == ""
-BASERUBY = echo executable host ruby is required. use --with-baseruby option.^& exit 1
-HAVE_BASERUBY = no
-$(BANG)elseif [($$(BASERUBY) -eexit) > nul 2> nul] == 0
-HAVE_BASERUBY = yes
-$(BANG)else
-HAVE_BASERUBY = no
-$(BANG)endif
-<<
!if "$(RUBY_DEVEL)" == "yes"
RUBY_DEVEL = yes
!endif