Commit 98a13624 authored by Natanael Copa's avatar Natanael Copa

build: allow override compiler/linker flags for external libs

Make it possible to individually override openssl, zlib and libfetch
cflags and linker flags. This makes it possible to build apk-tools
without having pkg-config installed.
parent 5906aef6
PKGDEPS := openssl zlib
PKG_CONFIG ?= pkg-config
LUAAPK ?= yes
OPENSSL_CFLAGS := $(shell $(PKG_CONFIG) --cflags openssl)
OPENSSL_LIBS := $(shell $(PKG_CONFIG) --libs openssl)
ZLIB_CFLAGS := $(shell $(PKG_CONFIG) --cflags zlib)
ZLIB_LIBS := $(shell $(PKG_CONFIG) --libs zlib)
FETCH_LIBS := /usr/lib/libfetch.a
# lua module
ifneq ($(LUAAPK),)
......@@ -17,10 +24,6 @@ install-LUA_LIB-y := $(INSTALLDIR) $(DESTDIR)$(LUA_LIBDIR) && \
ifeq ($(shell $(PKG_CONFIG) --print-errors --exists $(PKGDEPS) || echo fail),fail)
$(error Build dependencies are not met)
progs-y += apk
apk-objs := apk.o add.o del.o fix.o update.o info.o \
search.o upgrade.o cache.o ver.o index.o fetch.o \
......@@ -65,10 +68,9 @@ LIBS_apk.static := -Wl,--as-needed -ldl -Wl,--no-as-needed
LDFLAGS_apk += -L$(obj)
LDFLAGS_apk-test += -L$(obj)
CFLAGS_ALL += $(shell $(PKG_CONFIG) --cflags $(PKGDEPS))
LIBS := /usr/lib/libfetch.a \
-Wl,--as-needed \
$(shell $(PKG_CONFIG) --libs $(PKGDEPS)) \
LIBS := -Wl,--as-needed \
$(obj)/apk: $(LIBAPK-y)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment