1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Change the run_without_tabs switching to dedicated

variable of make instead of d059714746 as requested.

You can disable this like `make MJIT_WITHOUT_TABS=false` or
`export MJIT_WITHOUT_TABS=false`.
This commit is contained in:
Takashi Kokubun 2020-03-22 23:07:09 -07:00
parent d059714746
commit d578f1d3ea
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD
2 changed files with 9 additions and 9 deletions

View file

@ -221,12 +221,15 @@ mjit_config.h: Makefile
# These rules using MJIT_HEADER_SUFFIX must be in common.mk, not # These rules using MJIT_HEADER_SUFFIX must be in common.mk, not
# Makefile.in, in order to override the macro in defs/universal.mk. # Makefile.in, in order to override the macro in defs/universal.mk.
# Pass MJIT_WITHOUT_TABS=false to disable tool/run_without_tabs.rb
MJIT_WITHOUT_TABS=true
# Other `-Dxxx`s preceding `-DMJIT_HEADER` will be removed in transform_mjit_header.rb. # Other `-Dxxx`s preceding `-DMJIT_HEADER` will be removed in transform_mjit_header.rb.
# So `-DMJIT_HEADER` should be passed first when rb_mjit_header.h is generated. # So `-DMJIT_HEADER` should be passed first when rb_mjit_header.h is generated.
$(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time: probes.h vm.$(OBJEXT) \ $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time: probes.h vm.$(OBJEXT) \
$(TIMESTAMPDIR)/$(arch)/.time $(srcdir)/tool/run_without_tabs.rb $(TIMESTAMPDIR)/$(arch)/.time $(srcdir)/tool/run_without_tabs.rb
$(ECHO) building $(@F:.time=.h) $(ECHO) building $(@F:.time=.h)
$(Q) $(BASERUBY) $(srcdir)/tool/run_without_tabs.rb $(MJIT_DEBUGFLAGS) -- \ $(Q) $(BASERUBY) $(srcdir)/tool/run_without_tabs.rb $(MJIT_WITHOUT_TABS) \
$(CPP) -DMJIT_HEADER $(MJIT_HEADER_FLAGS) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/vm.c $(CPPOUTFLAG)$(@F:.time=.h).new $(CPP) -DMJIT_HEADER $(MJIT_HEADER_FLAGS) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/vm.c $(CPPOUTFLAG)$(@F:.time=.h).new
$(Q) $(IFCHANGE) "--timestamp=$@" $(@F:.time=.h) $(@F:.time=.h).new $(Q) $(IFCHANGE) "--timestamp=$@" $(@F:.time=.h) $(@F:.time=.h).new

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
# This is a script to run a command in ARGV, expanding tabs in some files # This is a script to run a command in ARGV, expanding tabs in some files
# included by vm.c to normalize indentation of MJIT header when debugflags # included by vm.c to normalize indentation of MJIT header. You can disable
# is -ggdb3 (default). # this feature by setting MJIT_WITHOUT_TABS=false make variable.
# #
# Note that preprocessor of GCC converts a hard tab to one spaces, where # Note that preprocessor of GCC converts a hard tab to one spaces, where
# we expect it to be shown as 8 spaces. To obviate this script, we need # we expect it to be shown as 8 spaces. To obviate this script, we need
@ -22,18 +22,15 @@ SKIPPED_FILES = %w[
vm_opts.h vm_opts.h
] ]
unless split_index = ARGV.index('--')
abort "Usage: #{$0} [debugflags] -- [cmmand...]"
end
debugflags, command = ARGV[0...split_index], ARGV[(split_index + 1)..-1]
srcdir = File.expand_path('..', __dir__) srcdir = File.expand_path('..', __dir__)
targets = EXPAND_TARGETS.flat_map { |t| Dir.glob(File.join(srcdir, t)) } - SKIPPED_FILES.map { |f| File.join(srcdir, f) } targets = EXPAND_TARGETS.flat_map { |t| Dir.glob(File.join(srcdir, t)) } - SKIPPED_FILES.map { |f| File.join(srcdir, f) }
sources = {} sources = {}
mtimes = {} mtimes = {}
flag, *command = ARGV
targets.each do |target| targets.each do |target|
next unless debugflags.include?('-ggdb3') next if flag != 'true'
unless File.writable?(target) unless File.writable?(target)
puts "tool/run_without_tabs.rb: Skipping #{target.dump} as it's not writable." puts "tool/run_without_tabs.rb: Skipping #{target.dump} as it's not writable."
next next