* Makefile.in (OUTFLAG): keep trailing spaces. [ruby-dev:27666]

* mkconfig.rb: substitution refereces added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2005-11-10 23:22:03 +00:00
parent 0535fc9cac
commit bf203228cf
3 changed files with 29 additions and 17 deletions

View File

@ -1,3 +1,9 @@
Fri Nov 11 08:20:56 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in (OUTFLAG): keep trailing spaces. [ruby-dev:27666]
* mkconfig.rb: substitution refereces added.
Fri Nov 11 07:39:49 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> Fri Nov 11 07:39:49 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* configure.in: undef HAVE_LINK on BeOS. (link(2) always returns * configure.in: undef HAVE_LINK on BeOS. (link(2) always returns

View File

@ -30,7 +30,8 @@ RDOCTARGET = @RDOCTARGET@
EXTOUT = @EXTOUT@ EXTOUT = @EXTOUT@
RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
OUTFLAG = -o empty =
OUTFLAG = @OUTFLAG@$(empty)
CFLAGS = @CFLAGS@ @XCFLAGS@ @ARCH_FLAG@ CFLAGS = @CFLAGS@ @XCFLAGS@ @ARCH_FLAG@
CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@ CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@ LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@

View File

@ -16,10 +16,10 @@ unless File.directory?(dir = File.dirname(rbconfig_rb))
end end
version = RUBY_VERSION version = RUBY_VERSION
rbconfig_rb_tmp = rbconfig_rb + '.tmp' def (config = "").write(arg)
config = open(rbconfig_rb_tmp, "w") concat(arg.to_s)
$orgout = $stdout.dup end
$stdout.reopen(config) $stdout = config
fast = {'prefix'=>TRUE, 'ruby_install_name'=>TRUE, 'INSTALL'=>TRUE, 'EXEEXT'=>TRUE} fast = {'prefix'=>TRUE, 'ruby_install_name'=>TRUE, 'INSTALL'=>TRUE, 'EXEEXT'=>TRUE}
print %[ print %[
@ -120,10 +120,13 @@ print <<EOS
val.gsub!(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do |var| val.gsub!(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do |var|
if !(v = $1 || $2) if !(v = $1 || $2)
'$' '$'
elsif key = config[v] elsif key = config[v = v[/\\A[^:]+(?=(?::(.*?)=(.*))?\\z)/]]
pat, sub = $1, $2
config[v] = false config[v] = false
Config::expand(key, config) Config::expand(key, config)
config[v] = key config[v] = key
key = key.gsub(/\#{Regexp.quote(pat)}(?=\\s|\\z)/n) {sub} if pat
key
else else
var var
end end
@ -136,17 +139,19 @@ print <<EOS
end end
CROSS_COMPILING = nil unless defined? CROSS_COMPILING CROSS_COMPILING = nil unless defined? CROSS_COMPILING
EOS EOS
$stdout.flush
$stdout.reopen($orgout) $stdout = STDOUT
config.close mode = IO::RDWR|IO::CREAT
if $timestamp and mode |= IO::BINARY if defined?(IO::BINARY)
File.exist?(rbconfig_rb) and open(rbconfig_rb, mode) do |f|
FileUtils.compare_file(rbconfig_rb, rbconfig_rb_tmp) if $timestamp and f.stat.size == config.size and f.read == config
puts "#{rbconfig_rb} unchanged" puts "#{rbconfig_rb} unchanged"
File.unlink(rbconfig_rb_tmp) else
else puts "#{rbconfig_rb} updated"
puts "#{rbconfig_rb} updated" f.rewind
File.rename(rbconfig_rb_tmp, rbconfig_rb) f.truncate(0)
f.print(config)
end
end end
if String === $timestamp if String === $timestamp
FileUtils.touch($timestamp) FileUtils.touch($timestamp)