From b54ff5dd1ebc230aa50570ecfebc8fd31739ebb4 Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Wed, 8 Jul 2009 10:46:38 +0300 Subject: build: link zlib dynamically, use --as-needed use pkgconfig of zlib instead of hard requiring it. and link in the pkg-config libs with --as-needed as not all of the openssl libs are really required. --- src/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 87c7038..0cd0774 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,4 @@ -PKGDEPS := openssl +PKGDEPS := openssl zlib ifeq ($(shell pkg-config --print-errors --exists $(PKGDEPS) || echo fail),fail) $(error Build dependencies are not met) @@ -16,8 +16,10 @@ apk.static-objs := $(apk-objs) LDFLAGS_apk.static := -static LDFLAGS_apk += -nopie -LIBS += $(shell pkg-config --libs $(PKGDEPS)) -LIBS += /usr/lib/libz.a +CFLAGS += $(shell pkg-config --cflags $(PKGDEPS)) +LIBS := -Wl,--as-needed \ + $(shell pkg-config --libs $(PKGDEPS)) \ + -Wl,--no-as-needed install:: $(INSTALLDIR) $(DESTDIR)$(SBINDIR) -- cgit v1.2.3