mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-18 09:37:40 +02:00
This should fix the detection problems on the Mac and may even help with issues on Windows and Linux. On any of the platforms, the main issue is the search path for libraries and how absolute path names are handled. The Mac seems to be especially susceptible since there isn't one concrete location where libraries are stored. Windows handles absolute paths differently and allows runtime updates to the environment variables (and if push comes to shove, provides the SetDllDirectory() function), so if problems still exist, they should be easy to circumvent. This patch does three things: 1) It adds a shell script on OSX that takes care of starting Audacity after reassigning and clearing the DYLD_LIBRARY_PATH environment variable. This will allow loading of libraries from their absolute path rather than searching DYLD_LIBRARY_PATH first. This script should be transparent to the user, but it will affect people running Audacity with gdb as they will have to specifically target Audacity.app/Contents/MacOS/Audacity instead of the Audacity.app bundle. Not big deal really. If ppl no enough to use gdb from the command line, they should be able to figure it out. 2) It corrects detection of a monolithic FFmpeg library. This is one where avformat, avcodec, and avutil have all been linked into one large library. The main issue here was that under OSX and Linux, looking for symbols that should reside in avutil and avcodec, would always succeed since dlsym() on these platforms not only scans the requested library, but any dependent libraries as well. And when avformat was loaded, it would pull in it's dependent libraries as well. Another issue here was the if it was determined that the library was not monolithic, the library was never unloaded, so those dependent libraries may have come from the wrong location since they would have been loaded via the normal search paths and not by absolute path name. 3) It adds a method to FileNames which returns the full path name of a loaded module that contains an address. In the case of FFmpeg, it is used to verify that a routine from a specific library is actually being used from that library or not. It is also used to show (in Help->Show log) the directory from which a library was actually loaded.
69 lines
2.0 KiB
C++
69 lines
2.0 KiB
C++
/**********************************************************************
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
FileNames.h
|
|
|
|
James Crook
|
|
|
|
**********************************************************************/
|
|
|
|
#ifndef __AUDACITY_FILE_NAMES__
|
|
#define __AUDACITY_FILE_NAMES__
|
|
|
|
#include <wx/string.h>
|
|
|
|
class wxFileName;
|
|
class wxArrayString;
|
|
|
|
// Uh, this is really a namespace rather than a class,
|
|
// since all the functions are static.
|
|
class AUDACITY_DLL_API FileNames
|
|
{
|
|
public:
|
|
static wxString MkDir(const wxString &Str);
|
|
static wxString TempDir();
|
|
|
|
// originally an ExportMultiple method. Append suffix if newName appears in otherNames.
|
|
static void MakeNameUnique(wxArrayString &otherNames, wxFileName &newName);
|
|
|
|
/** \brief Audacity user data directory
|
|
*
|
|
* Where audacity keeps it's settings and other user data squirreled away,
|
|
* by default ~/.audacity-data/ on Unix, Application Data/Audacity on
|
|
* windows system */
|
|
static wxString DataDir();
|
|
static wxString AutoSaveDir();
|
|
static wxString HtmlHelpDir();
|
|
static wxString HtmlHelpIndexFile(bool quick);
|
|
static wxString ChainDir();
|
|
static wxString NRPDir();
|
|
static wxString NRPFile();
|
|
static wxString PluginsCache();
|
|
|
|
/** \brief The user plug-in directory (not a system one)
|
|
*
|
|
* This returns the string path to where the user may have put plug-ins
|
|
* if they don't have system admin rights. Under default settings, it's
|
|
* <DataDir>/Plug-Ins/ */
|
|
static wxString PlugInDir();
|
|
static wxString ThemeDir();
|
|
static wxString ThemeComponentsDir();
|
|
static wxString ThemeCachePng();
|
|
static wxString ThemeCacheAsCee();
|
|
static wxString ThemeComponent(const wxString &Str);
|
|
static wxString ThemeCacheHtm();
|
|
static wxString ThemeImageDefsAsCee();
|
|
|
|
// Obtain name of loaded module that contains address
|
|
static wxString PathFromAddr(void *addr);
|
|
|
|
private:
|
|
// Private constructors: No one is ever going to instantiate it.
|
|
//
|
|
FileNames(){;};
|
|
~FileNames(){;};
|
|
};
|
|
|
|
#endif
|