zylin / zpugcc

50 stars 31 forks source link

Build fails if PATH contains paths with spaces in them. As in the WSL on Win10. #15

Open ZiCog opened 3 years ago

ZiCog commented 3 years ago

When running Debian Buster under the Windows Subsystem for Linux on Win 10 the PATH will contain directory names with spaces in them. Which causes the build.sh to fail.

The fix is to add some double quotes to the configure commands. As per this patch:

diff --git a/toolchain/build.sh b/toolchain/build.sh
index 332e4065..6a232acb 100644
--- a/toolchain/build.sh
+++ b/toolchain/build.sh
@@ -4,12 +4,13 @@ rm -rf build
 mkdir build
 cd build
 export CFLAGS=-D_FORTIFY_SOURCE=0
-../binutils/configure --target=zpu-elf --prefix=`pwd`/../install
+../binutils/configure --target=zpu-elf --prefix="`pwd`/../install"
 make
 make install
 cd ..

-export PATH=`pwd`/install/bin:$PATH
+export PATH="`pwd`/install/bin:$PATH"
+
 rm -rf gccbuild
 mkdir gccbuild
 cd gccbuild