Skip to content

Commit e2503dc

Browse files
authored
Improve Homebrew compatibility (#1135)
* Allow linking to Homebrew's openssl. * Add more search paths for better Homebrew compatibility.
1 parent 05bbe75 commit e2503dc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/mysql2/extconf.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def add_ssl_defines(header)
2121
$CFLAGS << ' -DNO_SSL_MODE_SUPPORT' if has_no_support
2222
end
2323

24+
# Homebrew openssl
25+
$LDFLAGS << ' -L/usr/local/opt/openssl/lib' if RUBY_PLATFORM =~ /darwin/
26+
2427
# 2.1+
2528
have_func('rb_absint_size')
2629
have_func('rb_absint_singlebit_p')
@@ -42,6 +45,9 @@ def add_ssl_defines(header)
4245
/usr/local/mysql-*
4346
/usr/local/lib/mysql5*
4447
/usr/local/opt/mysql5*
48+
/usr/local/opt/mysql@*
49+
/usr/local/opt/mysql-client
50+
/usr/local/opt/mysql-client@*
4551
].map { |dir| dir << '/bin' }
4652

4753
# For those without HOMEBREW_ROOT in PATH

0 commit comments

Comments
 (0)