Commits

Marianne Gagnon committed cd48fd7

Improve default paths on linux

  • Participants
  • Parent commits e94ce37

Comments (0)

Files changed (2)

     libs = wxStandardPaths::Get().GetPluginsDir() + wxFileName::GetPathSeparator();
 #endif
 
+    wxString pluginsPath = libs;
+#ifdef PLUGINSDIR
+    pluginsPath = wxString(PLUGINSDIR) + wxFileName::GetPathSeparator();
+#endif
+
     mplog_info("MupenfrontApp", "Will look for resources in <%s> and librairies in <%s>\n",
               (const char*)datadir.utf8_str(), (const char*)libs.utf8_str());
     int plugins = 0;
         {
             // TODO: automagically check for local runs (no install) with "OSAL_CURRENT_DIR"?
             m_api = new Mupen64PlusPlus(corepath,
-                                        libs.utf8_str(),
+                                        pluginsPath.utf8_str(),
                                         DEFAULT_VIDEO_PLUGIN,
                                         DEFAULT_AUDIO_PLUGIN,
                                         DEFAULT_INPUT_PLUGIN,
         catch (CoreNotFoundException& e)
         {
             mplog_error("MupenAPI", "The core was not found : %s\n", e.what());
-            wxMessageBox( _("The Mupen64Plus core library was not found or loaded; please select it before you can continue") );
+            wxMessageBox( wxString::Format(_("The Mupen64Plus core library was not found at <%s> or could not be loaded; please select it before you can continue"), corepath) );
             
             wxString wildcard = _("Dynamic libraries") + wxString(" (*") + OSAL_DLL_EXTENSION +
                                       ")|*" + OSAL_DLL_EXTENSION + "|" + _("All files") + "|*";
     opt.add_option('--debug',     action='store', help='Whether to make a debug build (may be \'true\' or \'false\')', default='false', dest="debugmode")
     opt.add_option('--wxconfig_args', action='store', help='Additional arguments passed to wx-config', default='',  dest='wxconfig_args')
     opt.add_option('--datadir', action='store', help='(Optional) the directory where to look for data files', default='',  dest='datadir')
-    opt.add_option('--libdir', action='store', help='(Optional) the directory where to look for plugin files', default='',  dest='libdir')
+    opt.add_option('--libdir', action='store', help='(Optional) the directory where to look for the core library', default='',  dest='libdir')
+    opt.add_option('--pluginsdir', action='store', help='(Optional) the directory where to look for plugin files', default='',  dest='pluginsdir')
     opt.add_option('--bindir', action='store', help='(Optional) the directory where to install wxmupen64plus binary', default='',  dest='bindir')
     opt.add_option('--debugger', action='store', help='Enable or disable the debugger (true or false). Requires GCC 4.6', default='true',  dest='debugger')
     
     ctx.env['wxhome'] = wxhome
     ctx.env['datadir'] = Options.options.datadir
     ctx.env['libdir'] = Options.options.libdir
+    ctx.env['pluginsdir'] = Options.options.pluginsdir
     ctx.env['enable_debugger'] = enable_debugger
     
     ctx.find_program('gcc', var='GCC', mandatory=True)
         build_flags += ['-DWXDATADIR="' + bld.env['datadir'] + '"']
     if len(bld.env['libdir']) > 0:
         build_flags += ['-DLIBDIR="' + bld.env['libdir'] + '"']
+    if len(bld.env['pluginsdir']) > 0:
+        build_flags += ['-DPLUGINSDIR="' + bld.env['pluginsdir'] + '"']
     if len(bld.env['bindir']) > 0:
         bin_install_path = bld.env['bindir']
     else: