X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgnulinker.cpp;h=f37cf99cf766ae567ca4645b2df03886c9562cd3;hb=68ef01e3f94ba5d0297e7979551e7d9404906db7;hp=2416449d63c5654a6f6dce62d6a620a6af1420c7;hpb=1009314aed27a555033e743f84a1e4347d0bad69;p=builder.git diff --git a/source/gnulinker.cpp b/source/gnulinker.cpp index 2416449..f37cf99 100644 --- a/source/gnulinker.cpp +++ b/source/gnulinker.cpp @@ -98,15 +98,17 @@ string GnuLinker::create_build_signature(const BuildInfo &binfo) const 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).get_tag(); - if(executable) + const FileTarget *exe = static_cast(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()) @@ -139,8 +141,8 @@ void GnuLinker::do_prepare() } 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; @@ -152,26 +154,26 @@ void GnuLinker::do_prepare() 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())); } }