Blame env/debian-7-64bit/files/install-gcc.sh

38f35f
#!/bin/bash
38f35f
38f35f
set -e
38f35f
38f35f
mkdir -p install-gcc
38f35f
cd install-gcc
38f35f
38f35f
echo && echo "download and unpack" && echo
38f35f
89a23b
GCC_SOURCES_URL="https://ftp.gnu.org/gnu/gcc/gcc-7.2.0/gcc-7.2.0.tar.xz"
38f35f
wget -c "$GCC_SOURCES_URL"
38f35f
tar -xf gcc-*.tar.*
38f35f
38f35f
echo && echo "build and install" && echo
38f35f
38f35f
mkdir -p build
38f35f
cd build
8e45a3
[ -f "../configure.done" ] || (../gcc-*/configure && touch "../configure.done")
9a8dee
make -j`nproc` || make || make
38f35f
make install
38f35f
(cd /usr/local/bin && ln gcc cc)
38f35f
cd ..
38f35f
38f35f
echo && echo "add licenses" && echo
38f35f
38f35f
cd gcc-*
38f35f
PREFIX="/usr/local/share/doc"
38f35f
TARGET="../copyright"
38f35f
TARGET_DIRS="gcc g++ gfortran cc c++ fortran"
38f35f
echo > "$TARGET"
38f35f
for FILE in README COPYING* MAINTAINERS; do
38f35f
    echo ""                                      >> "$TARGET"
38f35f
    echo "-------------------------------------" >> "$TARGET"
38f35f
    echo "  File: $FILE"                         >> "$TARGET"
38f35f
    echo "-------------------------------------" >> "$TARGET"
38f35f
    echo ""                                      >> "$TARGET"
38f35f
    cat  "$FILE"                                 >> "$TARGET"
38f35f
done
38f35f
for TARGET_DIR in $TARGET_DIRS; do
38f35f
    mkdir -p "$PREFIX/$TARGET_DIR"
38f35f
    cp "$TARGET" "$PREFIX/$TARGET_DIR/"
38f35f
done
38f35f
cd ..
38f35f
38f35f
cd ..
38f35f
38f35f
echo && echo "clean" && echo
38f35f
38f35f
rm -r install-gcc