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.
cute-signatures
Timo Teras 2009-07-08 10:46:38 +03:00
parent bf094dc5ea
commit b54ff5dd1e
1 changed files with 5 additions and 3 deletions

View File

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