- wxNode *node;
- wxLibrary *lib;
- wxClassInfo *old_sm_first;
-
- if ( (node = m_loaded.Find(name.GetData())) )
- return ((wxLibrary *)node->Data());
-
- // If DLL shares data, this is necessary.
- old_sm_first = wxClassInfo::sm_first;
- wxClassInfo::sm_first = NULL;
-
- wxString lib_name = ConstructLibraryName(name);
-
-#if defined(__UNIX__)
- // found the first file in LD_LIBRARY_PATH with this name
- wxString libPath("/lib:/usr/lib"); // system path first
- const char *envLibPath = getenv("LD_LIBRARY_PATH");
- if ( envLibPath )
- libPath << ':' << envLibPath;
- wxStringTokenizer tokenizer(libPath, _T(':'));
- while ( tokenizer.HasMoreToken() )
- {
- wxString fullname(tokenizer.NextToken());
-
- fullname << '/' << lib_name;
- if ( wxFileExists(fullname) )
- {
- lib_name = fullname;