Permalink
Browse files

Make specs run from rake regardless of install config.

  • Loading branch information...
1 parent 39a1ae4 commit 0c1fb8ed4eece07c8c84ed1e5f9e61ffa49d7f32 Brian Ford committed Nov 29, 2009
Showing with 15 additions and 1 deletion.
  1. +8 −0 Rakefile
  2. +7 −1 spec/capi/spec_helper.rb
View
@@ -25,6 +25,14 @@ $dlext = Config::CONFIG["DLEXT"]
$: << "lib"
task :default => %w[build vm:test] do
+ unless File.directory? BUILD_CONFIG[:runtime]
+ # Setting these enables the specs to run when rbx has been configured
+ # to be installed, but rake install has not been run yet.
+ ENV["RBX_RUNTIME"] = File.expand_path "../runtime", __FILE__
+ ENV["RBX_LIB"] = File.expand_path "../lib", __FILE__
+ ENV["CFLAGS"] = "-Ivm/capi"
+ end
+
sh "bin/mspec ci -B full --background"
end
View
@@ -10,6 +10,12 @@ def compile_extension(path, name)
signature = "#{ext}.sig"
header = "#{Config::CONFIG['rubyhdrdir']}/ruby.h"
+ unless File.exists? header
+ if Object.const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == "rbx"
+ header = "vm/capi/ruby.h"
+ end
+ end
+
return lib if File.exists?(signature) and
IO.read(signature).chomp == RUBY_NAME and
File.exists?(lib) and File.mtime(lib) > File.mtime(source) and
@@ -28,7 +34,7 @@ def compile_extension(path, name)
end
cc = Config::CONFIG["CC"]
- cflags = Config::CONFIG["CFLAGS"]
+ cflags = (ENV["CFLAGS"] || Config::CONFIG["CFLAGS"]).dup
cflags += " -fPIC" unless cflags.include?("-fPIC")
incflags = "-I#{path} -I#{hdrdir}"

0 comments on commit 0c1fb8e

Please sign in to comment.