Skip to content
Snippets Groups Projects
Commit 5746a5fc authored by Marek Vavruša's avatar Marek Vavruša
Browse files

build: support versioned dependencies

parent c493eea6
Branches
Tags
No related merge requests found
......@@ -26,7 +26,7 @@ $(eval $(call find_bin,doxygen))
$(eval $(call find_bin,sphinx-build))
$(eval $(call find_bin,gccgo))
$(eval $(call find_python))
$(eval $(call find_lib,libmemcached))
$(eval $(call find_lib,libmemcached,1.0))
# Work around luajit on OS X
ifeq ($(PLATFORM), Darwin)
......
......@@ -81,16 +81,21 @@ endef
# Find library (pkg-config)
define find_lib
$(call find_alt,$(1),$(1))
$(call find_alt,$(1),$(1),$(2))
endef
# Find library alternative (pkg-config)
define find_alt
ifeq ($$(strip $$($(1)_LIBS)),)
$(1)_CFLAGS := $(shell pkg-config --cflags $(2) --silence-errors)
$(1)_LIBS := $(shell pkg-config --libs $(2) --silence-errors)
ifneq ($(strip $(3)),)
$(1)_VER := $(shell pkg-config --atleast-version=$(3) $(2) && echo $(3))
endif
ifeq ($(strip $(3)),$$($(1)_VER))
$(1)_CFLAGS := $(shell pkg-config --cflags $(2) --silence-errors)
$(1)_LIBS := $(shell pkg-config --libs $(2) --silence-errors)
endif
endif
$(call have_lib,$(1))
$(call have_lib,$(1),$(3))
endef
# Find binary
......
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