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

ruby-changes:26725

From: nobu <ko1@a...>
Date: Fri, 11 Jan 2013 16:59:15 +0900 (JST)
Subject: [ruby-changes:26725] nobu:r38777 (trunk): tool/mkrunnable.rb: support mswin build on remote file system

nobu	2013-01-11 16:59:07 +0900 (Fri, 11 Jan 2013)

  New Revision: 38777

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38777

  Log:
    tool/mkrunnable.rb: support mswin build on remote file system

  Modified files:
    trunk/tool/mkrunnable.rb

Index: tool/mkrunnable.rb
===================================================================
--- tool/mkrunnable.rb	(revision 38776)
+++ tool/mkrunnable.rb	(revision 38777)
@@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/tool/mkrunnable.rb#L1
 #!./miniruby
 # -*- coding: us-ascii -*-
 
-require 'mkmf'
+require 'fileutils'
 
 case ARGV[0]
 when "-n"
@@ -14,6 +14,15 @@ else https://github.com/ruby/ruby/blob/trunk/tool/mkrunnable.rb#L14
   include FileUtils
 end
 
+def relative_from(path, base)
+  dir = File.join(path, "")
+  if File.expand_path(dir) == File.expand_path(dir, base)
+    path
+  else
+    File.join(base, path)
+  end
+end
+
 module Mswin
   def ln_safe(src, dest, *opt)
     cmd = ["mklink", dest.tr("/", "\\"), src.tr("/", "\\")]
@@ -35,11 +44,13 @@ end https://github.com/ruby/ruby/blob/trunk/tool/mkrunnable.rb#L44
 
 alias ln_dir_safe ln_safe
 
-if /mingw|mswin/ =~ RbConfig::CONFIG["build_os"]
+if /mingw|mswin/ =~ CROSS_COMPILING
   extend Mswin
 end
 
 config = RbConfig::CONFIG
+srcdir = config["srcdir"] ||= File.dirname(__FILE__)
+top_srcdir = config["top_srcdir"] ||= File.dirname(srcdir)
 extout = ARGV[0] || config["EXTOUT"]
 version = config["ruby_version"]
 arch = config["arch"]
@@ -82,4 +93,4 @@ else https://github.com/ruby/ruby/blob/trunk/tool/mkrunnable.rb#L93
 end
 ln_dir_safe("common", File.join(extout, version))
 ln_dir_safe(File.join("..", arch), File.join(extout, "common", arch))
-ln_dir_safe(relative_from(File.join(File.dirname(config["srcdir"]), "lib"), ".."), File.join(extout, "vendor_ruby"))
+ln_dir_safe(relative_from(File.join(top_srcdir, "lib"), ".."), File.join(extout, "vendor_ruby"))

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

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