11@ echo off
22@ setlocal EnableExtensions DisableDelayedExpansion || exit /b -1
33set PROMPT = $E[94m+$E[m$S
4+ goto :main
45
6+ :set
7+ set %*
8+ exit /b
9+
10+ :main
511if " %~dp0 " == " %CD% \" (
612 echo don't run in win32 directory.
713 exit /b 999
@@ -14,11 +20,12 @@ if "%~dp0" == "%CD%\" (
1420)
1521
1622set " WIN32DIR = %WIN32DIR:\ =/ % :/:"
17- call set " WIN32DIR = %% WIN32DIR:%~x0 :/:=:/:%% "
18- call set " WIN32DIR = %% WIN32DIR:/%~n0 :/:=:/:%% "
23+ call : set " WIN32DIR=%% WIN32DIR:%~x0 :/:=:/:%% "
24+ call : set " WIN32DIR=%% WIN32DIR:/%~n0 :/:=:/:%% "
1925set " WIN32DIR = %WIN32DIR:~0 ,-3 % "
2026
2127set configure = %~0
28+ set target =
2229set optdirs =
2330set pathlist =
2431set config_make = confargs~%RANDOM% .mak
@@ -88,7 +95,6 @@ goto :loop ;
8895 echo>> %confargs% " --target=%arg:$ =$$ % " \
8996goto :loop ;
9097:program_name
91- if " %eq% " == " " (set " arg=%~1 " & shift)
9298 for /f " delims=- tokens=1,*" %I in ("% opt%") do set "var=%%J "
9399 if " %var% " == " prefix" (set " var=PROGRAM_PREFIX" & goto :name)
94100 if " %var% " == " suffix" (set " var=PROGRAM_SUFFIX" & goto :name)
@@ -109,7 +115,7 @@ goto :loopend ;
109115:enable
110116 echo>> %confargs% " %opt% " \
111117 if %enable% == yes (set " opt=%opt:~9 % " ) else (set " opt=%opt:~10 % " )
112- if " %opt% " == " rdoc " (
118+ if " %opt% " == " install-doc " (
113119 echo>> %config_make% RDOCTARGET = %enable:yes =r % doc
114120 )
115121 if " %opt% " == " install-static-library" (
@@ -155,9 +161,9 @@ goto :loop ;
155161 if " %eq% " == " " (set " NTVER=%~1 " & shift) else (set " NTVER=%arg% " )
156162 if /i not " %NTVER:~0 ,2 % " == " 0x" if /i not " %NTVER:~0 ,13 % " == " _WIN32_WINNT_" (
157163 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 (
158- call set NTVER = %%N TVER:%%i =%%i %%
164+ call : set NTVER=%%N TVER:%%i =%%i %%
159165 )
160- call set NTVER = _WIN32_WINNT_%%N TVER%%
166+ call : set NTVER=_WIN32_WINNT_%%N TVER%%
161167 )
162168 echo>> %config_make% NTVER = %NTVER%
163169goto :loopend ;
@@ -170,7 +176,7 @@ goto :loopend ;
170176 set " pathlist = %pathlist%%a rg:\ =/ % ;"
171177goto :loopend ;
172178:extstatic
173- if " %eq% " == " " (set " arg=static" & shift )
179+ if " %eq% " == " " (set " arg=static" )
174180 echo>> %config_make% EXTSTATIC = %arg%
175181goto :loopend ;
176182:baseruby
@@ -205,7 +211,7 @@ goto :loop ;
205211 :optdir-loop
206212 for /f " delims=; tokens=1,*" %%I in (" %arg% " ) do (set " d=%%I " & set " arg = %%J " )
207213 pushd %d:/ =\ % 2 > nul && (
208- set " optdirs = %optdirs% ;%CD:\ =/ % "
214+ call : set " optdirs=%optdirs% ;%% C D:\=/% %"
209215 popd
210216 ) || (
211217 set " optdirs = %optdirs% ;%d:\ =/ % "
@@ -241,7 +247,7 @@ goto :EOF
241247 exit /b 1
242248:end
243249if " %debug_configure% " == " yes" (type %confargs% )
244- if defined optdirs (for %%I in ( " %optdirs:~ 1 % " ) do echo>> %config_make% optdirs = %%~I )
250+ if defined optdirs (echo>> %config_make% optdirs = %optdirs:~ 1 % )
245251(
246252 echo .
247253 echo configure_args = \
0 commit comments