# Note: depends on autoconf
# Note: depends on automake
# Note: depends on gettext
# Note: depends on bison
# Note: depends on texinfo
# Note: depends on flex
wget -c ftp://ftp.netlabs.org/pub/kbuild/kBuild-0.1.5-p2-src.tar.gz
tar -xzf kBuild-0.1.5-p2-src.tar.gz
cd kBuild-0.1.5-p2
# Minor patches
sed -i -e 's/void dprintf/#define dprintf kbuild_dprintf\n&/' src/ash/output.h
sed -i -e 's/kmk_LIBS +=.*/& pthread/' src/kmk/Makefile.kmk
kBuild/env.sh --full make -f bootstrap.gmk
kBuild/bin/*.*/kmk
cp out/*/release/kBuild/bin/*/* /usr/bin