- for(PackageMap::iterator i=packages.begin(); i!=packages.end(); ++i)
- if(SourcePackage *spkg=dynamic_cast<SourcePackage *>(i->second))
- spkg->get_deps_cache().save();
-
- return 0;
-}
-
-Target *Builder::get_header(const Msp::FS::Path &fn)
-{
- Target *tgt=get_target(fn.str());
- if(tgt) return tgt;
-
- if(FS::is_reg(fn))
- {
- tgt=new SystemHeader(*this, fn.str());
- return tgt;
- }
- return 0;
-}
-
-Target *Builder::get_library(const string &lib, const FS::Path &path, LibMode mode)
-{
- // Populate a list of candidate filenames
- StringList candidates;
-
- if(mode!=ALL_STATIC)
- {
- if(current_arch->get_name()=="win32")
- {
- candidates.push_back("lib"+lib+".dll");
- candidates.push_back(lib+".dll");
- }
- else
- candidates.push_back("lib"+lib+".so");
- }
-
- /* Static libraries are always considered, since sometimes shared versions
- may not be available */
- candidates.push_back("lib"+lib+".a");
- if(current_arch->get_name()=="win32")
- candidates.push_back("lib"+lib+".dll.a");
-
- for(StringList::iterator i=candidates.begin(); i!=candidates.end(); ++i)
- {
- string full=(path/ *i).str();
- Target *tgt=get_target(full);
-
- if(tgt)
- {
- Target *real_tgt=tgt;
- if(Install *inst=dynamic_cast<Install *>(tgt))
- real_tgt=&inst->get_source();
-
- /* Ignore dynamic libraries from local packages unless library mode is
- DYNAMIC */
- if(dynamic_cast<SharedLibrary *>(real_tgt) && mode!=DYNAMIC)
- continue;
- else if(tgt)
- return tgt;
- }
- else if(FS::is_reg(full))
- {
- tgt=new SystemLibrary(*this, full);
- return tgt;
- }
- }
-
- return 0;