aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJun Aruga <junaruga@users.noreply.github.com>2023-06-01 11:41:12 +0200
committerGitHub <noreply@github.com>2023-06-01 11:41:12 +0200
commit01f06fd26f6a5bdf31e0431909ec51eef43ac3f7 (patch)
tree1d3b9e747a5ba396c6d1a938dc670f4eae31dea6
parentbd7b593bffc3d68b8a179fa64f48c680b94f2f85 (diff)
parent8aee87305d6ef7b353e682e5dff9180b047948bf (diff)
downloadruby-openssl-01f06fd26f6a5bdf31e0431909ec51eef43ac3f7.tar.gz
Merge pull request #630 from junaruga/wip/print-compiler-version
Print the Ruby and compiler info or the command itself before compiling.
-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