Skip to content

Commit a1275db

Browse files
committed
Re-apply Truffle changes.
1 parent a369d7f commit a1275db

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/main/c/openssl/extconf.rb

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@
1313

1414
require "mkmf"
1515

16-
dir_config("openssl")
16+
if defined?(::TruffleRuby)
17+
require 'truffle/openssl-prefix'
18+
dir_config("openssl", ENV["OPENSSL_PREFIX"])
19+
else
20+
dir_config("openssl")
21+
end
22+
1723
dir_config("kerberos")
1824

1925
Logging::message "=== OpenSSL for Ruby configurator ===\n"
@@ -102,6 +108,13 @@ def find_openssl_library
102108
"is installed."
103109
end
104110

111+
# TruffleRuby: do not perform all checks again if extconf.h already exists
112+
extconf_h = "#{__dir__}/extconf.h"
113+
if File.exist?(extconf_h) && File.mtime(extconf_h) >= File.mtime(__FILE__ ) && !Truffle::OPENSSL_PREFIX_WAS_SET
114+
$extconf_h = extconf_h
115+
else
116+
### START of checks
117+
105118
version_ok = if have_macro("LIBRESSL_VERSION_NUMBER", "openssl/opensslv.h")
106119
is_libressl = true
107120
checking_for("LibreSSL version >= 3.1.0") {
@@ -184,5 +197,9 @@ def find_openssl_library
184197
Logging::message "=== Checking done. ===\n"
185198

186199
create_header
200+
201+
### END of checks
202+
end
203+
187204
create_makefile("openssl")
188205
Logging::message "Done.\n"

0 commit comments

Comments
 (0)