X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flink.cpp;h=b3e5152204b73d632478fe91a979a200e5f86b12;hb=05a2b9dabd01414e9e9a91f9d69babaca4ccb32d;hp=b6537d987a143e9551d893680be91f8eb29f08c8;hpb=20994a6f4802f2dbcf01888d0e1996edf554ade5;p=builder.git diff --git a/source/link.cpp b/source/link.cpp index b6537d9..b3e5152 100644 --- a/source/link.cpp +++ b/source/link.cpp @@ -1,7 +1,7 @@ /* $Id$ This file is part of builder -Copyright © 2006-2009 Mikko Rasa, Mikkosoft Productions +Copyright © 2006-2010 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ @@ -37,6 +37,10 @@ Link::Link(Builder &b, const Binary &bin): else if(comp.get_package().get_library_mode()==ALL_STATIC) argv.push_back("-static"); + if(const SharedLibrary *lib = dynamic_cast(&bin)) + if(!lib->get_soname().empty()) + argv.push_back("-Wl,-soname,"+lib->get_soname()); + const BuildInfo &binfo = comp.get_build_info(); for(list::const_iterator i=binfo.ldflags.begin(); i!=binfo.ldflags.end(); ++i) argv.push_back(*i); @@ -48,9 +52,7 @@ Link::Link(Builder &b, const Binary &bin): const TargetList &deps = bin.get_depends(); for(TargetList::const_iterator i=deps.begin(); i!=deps.end(); ++i) { - Target *tgt = *i; - if(Install *inst = dynamic_cast(tgt)) - tgt = &inst->get_source(); + Target *tgt = (*i)->get_real_target(); if(ObjectFile *obj = dynamic_cast(tgt)) argv.push_back(relative(obj->get_path(), work_dir).str());