repo/gcc/build
2021-08-25 13:58:56 +02:00

56 lines
1.5 KiB
Text
Executable file

wget -O gcc-11.1.2.tar.gz https://gcc.gnu.org/pub/gcc/releases/gcc-11.1.2/gcc-11.1.2.tar.xz
tar -xf gcc-11.1.2.tar.gz
cd gcc-11.1.2
wget https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz
tar -xf gmp-6.2.1.tar.xz gmp
wget https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.xz
tar -xf mprf-4.1.0.tar.xz mpfr
wget https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz
tar -xf mpc-1.2.1.tar.gz mpc
# Use lib not lib64 by default.
sed '/m64=/s/lib64/lib/' gcc/gcc/config/i386/t-linux64 > _
mv -f _ gcc/gcc/config/i386/t-linux64
sed 's/lib64/lib/' gcc/gcc/config/i386/linux64.h > _
mv -f _ gcc/gcc/config/i386/linux64.h
mkdir build
cd build
../configure \
--prefix=/usr \
--libexecdir=/usr/lib \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-multilib \
--disable-symvers \
--disable-libmpx \
--disable-libmudflap \
--disable-libsanitizer \
--disable-werror \
--disable-fixed-point \
--disable-libstdcxx-pch \
--disable-nls \
--enable-checking=release \
--enable-__cxa_atexit \
--enable-default-pie \
--enable-default-ssp \
--enable-shared \
--enable-threads \
--enable-tls \
--enable-languages=c,c++
make
make DESTDIR="$1" install
# Save 35MB. (from KISS)
find "$1" -name libgtkpeer.a -exec rm -f {} +
find "$1" -name libgjsmalsa.a -exec rm -f {} +
find "$1" -name libgij.a -exec rm -f {} +
ln -sf gcc "$1/usr/bin/cc"
echo "#!/bin/sh" > "$1"/usr/bin/c99
echo "exec cc -std=c99 "$@"" >> "$1"/usr/bin/c99
chmod +x "$1"/usr/bin/c99