Skip to content

Commit 827dc51

Browse files
committed
Looks like Windows Ruby 2.0 still has the buggy mkmf
1 parent 84bc37c commit 827dc51

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ext/mysql2/extconf.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ def add_ssl_defines(header)
5252
# If the user has provided a --with-mysql-dir argument, we must respect it or fail.
5353
inc, lib = dir_config('mysql')
5454
if inc && lib
55+
# Ruby versions below 2.0 on Unix and below 2.1 on Windows
56+
# do not properly search for lib directories, and must be corrected:
57+
# https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/39717
58+
unless lib && lib[-3, 3] == 'lib'
59+
@libdir_basename = 'lib'
60+
inc, lib = dir_config('mysql')
61+
end
5562
abort "-----\nCannot find include dir(s) #{inc}\n-----" unless inc && inc.split(File::PATH_SEPARATOR).any? { |dir| File.directory?(dir) }
5663
abort "-----\nCannot find library dir(s) #{lib}\n-----" unless lib && lib.split(File::PATH_SEPARATOR).any? { |dir| File.directory?(dir) }
5764
warn "-----\nUsing --with-mysql-dir=#{File.dirname inc}\n-----"

0 commit comments

Comments
 (0)