Fixes for NSIS build with clang on OSX.
Fixes for build.sh.
Added build_osx.sh.