]> git.tdb.fi Git - builder.git/blobdiff - source/sharedlibrary.cpp
Move some install location assignments to more logical places
[builder.git] / source / sharedlibrary.cpp
index a3225171836eafb10a67f30e3191ccc660d8901c..fac651a8e3518737187f817c0d4d14ee2575e036 100644 (file)
@@ -1,11 +1,5 @@
-/* $Id$
-
-This file is part of builder
-Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#include <msp/strings/formatter.h>
+#include <msp/fs/utils.h>
+#include <msp/strings/format.h>
 #include "component.h"
 #include "sharedlibrary.h"
 #include "sourcepackage.h"
@@ -18,7 +12,14 @@ SharedLibrary::SharedLibrary(Builder &b, const Component &c, const list<ObjectFi
        Binary(b, c, objs),
        Library(b, &c.get_package(), path, c.get_name()),
        soname(create_soname(c))
-{ }
+{
+       install_location = "lib";
+       if(comp.get_type()==Component::MODULE)
+       {
+               install_location += '/';
+               install_location += package->get_name();
+       }
+}
 
 string SharedLibrary::create_soname(const Component &c)
 {
@@ -36,5 +37,5 @@ string SharedLibrary::create_soname(const Component &c)
                                break;
                }
 
-       return format("%s.%s", name, ver.substr(0, i));
+       return format("%s.%s", FS::basename(path), ver.substr(0, i));
 }