Fix thirdparty build issues in macos mavericks