https://github.com/nwoolls/bfgminer/tree/feature/gridseed-support-new
I'm assuming you're using Linux (I have no idea how to compile this under Windows nor should you attempt that - there are binaries available).
1) Install prerequisites:
libudev-dev build-essential libcurl4-gnutls-dev yasm libncurses5-dev git autoconf automake
E.g. on ubuntu and its clones you would run:
apt-get install libudev-dev build-essential libcurl4-gnutls-dev yasm libncurses5-dev git autoconf automake
2) run this in your home folder:
git clone https://github.com/nwoolls/bfgminer
cd bfgminer
./autogen.sh
./configure
make
This is just to get you on track, if you have any problems please report back and I'll try to help.