summaryrefslogtreecommitdiff
path: root/4-build-gcc-stage-1.sh
blob: 31cbe9262ad9fa7fd3e0f2fe18fbc4258cf85a72 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
source ./common

options_do_configure=1
options_do_build=1
options_do_install=1

if [ "$1" = "-i" ]; then
  options_do_configure=
  options_do_build=
  options_do_install=1
fi

mkdir -p build/gcc-$gcc_ver
ln -Tsfrv unpacked/gmp-$gmp_ver unpacked/gcc-$gcc_ver/gmp
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
cd build/gcc-$gcc_ver
if [ -n "$options_do_configure" ]; then
  echo "Configuring gcc-${gcc_ver} (stage 1)"
  ../../unpacked/gcc-$gcc_ver/configure \
    --prefix=$prefix_dir \
    --target=$target \
    --enable-plugins \
    --enable-lto \
    --enable-linker-build-id \
    --enable-multiarch \
    --enable-soft-float \
    --enable-languages=c,c++ \
    --disable-libstdcxx-verbose \
    --disable-decimal-float \
    --disable-libffi \
    --disable-libgomp \
    --disable-libmudflap \
    --disable-libquadmath \
    --disable-libssp \
    --disable-libstdcxx-pch \
    --disable-nls \
    --disable-shared \
    --disable-threads \
    --disable-tls \
    --with-gnu-as \
    --with-gnu-ld \
    --with-newlib \
    --with-headers=yes \
    --with-headers=../../unpacked/newlib-$newlib_ver/newlib/libc/include \
    >configure-stage-1.log 2>&1
  ret=$?
  if [ $ret -ne 0 ]; then less configure-stage-1.log; exit 1; fi
fi
if [ -n "$options_do_build" ]; then
  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
fi
if [ -n "$options_do_install" ]; then
  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
fi
if [ -z "$options_do_configure$options_do_build$options_do_install" ]; then
  echo "Nothing to be done for gcc-$gcc_ver (stage 1)"
else
  echo "Done with gcc-$gcc_ver (stage 1)"
fi