mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fixed the location of the shared library
On platform where searchs shared libraries by `PATH` environment variable (i.e., Windows), the shared library is installed in `bindir`. On other platforms, the library directory is directed by `libdirname` indirectly.
This commit is contained in:
parent
4a71645565
commit
146330906f
2 changed files with 6 additions and 6 deletions
|
@ -39,7 +39,9 @@ describe 'RbConfig::CONFIG' do
|
|||
|
||||
guard -> {RbConfig::TOPDIR} do
|
||||
it "libdir/LIBRUBY_SO is the path to libruby and it exists if and only if ENABLE_SHARED" do
|
||||
libdir = RbConfig::CONFIG[RbConfig::CONFIG['libdirname'] || 'libdir']
|
||||
libdirname = RbConfig::CONFIG['LIBPATHENV'] == 'PATH' ? 'bindir' :
|
||||
RbConfig::CONFIG['libdirname']
|
||||
libdir = RbConfig::CONFIG[libdirname]
|
||||
libruby_so = "#{libdir}/#{RbConfig::CONFIG['LIBRUBY_SO']}"
|
||||
case RbConfig::CONFIG['ENABLE_SHARED']
|
||||
when 'yes'
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue