return result;
}
-void GnuLinker::do_prepare()
+void GnuLinker::do_prepare(ToolData &tool) const
{
bool path_found = false;
- const FS::Path &sysroot = build_info.sysroot;
+ const FS::Path &sysroot = tool.build_info.sysroot;
+ const std::string &tool_tag = static_cast<Tool &>(tool).get_tag();
- if(executable)
+ const FileTarget *exe = static_cast<Tool &>(tool).get_executable();
+ if(exe)
{
ExternalTask::Arguments argv;
- argv.push_back(executable->get_path().str());
+ argv.push_back(exe->get_path().str());
argv.push_back("-Wl,--verbose");
argv.push_back("-nostdlib");
if(!sysroot.empty())
}
path /= output.substr(search_dir, end-search_dir);
- builder.get_logger().log("tools", "Got %s system path: %s", tag, path);
- system_path.push_back(path);
+ builder.get_logger().log("tools", "Got %s system path: %s", tool_tag, path);
+ tool.system_path.push_back(path);
path_found = true;
start = end+3;
if(!path_found)
{
- builder.get_logger().log("tools", "No %s system path found, using defaults", tag);
+ builder.get_logger().log("tools", "No %s system path found, using defaults", tool_tag);
if(!sysroot.empty())
- system_path.push_back(sysroot/"usr/lib");
+ tool.system_path.push_back(sysroot/"usr/lib");
else if(architecture->is_native())
{
- system_path.push_back("/lib");
- system_path.push_back("/usr/lib");
+ tool.system_path.push_back("/lib");
+ tool.system_path.push_back("/usr/lib");
if(architecture->match_name("pc-32-linux"))
{
- system_path.push_back("/lib/i386-linux-gnu");
- system_path.push_back("/usr/lib/i386-linux-gnu");
+ tool.system_path.push_back("/lib/i386-linux-gnu");
+ tool.system_path.push_back("/usr/lib/i386-linux-gnu");
}
else if(architecture->match_name("pc-64-linux"))
{
- system_path.push_back("/lib/x86_64-linux-gnu");
- system_path.push_back("/usr/lib/x86_64-linux-gnu");
+ tool.system_path.push_back("/lib/x86_64-linux-gnu");
+ tool.system_path.push_back("/usr/lib/x86_64-linux-gnu");
}
}
else
- system_path.push_back(format("/usr/%s/lib", architecture->get_cross_prefix()));
+ tool.system_path.push_back(format("/usr/%s/lib", architecture->get_cross_prefix()));
}
}