summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2013-05-19 21:31:12 +0100
committerTim Angus <tim@ngus.net>2014-08-28 11:02:37 +0100
commit036a7e4d8d3c640a0157f5cdf4043e57c8e90655 (patch)
tree12f7c5ae06b9379302403b79343f77203ed6605a /Makefile
parentedc7f497dc90a1c61e477697747fed44e36a0042 (diff)
Find system zlib via user override, pkg-config or in standard locations
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 1e39e5f8..316c2019 100644
--- a/Makefile
+++ b/Makefile
@@ -1009,11 +1009,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