Fix some LINKAGE=static compile issues:

- Makefile circularity by fixing .so suffix
- simplify example/main Makefile
This commit is contained in:
Olof hagsand 2021-09-26 11:06:41 +02:00
parent c00162aec1
commit 5a875e3152
11 changed files with 34 additions and 30 deletions

View file

@ -62,7 +62,7 @@ wwwdir = @wwwdir@
# one of fcgi or native:
with_restconf = @with_restconf@
SH_SUFFIX = @SH_SUFFIX@
SH_SUFFIX = .so
CLIXON_MAJOR = @CLIXON_VERSION_MAJOR@
CLIXON_MINOR = @CLIXON_VERSION_MINOR@
@ -185,13 +185,15 @@ uninstall:
.c.o:
$(CC) $(INCLUDES) -D__PROGRAM__=\"clixon_restconf\" $(CPPFLAGS) $(CFLAGS) -c $<
$(APPL) : $(APPOBJ) $(MYLIBLINK) $(LIBDEPS)
# Note LIBDEPS is in lib/src and will always be remade du to a date dependency
$(APPL) : $(APPOBJ) $(MYLIB) $(LIBDEPS)
$(CC) $(LDFLAGS) $(APPOBJ) -L. $(MYLIB) $(LIBS) -o $@
$(MYLIBDYNAMIC) : $(LIBOBJ) $(LIBDEPS)
ifeq ($(HOST_VENDOR),apple)
$(MYLIBDYNAMIC) : $(LIBOBJ) $(LIBDEPS)
$(CC) $(LDFLAGS) -shared -undefined dynamic_lookup -o $@ $(LIBOBJ) $(LIBS)
else
$(MYLIBDYNAMIC) : $(LIBOBJ) $(LIBDEPS)
$(CC) $(LDFLAGS) -shared -Wl,-soname,$(MYLIBSO) -o $@ $(LIBOBJ) $(LIBS) -Wl,-soname=$(MYLIBSO)
endif

View file

@ -346,7 +346,7 @@ api_data_collection(clicon_handle h,
cxobj *xtop = NULL;
cxobj *xbot = NULL;
cxobj *xp;
cxobj *xpr;
cxobj *xpr = NULL;
yang_stmt *y = NULL;
cbuf *cbrpc = NULL;
int32_t depth = -1; /* Nr of levels to print, -1 is all, 0 is none */