-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GR-18163] Fix building native with OpenSSL 3
PullRequest: truffleruby/4412
- Loading branch information
Showing
1 changed file
with
5 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,10 @@ | |
# GNU General Public License version 2, or | ||
# GNU Lesser General Public License version 2.1. | ||
|
||
# From https://openssl-library.org/policies/releasestrat/index.html | ||
# 3.0 is LTS, 3.1+ is non-LTS and 1.1 is EOL | ||
# Set OPENSSL_PREFIX in ENV to find the OpenSSL headers | ||
|
||
# See the existing formula at https://github.com/Homebrew/homebrew-core/tree/master/Formula/o | ||
search_homebrew = -> homebrew { | ||
if prefix = "#{homebrew}/opt/[email protected]" and Dir.exist?(prefix) | ||
prefix | ||
elsif prefix = "#{homebrew}/opt/openssl@3" and Dir.exist?(prefix) | ||
prefix | ||
elsif prefix = "#{homebrew}/opt/[email protected]" and Dir.exist?(prefix) | ||
if prefix = "#{homebrew}/opt/[email protected]" and Dir.exist?(prefix) | ||
prefix | ||
elsif prefix = "#{homebrew}/opt/openssl" and Dir.exist?(prefix) | ||
prefix | ||
|
@@ -32,20 +26,17 @@ | |
homebrew = `brew --prefix 2>/dev/null`.strip | ||
homebrew = nil unless $?.success? and !homebrew.empty? and Dir.exist?(homebrew) | ||
|
||
# See https://ports.macports.org/search/?q=openssl&name=on for the list of MacPorts openssl ports | ||
if homebrew and prefix = search_homebrew.call(homebrew) | ||
# found | ||
elsif Dir.exist?('/opt/local/libexec/openssl3') | ||
prefix = '/opt/local/libexec/openssl3' | ||
elsif Dir.exist?('/opt/local/libexec/openssl11') | ||
elsif Dir.exist?('/opt/local/libexec/openssl11') # MacPorts, prefer OpenSSL 1.1 as known to be compatible | ||
prefix = '/opt/local/libexec/openssl11' | ||
elsif Dir.exist?('/opt/local/include/openssl') # symlinks, unknown version | ||
# MacPorts, try the generic version, too, but might not be compatible | ||
elsif Dir.exist?('/opt/local/include/openssl') | ||
prefix = '/opt/local' | ||
end | ||
end | ||
|
||
if prefix | ||
# Set OPENSSL_PREFIX in ENV to find the OpenSSL headers | ||
ENV['OPENSSL_PREFIX'] = prefix | ||
else | ||
abort 'Could not find OpenSSL headers, install via Homebrew or MacPorts or set OPENSSL_PREFIX' | ||
|