From 0be2b327816c4c3cf1f80cd1ac9372e1e57cdeef Mon Sep 17 00:00:00 2001 From: mental Date: Sun, 22 Jun 2008 03:26:22 +0000 Subject: make native build a noop on Rubies that have no real need for fastthread git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@1027 19e92222-5c0b-0410-8929-a290d50e31e9 --- projects/fastthread/ext/fastthread/extconf.rb | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/projects/fastthread/ext/fastthread/extconf.rb b/projects/fastthread/ext/fastthread/extconf.rb index fcacfd9..5f3fa2c 100644 --- a/projects/fastthread/ext/fastthread/extconf.rb +++ b/projects/fastthread/ext/fastthread/extconf.rb @@ -1,3 +1,28 @@ require 'mkmf' -create_makefile('fastthread') +version_components = RUBY_VERSION.split('.').map { |c| c.to_i } + +need_fastthread = ( !defined? RUBY_ENGINE ) +need_fastthread &= ( RUBY_PLATFORM != 'java' ) +need_fastthread &= ( version_components[0..1] == [1, 8] && ( version_components[2] < 6 || version_components[2] == 6 && RUBY_PATCHLEVEL < 111 ) ) + +if need_fastthread + create_makefile('fastthread') +else + File.open('Makefile', 'w') do |stream| + CONFIG.each do |key, value| + stream.puts "#{key} = #{value}" + end + stream.puts + stream << <