diff options
author | dzwdz | 2021-08-08 19:48:48 +0200 |
---|---|---|
committer | dzwdz | 2021-08-08 19:48:48 +0200 |
commit | 9b561ea71ab38e2893e887b8d902e7f8e16bac89 (patch) | |
tree | 35903eb95af2b53a14fd32922ca78cc8fd41187a /tools/dep_builders/binutils | |
parent | 6e5a5a3b27257f212fcd10a3580cfca3ea224fab (diff) | |
parent | bd50355d96bb081394f01c7d8e89debd1c040cd4 (diff) |
Merge branch 'main' of github.com:dzwdz/camellia
Diffstat (limited to 'tools/dep_builders/binutils')
-rwxr-xr-x | tools/dep_builders/binutils | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tools/dep_builders/binutils b/tools/dep_builders/binutils new file mode 100755 index 0000000..210c13b --- /dev/null +++ b/tools/dep_builders/binutils @@ -0,0 +1,47 @@ +#!/bin/sh +set -eu + +TOOL="binutils" +VER="2.37" +# this is ugly +{ HASHES=$(cat) ; } <<'HASHES' +c44968b97cd86499efbc4b4ab7d98471f673e5414c554ef54afa930062dbbfcb toolchain/cache/binutils-2.37.tar.gz +HASHES + +export PREFIX="$(pwd)/toolchain/" +export CACHE="$(pwd)/toolchain/cache/" +export PATH="$(pwd)/toolchain/bin/:$PATH" +export TARGET=i686-elf + + +# ensure that we're in the repo root +if [ ! -d .git ]; then + echo please cd to the repo\'s main directory + exit +fi + +mkdir -p $PREFIX + +echo "downloading missing files..." +tools/dep_builders/dl "https://ftp.gnu.org/gnu/$TOOL/$TOOL-$VER.tar.gz" +tools/dep_builders/dl "https://ftp.gnu.org/gnu/$TOOL/$TOOL-$VER.tar.gz.sig" +tools/dep_builders/dl "https://ftp.gnu.org/gnu/gnu-keyring.gpg" + +echo "verifying signatures..." +if ! gpg --verify --keyring toolchain/cache/gnu-keyring.gpg $CACHE/$TOOL-$VER.tar.gz.sig +then + echo "THE SIGNATURE COULDN'T BE VERIFIED. something's fishy." + exit +fi +echo "$HASHES" | sha256sum --check || exit + +echo "unpacking the tarball..." +tar xf toolchain/cache/$TOOL-$VER.tar.gz -C toolchain/cache + +echo "building..." +rm -rf $CACHE/$TOOL-$VER/builddir +mkdir $CACHE/$TOOL-$VER/builddir +cd $CACHE/$TOOL-$VER/builddir +../configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror +make +make install |