diff --git a/CHANGELOG.md b/CHANGELOG.md index d9d62254f..fdb0b7c05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac - Change, use system Lua library if available (@doegox) - Change, use system Jansson library if available (@doegox) - Change, use system Whereami library if available (@doegox) + - Change, use system Zlib library if available (@doegox) - Fix release version information (@doegox) ## [ice coffee.4.9237][2020-05-21] diff --git a/client/Makefile b/client/Makefile index 59c08f144..c1713e74c 100644 --- a/client/Makefile +++ b/client/Makefile @@ -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 # diff --git a/doc/md/Development/Maintainers.md b/doc/md/Development/Maintainers.md index 5d1400a7f..0ea33b924 100644 --- a/doc/md/Development/Maintainers.md +++ b/doc/md/Development/Maintainers.md @@ -62,7 +62,9 @@ It's also possible to skip parts even if libraries are present in the compilatio * `make client SKIPQT=1` to skip GUI even if Qt is present * `make client SKIPBT=1` to skip native Bluetooth support even if libbluetooth is present * `make client SKIPLUASYSTEM=1` to skip system Lua lib even if liblua5.2 is present, use embedded Lua lib instead +* `make client SKIPJANSSONSYSTEM=1` to skip system Jansson lib even if libjansson is present, use embedded Jansson lib instead * `make client SKIPWHEREAMISYSTEM=1` to skip system Whereami lib even if libwhereami is present, use embedded whereami lib instead +* `make client SKIPZLIBSYSTEM=1` to skip system Zlib even if libz is present, use embedded Zlib instead If you're cross-compiling, these ones might be useful: