File tree 1 file changed +22
-2
lines changed
1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 13
13
14
14
require "mkmf"
15
15
16
+ ssl_dirs = nil
16
17
if defined? ( ::TruffleRuby )
17
18
# Always respect the openssl prefix chosen by truffle/openssl-prefix
18
19
require 'truffle/openssl-prefix'
19
- dir_config_given = dir_config ( "openssl" , ENV [ "OPENSSL_PREFIX" ] ) . any?
20
+ ssl_dirs = dir_config ( "openssl" , ENV [ "OPENSSL_PREFIX" ] )
20
21
else
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."
22
42
end
23
43
24
44
dir_config ( "kerberos" )
You can’t perform that action at this time.
0 commit comments