+/*static*/
+wxString wxDynamicLibrary::CanonicalizePluginName(const wxString& name,
+ wxPluginCategory cat)
+{
+ wxString suffix;
+ if ( cat == wxDL_PLUGIN_GUI )
+ {
+ wxAppTraits *traits = wxAppConsole::GetInstance() ?
+ wxAppConsole::GetInstance()->GetTraits() : NULL;
+ wxASSERT_MSG( traits,
+ _("can't query for GUI plugins name in console applications") );
+ suffix = traits->GetToolkitInfo().shortName;
+ }
+#if wxUSE_UNICODE
+ suffix << _T('u');
+#endif
+#ifdef __WXDEBUG__
+ suffix << _T('d');
+#endif
+
+ if ( !suffix.empty() )
+ suffix = wxString(_T("_")) + suffix;
+
+#define WXSTRINGIZE(x) #x
+#ifdef __UNIX__
+ #if (wxMINOR_VERSION % 2) == 0
+ #define wxDLLVER(x,y,z) "-" WXSTRINGIZE(x) "." WXSTRINGIZE(y)
+ #else
+ #define wxDLLVER(x,y,z) "-" WXSTRINGIZE(x) "." WXSTRINGIZE(y) "." WXSTRINGIZE(z)
+ #endif
+#else
+ #if (wxMINOR_VERSION % 2) == 0
+ #define wxDLLVER(x,y,z) WXSTRINGIZE(x) WXSTRINGIZE(y)
+ #else
+ #define wxDLLVER(x,y,z) WXSTRINGIZE(x) WXSTRINGIZE(y) WXSTRINGIZE(z)
+ #endif
+#endif
+
+ suffix << wxString::FromAscii(wxDLLVER(wxMAJOR_VERSION, wxMINOR_VERSION,
+ wxRELEASE_NUMBER));
+#undef wxDLLVER
+#undef WXSTRINGIZE
+
+#ifdef __WINDOWS__
+ // Add compiler identification:
+ #if defined(__GNUG__)
+ suffix << _T("_gcc");
+ #elif defined(__VISUALC__)
+ suffix << _T("_vc");
+ #elif defined(__WATCOMC__)
+ suffix << _T("_wat");
+ #elif defined(__BORLANDC__)
+ suffix << _T("_bcc");
+ #endif
+#endif
+
+ return CanonicalizeName(name + suffix, wxDL_MODULE);
+}
+
+/*static*/
+wxString wxDynamicLibrary::GetPluginsDirectory()
+{
+#ifdef __UNIX__
+ wxString format = wxGetInstallPrefix();
+ format << wxFILE_SEP_PATH
+ << wxT("lib") << wxFILE_SEP_PATH
+ << wxT("wx") << wxFILE_SEP_PATH
+ << wxT("%i.%i");
+ wxString dir;
+ dir.Printf(format.c_str(), wxMAJOR_VERSION, wxMINOR_VERSION);
+ return dir;
+#else
+ return wxEmptyString;
+#endif