[Bug #20687] Exclude just built ruby as baseruby

On Windows, an executable file in the current directory has the
priority to the PATH environment variable always.
This commit is contained in:
Nobuyoshi Nakada 2024-08-21 20:43:56 +09:00
parent 6ab591f80a
commit 7845ab1bc9
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465

View File

@ -18,8 +18,11 @@ MFLAGS=-l
!endif !endif
!if "$(BASERUBY)" == "" !if "$(BASERUBY)" == ""
! if [ruby $(tooldir)/missing-baseruby.bat 2> nul] # After `nmake`, just built `ruby.exe` exists in the build directory,
! else if [for %I in (ruby.exe) do @echo BASERUBY = %~s$$PATH:I > baseruby.mk] # and is searched first prior to $PATH. Assume that no ruby
# executable in $(tooldir).
! if [cd $(tooldir) && ruby missing-baseruby.bat 2> nul]
! else if [(cd $(tooldir) && for %I in (ruby.exe) do @echo BASERUBY = %~s$$PATH:I) > baseruby.mk]
! else ! else
! include baseruby.mk ! include baseruby.mk
! endif ! endif