build script changes to support mac os x