X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgnuarchiver.cpp;h=71edc42d57d26d09560c9ddc1b389e0febcedae9;hb=3f541fceb5aeb5d685ceb2363ebbca1cb1c3eb84;hp=13b2054ff5f26d2ea9006b3513d17e924b28faf9;hpb=3e8f3a5e852e9dd5b78ec3d89c722ef1bae6bef5;p=builder.git diff --git a/source/gnuarchiver.cpp b/source/gnuarchiver.cpp index 13b2054..71edc42 100644 --- a/source/gnuarchiver.cpp +++ b/source/gnuarchiver.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include "builder.h" #include "component.h" @@ -13,10 +14,13 @@ using namespace std; using namespace Msp; -GnuArchiver::GnuArchiver(Builder &b): - Tool(b, "AR") +GnuArchiver::GnuArchiver(Builder &b, const Architecture &a): + Tool(b, a, "AR") { - executable = builder.get_vfs().find_binary("ar"); + string command = "ar"; + if(architecture->is_cross()) + command = format("%s-%s", architecture->get_cross_prefix(), command); + executable = builder.get_vfs().find_binary(command); input_suffixes.push_back(".o"); } @@ -35,7 +39,7 @@ Target *GnuArchiver::create_target(const list &sources, const string & throw invalid_argument("GnuArchiver::create_target"); } - const Component &comp = objs.front()->get_component(); + const Component &comp = *objs.front()->get_component(); StaticLibrary *lib = new StaticLibrary(builder, comp, objs); lib->set_tool(*this); return lib;