X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finstall.cpp;h=bfda555cda9269c962c2d683d1eae5518c7dc9bb;hb=0c83b922e56976a30506d9f8d43c9dcd38d573b5;hp=ecf50ee6cfa1e73f8c8e62d4f7d05f4a6778fc01;hpb=0458300fda4f345f865a7f3ee4fc0f2020a91983;p=builder.git diff --git a/source/install.cpp b/source/install.cpp index ecf50ee..bfda555 100644 --- a/source/install.cpp +++ b/source/install.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of builder -Copyright © 2006-2010 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include #include "builder.h" #include "copy.h" @@ -26,6 +19,13 @@ Install::Install(Builder &b, const SourcePackage &p, FileTarget &s, const std::s { buildable = true; add_depend(&source); + + if(const SharedLibrary *shlib = dynamic_cast(&source)) + if(!shlib->get_soname().empty()) + link = FS::dirname(path)/FS::basename(shlib->get_path()); + + if(!link.empty()) + builder.register_path(link, this); } Target *Install::get_real_target() @@ -45,7 +45,7 @@ void Install::check_rebuild() Action *Install::create_action() { - return new Copy(builder, *package, source.get_path(), path); + return new Copy(builder, *package, source.get_path(), path, link); } FS::Path Install::generate_target_path(const FileTarget &tgt, const std::string &loc) @@ -89,5 +89,5 @@ FS::Path Install::generate_target_path(const FileTarget &tgt, const std::string if(mid.empty()) throw invalid_argument("Don't know where to install "+tgtname); - return (base/mid/tgtname).str(); + return base/mid/tgtname; }