mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix helper to not assume glibc
This commit is contained in:
parent
0091fac1d8
commit
3e386d76c2
Notes:
git
2020-04-01 11:49:36 +09:00
1 changed files with 16 additions and 3 deletions
|
@ -32,7 +32,11 @@ when /linux/
|
||||||
# libc.so and libm.so are installed to /lib/arm-linux-gnu*.
|
# libc.so and libm.so are installed to /lib/arm-linux-gnu*.
|
||||||
# It's not installed to /lib32.
|
# It's not installed to /lib32.
|
||||||
dirs = Dir.glob('/lib/arm-linux-gnu*')
|
dirs = Dir.glob('/lib/arm-linux-gnu*')
|
||||||
|
if dirs.length > 0
|
||||||
libdir = dirs[0] if dirs && File.directory?(dirs[0])
|
libdir = dirs[0] if dirs && File.directory?(dirs[0])
|
||||||
|
else # handle alpine environment
|
||||||
|
libdir = '/lib' if File.directory? '/lib'
|
||||||
|
end
|
||||||
else
|
else
|
||||||
libdir = '/lib32' if File.directory? '/lib32'
|
libdir = '/lib32' if File.directory? '/lib32'
|
||||||
end
|
end
|
||||||
|
@ -40,8 +44,17 @@ when /linux/
|
||||||
# 64-bit ruby
|
# 64-bit ruby
|
||||||
libdir = '/lib64' if File.directory? '/lib64'
|
libdir = '/lib64' if File.directory? '/lib64'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Handle musl libc
|
||||||
|
libc = Dir.glob(File.join(libdir, "libc.musl*.so*"))
|
||||||
|
if libc && libc.length > 0
|
||||||
|
libc_so = libc[0]
|
||||||
|
libm_so = libc[0]
|
||||||
|
else
|
||||||
|
# glibc
|
||||||
libc_so = File.join(libdir, "libc.so.6")
|
libc_so = File.join(libdir, "libc.so.6")
|
||||||
libm_so = File.join(libdir, "libm.so.6")
|
libm_so = File.join(libdir, "libm.so.6")
|
||||||
|
end
|
||||||
when /mingw/, /mswin/
|
when /mingw/, /mswin/
|
||||||
require "rbconfig"
|
require "rbconfig"
|
||||||
crtname = RbConfig::CONFIG["RUBY_SO_NAME"][/msvc\w+/] || 'ucrtbase'
|
crtname = RbConfig::CONFIG["RUBY_SO_NAME"][/msvc\w+/] || 'ucrtbase'
|
||||||
|
|
Loading…
Reference in a new issue