Skip to content

Commit 9aeedbf

Browse files
committed
On linux and darwin, ensure we can resolve dlopen et al
Fixes #634
1 parent 3d93011 commit 9aeedbf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ext/sqlite3/extconf.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ def configure_packaged_libraries
9797

9898
ldflags.each { |ldflag| append_ldflags(ldflag) }
9999

100+
unless windows? || have_func("dlopen")
101+
append_ldflags("-ldl")
102+
end
103+
100104
append_cppflags("-DUSING_PACKAGED_LIBRARIES")
101105
append_cppflags("-DUSING_PRECOMPILED_LIBRARIES") if cross_build?
102106
end
@@ -194,6 +198,10 @@ def darwin?
194198
RbConfig::CONFIG["target_os"].include?("darwin")
195199
end
196200

201+
def windows?
202+
RbConfig::CONFIG["target_os"].match?(/mingw|mswin/)
203+
end
204+
197205
def print_help
198206
print(<<~TEXT)
199207
USAGE: ruby #{$PROGRAM_NAME} [options]

0 commit comments

Comments
 (0)