diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-01-23 02:19:00 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-01-23 02:19:00 +0000 |
commit | ea87854c5264e6101ba8965c5b9b1ee3cc44815d (patch) | |
tree | ac739b17dbb5adc321a239fe70a5ed6cceac2ead | |
parent | 7c30524bce9865e0dda1c9b693dabac16a5d0541 (diff) | |
download | ruby-ea87854c5264e6101ba8965c5b9b1ee3cc44815d.tar.gz |
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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rwxr-xr-x | ext/extmk.rb | 6 | ||||
-rw-r--r-- | template/extinit.c.tmpl | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb index 977e0c991c..602d30826a 100755 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -645,7 +645,7 @@ $extobjs ||= [] $extpath ||= [] $extflags ||= "" $extlibs ||= [] -extinits = {} +extinits = [] unless $extlist.empty? list = $extlist.dup built = [] @@ -660,7 +660,7 @@ unless $extlist.empty? 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 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)"' diff --git a/template/extinit.c.tmpl b/template/extinit.c.tmpl index 592eb0452f..7a9c910633 100644 --- a/template/extinit.c.tmpl +++ b/template/extinit.c.tmpl @@ -1,16 +1,17 @@ %# -*- 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 } |