[前][次][番号順一覧][スレッド一覧]

ruby-changes:31629

From: nobu <ko1@a...>
Date: Mon, 18 Nov 2013 23:19:24 +0900 (JST)
Subject: [ruby-changes:31629] nobu:r43708 (trunk): ext/rbconfig/sizeof: move to an extension library

nobu	2013-11-18 23:19:16 +0900 (Mon, 18 Nov 2013)

  New Revision: 43708

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43708

  Log:
    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.

  Added directories:
    trunk/ext/rbconfig/
    trunk/ext/rbconfig/sizeof/
  Added files:
    trunk/ext/rbconfig/sizeof/depend
    trunk/ext/rbconfig/sizeof/extconf.rb
  Modified files:
    trunk/common.mk
    trunk/inits.c
    trunk/miniinit.c
    trunk/template/sizes.c.tmpl
    trunk/win32/Makefile.sub
Index: miniinit.c
===================================================================
--- miniinit.c	(revision 43707)
+++ miniinit.c	(revision 43708)
@@ -28,9 +28,3 @@ Init_enc_set_filesystem_encoding(void) https://github.com/ruby/ruby/blob/trunk/miniinit.c#L28
 {
     return rb_enc_to_index(rb_default_external_encoding());
 }
-
-/* sizes.c */
-void
-Init_sizes(void)
-{
-}
Index: common.mk
===================================================================
--- common.mk	(revision 43707)
+++ common.mk	(revision 43708)
@@ -102,7 +102,6 @@ COMMONOBJS    = array.$(OBJEXT) \ https://github.com/ruby/ruby/blob/trunk/common.mk#L102
 EXPORTOBJS    = $(DLNOBJ) \
 		localeinit.$(OBJEXT) \
 		loadpath.$(OBJEXT) \
-		sizes.$(OBJEXT) \
 		$(COMMONOBJS)
 
 OBJS          = $(EXPORTOBJS) prelude.$(OBJEXT)
@@ -881,10 +880,10 @@ INSNS2VMOPT = --srcdir="$(srcdir)" https://github.com/ruby/ruby/blob/trunk/common.mk#L880
 
 {$(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 $(sr https://github.com/ruby/ruby/blob/trunk/common.mk#L907
 	$(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: $( https://github.com/ruby/ruby/blob/trunk/common.mk#L972
 	$(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
Index: win32/Makefile.sub
===================================================================
--- win32/Makefile.sub	(revision 43707)
+++ win32/Makefile.sub	(revision 43708)
@@ -1127,8 +1127,6 @@ probes.h: {$(VPATH)}probes.dmyh https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L1127
 	  $(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
 
Index: ext/rbconfig/sizeof/depend
===================================================================
--- ext/rbconfig/sizeof/depend	(revision 0)
+++ ext/rbconfig/sizeof/depend	(revision 43708)
@@ -0,0 +1,3 @@ https://github.com/ruby/ruby/blob/trunk/ext/rbconfig/sizeof/depend#L1
+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

Property changes on: ext/rbconfig/sizeof/depend
___________________________________________________________________
Added: svn:eol-style
   + LF

Index: ext/rbconfig/sizeof/extconf.rb
===================================================================
--- ext/rbconfig/sizeof/extconf.rb	(revision 0)
+++ ext/rbconfig/sizeof/extconf.rb	(revision 43708)
@@ -0,0 +1,2 @@ https://github.com/ruby/ruby/blob/trunk/ext/rbconfig/sizeof/extconf.rb#L1
+$srcs = %w[sizes.c]
+create_makefile('rbconfig/sizeof')

Property changes on: ext/rbconfig/sizeof/extconf.rb
___________________________________________________________________
Added: svn:eol-style
   + LF

Index: inits.c
===================================================================
--- inits.c	(revision 43707)
+++ inits.c	(revision 43708)
@@ -61,6 +61,5 @@ rb_call_inits(void) https://github.com/ruby/ruby/blob/trunk/inits.c#L61
     CALL(Complex);
     CALL(version);
     CALL(vm_trace);
-    CALL(sizes);
 }
 #undef CALL
Index: template/sizes.c.tmpl
===================================================================
--- template/sizes.c.tmpl	(revision 43707)
+++ template/sizes.c.tmpl	(revision 43708)
@@ -12,7 +12,7 @@ conditions = { https://github.com/ruby/ruby/blob/trunk/template/sizes.c.tmpl#L12
 }
 %>
 void
-Init_sizes(void)
+Init_sizeof(void)
 {
     VALUE s = rb_hash_new();
     rb_define_const(rb_define_module("RbConfig"), "SIZEOF", s);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]