There is a script to build bsnes-mecury