Skip to content

Commit 6163ac0

Browse files
committed
Set configure_args instead of cppflags/ldflags/dldflags for openssl
* See ruby/openssl#650 (comment) * Fixes #3170
1 parent b6c229a commit 6163ac0

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

lib/cext/ABI_version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9
1+
10

lib/truffle/rbconfig.rb

+4-7
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,12 @@ module RbConfig
9494

9595
toolchain_path = Truffle::Boot.toolchain_paths(:PATH)
9696

97+
configure_args = ''
9798
# Make C extensions use the same libssl as the one used for the openssl C extension
9899
if Truffle::Platform.darwin?
99100
require 'truffle/openssl-prefix'
100-
openssl_prefix = ENV['OPENSSL_PREFIX']
101-
if openssl_prefix
102-
# Change the same variables as MRI's --with-opt-dir configure option would
103-
cppflags << " -I#{openssl_prefix}/include"
104-
ldflags << " -L#{openssl_prefix}/lib"
105-
dldflags << " -L#{openssl_prefix}/lib"
101+
if openssl_prefix = ENV['OPENSSL_PREFIX']
102+
configure_args << " '--with-openssl-dir=#{openssl_prefix}'"
106103
end
107104
end
108105

@@ -131,7 +128,7 @@ module RbConfig
131128
'ARCH_FLAG' => '',
132129
'build' => host,
133130
'build_os' => host_os_full,
134-
'configure_args' => ' ',
131+
'configure_args' => configure_args,
135132
'CC' => cc,
136133
'CCDLFLAGS' => '-fPIC',
137134
'CP' => 'cp',

src/main/c/openssl/extconf.rb

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
require "mkmf"
1515

1616
if defined?(::TruffleRuby)
17-
require 'truffle/openssl-prefix'
18-
dir_config_given = dir_config("openssl", ENV["OPENSSL_PREFIX"]).any?
1917
# Needed with libssl 3.0.0 and -Werror from building core C extensions
2018
$warnflags += ' -Wno-deprecated-declarations'
21-
else
22-
dir_config_given = dir_config("openssl").any?
2319
end
2420

21+
dir_config_given = dir_config("openssl").any?
22+
2523
dir_config("kerberos")
2624

2725
Logging::message "=== OpenSSL for Ruby configurator ===\n"

0 commit comments

Comments
 (0)