mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fiddle: modversion may be unavailable
* ext/fiddle/extconf.rb: modversion may be unavailable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0c8b964ef7
commit
80036df9e3
1 changed files with 17 additions and 17 deletions
|
@ -19,7 +19,10 @@ begin
|
|||
ver = Dir.glob("#{$srcdir}/libffi-*/")
|
||||
.map {|n| File.basename(n)}
|
||||
.max_by {|n| n.scan(/\d+/).map(&:to_i)}
|
||||
if ver
|
||||
unless ver
|
||||
raise "missing libffi. Please install libffi."
|
||||
end
|
||||
|
||||
libffi = Struct.new(:dir, :srcdir, :builddir, :include, :lib, :a, :cflags).new
|
||||
libffi.dir = ver
|
||||
if $srcdir == "."
|
||||
|
@ -35,14 +38,11 @@ begin
|
|||
libffi.cflags = RbConfig.expand("$(CFLAGS)", CONFIG.merge("warnflags"=>""))
|
||||
ver = ver[/libffi-(.*)/, 1]
|
||||
end
|
||||
end
|
||||
|
||||
if ver
|
||||
ver = ver.gsub(/-rc\d+/, '') # If ver contains rc version, just ignored.
|
||||
ver = (ver.split('.') + [0,0])[0,3]
|
||||
$defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d%03d' % ver }})
|
||||
else
|
||||
raise "missing libffi. Please install libffi."
|
||||
end
|
||||
|
||||
have_header 'sys/mman.h'
|
||||
|
|
Loading…
Reference in a new issue