| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Mongrel
Revision: 1027
Author: mental
Date: 21 Jun 2008 23:26:22
Changes:make native build a noop on Rubies that have no real need for fastthread
Files:| ... | ...@@ -1,3 +1,28 @@ | |
| 1 | 1 | require 'mkmf' |
| 2 | 2 | |
| 3 | create_makefile('fastthread') | |
| 3 | version_components = RUBY_VERSION.split('.').map { |c| c.to_i } | |
| 4 | ||
| 5 | need_fastthread = ( !defined? RUBY_ENGINE ) | |
| 6 | need_fastthread &= ( RUBY_PLATFORM != 'java' ) | |
| 7 | need_fastthread &= ( version_components[0..1] == [1, 8] && ( version_components[2] < 6 || version_components[2] == 6 && RUBY_PATCHLEVEL < 111 ) ) | |
| 8 | ||
| 9 | if need_fastthread | |
| 10 | create_makefile('fastthread') | |
| 11 | else | |
| 12 | File.open('Makefile', 'w') do |stream| | |
| 13 | CONFIG.each do |key, value| | |
| 14 | stream.puts "#{key} = #{value}" | |
| 15 | end | |
| 16 | stream.puts | |
| 17 | stream << <<EOS | |
| 18 | RUBYARCHDIR = $(sitearchdir)$(target_prefix) | |
| 19 | ||
| 20 | default: | |
| 21 | ||
| 22 | install: | |
| 23 | mkdir -p $(RUBYARCHDIR) | |
| 24 | touch $(RUBYARCHDIR)/fastthread.rb | |
| 25 | ||
| 26 | EOS | |
| 27 | end | |
| 28 | end |