File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 1313
1414require "mkmf"
1515
16+ ssl_dirs = nil
1617if defined? ( ::TruffleRuby )
1718 # Always respect the openssl prefix chosen by truffle/openssl-prefix
1819 require 'truffle/openssl-prefix'
19- dir_config_given = dir_config ( "openssl" , ENV [ "OPENSSL_PREFIX" ] ) . any?
20+ ssl_dirs = dir_config ( "openssl" , ENV [ "OPENSSL_PREFIX" ] )
2021else
21- dir_config_given = dir_config ( "openssl" ) . any?
22+ ssl_dirs = dir_config ( "openssl" )
23+ end
24+ dir_config_given = ssl_dirs . any?
25+
26+ _ , ssl_ldir = ssl_dirs
27+ if ssl_ldir &.split ( File ::PATH_SEPARATOR ) &.none? { |dir | File . directory? ( dir ) }
28+ # According to the `mkmf.rb#dir_config`, the `--with-openssl-dir=<dir>` uses
29+ # the value of the `File.basename(RbConfig::MAKEFILE_CONFIG["libdir"])` as a
30+ # loaded library directory name.
31+ ruby_ldir_name = File . basename ( RbConfig ::MAKEFILE_CONFIG [ "libdir" ] )
32+
33+ raise "OpenSSL library directory could not be found in '#{ ssl_ldir } '. " \
34+ "You might want to fix this error in one of the following ways.\n " \
35+ " * Recompile OpenSSL by configuring it with --libdir=#{ ruby_ldir_name } " \
36+ " to specify the OpenSSL library directory.\n " \
37+ " * Recompile Ruby by configuring it with --libdir=<dir> to specify the " \
38+ "Ruby library directory.\n " \
39+ " * Compile this openssl gem with --with-openssl-include=<dir> and " \
40+ "--with-openssl-lib=<dir> options to specify the OpenSSL include and " \
41+ "library directories."
2242end
2343
2444dir_config ( "kerberos" )
You can’t perform that action at this time.
0 commit comments