aboutsummaryrefslogtreecommitdiffstats
path: root/Rakefile
diff options
context:
space:
mode:
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/Rakefile b/Rakefile
index 475e428f..a850c8b0 100644
--- a/Rakefile
+++ b/Rakefile
@@ -5,6 +5,8 @@ require 'bundler/gem_tasks'
begin
require 'rake/extensiontask'
Rake::ExtensionTask.new('openssl')
+ # Run the debug_compiler task before the compile task.
+ Rake::Task['compile'].prerequisites.unshift :debug_compiler
rescue LoadError
warn "rake-compiler not installed. Run 'bundle install' to " \
"install testing dependency gems."
@@ -22,6 +24,19 @@ RDoc::Task.new do |rdoc|
end
task :test => [:compile, :debug]
+
+# Print Ruby and compiler info for debugging purpose.
+task :debug_compiler do
+ ruby '-v'
+ compiler = RbConfig::CONFIG['CC']
+ case compiler
+ when 'gcc', 'clang'
+ sh "#{compiler} --version"
+ else
+ puts "Compiler: #{RbConfig::CONFIG['CC']}"
+ end
+end
+
task :debug do
ruby "-I./lib -ropenssl -ve'puts OpenSSL::OPENSSL_VERSION, OpenSSL::OPENSSL_LIBRARY_VERSION'"
end