Advertisement
tyler569

build-all

Nov 18th, 2019
469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.49 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. BINUTILS_VERSION="2.33.1"
  4. GCC_VERSION="9.2.0"
  5. PARALLEL=4
  6.  
  7. PREFIX="$HOME"
  8. PATH="$PREFIX/bin:$PATH"
  9. TARGET=x86_64-elf
  10.  
  11. # if there's old builds lying around
  12. rm -rf build-binutils.sh build-binutils binutils-${BINUTILS_VERSION}
  13. rm -rf build-gcc.sh build-gcc gcc-${GCC_VERSION}
  14.  
  15. mkdir -p "$PREFIX/src"
  16. cd "$PREFIX/src"
  17.  
  18. wget -q https://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VERSION}.tar.gz
  19. wget -q https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz
  20.  
  21. tar zxf binutils-${BINUTILS_VERSION}.tar.gz
  22. tar zxf gcc-${GCC_VERSION}.tar.gz
  23.  
  24. rm binutils-${BINUTILS_VERSION}.tar.gz gcc-${GCC_VERSION}.tar.gz
  25.  
  26. ### binutils
  27.  
  28. cd $PREFIX/src
  29. mkdir build-binutils
  30. cd build-binutils
  31. ../binutils-${BINUTILS_VERSION}/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --disable-werror --with-sysroot
  32. #../binutils-${BINUTILS_VERSION}/configure --prefix="$PREFIX" --disable-nls --disable-werror
  33. make -j $PARALLEL
  34. make install
  35.  
  36. cd $PREFIX/src
  37. #rm -rf build-binutils.sh build-binutils binutils-${BINUTILS_VERSION}
  38.  
  39. ### GCC
  40.  
  41. cd $PREFIX/src
  42. mkdir build-gcc
  43. cd build-gcc
  44. ../gcc-${GCC_VERSION}/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++
  45. #../gcc-${GCC_VERSION}/configure --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --disable-multilib
  46. make -j $PARALLEL all-gcc
  47. make -j $PARALLEL all-target-libgcc
  48. make install-gcc
  49. make install-target-libgcc
  50.  
  51. cd $PREFIX/src
  52. #rm -rf build-gcc.sh build-gcc gcc-${GCC_VERSION}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement