3 export CFLAGS
="-O2 -pipe -march=westmere -ftree-vectorize"
4 export CXXFLAGS
="$CFLAGS"
6 # Make sure gmp is built with generic options.
7 cp gcc
/gmp
/configfsf.guess gcc
/gmp
/config.guess
8 cp gcc
/gmp
/configfsf.sub gcc
/gmp
/config.sub
10 # Use lib not lib64 by default.
11 sed '/m64=/s/lib64/lib/' gcc
/gcc
/config
/i386
/t-linux64
> _
12 mv -f _ gcc
/gcc
/config
/i386
/t-linux64
13 sed 's/lib64/lib/' gcc
/gcc
/config
/i386
/linux64.h
> _
14 mv -f _ gcc
/gcc
/config
/i386
/linux64.h
16 # Build must happen outside of gcc source.
20 # Grab the system's GCC version.
21 gcc_version
=$
(gcc
-dumpversion) || gcc_version
=null
23 # Skip the bootstrap process if we are able.
24 case $2 in "$gcc_version"*)
25 printf '%s\n' "Minor version difference, disabling bootstrap."
26 bootstrap
=--disable-bootstrap
31 --libexecdir=/usr
/lib \
32 --mandir=/usr
/share
/man \
33 --infodir=/usr
/share
/info \
37 --disable-libmudflap \
38 --disable-libsanitizer \
40 --disable-fixed-point \
41 --disable-libstdcxx-pch \
43 --enable-checking=release \
44 --enable-__cxa_atexit \
45 --enable-default-pie \
46 --enable-default-ssp \
50 --enable-languages=c
,c
++ \
51 --without-included-gettext \
54 --build=x86_64-pc-linux-gnu \
55 "${bootstrap:---enable-bootstrap}"
58 make DESTDIR
="$1" install
61 find "$1" -name libgtkpeer.a
-exec rm -f {} +
62 find "$1" -name libgjsmalsa.a
-exec rm -f {} +
63 find "$1" -name libgij.a
-exec rm -f {} +
65 ln -sf gcc
"$1/usr/bin/cc"
66 cp -f ..
/c99
"$1/usr/bin"
70 mkdir
-p "$1/usr/lib/bfd-plugins"
72 ln -s "/usr/lib/gcc/x86_64-pc-linux-gnu/$2/liblto_plugin.so" \
73 "$1/usr/lib/bfd-plugins/liblto_plugin.so"