aboutsummaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
Diffstat (limited to 'template')
-rw-r--r--template/extinit.c.tmpl7
1 files changed, 4 insertions, 3 deletions
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
}