#!/bin/sh
set -e
VER="2.0.8"

rm -fr sys161-"$VER" sys161 || true

tar xvf sys161-"$VER".tar.zst

mkdir sys161

cd sys161-"$VER"

#fix build with newer compilers
sed -i 's/uint64_t extra_selecttime/extern uint64_t extra_selecttime/' include/onsel.h

./configure --prefix=../../sys161 mipseb
bmake
bmake install
