- sys::Path fullpath(dir);
- fullpath.append_file(link_item);
- if (native) {
- fullpath.append_suffix("a");
- } else {
- fullpath.append_suffix("bc");
- if (fullpath.readable())
- return fullpath;
- fullpath.elide_suffix();
- fullpath.append_suffix("o");
- if (fullpath.readable())
- return fullpath;
- fullpath = dir;
- fullpath.append_file(std::string("lib") + link_item);
- fullpath.append_suffix("a");
- if (fullpath.readable())
- return fullpath;
- fullpath.elide_suffix();
- fullpath.append_suffix("so");
+ sys::Path fullpath;
+ fullpath.setFile(link_item);
+ if (fullpath.readable())
+ return fullpath;
+ for (PathVector::iterator PI = LibraryPaths.begin(),
+ PE = LibraryPaths.end(); PI != PE; ++PI) {
+ fullpath.setDirectory(PI->toString());
+ fullpath.appendFile(link_item);