mesa: bump to 22.0.3
[kiss-trunc88.git] / gcc / build
blob4bd1b1834ba34c5e4c3a0e1bf0160f2998339b55
1 #!/bin/sh -e
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.
17 mkdir -p gcc-build
18 cd gcc-build
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
27 esac
29 ../gcc/configure \
30 --prefix=/usr \
31 --libexecdir=/usr/lib \
32 --mandir=/usr/share/man \
33 --infodir=/usr/share/info \
34 --disable-multilib \
35 --disable-symvers \
36 --disable-libmpx \
37 --disable-libmudflap \
38 --disable-libsanitizer \
39 --disable-werror \
40 --disable-fixed-point \
41 --disable-libstdcxx-pch \
42 --disable-nls \
43 --enable-checking=release \
44 --enable-__cxa_atexit \
45 --enable-default-pie \
46 --enable-default-ssp \
47 --enable-shared \
48 --enable-threads \
49 --enable-tls \
50 --enable-languages=c,c++ \
51 --without-included-gettext \
52 --with-zstd=no \
53 --with-system-zlib \
54 --build=x86_64-pc-linux-gnu \
55 "${bootstrap:---enable-bootstrap}"
57 make
58 make DESTDIR="$1" install
60 # Save 35MB.
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"
68 # Symlink for LTO.
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"