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 69 70
|
#!/bin/bash
PICOLIBC=$(realpath $(dirname "$0")/..)
case "$ARM_TK" in
"")
echo "Need to set ARM_TK before running $0"
exit 1
;;
esac
README="$ARM_TK/share/doc/arm-none-eabi/readme.txt"
if [ ! -f "$README" ]; then
echo "ARM_TK '$ARM_TK' doesn't appear valid?"
exit 1
fi
TK_VERSION=$(head -n 1 "$README" | awk '{ print $NF; }')
PICOLIBC_VERSION=$(cd "$PICOLIBC" && git describe)
echo Toolkit "$ARM_TK"
echo Toolkit version "$TK_VERSION"
echo Picolibc "$PICOLIBC"
echo Picolibc version "$PICOLIBC_VERSION"
case "$TK_VERSION" in
[12]*)
;;
*)
echo "Toolkit version '$TK_VERSION' doesn't appear valid?"
exit 1
;;
esac
export PATH=$ARM_TK/bin:$PATH
MINSIZE_DIR="$PICOLIBC"/builds/build-arm-tk-minsize
RELEASE_DIR="$PICOLIBC"/builds/build-arm-tk-release
export DESTDIR="$PICOLIBC"/builds/dist
rm -r "$MINSIZE_DIR"
rm -r "$RELEASE_DIR"
rm -r "$DESTDIR"/"$ARM_TK"
mkdir -p "$MINSIZE_DIR" "$RELEASE_DIR" "$DESTDIR"
set -e
#build_options=-Dmultilib-exclude=pacbti
build_options=
echo '###################################'
echo '####' ../../scripts/do-arm-configure -Dsysroot-install=true --buildtype=minsize $build_options
echo '###################################'
cd "$MINSIZE_DIR"
../../scripts/do-arm-configure -Dsysroot-install=true --buildtype=minsize $build_options
ninja test install
echo '###################################'
echo '####' ../../scripts/do-arm-configure -Dsysroot-install=true -Dbuild-type-subdir=release --buildtype=release $build_options
echo '###################################'
cd "$RELEASE_DIR"
../../scripts/do-arm-configure -Dsysroot-install=true -Dbuild-type-subdir=release --buildtype=release $build_options
ninja test install
cd "$DESTDIR"/"$ARM_TK"
ZIP="$DESTDIR"/picolibc-"$PICOLIBC_VERSION"-"$TK_VERSION".zip
rm -f "$ZIP"
zip -r "$ZIP" .
|