Skip to content
Snippets Groups Projects
Commit 79cf1a83 authored by Simon Rose's avatar Simon Rose
Browse files

Set STREAM_PROTOCOL_PATH for any module if stream has already been loaded.

Note that any module that depends on StreamDevice will load it first using `handleDependencies` which
is called before we add the _DB paths. So if a module depends on StreamDevice, this will be accurately
caught; moreover, if StreamDevice is not loaded, then we don't bother setting this path.
parent 01fb4662
No related branches found
No related tags found
No related merge requests found
......@@ -352,6 +352,8 @@ char *realpathSeparator(const char *location) {
return buffer;
}
int isModuleLoaded(const char *libname);
static int setupDbPath(const char *module, const char *dbdir) {
char *absdir =
realpathSeparator(dbdir); /* so we can change directory later safely */
......@@ -373,6 +375,9 @@ static int setupDbPath(const char *module, const char *dbdir) {
putenvprintf("%s_DB=%s", module, absdir);
putenvprintf("TEMPLATES=%s", absdir);
if (isModuleLoaded("stream")) {
pathAdd("STREAM_PROTOCOL_PATH", absdir);
}
pathAdd("EPICS_DB_INCLUDE_PATH", absdir);
free(absdir);
return 0;
......@@ -727,6 +732,16 @@ const char *getLibLocation(const char *libname) {
return NULL;
}
int isModuleLoaded(const char *libname) {
moduleitem *m;
for (m = loadedModules; m; m = m->next) {
if (strcmp(m->content, libname) == 0)
return TRUE;
}
return FALSE;
}
int libversionShow(const char *outfile) {
moduleitem *m;
size_t lm, lv;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment