mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
7c30524bce
commit
ea87854c52
2 changed files with 7 additions and 6 deletions
|
@ -645,7 +645,7 @@ $extobjs ||= []
|
||||||
$extpath ||= []
|
$extpath ||= []
|
||||||
$extflags ||= ""
|
$extflags ||= ""
|
||||||
$extlibs ||= []
|
$extlibs ||= []
|
||||||
extinits = {}
|
extinits = []
|
||||||
unless $extlist.empty?
|
unless $extlist.empty?
|
||||||
list = $extlist.dup
|
list = $extlist.dup
|
||||||
built = []
|
built = []
|
||||||
|
@ -660,7 +660,7 @@ unless $extlist.empty?
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
base = File.basename(feature)
|
base = File.basename(feature)
|
||||||
extinits[base] = feature
|
extinits << feature
|
||||||
$extobjs << format("ext/%s/%s.%s", target, base, $LIBEXT)
|
$extobjs << format("ext/%s/%s.%s", target, base, $LIBEXT)
|
||||||
built << target
|
built << target
|
||||||
end
|
end
|
||||||
|
@ -731,7 +731,7 @@ if $configure_only and $command_output
|
||||||
mf.macro "EXTLIBS", $extlibs
|
mf.macro "EXTLIBS", $extlibs
|
||||||
mf.macro "EXTSO", extso
|
mf.macro "EXTSO", extso
|
||||||
mf.macro "EXTLDFLAGS", $extflags.split
|
mf.macro "EXTLDFLAGS", $extflags.split
|
||||||
mf.macro "EXTINITS", extinits.map {|k, v| "#{k},#{v}"}
|
mf.macro "EXTINITS", extinits
|
||||||
submakeopts = []
|
submakeopts = []
|
||||||
if enable_config("shared", $enable_shared)
|
if enable_config("shared", $enable_shared)
|
||||||
submakeopts << 'DLDOBJS="$(EXTOBJS) $(EXTENCS)"'
|
submakeopts << 'DLDOBJS="$(EXTOBJS) $(EXTENCS)"'
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
%# -*- C -*-
|
%# -*- C -*-
|
||||||
|
% extinits = ARGV.map {|n| [n[%r[[^/.]+(?=\.[^/]*)?\z]], n]}
|
||||||
#include "ruby/ruby.h"
|
#include "ruby/ruby.h"
|
||||||
|
|
||||||
#define init(func, name) { \
|
#define init(func, name) { \
|
||||||
extern void func(void); \
|
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 ruby_init_ext(const char *name, void (*init)(void));
|
||||||
|
|
||||||
void Init_ext(void)
|
void Init_ext(void)
|
||||||
{
|
{
|
||||||
% ARGV.each do |n|
|
% extinits.each do |f, n|
|
||||||
init(Init_<%=n.sub(/,(.*)/, ', "\1.so"')%>);
|
init(Init_<%=f%>, <%=n.dump%>);
|
||||||
% end
|
% end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue