#!/bin/sh set -e source $(dirname $0)/setup-env.sh cd $LUNA_ROOT mkdir -p toolchain/tarballs mkdir -p toolchain/build if [ ! -f toolchain/tarballs/binutils-$LUNA_BINUTILS_VERSION_REQUIRED.tar.xz ]; then echo Downloading Binutils... wget -Otoolchain/tarballs/binutils-$LUNA_BINUTILS_VERSION_REQUIRED.tar.xz https://ftp.gnu.org/gnu/binutils/binutils-$LUNA_BINUTILS_VERSION_REQUIRED.tar.xz fi echo Extracting Binutils... tar xf toolchain/tarballs/binutils-$LUNA_BINUTILS_VERSION_REQUIRED.tar.xz -C toolchain/build/ echo Configuring Binutils... mkdir -p toolchain/build/binutils cd toolchain/build/binutils ../binutils-$LUNA_BINUTILS_VERSION_REQUIRED/configure --prefix="$PREFIX" --target=$TARGET --disable-nls --with-sysroot --disable-werror echo Building Binutils... make -j$(nproc) echo Installing Binutils... make install