Ticket #132: extconf.rb
| File extconf.rb, 365 bytes (added by manveru, 7 months ago) |
|---|
| Line | |
|---|---|
| 1 | require 'mkmf' |
| 2 | |
| 3 | dir_config("hpricot_scan") |
| 4 | have_library("c", "main") |
| 5 | |
| 6 | create_makefile("hpricot_scan") |
| 7 | |
| 8 | if RUBY_VERSION >= '1.9.0' |
| 9 | puts "Hackfixing all .c files to work on ruby 1.9" |
| 10 | |
| 11 | Dir['*.c'].each do |c| |
| 12 | source = File.read(c).gsub(/RSTRING\((\w+)\)->(\w+)/){ |
| 13 | "RSTRING_#{$2.upcase}(#$1)" |
| 14 | } |
| 15 | File.open(c, 'w+'){|io| io.write(source) } |
| 16 | end |
| 17 | end |
