build-toolchain.sh 919 B

1234567891011121314151617181920212223242526272829303132333435
  1. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  2. TARGET=x86_64-pc-toaru
  3. PREFIX="$DIR/local"
  4. SYSROOT="$DIR/../base"
  5. cd $DIR
  6. mkdir -p $PREFIX/bin
  7. mkdir -p $DIR/build/binutils
  8. cd $DIR/build/binutils
  9. ../../binutils-gdb/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot="$SYSROOT" --disable-werror --enable-shared
  10. make -j8
  11. make install
  12. mkdir -p $DIR/build/gcc
  13. cd $DIR/build/gcc
  14. ../../gcc/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot="$SYSROOT" --enable-languages=c,c++ --enable-shared
  15. make -j8 all-gcc
  16. make install-gcc
  17. make -j8 all-target-libgcc # This will fail, but we don't care, we need some other targets in here to build libc
  18. make install-target-libgcc
  19. cd $DIR/../
  20. make base/lib/libc.so
  21. cd $DIR/build/gcc
  22. make -j8 all-target-libgcc
  23. make install-target-libgcc
  24. cd $DIR/../
  25. make base/lib/libm.so
  26. cd $DIR/build/gcc
  27. make -j8 all-target-libstdc++-v3
  28. make install-target-libstdc++-v3