[前][次][番号順一覧][スレッド一覧]

ruby-changes:1722

From: ko1@a...
Date: 22 Aug 2007 12:28:43 +0900
Subject: [ruby-changes:1722] shyouhei - Ruby:r13212 (ruby_1_8_6): * ext/extmk.rb (extmake): save all CONFIG values.

shyouhei	2007-08-22 12:28:33 +0900 (Wed, 22 Aug 2007)

  New Revision: 13212

  Modified files:
    branches/ruby_1_8_6/ChangeLog
    branches/ruby_1_8_6/ext/extmk.rb
    branches/ruby_1_8_6/version.h

  Log:
    * ext/extmk.rb (extmake): save all CONFIG values.
    * ext/extmk.rb (extmake): remove mkmf.log at clean, and extconf.h at
      distclean, respectively.
    * ext/extmk.rb: remove rdoc at clean, and installed list file at
      distclean, respectively.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/ChangeLog?r1=13212&r2=13211
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/version.h?r1=13212&r2=13211
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/ext/extmk.rb?r1=13212&r2=13211

Index: ruby_1_8_6/ext/extmk.rb
===================================================================
--- ruby_1_8_6/ext/extmk.rb	(revision 13211)
+++ ruby_1_8_6/ext/extmk.rb	(revision 13212)
@@ -112,10 +112,10 @@
     Dir.chdir target
     top_srcdir = $top_srcdir
     topdir = $topdir
-    mk_srcdir = CONFIG["srcdir"]
-    mk_topdir = CONFIG["topdir"]
+    hdrdir = $hdrdir
     prefix = "../" * (target.count("/")+1)
-    $hdrdir = $top_srcdir = relative_from(top_srcdir, prefix)
+    $top_srcdir = relative_from(top_srcdir, prefix)
+    $hdrdir = relative_from(hdrdir, prefix)
     $topdir = prefix + $topdir
     $target = target
     $mdir = target
@@ -127,12 +127,31 @@
     makefile = "./Makefile"
     ok = File.exist?(makefile)
     unless $ignore
-      Config::CONFIG["hdrdir"] = $hdrdir
-      Config::CONFIG["srcdir"] = $srcdir
-      Config::CONFIG["topdir"] = $topdir
-      CONFIG["hdrdir"] = ($hdrdir == top_srcdir) ? top_srcdir : "$(topdir)"+top_srcdir[2..-1]
-      CONFIG["srcdir"] = "$(hdrdir)/ext/#{$mdir}"
-      CONFIG["topdir"] = $topdir
+      rbconfig0 = Config::CONFIG
+      mkconfig0 = CONFIG
+      rbconfig = {
+	"hdrdir" => $hdrdir,
+	"srcdir" => $srcdir,
+	"topdir" => $topdir,
+      }
+      mkconfig = {
+	"top_srcdir" => ($hdrdir == top_srcdir) ? top_srcdir : "$(topdir)"+top_srcdir[2..-1],
+	"hdrdir" => "$(top_srcdir)",
+	"srcdir" => "$(top_srcdir)/ext/#{$mdir}",
+	"topdir" => $topdir,
+      }
+      rbconfig0.each_pair {|key, val| rbconfig[key] ||= val.dup}
+      mkconfig0.each_pair {|key, val| mkconfig[key] ||= val.dup}
+      Config.module_eval {
+	remove_const(:CONFIG)
+	const_set(:CONFIG, rbconfig)
+	remove_const(:MAKEFILE_CONFIG)
+	const_set(:MAKEFILE_CONFIG, mkconfig)
+      }
+      Object.class_eval {
+	remove_const(:CONFIG)
+	const_set(:CONFIG, mkconfig)
+      }
       begin
 	$extconf_h = nil
 	ok &&= extract_makefile(makefile)
@@ -181,7 +200,11 @@
       $ignore or $continue or return false
     end
     $compiled[target] = true
-    if $clean and $clean != true
+    if $clean
+      FileUtils.rm_f("mkmf.log")
+      if $clean != true
+	FileUtils.rm_f([makefile, $extconf_h || "extconf.h"])
+      end
       File.unlink(makefile) rescue nil
     end
     if $static
@@ -195,13 +218,21 @@
       $extpath |= $LIBPATH
     end
   ensure
-    Config::CONFIG["srcdir"] = $top_srcdir
-    Config::CONFIG["topdir"] = topdir
-    CONFIG["srcdir"] = mk_srcdir
-    CONFIG["topdir"] = mk_topdir
-    CONFIG.delete("hdrdir")
-    $hdrdir = $top_srcdir = top_srcdir
+    unless $ignore
+      Config.module_eval {
+	remove_const(:CONFIG)
+	const_set(:CONFIG, rbconfig0)
+	remove_const(:MAKEFILE_CONFIG)
+	const_set(:MAKEFILE_CONFIG, mkconfig0)
+      }
+      Object.class_eval {
+	remove_const(:CONFIG)
+	const_set(:CONFIG, mkconfig0)
+      }
+    end
+    $top_srcdir = top_srcdir
     $topdir = topdir
+    $hdrdir = hdrdir
     Dir.chdir dir
   end
   begin
@@ -285,6 +316,7 @@
   $continue = $mflags.set?(?k)
   if $extout
     $extout = '$(topdir)/'+$extout
+    Config::CONFIG["extout"] = CONFIG["extout"] = $extout
     $extout_prefix = $extout ? "$(extout)$(target_prefix)/" : ""
     $mflags << "extout=#$extout" << "extout_prefix=#$extout_prefix"
   end
@@ -323,7 +355,7 @@
 else
   $ruby = '$(topdir)/miniruby' + EXEEXT
 end
-$ruby << " -I'$(topdir)' -I'$(hdrdir)/lib'"
+$ruby << " -I'$(topdir)' -I'$(top_srcdir)/lib'"
 $ruby << " -I'$(extout)/$(arch)' -I'$(extout)/common'" if $extout
 $ruby << " -I'$(hdrdir)/ext' -rpurelib.rb"
 $config_h = '$(topdir)/config.h'
@@ -404,12 +436,14 @@
 FileUtils::makedirs('ext')
 Dir::chdir('ext')
 
+hdrdir = $hdrdir
 $hdrdir = $top_srcdir = relative_from(srcdir, $topdir = "..")
 exts.each do |d|
   extmake(d) or abort
 end
-$hdrdir = $top_srcdir = srcdir
+$top_srcdir = srcdir
 $topdir = "."
+$hdrdir = hdrdir
 
 extinit = Struct.new(:c, :o) {
   def initialize(src)
Index: ruby_1_8_6/ChangeLog
===================================================================
--- ruby_1_8_6/ChangeLog	(revision 13211)
+++ ruby_1_8_6/ChangeLog	(revision 13212)
@@ -1,3 +1,13 @@
+Wed Aug 22 12:13:54 2007  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/extmk.rb (extmake): save all CONFIG values.
+
+	* ext/extmk.rb (extmake): remove mkmf.log at clean, and extconf.h at
+	  distclean, respectively.
+
+	* ext/extmk.rb: remove rdoc at clean, and installed list file at
+	  distclean, respectively.
+
 Wed Aug 22 11:49:00 2007  Nobuyoshi Nakada  <nobu@r...>
 
 	* sprintf.c (rb_f_sprintf): should not check positional number as
Index: ruby_1_8_6/version.h
===================================================================
--- ruby_1_8_6/version.h	(revision 13211)
+++ ruby_1_8_6/version.h	(revision 13212)
@@ -2,7 +2,7 @@
 #define RUBY_RELEASE_DATE "2007-08-22"
 #define RUBY_VERSION_CODE 186
 #define RUBY_RELEASE_CODE 20070822
-#define RUBY_PATCHLEVEL 82
+#define RUBY_PATCHLEVEL 83
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]