about summary refs log tree commit homepage
diff options
context:
space:
mode:
authormental <mental@19e92222-5c0b-0410-8929-a290d50e31e9>2008-06-22 03:26:22 +0000
committermental <mental@19e92222-5c0b-0410-8929-a290d50e31e9>2008-06-22 03:26:22 +0000
commit0be2b327816c4c3cf1f80cd1ac9372e1e57cdeef (patch)
tree2c7ca8d9b2863118a2d968ffcac2289b08e437f8
parent190b9ea4c86324e28357ff18ef8478d70acb025c (diff)
downloadunicorn-0be2b327816c4c3cf1f80cd1ac9372e1e57cdeef.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@1027 19e92222-5c0b-0410-8929-a290d50e31e9
-rw-r--r--projects/fastthread/ext/fastthread/extconf.rb27
1 files changed, 26 insertions, 1 deletions
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 << <<EOS
+RUBYARCHDIR = $(sitearchdir)$(target_prefix)
+
+default:
+
+install:
+        mkdir -p $(RUBYARCHDIR)
+        touch $(RUBYARCHDIR)/fastthread.rb
+
+EOS
+  end
+end