Browse Source

Fixes for 64bit windows. In particular, shorten all the directory names added to the path to the 8.3 format, so they don't contain inconvenient characters like "()" that break the way cmd.exe parses commmand lines.

WestfW 7 years ago
parent
commit
29bca68f13
1 changed files with 17 additions and 4 deletions
  1. 17 4
      optiboot/bootloaders/optiboot/omake.bat

+ 17 - 4
optiboot/bootloaders/optiboot/omake.bat

@@ -14,7 +14,7 @@ REM Things are good; try to set the paths and run the compile
 
 
 REM --------------------------------------------------------
 REM --------------------------------------------------------
    call :findArduino
    call :findArduino
-   DEBUG Using make %*
+   %DEBUG% Using make %*
    make %*
    make %*
    exit /b 0
    exit /b 0
 REM --------------------------------------------------------
 REM --------------------------------------------------------
@@ -132,8 +132,11 @@ REM setx will set a permanent path in the registry, but it won't take effect
 REM until the next invocation of cmd.exe
 REM until the next invocation of cmd.exe
 REM setx PATH %bin%;%etc%
 REM setx PATH %bin%;%etc%
 REM
 REM
-%DEBUG% echoing  PATH %PATH%;%bin%;%etc%
+%DEBUG% adding arduin bin and etc to PATH %bin%;%etc%
-PATH %%PATH%%;%bin%;%etc%
+call :shorten "%bin%"
+PATH %PATH%;!shortout!
+call :shorten "%etc%"
+PATH %PATH%;!shortout!
 
 
 %DEBUG% Have utils = %utils%
 %DEBUG% Have utils = %utils%
 
 
@@ -143,7 +146,8 @@ IF %utils% NEQ "" (
    call :which make.exe
    call :which make.exe
    if "%gotwhich%" EQU "" (
    if "%gotwhich%" EQU "" (
       echo Found Make at %utils%
       echo Found Make at %utils%
-      PATH %%PATH%%;%bin%;%etc%;%utils%
+      call :shorten %utils%
+      PATH %PATH%;!shortout!
    )
    )
 )
 )
 call :clearerrors
 call :clearerrors
@@ -205,4 +209,13 @@ REM Clear the ERRORLEVEL to 0, if it happened to be set
 :clearerrors
 :clearerrors
    exit /b 0
    exit /b 0
 
 
+
+REM ----------------------------------------------------------------------
+
+REM Shorten a pathname to 8.3 format filenames.
+
+:shorten
+  set shortout=%~s1
+  exit /b 0
+
 :eof
 :eof