summaryrefslogtreecommitdiff
path: root/4-build-gcc-stage-1.sh
blob: cdcfe95bec5ab138254913de20b79fc93f259835 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
source ./common

ln -Tsfrv unpacked/mpc-$mpc_ver unpacked/gcc-$gcc_ver/mpc
ln -Tsfrv unpacked/mpfr-$mpfr_ver unpacked/gcc-$gcc_ver/mpfr
ln -Tsfrv unpacked/isl-$isl_ver unpacked/gcc-$gcc_ver/isl
mkdir -p build/gcc-$gcc_ver
cd build/gcc-$gcc_ver
echo "Configuring gcc-${gcc_ver} (stage 1)"
# See https://gist.githubusercontent.com/lirenlin/a40d4b510799fa31acba/raw/0b6d0bc74b21661f6cbbcfbda86b3fea25b5ce77/build-gcc.md
../../unpacked/gcc-$gcc_ver/configure \
  --prefix=$prefix_dir \
  --target=$target \
  --with-newlib \
  --with-gnu-as \
  --with-gnu-ld \
  --enable-lto \
  --enable-linker-build-id \
  --disable-libmudflap \
  --disable-libgomp \
  --disable-libssp \
  --disable-libstdcxx-pch \
  --enable-multiarch \
  --disable-multilib \
  --enable-languages=c,c++ \
  --with-headers=../../unpacked/newlib-$newlib_ver/newlib/libc/include \
  --disable-shared \
  >configure-stage-1.log 2>&1
ret=$?
if [ $ret -ne 0 ]; then less configure-stage-1.log; exit 1; fi
echo "Building gcc-$gcc_ver (stage 1)"
make -j$jobs all >build-stage-1.log 2>&1
ret=$?
if [ $ret -ne 0 ]; then less build-stage-1.log; exit 1; fi
echo "Installing gcc-$gcc_ver (stage 1)"
make install >install-stage-1.log 2>&1
ret=$?
if [ $ret -ne 0 ]; then less install-stage-1.log; exit 1; fi
echo "Done with gcc-$gcc_ver (stage 1)"