+ {
+ 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());
+ }
+ }
+
+ BuildInfo binfo;
+ target.collect_build_info(binfo);
+
+ const FS::Path &sysroot = binfo.sysroot;
+ if(!sysroot.empty())
+ argv.push_back("--sysroot="+sysroot.str());
+
+ FS::Path lib_dir = builder.get_prefix()/"lib";
+ if(binfo.rpath_mode==BuildInfo::ABSOLUTE)
+ argv.push_back("-Wl,-rpath,"+lib_dir.str());
+ else
+ {
+ if(binfo.rpath_mode==BuildInfo::RELATIVE)
+ argv.push_back("-Wl,-rpath,$ORIGIN/../lib");
+ argv.push_back("-Wl,-rpath-link,"+lib_dir.str());