2017-01-27 22:55:44 +00:00
|
|
|
#!/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...
|
|
|
|
|
2017-01-28 17:16:07 +00:00
|
|
|
DIRNAME="`dirname $0`"
|
|
|
|
BASE="`cd "$DIRNAME" ; /bin/pwd `"
|
2017-01-27 22:55:44 +00:00
|
|
|
|
|
|
|
die() { echo >&2 "$@"; exit 1; }
|
|
|
|
|
2017-01-28 17:16:07 +00:00
|
|
|
if [ ! -d build/musl-cross ]; then
|
|
|
|
cd build
|
2017-01-31 00:44:55 +00:00
|
|
|
git clone https://github.com/GregorR/musl-cross.git \
|
2017-01-28 17:16:07 +00:00
|
|
|
|| die "clone failed"
|
|
|
|
|
|
|
|
cd musl-cross
|
|
|
|
patch -p1 < ../../patches/musl-cross.patch \
|
|
|
|
|| die "patch of configuration failed!"
|
|
|
|
else
|
|
|
|
cd build/musl-cross
|
|
|
|
fi
|
2017-01-27 22:55:44 +00:00
|
|
|
|
2017-01-28 17:16:07 +00:00
|
|
|
export CC_BASE_PREFIX="$BASE/crossgcc"
|
|
|
|
echo "export CC_BASE_PREFIX='$CC_BASE_PREFIX'"
|
2017-01-27 22:55:44 +00:00
|
|
|
|
|
|
|
./build.sh \
|
|
|
|
|| die "compiler build failed!"
|