# Exit on error:
set -e

wget -c http://www.x.org/releases/individual/app/mkfontscale-1.1.1.tar.bz2
tar xf mkfontscale-1.1.1.tar.bz2
cd mkfontscale-1.1.1

PKG_CONFIG=/static/bin/pkg-config \
    CC=/static/bin/musl-gcc \
    LDFLAGS='-s -L/static/lib -static -static-libgcc' \
    ./configure --prefix=/static

make \
    LIBS="-lbz2 -lz" \
    install

cd ..
rm -rf mkfontscale-1.1.1
rm mkfontscale-1.1.1.tar.bz2

exit 0
