Permalink
Browse files

Merge master.

  • Loading branch information...
1 parent ac331b4 commit 31a0d90de3eae859ee58474d7ca61dd68ceffd17 Brian Ford committed Nov 22, 2010
Showing with 23 additions and 7 deletions.
  1. +15 −3 Rakefile
  2. +8 −4 configure
View
18 Rakefile
@@ -44,9 +44,21 @@ unless BUILD_CONFIG[:which_ruby] == :ruby or BUILD_CONFIG[:which_ruby] == :rbx
exit 1
end
-bin = RbConfig::CONFIG["RUBY_INSTALL_NAME"] || RbConfig::CONFIG["ruby_install_name"]
-bin << (RbConfig::CONFIG['EXEEXT'] || RbConfig::CONFIG['exeext'] || '')
-build_ruby = File.join(RbConfig::CONFIG['bindir'], bin)
+# Records the full path to the ruby executable that runs this configure
+# script. That path will be made available to the rest of the build system
+# so the same version of ruby is invoked as needed.
+#
+# This is duplicated from the configure script for now.
+@build_ruby = nil
+
+def build_ruby
+ unless @build_ruby
+ bin = RbConfig::CONFIG["RUBY_INSTALL_NAME"] || RbConfig::CONFIG["ruby_install_name"]
+ bin += (RbConfig::CONFIG['EXEEXT'] || RbConfig::CONFIG['exeext'] || '')
+ @build_ruby = File.join(RbConfig::CONFIG['bindir'], bin)
+ end
+ @build_ruby
+end
unless BUILD_CONFIG[:build_ruby] == build_ruby
STDERR.puts "\nUnable to build using the running Ruby executable.\n\n"
View
12 configure
@@ -39,6 +39,7 @@ class Configure
@install = false
@version_19 = false
@version_20 = false
+ @build_ruby = nil
# LLVM settings
@use_llvm = true
@@ -561,7 +562,7 @@ class Configure
system "./#{basename}"
return $?.exitstatus
ensure
- File.delete *Dir["#{basename}*"]
+ File.delete(*Dir["#{basename}*"])
end
end
@@ -708,9 +709,12 @@ int main() { return tgetnum(""); }
# script. That path will be made available to the rest of the build system
# so the same version of ruby is invoked as needed.
def build_ruby
- bin = RbConfig::CONFIG["RUBY_INSTALL_NAME"] || RbConfig::CONFIG["ruby_install_name"]
- bin << (RbConfig::CONFIG['EXEEXT'] || RbConfig::CONFIG['exeext'] || '')
- File.join(RbConfig::CONFIG['bindir'], bin)
+ unless @build_ruby
+ bin = RbConfig::CONFIG["RUBY_INSTALL_NAME"] || RbConfig::CONFIG["ruby_install_name"]
+ bin += (RbConfig::CONFIG['EXEEXT'] || RbConfig::CONFIG['exeext'] || '')
+ @build_ruby = File.join(RbConfig::CONFIG['bindir'], bin)
+ end
+ @build_ruby
end
def get_system_name

0 comments on commit 31a0d90

Please sign in to comment.