heads/bootstrap
2017-01-28 12:16:07 -05:00

31 lines
748 B
Bash
Executable File

#!/bin/sh
# Download and build the musl-libc cross compiler.
# This should be worked around eventually to use the coreboot
# cross compile suite that we've already built, but for now
# we'll download yet another copy of gcc...
DIRNAME="`dirname $0`"
BASE="`cd "$DIRNAME" ; /bin/pwd `"
die() { echo >&2 "$@"; exit 1; }
if [ ! -d build/musl-cross ]; then
die "cross compiler already built?"
cd build
hg clone https://bitbucket.org/GregorR/musl-cross \
|| die "clone failed"
cd musl-cross
patch -p1 < ../../patches/musl-cross.patch \
|| die "patch of configuration failed!"
else
cd build/musl-cross
fi
export CC_BASE_PREFIX="$BASE/crossgcc"
echo "export CC_BASE_PREFIX='$CC_BASE_PREFIX'"
./build.sh \
|| die "compiler build failed!"