2020-12-30 23:03:15 +01:00
|
|
|
#! /usr/bin/env bash
|
|
|
|
|
2021-01-08 10:00:34 +01:00
|
|
|
# Avoid rebuilds of the same version
|
2022-08-19 15:23:21 +02:00
|
|
|
[[ -e "build/giteapc-skip-rebuild.txt" ]] && exit 0
|
2021-01-08 10:00:34 +01:00
|
|
|
|
2021-01-02 00:13:11 +01:00
|
|
|
source util.sh
|
|
|
|
PREFIX="$1"
|
2022-08-19 15:23:21 +02:00
|
|
|
cd build
|
2021-01-02 00:13:11 +01:00
|
|
|
|
2022-08-19 15:23:21 +02:00
|
|
|
if [[ -e "giteapc-build-libstdcxx.txt" ]]; then
|
|
|
|
echo "$TAG Installing libstdc++-v3 to the SuperH sysroot..."
|
|
|
|
run_quietly giteapc-install-libstdcxx.log \
|
|
|
|
$MAKE_COMMAND -j"$cores" install-strip-target-libstdc++-v3
|
2021-03-18 14:25:27 +01:00
|
|
|
else
|
2022-08-19 15:23:21 +02:00
|
|
|
echo "$TAG Installing GCC to the SuperH sysroot..."
|
|
|
|
run_quietly giteapc-install.log \
|
|
|
|
$MAKE_COMMAND install-strip-gcc install-strip-target-libgcc
|
|
|
|
|
|
|
|
# Symbolic link executables to $PREFIX/bin
|
|
|
|
echo "$TAG Symlinking sysroot binaries to $PREFIX/bin..."
|
|
|
|
mkdir -p "$PREFIX/bin"
|
|
|
|
for f in "$SYSROOT/bin"/*; do
|
|
|
|
ln -sf "$f" "$PREFIX/${f#$SYSROOT/}"
|
|
|
|
done
|
2021-03-18 14:25:27 +01:00
|
|
|
fi
|
|
|
|
|
2021-01-02 00:13:11 +01:00
|
|
|
cd ..
|
|
|
|
|
2022-08-19 15:23:21 +02:00
|
|
|
# Cleanup build files after installing libstdc++
|
|
|
|
if [[ ! -z "$CONFIG_CLEAN" && -e "build/giteapc-build-libstdcxx.txt" ]]; then
|
2021-05-04 20:05:58 +02:00
|
|
|
echo "$TAG Cleaning up build files..."
|
2022-08-19 15:23:21 +02:00
|
|
|
rm -rf gcc-*/ gcc-*.tar.* build/
|
2021-05-04 20:05:58 +02:00
|
|
|
fi
|