diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 00:55:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 00:55:53 +0000 |
commit | 3d0386f27ca66379acf50199e1d1298386eeeeb8 (patch) | |
tree | f87bd4a126b3a843858eb447e8fd5893c3ee3882 /tests/deckard/platform.mk | |
parent | Initial commit. (diff) | |
download | knot-resolver-3d0386f27ca66379acf50199e1d1298386eeeeb8.tar.xz knot-resolver-3d0386f27ca66379acf50199e1d1298386eeeeb8.zip |
Adding upstream version 3.2.1.upstream/3.2.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/deckard/platform.mk')
-rw-r--r-- | tests/deckard/platform.mk | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/deckard/platform.mk b/tests/deckard/platform.mk new file mode 100644 index 0000000..4a96c71 --- /dev/null +++ b/tests/deckard/platform.mk @@ -0,0 +1,27 @@ +# Evaluate library +define have_lib +ifeq ($$(strip $$($(1)_LIBS)),) + HAS_$(1) := no +else + HAS_$(1) := yes +endif +endef + +# Find library (pkg-config) +define find_lib + $(call find_alt,$(1),$(1),$(2)) +endef + +# Find library alternative (pkg-config) +define find_alt + ifeq ($$(strip $$($(1)_LIBS)),) + 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),$(3)) +endef |