summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-18 14:19:16 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-18 14:19:16 (GMT)
commit28849ce257de28993e4786ed102a6f1f0433278e (patch)
tree6f80313e09237e2aa60624e25af8e86d1d9bd739
parent340390093b1db331630d227edbd0f32d2d2b882a (diff)
ext/rbconfig/sizeof: move to an extension library
* common.mk, ext/rbconfig/sizeof: move RbConfig::SIZEOF to an extension library to get rid of annoying nmake VPATH rule. * inits.c (rb_call_inits), miniinit.c (Init_sizes): RbConfig::SIZEOF is no loger built-in. * template/sizes.c.tmpl (Init_sizeof): rename initialization function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--common.mk16
-rw-r--r--ext/rbconfig/sizeof/depend3
-rw-r--r--ext/rbconfig/sizeof/extconf.rb2
-rw-r--r--inits.c1
-rw-r--r--miniinit.c6
-rw-r--r--template/sizes.c.tmpl2
-rw-r--r--win32/Makefile.sub2
7 files changed, 14 insertions, 18 deletions
diff --git a/common.mk b/common.mk
index f8ab233..e94c475 100644
--- a/common.mk
+++ b/common.mk
@@ -102,7 +102,6 @@ COMMONOBJS = array.$(OBJEXT) \
EXPORTOBJS = $(DLNOBJ) \
localeinit.$(OBJEXT) \
loadpath.$(OBJEXT) \
- sizes.$(OBJEXT) \
$(COMMONOBJS)
OBJS = $(EXPORTOBJS) prelude.$(OBJEXT)
@@ -881,10 +880,10 @@ INSNS2VMOPT = --srcdir="$(srcdir)"
{$(VPATH)}vm.inc: $(srcdir)/template/vm.inc.tmpl
-srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c {$(VPATH)}newline.c {$(VPATH)}id.c {$(VPATH)}sizes.c srcs-ext srcs-enc
+srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c {$(VPATH)}newline.c {$(VPATH)}id.c srcs-ext srcs-enc
EXT_SRCS = $(srcdir)/ext/ripper/ripper.c $(srcdir)/ext/json/parser/parser.c \
- $(srcdir)/ext/dl/callback/callback.c
+ $(srcdir)/ext/dl/callback/callback.c $(srcdir)/ext/rbconfig/sizeof/sizes.c
srcs-ext: $(EXT_SRCS)
@@ -908,11 +907,6 @@ id.c: $(srcdir)/tool/generic_erb.rb $(srcdir)/template/id.c.tmpl $(srcdir)/defs/
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb --output=$@ \
$(srcdir)/template/id.c.tmpl
-sizes.c: $(srcdir)/tool/generic_erb.rb $(srcdir)/template/sizes.c.tmpl $(srcdir)/configure.in
- $(ECHO) generating $@
- $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb --output=$@ \
- $(srcdir)/template/sizes.c.tmpl $(srcdir)/configure.in
-
node_name.inc: {$(VPATH)}node.h
$(ECHO) generating $@
$(Q) $(BASERUBY) -n $(srcdir)/tool/node_name.rb < $? > $@
@@ -978,6 +972,12 @@ $(srcdir)/ext/dl/callback/callback.c: $(srcdir)/ext/dl/callback/mkcallback.rb $(
$(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. RUBY="$(BASERUBY)"
+$(srcdir)/ext/rbconfig/sizeof/sizes.c: $(srcdir)/ext/rbconfig/sizeof/depend \
+ $(srcdir)/tool/generic_erb.rb $(srcdir)/template/sizes.c.tmpl $(srcdir)/configure.in
+ $(ECHO) generating $@
+ $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
+ Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. RUBY="$(BASERUBY)"
+
##
run: fake miniruby$(EXEEXT) PHONY
diff --git a/ext/rbconfig/sizeof/depend b/ext/rbconfig/sizeof/depend
new file mode 100644
index 0000000..360b338
--- /dev/null
+++ b/ext/rbconfig/sizeof/depend
@@ -0,0 +1,3 @@
+sizes.c: $(top_srcdir)/tool/generic_erb.rb $(top_srcdir)/template/sizes.c.tmpl $(top_srcdir)/configure.in
+ $(Q) $(RUBY) $(top_srcdir)/tool/generic_erb.rb --output=$@ \
+ $(top_srcdir)/template/sizes.c.tmpl $(top_srcdir)/configure.in
diff --git a/ext/rbconfig/sizeof/extconf.rb b/ext/rbconfig/sizeof/extconf.rb
new file mode 100644
index 0000000..619b425
--- /dev/null
+++ b/ext/rbconfig/sizeof/extconf.rb
@@ -0,0 +1,2 @@
+$srcs = %w[sizes.c]
+create_makefile('rbconfig/sizeof')
diff --git a/inits.c b/inits.c
index f6611a0..fe0aade 100644
--- a/inits.c
+++ b/inits.c
@@ -61,6 +61,5 @@ rb_call_inits(void)
CALL(Complex);
CALL(version);
CALL(vm_trace);
- CALL(sizes);
}
#undef CALL
diff --git a/miniinit.c b/miniinit.c
index 6d285ae..bc6138a 100644
--- a/miniinit.c
+++ b/miniinit.c
@@ -28,9 +28,3 @@ Init_enc_set_filesystem_encoding(void)
{
return rb_enc_to_index(rb_default_external_encoding());
}
-
-/* sizes.c */
-void
-Init_sizes(void)
-{
-}
diff --git a/template/sizes.c.tmpl b/template/sizes.c.tmpl
index e47eade..ac9964d 100644
--- a/template/sizes.c.tmpl
+++ b/template/sizes.c.tmpl
@@ -12,7 +12,7 @@ conditions = {
}
%>
void
-Init_sizes(void)
+Init_sizeof(void)
{
VALUE s = rb_hash_new();
rb_define_const(rb_define_module("RbConfig"), "SIZEOF", s);
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index cd41a3a..216fb9d 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -1127,8 +1127,6 @@ probes.h: {$(VPATH)}probes.dmyh
$(Q) $(CP) $(srcdir:/=\)\probes.dmyh $(OS_DEST_FILE)\
)
-{$(VPATH)}sizes.c: sizes.c
-
INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \
vmtc.inc vm.inc