X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsharedlibrary.cpp;h=c25c6f213f3e7c791525aad240259384335c60ac;hb=HEAD;hp=d3a8ceb25568e8f4077cc077f3deeb3dea69062a;hpb=dc4b917034c9d3718f07139e2f0f3631a080c6f3;p=builder.git diff --git a/source/sharedlibrary.cpp b/source/sharedlibrary.cpp deleted file mode 100644 index d3a8ceb..0000000 --- a/source/sharedlibrary.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include -#include -#include "component.h" -#include "sharedlibrary.h" -#include "sourcepackage.h" - -using namespace std; -using namespace Msp; - -SharedLibrary::SharedLibrary(Builder &b, const Msp::FS::Path &p): - Binary(b, p) -{ - libname = FS::basepart(FS::basename(path)); - if(!libname.compare(0, 3, "lib")) - libname = libname.substr(3); -} - -SharedLibrary::SharedLibrary(Builder &b, const Component &c, const list &objs): - Binary(b, c, objs), - libname(c.get_name()), - soname(create_soname(c)) -{ - install_location = "lib"; - if(component->get_type()==Component::MODULE) - { - install_location += '/'; - install_location += package->get_name(); - } -} - -string SharedLibrary::create_soname(const Component &c) -{ - const string &ver = c.get_package().get_version(); - if(ver.empty()) - return string(); - - unsigned dots = 0; - unsigned i = 0; - for(; i=2) - break; - } - - return format("%s.%s", FS::basename(path), ver.substr(0, i)); -}