summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2022-07-29 13:54:27 -0400
committerYuta Saito <kateinoigakukun@gmail.com>2022-08-04 16:29:22 +0900
commite5a3f232563139fdf15660d54aeaec112ffc2349 (patch)
tree8a4c23500804f5d370d85216e6d73e6d7d14beb7 /ext/extmk.rb
parentc69582a5401ac7b6e59b87a8bcc8636c27eb923e (diff)
downloadruby-e5a3f232563139fdf15660d54aeaec112ffc2349.tar.gz
Use $(bindir) for path to executable in mkmf
For the macOS -bundle_loader linker option, we need a path to the Ruby exectuable. $(RUBY) is not necessarily a path since it could be a command line invocation. That happens during build with runruby.rb and can happen post installation if the user passes the --ruby option to a extconf.rb. Use $(bindir) to locate the executable instead. Before installation, $(bindir) doesn't exist, so we need to be able to override $(BUILTRUBY) in such situations so test-spec and bundled extensions could build. Use a new mkmf global, $builtruby, to do this; set it in fake.rb and in extmk.rb. Our build system is quite complex...
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-xext/extmk.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 70067d28b8..b0d84ef00f 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -417,7 +417,6 @@ elsif CONFIG['EXTSTATIC']
else
$ruby = '$(topdir)/ruby' + EXEEXT
end
-$mflags << "BUILTRUBY=#$ruby"
$ruby = [$ruby]
$ruby << "-I'$(topdir)'"
unless CROSS_COMPILING
@@ -428,6 +427,7 @@ end
topruby = $ruby
$ruby = topruby.join(' ')
$mflags << "ruby=#$ruby"
+$builtruby = '$(topdir)/ruby' + EXEEXT # Must be an executable path
MTIMES = [__FILE__, 'rbconfig.rb', srcdir+'/lib/mkmf.rb'].collect {|f| File.mtime(f)}