+ Binary(b, c, generate_filename(c), objs),
+ libname(c.get_name()),
+ import_lib(0)
+{
+ if(builder.get_current_arch().get_system()=="windows")
+ install_location = "bin";
+ else
+ 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());
+ }
+}