Files
ficus/ficus-toolchain/build-newlib.sh
Stepan Usatiuk df13f41be2 CI: build in ci, more streamlined toolchain
Reviewed-on: #2
Co-authored-by: Stepan Usatiuk <stepan@usatiuk.com>
Co-committed-by: Stepan Usatiuk <stepan@usatiuk.com>
2024-04-28 08:36:50 +02:00

21 lines
604 B
Bash
Executable File

#!/bin/bash
set -euxo pipefail
if [ -z "$FICUS_ROOT" ]; then
echo "$FICUS_ROOT" is blank
fi
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
export PREFIX="$FICUS_ROOT/toolchain/gcc-x86_64-ficus-prefix/"
export TARGET=x86_64-ficus
export PATH="$PREFIX/bin:$PATH"
cd "$SCRIPT_DIR"
cd newlib
# rm -rf build
mkdir -p build
cd build
../newlib-4.4.0.20231231/configure --enable-newlib-supplied-syscalls --prefix=/usr --target=$TARGET
make -j$BUILD_PARALLEL all
make DESTDIR="$FICUS_ROOT/sysroot" install
cp -r "$FICUS_ROOT/sysroot/usr"/x86_64-ficus/* "$FICUS_ROOT/sysroot/usr"