From e1cb888bd9c74c6ca72f1cbfee0cc7e09a2cde2a Mon Sep 17 00:00:00 2001 From: lat9nq Date: Sun, 22 May 2022 23:08:23 -0400 Subject: [PATCH] gcc: And build scripts --- gcc/build_gcc.sh | 19 +++++++++++++++++++ gcc/docker.sh | 12 ++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 gcc/build_gcc.sh create mode 100644 gcc/docker.sh diff --git a/gcc/build_gcc.sh b/gcc/build_gcc.sh new file mode 100644 index 0000000..e1b87cb --- /dev/null +++ b/gcc/build_gcc.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# This script is meant to make it easy to build GCC using a Docker container. + +# Run this from the same directory as gcc source directory +# Recommended to clone GCC with: +# git clone --depth 1 -b "releases/gcc-11.3.0" git://gcc.gnu.org/git/gcc.git + +THIS=$(readlink -e $0) +USER_ID=`id -u` +GROUP_ID=`id -g` +VERSION=11.3.0 + +mkdir -p gcc-$VERSION + +docker run -v $(pwd):/src -w /src -u root -t debian:test /bin/bash /src/docker.sh $VERSION + +cp -v $THIS gcc-$VERSION/ +tar cv gcc-$VERSION | xz -T0 -c | split --bytes=90MB - gcc-$VERSION.tar.xz. diff --git a/gcc/docker.sh b/gcc/docker.sh new file mode 100644 index 0000000..d257523 --- /dev/null +++ b/gcc/docker.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +THIS=$(readlink -e $0) + +mkdir build +cd build +/src/gcc/configure --enable-languages=c,c++ --disable-multilib +make -j$(nproc) + +mkdir gcc-$1 +make -j$(nproc) install DESTDIR=/src/gcc-$1 +cp $THIS /src/gcc-$1