summaryrefslogtreecommitdiff
path: root/4-build-gcc-stage-1.sh
diff options
context:
space:
mode:
Diffstat (limited to '4-build-gcc-stage-1.sh')
-rw-r--r--4-build-gcc-stage-1.sh81
1 files changed, 50 insertions, 31 deletions
diff --git a/4-build-gcc-stage-1.sh b/4-build-gcc-stage-1.sh
index cdcfe95..ab35497 100644
--- a/4-build-gcc-stage-1.sh
+++ b/4-build-gcc-stage-1.sh
@@ -1,39 +1,58 @@
#!/bin/sh
source ./common
+options_do_configure=1
+options_do_build=1
+options_do_install=1
+
+if [ "$0" == "-i" ]; then
+ options_do_configure=
+ options_do_build=
+ options_do_install=1
+fi
+
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)"
+if [ -n "$options_do_configure" ]; then
+ echo "Configuring gcc-${gcc_ver} (stage 1)"
+ ../../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 \
+ --enable-soft-float \
+ --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
+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