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

ruby-changes:45325

From: nobu <ko1@a...>
Date: Mon, 23 Jan 2017 11:19:08 +0900 (JST)
Subject: [ruby-changes:45325] nobu:r57398 (trunk): extinit.c.tmpl: drop after dot

nobu	2017-01-23 11:19:00 +0900 (Mon, 23 Jan 2017)

  New Revision: 57398

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

  Log:
    extinit.c.tmpl: drop after dot
    
    * template/extinit.c.tmpl: drop rest from the first dot in the
      base name of a feature is ignored since r30464.

  Modified files:
    trunk/ext/extmk.rb
    trunk/template/extinit.c.tmpl
Index: template/extinit.c.tmpl
===================================================================
--- template/extinit.c.tmpl	(revision 57397)
+++ template/extinit.c.tmpl	(revision 57398)
@@ -1,16 +1,17 @@ https://github.com/ruby/ruby/blob/trunk/template/extinit.c.tmpl#L1
 %# -*- C -*-
+% extinits = ARGV.map {|n| [n[%r[[^/.]+(?=\.[^/]*)?\z]], n]}
 #include "ruby/ruby.h"
 
 #define init(func, name) {	\
     extern void func(void);	\
-    ruby_init_ext(name, func);	\
+    ruby_init_ext(name".so", func); \
 }
 
 void ruby_init_ext(const char *name, void (*init)(void));
 
 void Init_ext(void)
 {
-% ARGV.each do |n|
-    init(Init_<%=n.sub(/,(.*)/, ', "\1.so"')%>);
+% extinits.each do |f, n|
+    init(Init_<%=f%>, <%=n.dump%>);
 % end
 }
Index: ext/extmk.rb
===================================================================
--- ext/extmk.rb	(revision 57397)
+++ ext/extmk.rb	(revision 57398)
@@ -645,7 +645,7 @@ $extobjs ||= [] https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L645
 $extpath ||= []
 $extflags ||= ""
 $extlibs ||= []
-extinits = {}
+extinits = []
 unless $extlist.empty?
   list = $extlist.dup
   built = []
@@ -660,7 +660,7 @@ unless $extlist.empty? https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L660
       next
     end
     base = File.basename(feature)
-    extinits[base] = feature
+    extinits << feature
     $extobjs << format("ext/%s/%s.%s", target, base, $LIBEXT)
     built << target
   end
@@ -731,7 +731,7 @@ if $configure_only and $command_output https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L731
     mf.macro "EXTLIBS", $extlibs
     mf.macro "EXTSO", extso
     mf.macro "EXTLDFLAGS", $extflags.split
-    mf.macro "EXTINITS", extinits.map {|k, v| "#{k},#{v}"}
+    mf.macro "EXTINITS", extinits
     submakeopts = []
     if enable_config("shared", $enable_shared)
       submakeopts << 'DLDOBJS="$(EXTOBJS) $(EXTENCS)"'

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

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