diff options
author | Takashi Kokubun <[email protected]> | 2023-03-06 22:53:38 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2023-03-06 22:53:38 -0800 |
commit | b2130d5f5d5cf01f371275ec92bbed56f93a7770 (patch) | |
tree | 2030ad9e6d207574e59bae5c37260c265191165c | |
parent | 072fc7671a2e1d203b8e006c5cd9d629b0315fa8 (diff) |
Remove obsoleted tool/mjit_tabs.rb
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | template/Makefile.in | 1 | ||||
-rw-r--r-- | tool/mjit_tabs.rb | 67 |
3 files changed, 0 insertions, 72 deletions
diff --git a/configure.ac b/configure.ac index 42b96abbad..813fa9bb3d 100644 --- a/configure.ac +++ b/configure.ac @@ -2925,10 +2925,6 @@ AS_CASE(["$target_os"], ])]) LIBEXT=a -AC_ARG_WITH(mjit-tabs, - AS_HELP_STRING([--without-mjit-tabs], [expand tabs in mjit header]), - [AS_IF([test $withval = no], [MJIT_TABS=false])]) -AC_SUBST(MJIT_TABS)dnl AC_SUBST(DLDFLAGS)dnl AC_SUBST(ARCH_FLAG)dnl AC_SUBST(MJIT_CC)dnl diff --git a/template/Makefile.in b/template/Makefile.in index c912262140..3068992e6d 100644 --- a/template/Makefile.in +++ b/template/Makefile.in @@ -102,7 +102,6 @@ MJIT_OPTFLAGS = @MJIT_OPTFLAGS@ MJIT_DEBUGFLAGS = @MJIT_DEBUGFLAGS@ MJIT_LDSHARED = @MJIT_LDSHARED@ MJIT_DLDFLAGS = $(XDLDFLAGS) -MJIT_TABS=@MJIT_TABS@ YJIT_SUPPORT=@YJIT_SUPPORT@ YJIT_LIBS=@YJIT_LIBS@ YJIT_OBJ=@YJIT_OBJ@ diff --git a/tool/mjit_tabs.rb b/tool/mjit_tabs.rb deleted file mode 100644 index edcbf6cfcb..0000000000 --- a/tool/mjit_tabs.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true -# 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. You can enable -# this feature by passing `--without-mjit-tabs` in configure. -# -# 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 -# to convert all tabs to spaces in these files. - -require 'fileutils' - -EXPAND_TARGETS = %w[ - vm*.* - include/ruby/ruby.h -] - -# These files have no hard tab indentations. Skip normalizing these files from the glob result. -SKIPPED_FILES = %w[ - vm_callinfo.h - vm_debug.h - vm_exec.h - vm_opts.h - vm_sync.h - vm_sync.c -] - -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) } -sources = {} -mtimes = {} - -mjit_tabs, *command = ARGV - -targets.each do |target| - next if mjit_tabs != 'false' - unless File.writable?(target) - puts "tool/mjit_tabs.rb: Skipping #{target.dump} as it's not writable." - next - end - source = File.read(target) - begin - expanded = source.gsub(/^\t+/) { |tab| ' ' * 8 * tab.length } - rescue ArgumentError # invalid byte sequence in UTF-8 (Travis, RubyCI) - puts "tool/mjit_tabs.rb: Skipping #{target.dump} as the encoding is #{source.encoding}." - next - end - - sources[target] = source - mtimes[target] = File.mtime(target) - - if sources[target] == expanded - puts "#{target.dump} has no hard tab indentation. This should be ignored in tool/mjit_tabs.rb." - end - File.write(target, expanded) - FileUtils.touch(target, mtime: mtimes[target]) -end - -result = system(*command) - -targets.each do |target| - if sources.key?(target) - File.write(target, sources[target]) - FileUtils.touch(target, mtime: mtimes.fetch(target)) - end -end - -exit result |