Permalink
Browse files

More chewing gum, duct tape, and baling wire.

I swear I will finish daedalus once 2.0 is released.
  • Loading branch information...
1 parent dbfeb76 commit ed115c496ce4c58ef50546d584a25619727867cd @brixen brixen committed Dec 6, 2011
Showing with 18 additions and 5 deletions.
  1. +1 −1 rakelib/ext_helper.rb
  2. +17 −4 rakelib/extensions.rake
View
2 rakelib/ext_helper.rb
@@ -141,7 +141,7 @@ def add_rbx_capi
add_cxxflag "-O2"
end
- if RUBY_VERSION =~ /^1\.8/
+ if ENV['BUILD_VERSION'] == "18"
add_include_dir include18_dir
else
add_include_dir include19_dir
View
21 rakelib/extensions.rake
@@ -48,10 +48,14 @@ def build_extconf(name, opts)
include19_dir = File.expand_path("../../vm/capi/19/include", __FILE__)
unless File.directory? BUILD_CONFIG[:runtime]
- ENV["CFLAGS"] = "-I#{include18_dir} -I#{include19_dir}"
+ if opts[:env] == "-X18"
+ ENV["CFLAGS"] = "-I#{include18_dir}"
+ else
+ ENV["CFLAGS"] = "-I#{include19_dir}"
+ end
end
- ENV["RBXOPT"] = opts[:env] if opts.key? :env
+ ENV["RBXOPT"] = opts[:env]
unless opts[:deps] and opts[:deps].all? { |n| File.exists? n }
sh("#{rbx_build} extconf.rb #{redirect}", &fail_block)
@@ -74,6 +78,8 @@ def compile_ext(name, opts={})
ext_task_name = "build"
end
+ opts[:env] ||= "-X18"
+
task_name = names.join "_"
namespace :extensions do
@@ -84,6 +90,8 @@ def compile_ext(name, opts={})
build_config = File.expand_path "../../config.rb", __FILE__
Dir.chdir ext_dir do
if File.exists? "Rakefile"
+ ENV["BUILD_VERSION"] = opts[:env][-2..-1]
+
sh "#{BUILD_CONFIG[:build_ruby]} -S #{BUILD_CONFIG[:build_rake]} #{'-t' if $verbose} -r #{build_config} -r #{ext_helper} -r #{dep_grapher} #{ext_task_name}"
else
build_extconf name, opts
@@ -112,8 +120,13 @@ File.open(build_ruby, "wb") do |f|
f.puts build_version
end
-compile_ext "melbourne", :task => "rbx", :doc => "for Rubinius"
-compile_ext "melbourne", :task => "build", :doc => "for bootstrapping"
+compile_ext "melbourne", :task => "build",
+ :doc => "for bootstrapping"
+
+melbourne_env = BUILD_CONFIG[:version_list].include?("19") ? "-X19" : "-X18"
+compile_ext "melbourne", :task => "rbx",
+ :env => melbourne_env,
+ :doc => "for Rubinius"
compile_ext "digest", :dir => "lib/digest/ext"
compile_ext "digest:md5", :dir => "lib/digest/ext/md5"

0 comments on commit ed115c4

Please sign in to comment.