Created
December 24, 2016 20:40
-
-
Save abepark01/c7d02561176eaef95206995ab923058d to your computer and use it in GitHub Desktop.
Download and Build gcc locally
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#### Description: downloads and installs gcc 6.3.0 locally | |
GCC_VERSION=6.3.0 | |
INSTALLDIR="${HOME}/.local" | |
WORKDIR="${HOME}/src" | |
SRCDIR="${WORKDIR}/gcc-${GCC_VERSION}" | |
OBJDIR="${WORKDIR}/objdir" | |
# setup folders | |
if [ ! -z "$OBJDIR" ] | |
then | |
rm -fr "${OBJDIR}" | |
fi | |
mkdir -p "${OBJDIR}" | |
mkdir -p "${WORKDIR}" | |
mkdir -p "$INSTALLDIR" | |
# Download the source | |
cd "${WORKDIR}" | |
if [ ! -d "${SRCDIR}" ]; then | |
wget -q http://mirrors-usa.go-parts.com/gcc/releases/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2 | |
tar xvf gcc-${GCC_VERSION}.tar.bz2 | |
fi | |
# Download the prerequisites | |
cd "${SRCDIR}" | |
./contrib/download_prerequisites | |
cd "${OBJDIR}" | |
# Build | |
${SRCDIR}/configure \ | |
--prefix=${INSTALLDIR} \ | |
--enable-shared \ | |
--enable-threads=posix \ | |
--enable-__cxa_atexit \ | |
--enable-clocale=gnu \ | |
--enable-languages=c,c++ \ | |
--enable-bootstrap | |
make bootstrap | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment