diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2026-02-01 22:08:27 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2026-02-01 23:57:35 +0900 |
| commit | 911c1ca2823601d4bcf6e0e9b5a40f1d4aae51bd (patch) | |
| tree | 6a29bb360bf60f836e24660b715bd560937b5161 | |
| parent | 2ed817434f2958398773d8f3360a412fbf9384af (diff) | |
Win32: keep --with-opt-dir as-is unless it is a real path
Allow to expand environment variables in Makefile.
E.g.:
```batch
set VCPKG_INSTALLED=%HOME%\vcpkg\vcpkg_installed
win32\configure.bat "--with-opt-dir=$(VCPKG_INSTALLED)/$(MACHINE)-windows"
```
| -rwxr-xr-x | win32/configure.bat | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/win32/configure.bat b/win32/configure.bat index 72c2a0139b..68ce7fb53f 100755 --- a/win32/configure.bat +++ b/win32/configure.bat @@ -5,12 +5,12 @@ set PROMPT=$E[94m+$E[m$S if "%~dp0" == "%CD%\" (
echo don't run in win32 directory.
exit /b 999
-) else if "%~0" == "%~nx0" ( +) else if "%~0" == "%~nx0" (
set "WIN32DIR=%~$PATH:0"
-) else if "%~0" == "%~n0" ( +) else if "%~0" == "%~n0" (
set "WIN32DIR=%~$PATH:0"
) else (
- set "WIN32DIR=%~0" + set "WIN32DIR=%~0"
)
set "WIN32DIR=%WIN32DIR:\=/%:/:"
@@ -204,9 +204,11 @@ goto :loop ; )
:optdir-loop
for /f "delims=; tokens=1,*" %%I in ("%arg%") do (set "d=%%I" & set "arg=%%J")
- pushd %d:/=\% && (
+ pushd %d:/=\% 2> nul && (
set "optdirs=%optdirs%;%CD:\=/%"
popd
+ ) || (
+ set "optdirs=%optdirs%;%d:\=/%"
)
if not "%arg%" == "" goto :optdir-loop
goto :loop ;
@@ -239,7 +241,7 @@ goto :EOF exit /b 1
:end
if "%debug_configure%" == "yes" (type %confargs%)
-if not "%optdirs%" == "" (echo>>%config_make% optdirs = %optdirs:~1%)
+if defined optdirs (for %%I in ("%optdirs:~1%") do echo>>%config_make% optdirs = %%~I)
(
echo.
echo configure_args = \
|
