[dm-devel] [PATCH 1/7] multipath-tools Makefiles: make pkg-config configurable

mwilck at suse.com mwilck at suse.com
Fri Mar 26 21:29:38 UTC 2021


From: Martin Wilck <mwilck at suse.com>

This is useful for building in a cross-compilation environment.

Signed-off-by: Martin Wilck <mwilck at suse.com>
---
 Makefile.inc     | 6 ++++--
 libdmmp/Makefile | 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Makefile.inc b/Makefile.inc
index 0542930..f1e2313 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -15,6 +15,8 @@
 # Uncomment to disable dmevents polling support
 # ENABLE_DMEVENTS_POLL = 0
 
+PKGCONFIG	?= pkg-config
+
 ifeq ($(TOPDIR),)
 	TOPDIR	= ..
 endif
@@ -36,8 +38,8 @@ ifndef RUN
 endif
 
 ifndef SYSTEMD
-	ifeq ($(shell pkg-config --modversion libsystemd >/dev/null 2>&1 && echo 1), 1)
-		SYSTEMD = $(shell pkg-config --modversion libsystemd | awk '{print $$1}')
+	ifeq ($(shell $(PKGCONFIG) --modversion libsystemd >/dev/null 2>&1 && echo 1), 1)
+		SYSTEMD = $(shell $(PKGCONFIG) --modversion libsystemd | awk '{print $$1}')
 	else
 		ifeq ($(shell systemctl --version >/dev/null 2>&1 && echo 1), 1)
 			SYSTEMD = $(shell systemctl --version 2> /dev/null | \
diff --git a/libdmmp/Makefile b/libdmmp/Makefile
index 1dd3f34..4175c3f 100644
--- a/libdmmp/Makefile
+++ b/libdmmp/Makefile
@@ -16,9 +16,9 @@ HEADERS = libdmmp/libdmmp.h
 OBJS = libdmmp.o libdmmp_mp.o libdmmp_pg.o libdmmp_path.o libdmmp_misc.o
 
 CFLAGS += $(LIB_CFLAGS) -fvisibility=hidden -I$(libdmmpdir) -I$(mpathcmddir) \
-	  $(shell pkg-config --cflags json-c)
+	  $(shell $(PKGCONFIG) --cflags json-c)
 
-LIBDEPS += $(shell pkg-config --libs json-c) -L$(mpathcmddir) -lmpathcmd -lpthread
+LIBDEPS += $(shell $(PKGCONFIG) --libs json-c) -L$(mpathcmddir) -lmpathcmd -lpthread
 
 all: $(LIBS) doc
 
-- 
2.30.1





More information about the dm-devel mailing list