summaryrefslogtreecommitdiff
path: root/ext/fiddle
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-21 08:12:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-21 08:12:18 +0000
commit80036df9e365b083d029e06739b8d02ed6e15bce (patch)
tree38d21b3b3552502ce8b5da07f9e1dcb02e27a912 /ext/fiddle
parent0c8b964ef7694f73aba5e1019521bc3d540efbe7 (diff)
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
Diffstat (limited to 'ext/fiddle')
-rw-r--r--ext/fiddle/extconf.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
index 8f1ff54..d0a1bc8 100644
--- a/ext/fiddle/extconf.rb
+++ b/ext/fiddle/extconf.rb
@@ -19,30 +19,30 @@ begin
ver = Dir.glob("#{$srcdir}/libffi-*/")
.map {|n| File.basename(n)}
.max_by {|n| n.scan(/\d+/).map(&:to_i)}
- if ver
- libffi = Struct.new(:dir, :srcdir, :builddir, :include, :lib, :a, :cflags).new
- libffi.dir = ver
- if $srcdir == "."
- libffi.builddir = "#{ver}/#{RUBY_PLATFORM}"
- libffi.srcdir = "."
- else
- libffi.builddir = libffi.dir
- libffi.srcdir = relative_from("#{$srcdir}/#{ver}", "..")
- end
- libffi.include = "#{libffi.builddir}/include"
- libffi.lib = "#{libffi.builddir}/.libs"
- libffi.a = "#{libffi.lib}/libffi.#{$LIBEXT}"
- libffi.cflags = RbConfig.expand("$(CFLAGS)", CONFIG.merge("warnflags"=>""))
- ver = ver[/libffi-(.*)/, 1]
+ 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 == "."
+ libffi.builddir = "#{ver}/#{RUBY_PLATFORM}"
+ libffi.srcdir = "."
+ else
+ libffi.builddir = libffi.dir
+ libffi.srcdir = relative_from("#{$srcdir}/#{ver}", "..")
end
+ libffi.include = "#{libffi.builddir}/include"
+ libffi.lib = "#{libffi.builddir}/.libs"
+ libffi.a = "#{libffi.lib}/libffi.#{$LIBEXT}"
+ libffi.cflags = RbConfig.expand("$(CFLAGS)", CONFIG.merge("warnflags"=>""))
+ ver = ver[/libffi-(.*)/, 1]
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'