Skip to content

Commit

Permalink
Set configure_args instead of cppflags/ldflags/dldflags for openssl
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Jul 24, 2023
1 parent b6c229a commit 6163ac0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/cext/ABI_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9
10
11 changes: 4 additions & 7 deletions lib/truffle/rbconfig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,12 @@ module RbConfig

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

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

Expand Down Expand Up @@ -131,7 +128,7 @@ module RbConfig
'ARCH_FLAG' => '',
'build' => host,
'build_os' => host_os_full,
'configure_args' => ' ',
'configure_args' => configure_args,
'CC' => cc,
'CCDLFLAGS' => '-fPIC',
'CP' => 'cp',
Expand Down
6 changes: 2 additions & 4 deletions src/main/c/openssl/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
require "mkmf"

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

dir_config_given = dir_config("openssl").any?

dir_config("kerberos")

Logging::message "=== OpenSSL for Ruby configurator ===\n"
Expand Down

0 comments on commit 6163ac0

Please sign in to comment.