diff options
Diffstat (limited to 'contrib/dep_builders')
-rwxr-xr-x | contrib/dep_builders/binutils | 27 | ||||
-rwxr-xr-x | contrib/dep_builders/dl | 9 | ||||
-rwxr-xr-x | contrib/dep_builders/gcc | 31 |
3 files changed, 67 insertions, 0 deletions
diff --git a/contrib/dep_builders/binutils b/contrib/dep_builders/binutils new file mode 100755 index 0000000..42dd04b --- /dev/null +++ b/contrib/dep_builders/binutils @@ -0,0 +1,27 @@ +#!/bin/sh +set -eu + +# ensure that we're in the repo root +if [ ! -d .git ]; then + echo please cd to the repo\'s main directory + exit +fi + +export PREFIX="$(pwd)/toolchain/prefix/" +export PATH="$(pwd)/toolchain/prefix/bin/:$PATH" +BUILDDIR="$(pwd)/toolchain/binutils-build/" +SYSROOT="$(pwd)/sysroot/" +mkdir -p $PREFIX +mkdir -p $BUILDDIR + +cd $BUILDDIR + +../binutils/configure \ + --target=x86_64-camellia \ + --prefix="$PREFIX" \ + --with-sysroot="$SYSROOT" \ + --disable-nls \ + --disable-werror +mkdir -p gas/doc/ # stupid workaround for the broken build +make -j4 +make install diff --git a/contrib/dep_builders/dl b/contrib/dep_builders/dl new file mode 100755 index 0000000..e6f279f --- /dev/null +++ b/contrib/dep_builders/dl @@ -0,0 +1,9 @@ +#!/bin/sh +# downloads a file to toolchain/cache unless it's already present there + +mkdir -p cache/toolchain +OUT="cache/toolchain/$(basename $1)" + +[ -e "$OUT" ] && exit +echo "downloading $1..." +curl "$1" > $OUT diff --git a/contrib/dep_builders/gcc b/contrib/dep_builders/gcc new file mode 100755 index 0000000..0a37541 --- /dev/null +++ b/contrib/dep_builders/gcc @@ -0,0 +1,31 @@ +#!/bin/sh +set -eu + +# ensure that we're in the repo root +if [ ! -d .git ]; then + echo please cd to the repo\'s main directory + exit +fi + +export PREFIX="$(pwd)/toolchain/prefix/" +export PATH="$(pwd)/toolchain/prefix/bin/:$PATH" +BUILDDIR="$(pwd)/toolchain/gcc-build/" +SYSROOT="$(pwd)/sysroot/" +mkdir -p $PREFIX +mkdir -p $BUILDDIR + +cd $BUILDDIR + +../gcc/configure \ + --target=x86_64-camellia \ + --prefix="$PREFIX" \ + --with-sysroot="$SYSROOT" \ + --enable-languages=c,c++ \ + --enable-default-pie \ + --disable-nls \ + --disable-gcov \ + --disable-werror +make -j4 all-gcc +make -j4 all-target-libgcc +make install-gcc +make install-target-libgcc |