FS-4771 --resolve
This commit is contained in:
parent
fe5dbf3b03
commit
759d26db09
|
@ -464,6 +464,7 @@ typedef struct {
|
||||||
struct switch_directories {
|
struct switch_directories {
|
||||||
char *base_dir;
|
char *base_dir;
|
||||||
char *mod_dir;
|
char *mod_dir;
|
||||||
|
char *lib_dir;
|
||||||
char *conf_dir;
|
char *conf_dir;
|
||||||
char *log_dir;
|
char *log_dir;
|
||||||
char *run_dir;
|
char *run_dir;
|
||||||
|
|
|
@ -575,6 +575,14 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
|
||||||
#endif
|
#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))) {
|
if (!SWITCH_GLOBAL_dirs.conf_dir && (SWITCH_GLOBAL_dirs.conf_dir = (char *) malloc(BUFSIZE))) {
|
||||||
#ifdef SWITCH_CONF_DIR
|
#ifdef SWITCH_CONF_DIR
|
||||||
switch_snprintf(SWITCH_GLOBAL_dirs.conf_dir, BUFSIZE, "%s", 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.base_dir);
|
||||||
switch_assert(SWITCH_GLOBAL_dirs.mod_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.conf_dir);
|
||||||
switch_assert(SWITCH_GLOBAL_dirs.log_dir);
|
switch_assert(SWITCH_GLOBAL_dirs.log_dir);
|
||||||
switch_assert(SWITCH_GLOBAL_dirs.run_dir);
|
switch_assert(SWITCH_GLOBAL_dirs.run_dir);
|
||||||
|
|
|
@ -1219,7 +1219,11 @@ static switch_status_t switch_loadable_module_load_file(char *path, char *filena
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
dso = switch_dso_open("FreeSwitch.dll", load_global, &derr);
|
dso = switch_dso_open("FreeSwitch.dll", load_global, &derr);
|
||||||
#elif defined (MACOSX) || defined(DARWIN)
|
#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
|
#else
|
||||||
dso = switch_dso_open(NULL, load_global, &derr);
|
dso = switch_dso_open(NULL, load_global, &derr);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue