From: Maxin John Date: Tue, 24 Feb 2026 22:26:42 +0000 (+0200) Subject: Makefile: detect corosync and libdlm via pkg-config X-Git-Tag: mdadm-4.6~5 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=5b8560e66ca8f72d008778b5daa1059de48fb73a;p=thirdparty%2Fmdadm.git Makefile: detect corosync and libdlm via pkg-config The Makefile currently checks for corosync and libdlm headers by probing /usr/include directly. This breaks in cross-compilation environments because the headers may be located in a sysroot rather than the host filesystem. Use pkg-config to detect the presence of corosync and libdlm instead. Signed-off-by: Maxin John --- diff --git a/Makefile b/Makefile index 8031ce24..43b128e5 100644 --- a/Makefile +++ b/Makefile @@ -120,8 +120,8 @@ FAILED_SLOTS_DIR = $(RUN_DIR)/failed-slots SYSTEMD_DIR=/lib/systemd/system LIB_DIR=/usr/libexec/mdadm -COROSYNC:=$(shell [ -d /usr/include/corosync ] || echo -DNO_COROSYNC) -DLM:=$(shell [ -f /usr/include/libdlm.h ] || echo -DNO_DLM) +COROSYNC:=$(shell $(PKG_CONFIG) --exists corosync || echo -DNO_COROSYNC) +DLM:=$(shell $(PKG_CONFIG) --exists libdlm || echo -DNO_DLM) DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\" DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\"