Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

* mkconfig.rb: substitution refereces added.


git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 64cf9365ada0bb6e3c3f1750201c8b71893c171d 1 parent 194bd81
@nobu nobu authored
Showing with 31 additions and 19 deletions.
  1. +8 −2 ChangeLog
  2. +2 −1  Makefile.in
  3. +21 −16 mkconfig.rb
View
10 ChangeLog
@@ -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:44:18 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* configure.in: undef HAVE_LINK on BeOS. (link(2) always returns
@@ -17,9 +23,9 @@ Tue Nov 8 15:32:27 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
Mon Nov 7 13:43:51 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
- * ext/tk/stubs.c (_nativethread_consistency_check): use simpler
+ * ext/tk/stubs.c (_nativethread_consistency_check): use simpler
(low cost) way to check whether the Tcl interpreter was compiled
- with threads enabled of not.
+ with threads enabled of not.
* ext/tk/tcltklib.c: reduce warnings.
View
3  Makefile.in
@@ -30,7 +30,8 @@ RDOCTARGET = @RDOCTARGET@
EXTOUT = @EXTOUT@
RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
-OUTFLAG = -o
+empty =
+OUTFLAG = @OUTFLAG@$(empty)
CFLAGS = @CFLAGS@ @XCFLAGS@ @ARCH_FLAG@
CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
View
37 mkconfig.rb
@@ -16,10 +16,10 @@
end
version = RUBY_VERSION
-rbconfig_rb_tmp = rbconfig_rb + '.tmp'
-config = open(rbconfig_rb_tmp, "w")
-$orgout = $stdout.dup
-$stdout.reopen(config)
+def (config = "").write(arg)
+ concat(arg.to_s)
+end
+$stdout = config
fast = {'prefix'=>TRUE, 'ruby_install_name'=>TRUE, 'INSTALL'=>TRUE, 'EXEEXT'=>TRUE}
print %[
@@ -119,10 +119,13 @@ def Config::expand(val, config = CONFIG)
val.gsub!(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do |var|
if !(v = $1 || $2)
'$'
- elsif key = config[v]
+ elsif key = config[v = v[/\\A[^:]+(?=(?::(.*?)=(.*))?\\z)/]]
+ pat, sub = $1, $2
config[v] = false
Config::expand(key, config)
config[v] = key
+ key = key.gsub(/\#{Regexp.quote(pat)}(?=\\s|\\z)/n) {sub} if pat
+ key
else
var
end
@@ -135,17 +138,19 @@ def Config::expand(val, config = CONFIG)
end
CROSS_COMPILING = nil unless defined? CROSS_COMPILING
EOS
-$stdout.flush
-$stdout.reopen($orgout)
-config.close
-if $timestamp and
- File.exist?(rbconfig_rb) and
- FileUtils.compare_file(rbconfig_rb, rbconfig_rb_tmp)
- puts "#{rbconfig_rb} unchanged"
- File.unlink(rbconfig_rb_tmp)
-else
- puts "#{rbconfig_rb} updated"
- File.rename(rbconfig_rb_tmp, rbconfig_rb)
+
+$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)
Please sign in to comment.
Something went wrong with that request. Please try again.