To get kcgi up and running:
mkdir ~/local
cd ~/local
wget https://kristaps.bsd.lv/kcgi/snapshots/kcgi.tgz
tar xzf kcgi.tgz
cd kcgi-*
echo "PREFIX=$HOME/local" >> configure.local
./configure
gmake
gmake install
How to use it:
cc -static -g -W -Wall -o index.cgi index.c -I$HOME/local/include -L$HOME/local/lib -lkcgi -lz