X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsharedlibrary.cpp;h=c25c6f213f3e7c791525aad240259384335c60ac;hb=HEAD;hp=56f9b32d3e09d5056717faf93d663b57d80648ec;hpb=e15bd086a1ef924b7986d18a1c5b3d31f54a01de;p=builder.git diff --git a/source/sharedlibrary.cpp b/source/sharedlibrary.cpp deleted file mode 100644 index 56f9b32..0000000 --- a/source/sharedlibrary.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include -#include -#include "builder.h" -#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, generate_filename(c), objs), - libname(c.get_name()) -{ - install_location = "lib"; - if(component->get_type()==Component::MODULE) - install_location /= package->get_name(); - - const string &version = component->get_package().get_interface_version(); - if(!version.empty()) - { - const Architecture &arch = builder.get_current_arch(); - const Pattern &pattern = arch.get_shared_library_patterns().front(); - if(arch.get_system()=="windows") - soname = pattern.apply(format("%s-%s", component->get_name(), version)); - else - soname = format("%s.%s", pattern.apply(component->get_name()), version); - - install_filename = soname; - } -} - -string SharedLibrary::generate_filename(const Component &comp) -{ - if(comp.get_type()==Component::MODULE) - return comp.get_name()+".m"; - else - { - const Architecture &arch = comp.get_package().get_builder().get_current_arch(); - return arch.get_shared_library_patterns().front().apply(comp.get_name()); - } -}