Skip to content

Commit 4ba1038

Browse files
committed
rtname.cmd: extract at once
* win32/rtname.cmd: extract runtime DLL names at once, and other refactoring. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent f77967a commit 4ba1038

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

win32/rtname.cmd

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,34 @@
22
set rt=
33
set rtver=
44
set osver=
5-
for /f "usebackq" %%I in (`dumpbin -dependents %1 ^| findstr -r -i "\<msvcr.*\.dll$"`) do set rt=%%~nI
6-
if "%rt%" NEQ "" goto :msvcr
7-
for /f "usebackq" %%I in (`dumpbin -dependents %1 ^| findstr -r -i "\<vcruntime.*\.dll$"`) do set rt=%%~nI
8-
if "%rt%" NEQ "" goto :vcruntime
5+
for /f "usebackq" %%I in (`
6+
dumpbin -dependents %1 ^|
7+
findstr -r -i -c:"\<vcruntime.*\.dll$" -c:"\<msvcr.*\.dll$"
8+
`) do (
9+
set rt=%%~nI
10+
)
911

10-
(echo %0: %1 is not linked to msvcrt nor vcruntime) 1>&2
11-
exit 1
12+
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 @(
13+
::- downcase
14+
call set rt=%%rt:%%i=%%i%%
15+
)
1216

13-
:msvcr
14-
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%%
1517
if "%rt%" == "msvcrt" (
1618
call set rtver=60
17-
) else (
19+
) else if "%rt:~0,5%" == "msvcr" (
1820
call set rtver=%%rt:msvcr=%%
19-
call set rt=msvcr%%rtver%%
2021
call set osver=_%%rtver%%
22+
) else if "%rt:~0,9%" == "vcruntime" (
23+
call set rtver=%%rt:vcruntime=%%
24+
call set osver=_%%rtver%%
25+
) else (
26+
(echo %0: %1 is not linked to msvcrt nor vcruntime) 1>&2
27+
exit 1
28+
)
29+
for %%I in (
30+
"PLATFORM = $(TARGET_OS)%osver%"
31+
"RT = %rt%"
32+
"RT_VER = %rtver%"
33+
) do @(
34+
echo %%~I
2135
)
22-
goto :exit
23-
24-
:vcruntime
25-
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%%
26-
call set rtver=%%rt:vcruntime=%%
27-
call set rt=vcruntime%%rtver%%
28-
call set osver=_%%rtver%%
29-
30-
:exit
31-
for %%I in ("PLATFORM = $(TARGET_OS)%osver%" "RT = %rt%" "RT_VER = %rtver%") do @echo %%~I

0 commit comments

Comments
 (0)