use system zlib if available (client only)

This commit is contained in:
Philippe Teuwen
2020-05-25 02:30:00 +02:00
parent b4716f78a8
commit 79f3cec717
3 changed files with 18 additions and 0 deletions

View File

@@ -165,6 +165,15 @@ INCLUDES += $(WAILIBINC)
## Zlib
# system library useable? Need to recompress hardnested tables?
ifneq ($(SKIPZLIBSYSTEM),1)
ZLIBINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags zlib 2>/dev/null)
ZLIBLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs zlib 2>/dev/null)
ifneq ($(ZLIBLDLIBS),)
ZLIB = $(ZLIBLDLIBS)
ZLIBINC = $(ZLIBINCLUDES)
ZLIB_FOUND = 1
endif
endif
LDLIBS +=$(ZLIB)
INCLUDES += $(ZLIBINC)
@@ -328,6 +337,10 @@ ifeq ($(WAI_FOUND),1)
$(info Whereami library: system library found)
endif
ifeq ($(ZLIB_FOUND),1)
$(info Zlib library: system library found)
endif
$(info compiler version: $(shell $(CC) --version|head -n 1))
$(info ===================================================================)
@@ -622,8 +635,10 @@ mbedtls:
$(Q)$(MAKE) --no-print-directory -C $(MBEDTLSLIBPATH) OBJDIR=$(ROOT_DIR)$(OBJDIR) BINDIR=$(ROOT_DIR)$(OBJDIR) all
zlib:
ifneq ($(ZLIB_FOUND),1)
$(info [*] MAKE $@)
$(Q)$(MAKE) --no-print-directory -C $(ZLIBPATH) OBJDIR=$(ROOT_DIR)$(OBJDIR) BINDIR=$(ROOT_DIR)$(OBJDIR) all
endif
########
# misc #