- for(BuildInfo::PathList::iterator i=export_binfo.incpath.begin(); i!=export_binfo.incpath.end(); ++i)
- *i = base_path/ *i;
- for(BuildInfo::PathList::iterator i=export_binfo.libpath.begin(); i!=export_binfo.libpath.end(); ++i)
- *i = base_path/ *i;
+ if(has_relative_paths)
+ {
+ for(BuildInfo::PathList::iterator i=export_binfo.incpath.begin(); i!=export_binfo.incpath.end(); ++i)
+ *i = base_path/ *i;
+ for(BuildInfo::PathList::iterator i=export_binfo.libpath.begin(); i!=export_binfo.libpath.end(); ++i)
+ *i = base_path/ *i;
+ }
+
+ if(!static_binfo.libs.empty())
+ {
+ BuildInfo::PathList combined_libpath = static_binfo.libpath;
+ combined_libpath.insert(combined_libpath.end(), export_binfo.libpath.begin(), export_binfo.libpath.end());
+
+ for(BuildInfo::WordList::const_iterator i=export_binfo.libs.begin(); i!=export_binfo.libs.end(); ++i)
+ if(Target *lib = builder.get_vfs().find_library(*i, export_binfo.libpath, BuildInfo::FORCE_STATIC, system))
+ if(StaticLibrary *stlib = dynamic_cast<StaticLibrary *>(lib))
+ {
+ for(BuildInfo::WordList::const_iterator j=static_binfo.libs.begin(); j!=static_binfo.libs.end(); ++j)
+ stlib->add_required_library(*j);
+ for(BuildInfo::PathList::const_iterator j=combined_libpath.begin(); j!=combined_libpath.end(); ++j)
+ stlib->add_library_path(*j);
+ }
+ }