From c817ab5ae0601a9bbdce6c36f7cdccff9fe7474b Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 19 May 2013 21:31:12 +0100 Subject: [PATCH] Find system zlib via user override, pkg-config or in standard locations --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 416d1f17..1563d703 100644 --- a/Makefile +++ b/Makefile @@ -1028,11 +1028,13 @@ ifeq ($(USE_VOIP),1) endif ifeq ($(USE_INTERNAL_ZLIB),1) - BASE_CFLAGS += -DNO_GZIP - BASE_CFLAGS += -I$(ZDIR) + ZLIB_CFLAGS = -DNO_GZIP -I$(ZDIR) else - LIBS += -lz + ZLIB_CFLAGS ?= $(shell pkg-config --silence-errors --cflags zlib || true) + ZLIB_LIBS ?= $(shell pkg-config --silence-errors --libs zlib || echo -lz) endif +BASE_CFLAGS += $(ZLIB_CFLAGS) +LIBS += $(ZLIB_LIBS) ifeq ($(USE_INTERNAL_JPEG),1) BASE_CFLAGS += -DUSE_INTERNAL_JPEG