mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
340390093b
commit
28849ce257
7 changed files with 14 additions and 18 deletions
16
common.mk
16
common.mk
|
@ -102,7 +102,6 @@ COMMONOBJS = array.$(OBJEXT) \
|
||||||
EXPORTOBJS = $(DLNOBJ) \
|
EXPORTOBJS = $(DLNOBJ) \
|
||||||
localeinit.$(OBJEXT) \
|
localeinit.$(OBJEXT) \
|
||||||
loadpath.$(OBJEXT) \
|
loadpath.$(OBJEXT) \
|
||||||
sizes.$(OBJEXT) \
|
|
||||||
$(COMMONOBJS)
|
$(COMMONOBJS)
|
||||||
|
|
||||||
OBJS = $(EXPORTOBJS) prelude.$(OBJEXT)
|
OBJS = $(EXPORTOBJS) prelude.$(OBJEXT)
|
||||||
|
@ -881,10 +880,10 @@ INSNS2VMOPT = --srcdir="$(srcdir)"
|
||||||
|
|
||||||
{$(VPATH)}vm.inc: $(srcdir)/template/vm.inc.tmpl
|
{$(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 \
|
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)
|
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=$@ \
|
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb --output=$@ \
|
||||||
$(srcdir)/template/id.c.tmpl
|
$(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
|
node_name.inc: {$(VPATH)}node.h
|
||||||
$(ECHO) generating $@
|
$(ECHO) generating $@
|
||||||
$(Q) $(BASERUBY) -n $(srcdir)/tool/node_name.rb < $? > $@
|
$(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) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
|
||||||
Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. RUBY="$(BASERUBY)"
|
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
|
run: fake miniruby$(EXEEXT) PHONY
|
||||||
|
|
3
ext/rbconfig/sizeof/depend
Normal file
3
ext/rbconfig/sizeof/depend
Normal file
|
@ -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
|
2
ext/rbconfig/sizeof/extconf.rb
Normal file
2
ext/rbconfig/sizeof/extconf.rb
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
$srcs = %w[sizes.c]
|
||||||
|
create_makefile('rbconfig/sizeof')
|
1
inits.c
1
inits.c
|
@ -61,6 +61,5 @@ rb_call_inits(void)
|
||||||
CALL(Complex);
|
CALL(Complex);
|
||||||
CALL(version);
|
CALL(version);
|
||||||
CALL(vm_trace);
|
CALL(vm_trace);
|
||||||
CALL(sizes);
|
|
||||||
}
|
}
|
||||||
#undef CALL
|
#undef CALL
|
||||||
|
|
|
@ -28,9 +28,3 @@ Init_enc_set_filesystem_encoding(void)
|
||||||
{
|
{
|
||||||
return rb_enc_to_index(rb_default_external_encoding());
|
return rb_enc_to_index(rb_default_external_encoding());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sizes.c */
|
|
||||||
void
|
|
||||||
Init_sizes(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ conditions = {
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
void
|
void
|
||||||
Init_sizes(void)
|
Init_sizeof(void)
|
||||||
{
|
{
|
||||||
VALUE s = rb_hash_new();
|
VALUE s = rb_hash_new();
|
||||||
rb_define_const(rb_define_module("RbConfig"), "SIZEOF", s);
|
rb_define_const(rb_define_module("RbConfig"), "SIZEOF", s);
|
||||||
|
|
|
@ -1127,8 +1127,6 @@ probes.h: {$(VPATH)}probes.dmyh
|
||||||
$(Q) $(CP) $(srcdir:/=\)\probes.dmyh $(OS_DEST_FILE)\
|
$(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 \
|
INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \
|
||||||
vmtc.inc vm.inc
|
vmtc.inc vm.inc
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue