2020-11-21 11:44:12 +01:00
|
|
|
From 922855e245c8bdadc0d24b5b706549b18fb5f079 Mon Sep 17 00:00:00 2001
|
2020-09-06 11:19:43 +02:00
|
|
|
From: Alexander Egorenkov <egorenar-dev@posteo.net>
|
2020-11-21 11:44:12 +01:00
|
|
|
Date: Sat, 21 Nov 2020 11:08:56 +0100
|
2020-09-06 11:19:43 +02:00
|
|
|
Subject: [PATCH] kpartx, libmultipath: use pkg-config to get path to
|
|
|
|
headers
|
|
|
|
|
|
|
|
Use pkg-config in Makefile to find path to devmapper and udev headers
|
|
|
|
to enable cross-compilation.
|
|
|
|
|
|
|
|
Signed-off-by: Alexander Egorenkov <egorenar-dev@posteo.net>
|
|
|
|
---
|
2020-11-21 11:44:12 +01:00
|
|
|
kpartx/Makefile | 2 +-
|
|
|
|
libmultipath/Makefile | 12 ++++++------
|
|
|
|
2 files changed, 7 insertions(+), 7 deletions(-)
|
2020-09-06 11:19:43 +02:00
|
|
|
|
|
|
|
diff --git a/kpartx/Makefile b/kpartx/Makefile
|
|
|
|
index 2906a984..29573890 100644
|
|
|
|
--- a/kpartx/Makefile
|
|
|
|
+++ b/kpartx/Makefile
|
|
|
|
@@ -8,7 +8,7 @@ LDFLAGS += $(BIN_LDFLAGS)
|
|
|
|
|
|
|
|
LIBDEPS += -ldevmapper
|
|
|
|
|
|
|
|
-ifneq ($(call check_func,dm_task_set_cookie,/usr/include/libdevmapper.h),0)
|
|
|
|
+ifneq ($(call check_func,dm_task_set_cookie,$(shell $(PKG_CONFIG) --variable=includedir devmapper)/libdevmapper.h),0)
|
|
|
|
CFLAGS += -DLIBDM_API_COOKIE
|
|
|
|
endif
|
|
|
|
|
|
|
|
diff --git a/libmultipath/Makefile b/libmultipath/Makefile
|
2020-11-21 11:44:12 +01:00
|
|
|
index 62ba16e8..3ad9130c 100644
|
2020-09-06 11:19:43 +02:00
|
|
|
--- a/libmultipath/Makefile
|
|
|
|
+++ b/libmultipath/Makefile
|
2020-11-21 11:44:12 +01:00
|
|
|
@@ -20,27 +20,27 @@ ifdef SYSTEMD
|
2020-09-06 11:19:43 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
-ifneq ($(call check_func,dm_task_no_flush,/usr/include/libdevmapper.h),0)
|
|
|
|
+ifneq ($(call check_func,dm_task_no_flush,$(shell $(PKG_CONFIG) --variable=includedir devmapper)/libdevmapper.h),0)
|
|
|
|
CFLAGS += -DLIBDM_API_FLUSH -D_GNU_SOURCE
|
|
|
|
endif
|
|
|
|
|
2020-11-21 11:44:12 +01:00
|
|
|
-ifneq ($(call check_func,dm_task_get_errno,/usr/include/libdevmapper.h),0)
|
|
|
|
+ifneq ($(call check_func,dm_task_get_errno,$(shell $(PKG_CONFIG) --variable=includedir devmapper)/libdevmapper.h),0)
|
|
|
|
CFLAGS += -DLIBDM_API_GET_ERRNO
|
|
|
|
endif
|
|
|
|
|
2020-09-06 11:19:43 +02:00
|
|
|
-ifneq ($(call check_func,dm_task_set_cookie,/usr/include/libdevmapper.h),0)
|
|
|
|
+ifneq ($(call check_func,dm_task_set_cookie,$(shell $(PKG_CONFIG) --variable=includedir devmapper)/libdevmapper.h),0)
|
|
|
|
CFLAGS += -DLIBDM_API_COOKIE
|
|
|
|
endif
|
|
|
|
|
|
|
|
-ifneq ($(call check_func,udev_monitor_set_receive_buffer_size,/usr/include/libudev.h),0)
|
|
|
|
+ifneq ($(call check_func,udev_monitor_set_receive_buffer_size,$(shell $(PKG_CONFIG) --variable=includedir libudev)/libudev.h),0)
|
|
|
|
CFLAGS += -DLIBUDEV_API_RECVBUF
|
|
|
|
endif
|
|
|
|
|
|
|
|
-ifneq ($(call check_func,dm_task_deferred_remove,/usr/include/libdevmapper.h),0)
|
|
|
|
+ifneq ($(call check_func,dm_task_deferred_remove,$(shell $(PKG_CONFIG) --variable=includedir devmapper)/libdevmapper.h),0)
|
|
|
|
CFLAGS += -DLIBDM_API_DEFERRED
|
|
|
|
endif
|
|
|
|
|
2020-11-21 11:44:12 +01:00
|
|
|
-ifneq ($(call check_func,dm_hold_control_dev,/usr/include/libdevmapper.h),0)
|
|
|
|
+ifneq ($(call check_func,dm_hold_control_dev,$(shell $(PKG_CONFIG) --variable=includedir devmapper)/libdevmapper.h),0)
|
|
|
|
CFLAGS += -DLIBDM_API_HOLD_CONTROL
|
|
|
|
endif
|
|
|
|
|
2020-09-06 11:19:43 +02:00
|
|
|
--
|
2020-11-21 11:44:12 +01:00
|
|
|
2.29.2
|
2020-09-06 11:19:43 +02:00
|
|
|
|