sh-elf-gcc/install.sh
Lephenixnoir 26affe51cf
new build system for fxSDK sysroot and libstdc++-v3
The main change is making the scripts a two-stage process where we
first build GCC, leave the user to install the libc, and then come back
to install libstdc++-v3.

* Detect whether we are in the first or second stage
* Don't clean files after first stage install, and even then only do it
  if :clean is specified
* Update README except for the manual install tutorial
* Patch the source using a backported GCC 12.1 commit to make the
  configure script for libstdc++-v3 skip checking for dlopen, which is
  impossible is our not-really-hosted setup

Details:
* Proper .gitignore
2022-08-19 15:23:21 +02:00

33 lines
952 B
Bash
Executable file

#! /usr/bin/env bash
# Avoid rebuilds of the same version
[[ -e "build/giteapc-skip-rebuild.txt" ]] && exit 0
source util.sh
PREFIX="$1"
cd build
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
else
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
fi
cd ..
# Cleanup build files after installing libstdc++
if [[ ! -z "$CONFIG_CLEAN" && -e "build/giteapc-build-libstdcxx.txt" ]]; then
echo "$TAG Cleaning up build files..."
rm -rf gcc-*/ gcc-*.tar.* build/
fi