1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
def fake_makefile
File.open(File.join(File.dirname(__FILE__), "Makefile"), "w") do |f|
f.puts %[install:\n\techo "Nada."]
f.puts %[\nclean:\n\techo "Nada."]
end
end
def mri_2?
defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" &&
RUBY_VERSION =~ /^2/
end
def rbx?
defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /rbx/
end
if mri_2? || rbx?
fake_makefile
else
require 'mkmf'
$CFLAGS += " -O0"
$CFLAGS += " -std=c99"
case RUBY_VERSION
when /1.9.2/
$CFLAGS += " -I./ruby_headers/192/ -DRUBY_192"
when /1.9.3/
$CFLAGS += " -I./ruby_headers/193/ -DRUBY_193"
end
create_makefile('binding_of_caller')
end
|