FS-4771 --resolve

This commit is contained in:
Anthony Minessale 2012-10-29 09:27:59 -05:00
parent fe5dbf3b03
commit 759d26db09
3 changed files with 15 additions and 1 deletions

View File

@ -464,6 +464,7 @@ typedef struct {
struct switch_directories {
char *base_dir;
char *mod_dir;
char *lib_dir;
char *conf_dir;
char *log_dir;
char *run_dir;

View File

@ -575,6 +575,14 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
#endif
}
if (!SWITCH_GLOBAL_dirs.lib_dir && (SWITCH_GLOBAL_dirs.lib_dir = (char *) malloc(BUFSIZE))) {
#ifdef SWITCH_LIB_DIR
switch_snprintf(SWITCH_GLOBAL_dirs.lib_dir, BUFSIZE, "%s", SWITCH_LIB_DIR);
#else
switch_snprintf(SWITCH_GLOBAL_dirs.lib_dir, BUFSIZE, "%s%slib", base_dir, SWITCH_PATH_SEPARATOR);
#endif
}
if (!SWITCH_GLOBAL_dirs.conf_dir && (SWITCH_GLOBAL_dirs.conf_dir = (char *) malloc(BUFSIZE))) {
#ifdef SWITCH_CONF_DIR
switch_snprintf(SWITCH_GLOBAL_dirs.conf_dir, BUFSIZE, "%s", SWITCH_CONF_DIR);
@ -671,6 +679,7 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
switch_assert(SWITCH_GLOBAL_dirs.base_dir);
switch_assert(SWITCH_GLOBAL_dirs.mod_dir);
switch_assert(SWITCH_GLOBAL_dirs.lib_dir);
switch_assert(SWITCH_GLOBAL_dirs.conf_dir);
switch_assert(SWITCH_GLOBAL_dirs.log_dir);
switch_assert(SWITCH_GLOBAL_dirs.run_dir);

View File

@ -1219,7 +1219,11 @@ static switch_status_t switch_loadable_module_load_file(char *path, char *filena
#ifdef WIN32
dso = switch_dso_open("FreeSwitch.dll", load_global, &derr);
#elif defined (MACOSX) || defined(DARWIN)
dso = switch_dso_open(SWITCH_PREFIX_DIR "/lib/libfreeswitch.dylib", load_global, &derr);
{
char *lib_path = switch_mprintf("%s/libfreeswitch.dylib", SWITCH_GLOBAL_dirs.lib_dir);
dso = switch_dso_open(lib_path, load_global, &derr);
switch_safe_free(lib_path);
}
#else
dso = switch_dso_open(NULL, load_global, &derr);
#endif