- if(const SharedLibrary *shlib = dynamic_cast<const SharedLibrary *>(&source))
- if(!shlib->get_soname().empty())
- link = FS::dirname(path)/FS::basename(shlib->get_path());
-
- if(!link.empty())
+ /* XXX Ideally, the tool should handle this (symlinks are not necessary for
+ windows dlls). However, the tool that created the target being installed
+ knows nothing about the InstalledFile. */
+ string base_fn = FS::basename(source.get_path());
+ const string &inst_fn = source.get_install_filename();
+ if(!inst_fn.empty() && inst_fn!=base_fn)
+ {
+ link = FS::dirname(path)/base_fn;