Skip to content

Commit

Permalink
Only compile extensions when MRI version is 1.9.x
Browse files Browse the repository at this point in the history
All the other implementations don't use extensions

Fixes #35
  • Loading branch information
badosu committed Oct 3, 2013
1 parent 25629da commit 266db4c
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions ext/binding_of_caller/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ def fake_makefile
end
end

def mri_2?
def mri_1_9?
defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" &&
RUBY_VERSION =~ /^2/
RUBY_VERSION =~ /^1\.9/
end

def rbx?
defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /rbx/
end

if mri_2? || rbx?
fake_makefile
else
if mri_1_9?
require 'mkmf'

$CFLAGS += " -O0"
Expand All @@ -29,5 +23,6 @@ def rbx?
end

create_makefile('binding_of_caller')
else
fake_makefile
end

0 comments on commit 266db4c

Please sign in to comment.