Skip to content

Commit

Permalink
Improve Homebrew compatibility (#1135)
Browse files Browse the repository at this point in the history
* Allow linking to Homebrew's openssl.
* Add more search paths for better Homebrew compatibility.
  • Loading branch information
stefansundin authored Sep 8, 2020
1 parent 05bbe75 commit e2503dc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ext/mysql2/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def add_ssl_defines(header)
$CFLAGS << ' -DNO_SSL_MODE_SUPPORT' if has_no_support
end

# Homebrew openssl
$LDFLAGS << ' -L/usr/local/opt/openssl/lib' if RUBY_PLATFORM =~ /darwin/

# 2.1+
have_func('rb_absint_size')
have_func('rb_absint_singlebit_p')
Expand All @@ -42,6 +45,9 @@ def add_ssl_defines(header)
/usr/local/mysql-*
/usr/local/lib/mysql5*
/usr/local/opt/mysql5*
/usr/local/opt/mysql@*
/usr/local/opt/mysql-client
/usr/local/opt/mysql-client@*
].map { |dir| dir << '/bin' }

# For those without HOMEBREW_ROOT in PATH
Expand Down

0 comments on commit e2503dc

Please sign in to comment.