Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

More chewing gum, duct tape, and baling wire.

I swear I will finish daedalus once 2.0 is released.
  • Loading branch information...
commit ed115c496ce4c58ef50546d584a25619727867cd 1 parent dbfeb76
Brian Shirai authored December 06, 2011
2  rakelib/ext_helper.rb
@@ -141,7 +141,7 @@ def add_rbx_capi
141 141
     add_cxxflag "-O2"
142 142
   end
143 143
 
144  
-  if RUBY_VERSION =~ /^1\.8/
  144
+  if ENV['BUILD_VERSION'] == "18"
145 145
     add_include_dir include18_dir
146 146
   else
147 147
     add_include_dir include19_dir
21  rakelib/extensions.rake
@@ -48,10 +48,14 @@ def build_extconf(name, opts)
48 48
   include19_dir = File.expand_path("../../vm/capi/19/include", __FILE__)
49 49
 
50 50
   unless File.directory? BUILD_CONFIG[:runtime]
51  
-    ENV["CFLAGS"]      = "-I#{include18_dir} -I#{include19_dir}"
  51
+    if opts[:env] == "-X18"
  52
+      ENV["CFLAGS"] = "-I#{include18_dir}"
  53
+    else
  54
+      ENV["CFLAGS"] = "-I#{include19_dir}"
  55
+    end
52 56
   end
53 57
 
54  
-  ENV["RBXOPT"] = opts[:env] if opts.key? :env
  58
+  ENV["RBXOPT"] = opts[:env]
55 59
 
56 60
   unless opts[:deps] and opts[:deps].all? { |n| File.exists? n }
57 61
     sh("#{rbx_build} extconf.rb #{redirect}", &fail_block)
@@ -74,6 +78,8 @@ def compile_ext(name, opts={})
74 78
     ext_task_name = "build"
75 79
   end
76 80
 
  81
+  opts[:env] ||= "-X18"
  82
+
77 83
   task_name = names.join "_"
78 84
 
79 85
   namespace :extensions do
@@ -84,6 +90,8 @@ def compile_ext(name, opts={})
84 90
       build_config = File.expand_path "../../config.rb", __FILE__
85 91
       Dir.chdir ext_dir do
86 92
         if File.exists? "Rakefile"
  93
+          ENV["BUILD_VERSION"] = opts[:env][-2..-1]
  94
+
87 95
           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}"
88 96
         else
89 97
           build_extconf name, opts
@@ -112,8 +120,13 @@ File.open(build_ruby, "wb") do |f|
112 120
   f.puts build_version
113 121
 end
114 122
 
115  
-compile_ext "melbourne", :task => "rbx", :doc => "for Rubinius"
116  
-compile_ext "melbourne", :task => "build", :doc => "for bootstrapping"
  123
+compile_ext "melbourne", :task => "build",
  124
+                         :doc => "for bootstrapping"
  125
+
  126
+melbourne_env = BUILD_CONFIG[:version_list].include?("19") ? "-X19" : "-X18"
  127
+compile_ext "melbourne", :task => "rbx",
  128
+                         :env => melbourne_env,
  129
+                         :doc => "for Rubinius"
117 130
 
118 131
 compile_ext "digest", :dir => "lib/digest/ext"
119 132
 compile_ext "digest:md5", :dir => "lib/digest/ext/md5"

0 notes on commit ed115c4

Please sign in to comment.
Something went wrong with that request. Please try again.