- sys::Path FullLibraryPath = sys::Path::FindLibrary(*i);
- if (!FullLibraryPath.isEmpty() && FullLibraryPath.isDynamicLibrary())
+ // try explicit -L arguments first:
+ sys::Path FullLibraryPath;
+ for (cl::list<std::string>::const_iterator P = LibPaths.begin(),
+ E = LibPaths.end(); P != E; ++P) {
+ FullLibraryPath = *P;
+ FullLibraryPath.appendComponent("lib" + *i);
+ FullLibraryPath.appendSuffix(&(LTDL_SHLIB_EXT[1]));
+ if (!FullLibraryPath.isEmpty()) {
+ if (!FullLibraryPath.isDynamicLibrary()) {
+ // Not a native shared library; mark as invalid
+ FullLibraryPath = sys::Path();
+ } else break;
+ }
+ }
+ if (FullLibraryPath.isEmpty())
+ FullLibraryPath = sys::Path::FindLibrary(*i);
+ if (!FullLibraryPath.isEmpty())