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

@ -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]

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 #

View file

@ -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: