Improved build script for OSX framework.