Skip to content

Commit 5cb8f7d

Browse files
committed
workaround for bug in mkmf
works-around a known bug in mkmf, which was resolved in https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/39717 Since the current Windows Ruby distribution doesn't include this fix yet, we work around it by detecting whether mkmf is functioning properly or not, and fixing it if it's not. This behavior will degrade gracefully if the user is running a version of mkmf with the fix.
1 parent bcdcc86 commit 5cb8f7d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ext/mysql2/extconf.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ def asplode lib
2929

3030
if RUBY_PLATFORM =~ /mswin|mingw/
3131
inc, lib = dir_config('mysql')
32+
33+
# Ruby versions not incorporating the mkmf fix at
34+
# https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/39717
35+
# do not properly search for lib directories, and must be corrected
36+
unless lib[-3, 3] == 'lib'
37+
@libdir_basename = 'lib'
38+
inc, lib = dir_config('mysql')
39+
end
3240
exit 1 unless have_library("libmysql")
3341
elsif mc = (with_config('mysql-config') || Dir[GLOB].first) then
3442
mc = Dir[GLOB].first if mc == true

0 commit comments

Comments
 (0)