From cb780ea9c88f259e2b10c17965fb69714f3e3b78 Mon Sep 17 00:00:00 2001
From: Hongli Lai (Phusion) <hongli@phusion.nl>
Date: Mon, 2 Feb 2009 14:01:53 +0100
Subject: [PATCH] Make fastthread a no-op on non-MRI 1.8 Ruby interpreters.

---
 ext/fastthread/extconf.rb |   12 +++++++++---
 setup.rb                  |   12 ++++++++----
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/ext/fastthread/extconf.rb b/ext/fastthread/extconf.rb
index fcacfd9..479a3d9 100644
--- a/ext/fastthread/extconf.rb
+++ b/ext/fastthread/extconf.rb
@@ -1,3 +1,9 @@
-require 'mkmf'
-
-create_makefile('fastthread')
+if !defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby"
+  require 'mkmf'
+  
+  create_makefile('fastthread')
+else
+  File.open('Makefile', 'w') do |f|
+    f.puts("all:")
+  end
+end
diff --git a/setup.rb b/setup.rb
index f54f84e..f259fb5 100755
--- a/setup.rb
+++ b/setup.rb
@@ -1383,11 +1383,15 @@ class Installer
   end
 
   def rubyextentions(dir)
-    ents = glob_select("*.#{@config.dllext}", targetfiles())
-    if ents.empty?
-      setup_rb_error "no ruby extention exists: 'ruby #{$0} setup' first"
+    if !defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby"
+      ents = glob_select("*.#{@config.dllext}", targetfiles())
+      if ents.empty?
+        setup_rb_error "no ruby extention exists: 'ruby #{$0} setup' first"
+      end
+      ents
+    else
+      []
     end
-    ents
   end
 
   def targetfiles
-- 
1.5.4.3


