Patches to the apple-osx-377 branch so that it will compile and run on 
non-Mac unix platforms.