aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/optional/capi/spec_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/optional/capi/spec_helper.rb')
-rw-r--r--spec/ruby/optional/capi/spec_helper.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/spec/ruby/optional/capi/spec_helper.rb b/spec/ruby/optional/capi/spec_helper.rb
index 74a6325fe0..a7029a74ed 100644
--- a/spec/ruby/optional/capi/spec_helper.rb
+++ b/spec/ruby/optional/capi/spec_helper.rb
@@ -32,11 +32,9 @@ def compile_extension(name)
ruby_header = "#{RbConfig::CONFIG['rubyhdrdir']}/ruby.h"
if RbConfig::CONFIG["ENABLE_SHARED"] == "yes"
- if PlatformGuard.windows?
- libruby_so = "#{RbConfig::CONFIG['bindir']}/#{RbConfig::CONFIG['LIBRUBY_SO']}"
- else
- libruby_so = "#{RbConfig::CONFIG['libdir']}/#{RbConfig::CONFIG['LIBRUBY_SO']}"
- end
+ libdirname = RbConfig::CONFIG['LIBPATHENV'] == 'PATH' ? 'bindir' :
+ RbConfig::CONFIG['libdirname'] # defined since 2.1
+ libruby_so = "#{RbConfig::CONFIG[libdirname]}/#{RbConfig::CONFIG['LIBRUBY_SO']}"
end
begin