]> git.wincent.com - wikitext.git/blobdiff - ext/extconf.rb
Conditional compilation for Ruby 1.8.x and 1.9.x
[wikitext.git] / ext / extconf.rb
index bfc8021cff1b10f56ad18b8a6847259fcf9c0f3a..f49c9c448a1f4978503b9cb0e0c47dc9dcf7f210 100644 (file)
@@ -28,5 +28,14 @@ def missing item
   exit 1
 end
 
+case RUBY_VERSION
+when /\A1\.8/
+  $CFLAGS += ' -DRUBY_1_8_x'
+when /\A1\.9/
+  $CFLAGS += ' -DRUBY_1_9_x'
+else
+  raise "unsupported Ruby version: #{RUBY_VERSION}"
+end
+
 have_header('ruby.h') or missing 'ruby.h'
 create_makefile('wikitext')