argv.push_back("-shared");
argv.push_back("-fPIC");
if(architecture->get_system()!="windows" && !shlib->get_soname().empty())
- argv.push_back("-Wl,-soname,"+shlib->get_soname());
+ {
+ if(architecture->get_system()=="darwin")
+ {
+ argv.push_back("-install_name");
+ argv.push_back(shlib->get_soname());
+
+ const string &ver = shlib->get_package()->get_version();
+ const string &if_ver = shlib->get_package()->get_interface_version();
+ if(!ver.empty() && !if_ver.empty())
+ {
+ argv.push_back("-current_version");
+ argv.push_back(ver);
+ argv.push_back("-compatibility_version");
+ argv.push_back(if_ver);
+ }
+ }
+ else
+ argv.push_back("-Wl,-soname,"+shlib->get_soname());
+ }
}
const BuildInfo &binfo = comp.get_build_info();
argv.push_back("-L"+i->str());
if(binfo.strip)
argv.push_back("-s");
- if(binfo.threads && architecture->get_system()!="windows")
+ if(binfo.threads && architecture->get_system()!="windows" && architecture->get_system()!="darwin")
argv.push_back("-pthread");
const Architecture &native_arch = builder.get_native_arch();