Permalink
Browse files

allow compilation with JRuby, since it has cext, now

  • Loading branch information...
1 parent 6e881ac commit 9612e9f263b92cc6847fab9e327c4171d3d9cad7 @timfel committed Aug 3, 2010
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/rake/extensiontask.rb
@@ -32,8 +32,20 @@ def cross_compiling(&block)
@cross_compiling = block if block_given?
end
+ def binary(platform = nil)
+ if platform == "java"
+ warn_once <<-EOF
+Compiling a native C extension on JRuby. This is discouraged and a
+Java extension should be preferred.
+ EOF
+ "#{name}.#{RbConfig::MAKEFILE_CONFIG['DLEXT']}"
+ else
+ super
+ end
+ end
+
def define
- if RUBY_PLATFORM == 'java' || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ironruby')
+ if (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ironruby')
warn_once <<-EOF
WARNING: You're attempting to (cross-)compile C extensions from a platform
(#{RUBY_ENGINE}) that does not support native extensions or mkmf.rb.

1 comment on commit 9612e9f

@luislavena

Thank you,

Released in version 0.7.1

Please sign in to comment.