Removed default of CLICON_RESTCONF_INSTALLDIR
* The default behaviour is changed to use the config $(sbindir) to locate `clixon_restconf` when starting restconf internally
This commit is contained in:
parent
5de6d56822
commit
96a3ee98c6
6 changed files with 43 additions and 20 deletions
|
|
@ -152,7 +152,9 @@ install-include: clixon_backend.h clixon_backend_handle.h clixon_backend_transac
|
|||
.SUFFIXES: .c .o
|
||||
|
||||
.c.o:
|
||||
$(CC) $(INCLUDES) $(CPPFLAGS) -D__PROGRAM__=\"$(APPL)\" $(CFLAGS) -c $<
|
||||
# Note: CLIXON_CONFIG_SBINDIR is where clixon_restconf is believed to be installed, unless
|
||||
# overruled by CLICON_RESTCONF_INSTALLDIR option
|
||||
$(CC) $(INCLUDES) $(CPPFLAGS) -D__PROGRAM__=\"$(APPL)\" -DCLIXON_CONFIG_SBINDIR=\"$(sbindir)\" $(CFLAGS) -c $<
|
||||
|
||||
# Just link test programs
|
||||
test.c :
|
||||
|
|
|
|||
|
|
@ -245,6 +245,7 @@ restconf_pseudo_process_control(clicon_handle h)
|
|||
int i;
|
||||
int nr;
|
||||
cbuf *cb = NULL;
|
||||
char *dir = NULL;
|
||||
|
||||
nr = 10;
|
||||
if ((argv = calloc(nr, sizeof(char *))) == NULL){
|
||||
|
|
@ -256,12 +257,18 @@ restconf_pseudo_process_control(clicon_handle h)
|
|||
clicon_err(OE_UNIX, errno, "cbuf_new");
|
||||
goto done;
|
||||
}
|
||||
/* CLICON_RESTCONF_INSTALLDIR is where we think clixon_restconf is installed
|
||||
* Problem is where to define it? Now in config file, but maybe it should be in configure?
|
||||
* Tried Makefile but didnt work on Docker since it was moved around.
|
||||
/* Try to figure out where clixon_restconf is installed
|
||||
* If config option CLICON_RESTCONF_INSTALLDIR is installed, use that.
|
||||
* If not, use the Makefile
|
||||
* Use PATH?
|
||||
*/
|
||||
cprintf(cb, "%s/clixon_restconf", clicon_option_str(h, "CLICON_RESTCONF_INSTALLDIR"));
|
||||
if ((dir = clicon_option_str(h, "CLICON_RESTCONF_INSTALLDIR")) == NULL){
|
||||
if ((dir = CLIXON_CONFIG_SBINDIR) == NULL){
|
||||
clicon_err(OE_RESTCONF, EINVAL, "Both option CLICON_RESTCONF_INSTALLDIR and makefile constant CLIXON_CONFIG_SBINDIR are NULL which make sit not possible to know where clixon_restconf is installed(shouldnt happen)");
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
cprintf(cb, "%s/clixon_restconf", dir);
|
||||
argv[i++] = cbuf_get(cb);
|
||||
argv[i++] = "-f";
|
||||
argv[i++] = clicon_option_str(h, "CLICON_CONFIGFILE");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue