Skip to content

Commit

Permalink
More chewing gum, duct tape, and baling wire.
Browse files Browse the repository at this point in the history
I swear I will finish daedalus once 2.0 is released.
  • Loading branch information
brixen committed Dec 6, 2011
1 parent dbfeb76 commit ed115c4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rakelib/ext_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def add_rbx_capi
add_cxxflag "-O2" add_cxxflag "-O2"
end end


if RUBY_VERSION =~ /^1\.8/ if ENV['BUILD_VERSION'] == "18"
add_include_dir include18_dir add_include_dir include18_dir
else else
add_include_dir include19_dir add_include_dir include19_dir
Expand Down
21 changes: 17 additions & 4 deletions rakelib/extensions.rake
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@ def build_extconf(name, opts)
include19_dir = File.expand_path("../../vm/capi/19/include", __FILE__) include19_dir = File.expand_path("../../vm/capi/19/include", __FILE__)


unless File.directory? BUILD_CONFIG[:runtime] 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 end


ENV["RBXOPT"] = opts[:env] if opts.key? :env ENV["RBXOPT"] = opts[:env]


unless opts[:deps] and opts[:deps].all? { |n| File.exists? n } unless opts[:deps] and opts[:deps].all? { |n| File.exists? n }
sh("#{rbx_build} extconf.rb #{redirect}", &fail_block) sh("#{rbx_build} extconf.rb #{redirect}", &fail_block)
Expand All @@ -74,6 +78,8 @@ def compile_ext(name, opts={})
ext_task_name = "build" ext_task_name = "build"
end end


opts[:env] ||= "-X18"

task_name = names.join "_" task_name = names.join "_"


namespace :extensions do namespace :extensions do
Expand All @@ -84,6 +90,8 @@ def compile_ext(name, opts={})
build_config = File.expand_path "../../config.rb", __FILE__ build_config = File.expand_path "../../config.rb", __FILE__
Dir.chdir ext_dir do Dir.chdir ext_dir do
if File.exists? "Rakefile" 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}" 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 else
build_extconf name, opts build_extconf name, opts
Expand Down Expand Up @@ -112,8 +120,13 @@ File.open(build_ruby, "wb") do |f|
f.puts build_version f.puts build_version
end end


compile_ext "melbourne", :task => "rbx", :doc => "for Rubinius" compile_ext "melbourne", :task => "build",
compile_ext "melbourne", :task => "build", :doc => "for bootstrapping" :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", :dir => "lib/digest/ext"
compile_ext "digest:md5", :dir => "lib/digest/ext/md5" compile_ext "digest:md5", :dir => "lib/digest/ext/md5"
Expand Down

0 comments on commit ed115c4

Please sign in to comment.