[前][次][番号順一覧][スレッド一覧]

ruby-changes:36835

From: nobu <ko1@a...>
Date: Sun, 21 Dec 2014 17:12:31 +0900 (JST)
Subject: [ruby-changes:36835] nobu:r48916 (trunk): fiddle: modversion may be unavailable

nobu	2014-12-21 17:12:18 +0900 (Sun, 21 Dec 2014)

  New Revision: 48916

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48916

  Log:
    fiddle: modversion may be unavailable
    
    * ext/fiddle/extconf.rb: modversion may be unavailable.

  Modified files:
    trunk/ext/fiddle/extconf.rb
Index: ext/fiddle/extconf.rb
===================================================================
--- ext/fiddle/extconf.rb	(revision 48915)
+++ ext/fiddle/extconf.rb	(revision 48916)
@@ -19,30 +19,30 @@ begin https://github.com/ruby/ruby/blob/trunk/ext/fiddle/extconf.rb#L19
   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'

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]