ruby-changes:39158
From: nobu <ko1@a...>
Date: Tue, 14 Jul 2015 17:13:41 +0900 (JST)
Subject: [ruby-changes:39158] nobu:r51239 (trunk): rtname.cmd: extract at once
nobu 2015-07-14 17:13:18 +0900 (Tue, 14 Jul 2015) New Revision: 51239 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51239 Log: rtname.cmd: extract at once * win32/rtname.cmd: extract runtime DLL names at once, and other refactoring. Modified files: trunk/win32/rtname.cmd Index: win32/rtname.cmd =================================================================== --- win32/rtname.cmd (revision 51238) +++ win32/rtname.cmd (revision 51239) @@ -2,30 +2,34 @@ https://github.com/ruby/ruby/blob/trunk/win32/rtname.cmd#L2 set rt= set rtver= set osver= -for /f "usebackq" %%I in (`dumpbin -dependents %1 ^| findstr -r -i "\<msvcr.*\.dll$"`) do set rt=%%~nI -if "%rt%" NEQ "" goto :msvcr -for /f "usebackq" %%I in (`dumpbin -dependents %1 ^| findstr -r -i "\<vcruntime.*\.dll$"`) do set rt=%%~nI -if "%rt%" NEQ "" goto :vcruntime +for /f "usebackq" %%I in (` + dumpbin -dependents %1 ^| + findstr -r -i -c:"\<vcruntime.*\.dll$" -c:"\<msvcr.*\.dll$" +`) do ( + set rt=%%~nI +) -(echo %0: %1 is not linked to msvcrt nor vcruntime) 1>&2 -exit 1 +for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do @( + ::- downcase + call set rt=%%rt:%%i=%%i%% +) -:msvcr -for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do @call set rt=%%rt:%%i=%%i%% if "%rt%" == "msvcrt" ( call set rtver=60 -) else ( +) else if "%rt:~0,5%" == "msvcr" ( call set rtver=%%rt:msvcr=%% - call set rt=msvcr%%rtver%% call set osver=_%%rtver%% +) else if "%rt:~0,9%" == "vcruntime" ( + call set rtver=%%rt:vcruntime=%% + call set osver=_%%rtver%% +) else ( + (echo %0: %1 is not linked to msvcrt nor vcruntime) 1>&2 + exit 1 +) +for %%I in ( + "PLATFORM = $(TARGET_OS)%osver%" + "RT = %rt%" + "RT_VER = %rtver%" +) do @( + echo %%~I ) -goto :exit - -:vcruntime -for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do @call set rt=%%rt:%%i=%%i%% -call set rtver=%%rt:vcruntime=%% -call set rt=vcruntime%%rtver%% -call set osver=_%%rtver%% - -:exit -for %%I in ("PLATFORM = $(TARGET_OS)%osver%" "RT = %rt%" "RT_VER = %rtver%") do @echo %%~I -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/