X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Farchive.cpp;h=63d1635bee578e37f0bf6c75c786ebcf6294e168;hb=4c11e2a041d2064f44b7eb3dbf1976c35fc8881c;hp=11c633c39da54539d2fdd827cb831a8556aea2b3;hpb=1a46151c99a406123c4ddfc797a7841baf3e4cc2;p=builder.git diff --git a/source/archive.cpp b/source/archive.cpp index 11c633c..63d1635 100644 --- a/source/archive.cpp +++ b/source/archive.cpp @@ -1,9 +1,16 @@ +/* $Id$ + +This file is part of builder +Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ + #include #include "archive.h" #include "builder.h" #include "component.h" #include "objectfile.h" -#include "package.h" +#include "sourcepackage.h" #include "staticlibrary.h" using namespace std; @@ -14,20 +21,23 @@ Archive::Archive(Builder &b, const StaticLibrary &lib): { const Component &comp=lib.get_component(); - argv.push_back("ar"); + work_dir=comp.get_package().get_source(); + + std::string tool="AR"; + argv.push_back(builder.get_current_arch().get_tool(tool)); argv.push_back("rc"); - argv.push_back(lib.get_name()); + argv.push_back(relative(lib.get_name(), work_dir).str()); const TargetList &deps=lib.get_depends(); for(TargetList::const_iterator i=deps.begin(); i!=deps.end(); ++i) if(dynamic_cast(*i)) - argv.push_back((*i)->get_name()); + argv.push_back(relative((*i)->get_name(), work_dir).str()); - Path::Path lpath=lib.get_name(); + Path lpath=lib.get_name(); if(!builder.get_dry_run()) - Path::mkpath(lpath.subpath(0, lpath.size()-1), 0755); + mkpath(lpath.subpath(0, lpath.size()-1), 0755); - announce(comp.get_package().get_name(), "AR ", relative(lpath, comp.get_package().get_source()).str()); + announce(comp.get_package().get_name(), tool, relative(lpath, work_dir).str()); launch(); }