Permalink
Browse files

extconf tweaks: fail hard, add --without-readline, handle windows

  • Loading branch information...
1 parent 5cc5b76 commit b840f3bf8e73b9e08474e57bf065216edd62640b @cldwalker committed Jan 10, 2011
Showing with 7 additions and 6 deletions.
  1. +7 −6 ext/readline_line_buffer/extconf.rb
@@ -7,16 +7,17 @@ def dummy_makefile
}
end
-if RUBY_VERSION < '1.9.2' && RUBY_PLATFORM !~ /java/
+if RUBY_VERSION >= '1.9.2' || RUBY_PLATFORM[/java|mswin|mingw|bccwin|wince/i] ||
+ ARGV.include?('--without-readline')
+ dummy_makefile
+else
dir_config("readline")
have_library('readline')
if !have_header('readline/readline.h')
- puts "Bond was built without readline. To use it with readline: gem install bond" +
- " -- --with-readline-dir=/path/to/readline"
- dummy_makefile
+ abort "\n** Bond Install Error: Unable to find readline.h. Please try again. **\n"+
+ "To install with your readline: gem install bond -- --with-readline-dir=/path/to/readline\n"+
+ "To install without readline: gem install bond -- --without-readline"
else
create_makefile 'readline_line_buffer'
end
-else
- dummy_makefile
end

0 comments on commit b840f3b

Please sign in to comment.