mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/dl/callback/depend: fix for parallel build.
* ext/dl/callback/extconf.rb: callback.h is no longer created. * ext/dl/callback/mkcallback.rb: creates main source first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d3c4a4686a
commit
53f011e662
4 changed files with 30 additions and 24 deletions
|
@ -1,4 +1,10 @@
|
|||
Tue Mar 10 01:57:15 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Tue Mar 10 03:48:27 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/dl/callback/depend: fix for parallel build.
|
||||
|
||||
* ext/dl/callback/extconf.rb: callback.h is no longer created.
|
||||
|
||||
* ext/dl/callback/mkcallback.rb: creates main source first.
|
||||
|
||||
* ext/dl/callback/extconf.rb ($distcleanfiles): added callback.c.
|
||||
|
||||
|
|
|
@ -1,18 +1,10 @@
|
|||
callback.o: $(hdrdir)/ruby.h $(hdrdir)/io.h
|
||||
|
||||
callback-0.o: callback-0.c $(hdrdir)/ruby.h
|
||||
callback-1.o: callback-1.c $(hdrdir)/ruby.h
|
||||
callback-2.o: callback-2.c $(hdrdir)/ruby.h
|
||||
callback-3.o: callback-3.c $(hdrdir)/ruby.h
|
||||
callback-4.o: callback-4.c $(hdrdir)/ruby.h
|
||||
callback-5.o: callback-5.c $(hdrdir)/ruby.h
|
||||
callback-6.o: callback-6.c $(hdrdir)/ruby.h
|
||||
callback-7.o: callback-7.c $(hdrdir)/ruby.h
|
||||
callback-8.o: callback-8.c $(hdrdir)/ruby.h
|
||||
$(OBJS): $(hdrdir)/ruby.h
|
||||
|
||||
callback-0.c callback-1.c callback-2.c \
|
||||
callback-3.c callback-4.c callback-5.c \
|
||||
callback-6.c callback-7.c callback-8.c \
|
||||
: callback.c
|
||||
|
||||
callback.c: $(srcdir)/mkcallback.rb $(srcdir)/../dl.h
|
||||
@echo "generating callback.h"
|
||||
@$(RUBY) $(srcdir)/mkcallback.rb $(srcdir)/../dl.h
|
||||
@echo "generating callback.c"
|
||||
@$(RUBY) $(srcdir)/mkcallback.rb -output=callback $(srcdir)/../dl.h
|
||||
|
|
|
@ -5,7 +5,8 @@ if compiled?("dl")
|
|||
callback_srcs = callbacks.map{|basename| "#{basename}.c"}
|
||||
callback_objs = callbacks.map{|basename| "#{basename}.o"}
|
||||
|
||||
$distcleanfiles += [ "callback.h", *callback_srcs ]
|
||||
$distcleanfiles << '$(SRCS)'
|
||||
$srcs = callback_srcs
|
||||
$objs = callback_objs
|
||||
$INCFLAGS << " -I$(srcdir)/.."
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
$out = open("callback.c", "w")
|
||||
#!ruby -s
|
||||
$output ||= "callback"
|
||||
$out = open("#{$output}.c", "w")
|
||||
|
||||
$dl_h = ARGV[0] || "dl.h"
|
||||
|
||||
|
@ -157,10 +159,9 @@ def gen_push_addr_ary(ty, aryname, calltype)
|
|||
end
|
||||
|
||||
def gen_callback_file(ty)
|
||||
filename = "callback-#{ty}.c"
|
||||
filename = "#{$output}-#{ty}.c"
|
||||
initname = "rb_dl_init_callbacks_#{ty}"
|
||||
open(filename, "w") {|f|
|
||||
f.puts <<-EOS
|
||||
body = <<-EOS
|
||||
#include "dl.h"
|
||||
|
||||
extern VALUE rb_DLCdeclCallbackAddrs, rb_DLCdeclCallbackProcs;
|
||||
|
@ -169,8 +170,8 @@ extern VALUE rb_DLStdcallCallbackAddrs, rb_DLStdcallCallbackProcs;
|
|||
#endif
|
||||
extern ID rb_dl_cb_call;
|
||||
EOS
|
||||
yield f
|
||||
f.puts <<-EOS
|
||||
yield body
|
||||
body << <<-EOS
|
||||
void
|
||||
#{initname}()
|
||||
{
|
||||
|
@ -182,12 +183,12 @@ void
|
|||
#endif
|
||||
}
|
||||
EOS
|
||||
}
|
||||
initname
|
||||
[filename, initname, body]
|
||||
end
|
||||
|
||||
callbacks = []
|
||||
for ty in 0...MAX_DLTYPE
|
||||
initname = gen_callback_file(ty) {|f|
|
||||
filename, initname, body = gen_callback_file(ty) {|f|
|
||||
foreach_proc_entry do |calltype, proc_entry|
|
||||
for argc in 0...DLSTACK_SIZE
|
||||
for n in 0...MAX_CALLBACK
|
||||
|
@ -197,6 +198,7 @@ for ty in 0...MAX_DLTYPE
|
|||
end
|
||||
}
|
||||
$out << "void #{initname}();\n"
|
||||
callbacks << [filename, body]
|
||||
end
|
||||
|
||||
$out << (<<EOS)
|
||||
|
@ -229,3 +231,8 @@ Init_callback(void)
|
|||
}
|
||||
}
|
||||
EOS
|
||||
$out.close
|
||||
|
||||
for filename, body in callbacks
|
||||
open(filename, "wb") {|f| f.puts body}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue