aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-09 06:32:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-09 06:32:18 +0000
commit83e6b94571240b26f790dc893d882418e9a8a722 (patch)
treed0ec0d212c1c2a2e4cb9d81a797caebd4cbc6670
parentba6f4f0a2eabb862af35b6a4951e6100d5123231 (diff)
downloadruby-83e6b94571240b26f790dc893d882418e9a8a722.tar.gz
common.mk: ifchange for mkconfig.rb
* common.mk (RBCONFIG): use ifchange tool to see if the content is changed and update the timestamp file. * tool/mkconfig.rb: remove ifchange features. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--common.mk5
-rwxr-xr-xtool/mkconfig.rb28
3 files changed, 9 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index 3cfc64c393..c17bb68d83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-Thu Jun 9 15:31:52 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jun 9 15:32:17 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (RBCONFIG): use ifchange tool to see if the content is
+ changed and update the timestamp file.
+
+ * tool/mkconfig.rb: remove ifchange features.
* tool/ifchange: make target directory if it does not exist with
its parent directories.
diff --git a/common.mk b/common.mk
index 9a0758259f..fcf22e5dee 100644
--- a/common.mk
+++ b/common.mk
@@ -624,11 +624,12 @@ extconf: $(PREP)
$(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
$(RBCONFIG): $(srcdir)/tool/mkconfig.rb config.status $(srcdir)/version.h
- $(Q)$(BOOTSTRAPRUBY) $(srcdir)/tool/mkconfig.rb -timestamp=$@ \
+ $(Q)$(BOOTSTRAPRUBY) $(srcdir)/tool/mkconfig.rb \
-cross_compiling=$(CROSS_COMPILING) \
-arch=$(arch) -version=$(RUBY_PROGRAM_VERSION) \
-install_name=$(RUBY_INSTALL_NAME) \
- -so_name=$(RUBY_SO_NAME) rbconfig.rb
+ -so_name=$(RUBY_SO_NAME) | \
+ $(srcdir)/tool/ifchange --timestamp=$@ rbconfig.rb -
test-rubyspec-precheck:
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
index 63d0520dba..566f5a304e 100755
--- a/tool/mkconfig.rb
+++ b/tool/mkconfig.rb
@@ -19,17 +19,6 @@ $:.unshift(".")
require "fileutils"
mkconfig = File.basename($0)
-rbconfig_rb = ARGV[0] || 'rbconfig.rb'
-unless File.directory?(dir = File.dirname(rbconfig_rb))
- FileUtils.makedirs(dir, :verbose => true)
-end
-
-config = ""
-def config.write(arg)
- concat(arg.to_s)
-end
-$stdout = config
-
fast = {'prefix'=>TRUE, 'ruby_install_name'=>TRUE, 'INSTALL'=>TRUE, 'EXEEXT'=>TRUE}
win32 = /mswin/ =~ arch
@@ -287,21 +276,4 @@ end
CROSS_COMPILING = nil unless defined? CROSS_COMPILING
EOS
-$stdout = STDOUT
-mode = IO::RDWR|IO::CREAT
-mode |= IO::BINARY if defined?(IO::BINARY)
-open(rbconfig_rb, mode) do |f|
- if $timestamp and f.stat.size == config.size and f.read == config
- puts "#{rbconfig_rb} unchanged"
- else
- puts "#{rbconfig_rb} updated"
- f.rewind
- f.truncate(0)
- f.print(config)
- end
-end
-if String === $timestamp
- FileUtils.touch($timestamp)
-end
-
# vi:set sw=2: