Skip to content

Instantly share code, notes, and snippets.

@KunoiSayami
Created December 27, 2018 17:24
Show Gist options
  • Save KunoiSayami/f185b940e61b34f030ce27dc66ab63bd to your computer and use it in GitHub Desktop.
Save KunoiSayami/f185b940e61b34f030ce27dc66ab63bd to your computer and use it in GitHub Desktop.
#!/bin/sh
version=$1
yum -y install gcc gcc-c++ kernel-devel glibc-static libstdc++-static
cd /opt
wget ftp://gcc.gnu.org/pub/gcc/releases/gcc-$version/gcc-$version.tar.$2
tar $3 gcc-$version.tar.$2 -C /usr/local/src
cd /usr/local/src/gcc-$version
./contrib/download_prerequisites
mkdir /usr/local/build
mkdir /usr/local/build/gcc-$version
cd /usr/local/build/gcc-$version
/usr/local/src/gcc-$version/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
make && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment