summaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
Diffstat (limited to 'template')
-rw-r--r--template/Makefile.in29
-rw-r--r--template/configure-ext.mk.tmpl41
-rw-r--r--template/fake.rb.in1
-rw-r--r--template/id.c.tmpl2
-rw-r--r--template/unicode_norm_gen.tmpl17
5 files changed, 53 insertions, 37 deletions
diff --git a/template/Makefile.in b/template/Makefile.in
index 39f702b66d..7ce612e8e9 100644
--- a/template/Makefile.in
+++ b/template/Makefile.in
@@ -37,6 +37,8 @@ CONFIGURE = @CONFIGURE@
MKFILES = @MAKEFILES@
BASERUBY = @BASERUBY@
HAVE_BASERUBY = @HAVE_BASERUBY@
+DUMP_AST = @X_DUMP_AST@
+DUMP_AST_TARGET = @X_DUMP_AST_TARGET@
TEST_RUNNABLE = @TEST_RUNNABLE@
CROSS_COMPILING = @CROSS_COMPILING@
DOXYGEN = @DOXYGEN@
@@ -114,6 +116,9 @@ JIT_CARGO_SUPPORT=@JIT_CARGO_SUPPORT@
CARGO_TARGET_DIR=@abs_top_builddir@/target
CARGO_BUILD_ARGS=@CARGO_BUILD_ARGS@
ZJIT_TEST_FEATURES=@ZJIT_TEST_FEATURES@
+JIT_RUST_FLAGS=@JIT_RUST_FLAGS@
+RUSTC_FLAGS=@RUSTC_FLAGS@
+RLIB_DIR=@RLIB_DIR@
RUST_LIB=@RUST_LIB@
RUST_LIBOBJ = $(RUST_LIB:.a=.@OBJEXT@)
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
@@ -148,6 +153,7 @@ RUBY_API_VERSION=@RUBY_API_VERSION@
RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
RUBY_SO_NAME=@RUBY_SO_NAME@
EXEEXT = @EXEEXT@
+BUILD_EXEEXT = @X_BUILD_EXEEXT@
LIBEXT = @LIBEXT@
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
RUBY = $(RUBY_INSTALL_NAME)
@@ -337,7 +343,8 @@ $(LIBRUBY_SO):
@-[ -n "$(EXTSTATIC)" ] || $(PRE_LIBRUBY_UPDATE)
$(ECHO) linking shared-library $@
$(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(EXTSOLIBS) $(OUTFLAG)$@
- -$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)ruby_static_id_*' \
+ -$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)InitVM_*' \
+ -L '$(SYMBOL_PREFIX)ruby_static_id_*' \
-L '$(SYMBOL_PREFIX)*_threadptr_*' -L '$(SYMBOL_PREFIX)*_ec_*' $@
$(Q) $(POSTLINK)
@-$(MINIRUBY) -e 'so, *aliases = ARGV; aliases.uniq!; aliases.delete(File.basename(so)); \
@@ -510,7 +517,11 @@ _PREFIXED_SYMBOL = TOKEN_PASTE($(SYMBOL_PREFIX),name)
.d.h:
@$(ECHO) translating probes $<
- $(Q) $(DTRACE) -o $@.tmp -h -C $(INCFLAGS) $(CPPFLAGS) -s $<
+ $(Q) set x -o $@.tmp -h -C $(INCFLAGS); \
+ for flag in $(CPPFLAGS); do case $$flag in -[DU]*) set "$$@" "$$flag";; esac; done; \
+ shift; \
+ $(Q1:0=:) set -x; \
+ $(DTRACE) "$$@" -s $<
$(Q) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/RUBY_PROBES_H/' -e 's/(char \*/(const char */g' -e 's/, char \*/, const char */g' $@.tmp > $@
$(Q) $(RM) $@.tmp
@@ -664,14 +675,14 @@ $(INSNS): $(srcdir)/insns.def vm_opts.h \
$(tooldir)/ruby_vm/loaders/opt_operand_def.rb \
$(tooldir)/ruby_vm/loaders/vm_opts_h.rb \
$(tooldir)/ruby_vm/models/attribute.rb \
- $(tooldir)/ruby_vm/models/bare_instructions.rb \
+ $(tooldir)/ruby_vm/models/bare_instruction.rb \
$(tooldir)/ruby_vm/models/c_expr.rb \
$(tooldir)/ruby_vm/models/instructions.rb \
- $(tooldir)/ruby_vm/models/instructions_unifications.rb \
- $(tooldir)/ruby_vm/models/operands_unifications.rb \
- $(tooldir)/ruby_vm/models/trace_instructions.rb \
+ $(tooldir)/ruby_vm/models/instructions_unification.rb \
+ $(tooldir)/ruby_vm/models/operands_unification.rb \
+ $(tooldir)/ruby_vm/models/trace_instruction.rb \
$(tooldir)/ruby_vm/models/typemap.rb \
- $(tooldir)/ruby_vm/models/zjit_instructions.rb \
+ $(tooldir)/ruby_vm/models/zjit_instruction.rb \
$(tooldir)/ruby_vm/scripts/converter.rb \
$(tooldir)/ruby_vm/scripts/insns2vm.rb \
$(tooldir)/ruby_vm/views/_attributes.erb \
@@ -679,6 +690,7 @@ $(INSNS): $(srcdir)/insns.def vm_opts.h \
$(tooldir)/ruby_vm/views/_comptime_insn_stack_increase.erb \
$(tooldir)/ruby_vm/views/_copyright.erb \
$(tooldir)/ruby_vm/views/_insn_entry.erb \
+ $(tooldir)/ruby_vm/views/_insn_leaf_info.erb \
$(tooldir)/ruby_vm/views/_insn_len_info.erb \
$(tooldir)/ruby_vm/views/_insn_name_info.erb \
$(tooldir)/ruby_vm/views/_insn_operand_info.erb \
@@ -747,5 +759,4 @@ yes-test-syntax-suggest: $(PREPARE_SYNTAX_SUGGEST)
no-test-syntax-suggest:
yesterday:
- $(GIT) -C $(srcdir) reset --hard \
- `$(GIT) -C $(srcdir) log -1 --before=00:00+0900 --format=%H`
+ $(GIT_IN_SRC) reset --hard `TZ=UTC-9 $(GIT_LOG_FORMAT)%H -1 --before=00:00`
diff --git a/template/configure-ext.mk.tmpl b/template/configure-ext.mk.tmpl
index cabdb652fd..b4e999fe8e 100644
--- a/template/configure-ext.mk.tmpl
+++ b/template/configure-ext.mk.tmpl
@@ -7,25 +7,49 @@ ECHO = $(ECHO1:0=@echo)
<%
srcdir = miniruby = script_args = nil
+with_exts = []
+without_exts = []
opt = OptionParser.new do |o|
o.on('--srcdir=SRCDIR') {|v| srcdir = v}
o.on('--miniruby=MINIRUBY') {|v| miniruby = v}
o.on('--script-args=MINIRUBY') {|v| script_args = v}
+ o.on('--with-ext=ext[,...]', Array) {|v| with_exts.concat(v)}
+ o.on('--without-ext=ext[,...]', Array) {|v| without_exts.concat(v)}
o.order!(ARGV)
end
srcdir ||= File.dirname(File.dirname(__FILE__))
-exts = {}
-[
- ["exts", "ext", "--extstatic $(EXTSTATIC)"],
- ["gems", ".bundle/gems", "--no-extstatic"],
-].each do |t, d, o|
- exts[t] = [o, Dir.glob("#{srcdir}/#{d}/*/").map {|n| n[(srcdir.size+1)..-2]}]
+script_args ||= ""
+
+filter = proc do |ext|
+ next false unless with_exts.empty? or !with_exts.any? {|w| File.fnmatch?(w, ext)}
+ without_exts.empty? or !without_exts.any? {|w| File.fnmatch?(w, ext)}
end
+exts = {
+ exts: [
+ "--extstatic $(EXTSTATIC)",
+ Dir.glob("ext/**/extconf.rb", base: srcdir).filter_map do |d|
+ d if filter[File.basename(d = d[%r[\Aext/[^/]+]])]
+ end.uniq
+ ],
+ gems: [
+ "--no-extstatic",
+ Dir.glob(".bundle/gems/**/extconf.rb", base: srcdir).grep_v(/test/).filter_map do |d|
+ d if filter[File.basename(d = d[%r[\A\.bundle/gems/[^/]+]])]
+ end.uniq
+ ],
+}
%>
MINIRUBY = <%=miniruby%>
SCRIPT_ARGS = <%=script_args.gsub("#", "\\#").gsub(/\A|[\s"']\K--jobserver-auth=[^\s'"]*/, "")%>
EXTMK_ARGS = $(SCRIPT_ARGS) --gnumake=$(gnumake) --extflags="$(EXTLDFLAGS)" \
- --make-flags="MINIRUBY='$(MINIRUBY)'"
+ --make-flags="MINIRUBY='$(MINIRUBY)'" \
+<% unless with_exts.empty? -%>
+ --with-ext=<%= with_exts.join(',') %> \
+<% end -%>
+<% unless without_exts.empty? -%>
+ --without-ext=<%= without_exts.join(',') %> \
+<% end -%>
+ # EXTMK_ARGS
all: exts gems
exts:
@@ -33,9 +57,6 @@ gems:
% exts.each do |t, (o, dirs)|
% dirs.each do |d|
-% extconf = Dir.glob("#{srcdir}/#{d}/**/extconf.rb")
-% next if extconf.empty?
-% next if extconf.any?{|f| f.include?(".bundle/gems") && f.include?("test") }
<%=t%>: <%=d%>/exts.mk
<%=d%>/exts.mk: FORCE
$(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make='$(MAKE)' \
diff --git a/template/fake.rb.in b/template/fake.rb.in
index a02582a9dc..fed640aee7 100644
--- a/template/fake.rb.in
+++ b/template/fake.rb.in
@@ -49,6 +49,7 @@ class Object
else%><%=v.inspect%><%end%>
% }
end
+v=$VERBOSE;$VERBOSE=nil;module Ruby; end;$VERBOSE=v
module Ruby
constants.each {|n| remove_const n}
% arg['versions'].each {|n, v|
diff --git a/template/id.c.tmpl b/template/id.c.tmpl
index 5aa8e47ce7..d40f143065 100644
--- a/template/id.c.tmpl
+++ b/template/id.c.tmpl
@@ -1,5 +1,5 @@
%# -*- c -*-
-/* DO NOT EDIT THIS FILE DIRECTLY */
+/* DO NOT EDIT THIS FILE DIRECTLY: source is at template/id.c.tmpl */
/**********************************************************************
id.c -
diff --git a/template/unicode_norm_gen.tmpl b/template/unicode_norm_gen.tmpl
index 17505f100e..773a727cec 100644
--- a/template/unicode_norm_gen.tmpl
+++ b/template/unicode_norm_gen.tmpl
@@ -22,23 +22,6 @@ class Integer
end
end
-module Enumerable
- unless method_defined?(:each_slice)
- def each_slice(n)
- ary = []
- each do |i|
- ary << i
- if ary.size >= n
- yield ary
- ary = []
- end
- end
- yield ary unless ary.empty?
- self
- end
- end
-end
-
class Array
def to_UTF8() collect {|c| c.to_UTF8}.join('') end