2019-06-17 14:27:17 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2019-07-14 23:54:58 +00:00
|
|
|
# Make sure gmp is built with generic options.
|
2019-07-15 03:02:52 +00:00
|
|
|
cp -v gcc/gmp/configfsf.guess gcc/gmp/config.guess
|
|
|
|
cp -v gcc/gmp/configfsf.sub gcc/gmp/config.sub
|
|
|
|
|
|
|
|
# Use lib not lib64 by default.
|
|
|
|
sed -i '/m64=/s/lib64/lib/' gcc/gcc/config/i386/t-linux64
|
|
|
|
sed -i 's/lib64/lib/' gcc/gcc/config/i386/linux64.h
|
2019-07-14 23:54:58 +00:00
|
|
|
|
2019-06-17 14:27:17 +00:00
|
|
|
# Build must happen outside of gcc source.
|
2019-06-17 17:50:37 +00:00
|
|
|
mkdir -p gcc-build
|
2019-06-21 11:25:22 +00:00
|
|
|
cd gcc-build
|
2019-06-17 14:27:17 +00:00
|
|
|
|
|
|
|
export libat_cv_have_ifunc=no
|
|
|
|
|
2019-07-13 08:57:51 +00:00
|
|
|
../gcc/configure \
|
2019-06-17 17:46:58 +00:00
|
|
|
--prefix=/usr \
|
2019-07-13 07:23:32 +00:00
|
|
|
--disable-multilib \
|
2019-06-17 17:46:58 +00:00
|
|
|
--disable-symvers \
|
|
|
|
--disable-libmpx \
|
|
|
|
--disable-libmudflap \
|
|
|
|
--disable-libsanitizer \
|
|
|
|
--disable-nls \
|
|
|
|
--disable-werror \
|
|
|
|
--disable-fixed-point \
|
|
|
|
--disable-libstdcxx-pch \
|
|
|
|
--enable-checking=release \
|
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--infodir=/usr/share/info \
|
|
|
|
--with-system-zlib \
|
|
|
|
--enable-__cxa_atexit \
|
|
|
|
--enable-default-pie \
|
|
|
|
--enable-default-ssp \
|
|
|
|
--enable-shared \
|
|
|
|
--enable-threads \
|
|
|
|
--enable-tls \
|
2019-07-13 15:30:27 +00:00
|
|
|
--enable-languages=c,c++ \
|
2019-07-16 18:35:35 +00:00
|
|
|
--build=x86_64-pc-linux-musl
|
2019-06-17 14:27:17 +00:00
|
|
|
|
2019-07-13 07:14:38 +00:00
|
|
|
make
|
2019-06-17 14:27:17 +00:00
|
|
|
make DESTDIR="$1" install
|
2019-06-18 18:00:16 +00:00
|
|
|
|
2019-07-12 07:22:13 +00:00
|
|
|
# Save 35MB.
|
|
|
|
find "$1" -name libgtkpeer.a -delete
|
|
|
|
find "$1" -name libgjsmalsa.a -delete
|
|
|
|
find "$1" -name libgij.a -delete
|
|
|
|
|
2019-06-18 18:00:16 +00:00
|
|
|
# Remove all info files.
|
|
|
|
rm -rf "$1/usr/share/info"
|
2019-06-19 04:43:03 +00:00
|
|
|
|
|
|
|
# Some legacy programs will expect cc
|
2019-06-19 04:53:01 +00:00
|
|
|
ln -s gcc "$1/usr/bin/cc"
|
2019-06-28 15:04:37 +00:00
|
|
|
|
|
|
|
# POSIX compliance.
|
|
|
|
install -Dm755 ../c99 "$1/usr/bin/c99"
|