multipath-tools: avoid using GZIP Makefile variable
Subsystems (2)
PATCH 1/4 multipath-tools: avoid using GZIP Makefile variable
gzip supports (deprecated) GZIP environment variable. If it's already present Makefile would override it and pass it through causing thre breakage:
$ dev>GZIP=-n make
gzip -9 -c mpath_persistent_reserve_in.3 > mpath_persistent_reserve_in.3.gz
gzip: -c: option not valid in GZIP environment variable
Try `gzip --help' for more information.Fix build by renaming GZIP variable to GZIP_PROG to avoid collision.
--- Makefile.inc | 2 +- kpartx/Makefile | 2 +- libmpathpersist/Makefile | 4 ++-- mpathpersist/Makefile | 2 +- multipath/Makefile | 4 ++-- multipathd/Makefile | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-)
Makefile.inc +1 -1
@@ -75,7 +75,7 @@ nvmedir = $(TOPDIR)/libmultipath/nvme includedir = $(prefix)/usr/include pkgconfdir = $(usrlibdir)/pkgconfig -GZIP = gzip -9 -c +GZIP_PROG = gzip -9 -c RM = rm -f LN = ln -sf INSTALL_PROGRAM = install
kpartx/Makefile +1 -1
@@ -21,7 +21,7 @@ all: $(EXEC) $(EXEC): $(OBJS) $(CC) $(CFLAGS) $(OBJS) -o $(EXEC) $(LDFLAGS) $(LIBDEPS) - $(GZIP) $(EXEC).8 > $(EXEC).8.gz + $(GZIP_PROG) $(EXEC).8 > $(EXEC).8.gz install: $(EXEC) $(EXEC).8 $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
libmpathpersist/Makefile +2 -2
@@ -33,8 +33,8 @@ $(DEVLIB): $(LIBS) $(LN) $(LIBS) $@ man: - $(GZIP) mpath_persistent_reserve_in.3 > mpath_persistent_reserve_in.3.gz - $(GZIP) mpath_persistent_reserve_out.3 > mpath_persistent_reserve_out.3.gz + $(GZIP_PROG) mpath_persistent_reserve_in.3 > mpath_persistent_reserve_in.3.gz + $(GZIP_PROG) mpath_persistent_reserve_out.3 > mpath_persistent_reserve_out.3.gz install: all $(INSTALL_PROGRAM) -d $(DESTDIR)$(syslibdir)
mpathpersist/Makefile +1 -1
@@ -14,7 +14,7 @@ all: $(EXEC) $(EXEC): $(OBJS) $(CC) $(OBJS) -o $(EXEC) $(LDFLAGS) $(CFLAGS) $(LIBDEPS) - $(GZIP) $(EXEC).8 > $(EXEC).8.gz + $(GZIP_PROG) $(EXEC).8 > $(EXEC).8.gz install: $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
multipath/Makefile +2 -2
@@ -16,8 +16,8 @@ all: $(EXEC) $(EXEC): $(OBJS) $(multipathdir)/libmultipath.so $(mpathcmddir)/libmpathcmd.so $(CC) $(CFLAGS) $(OBJS) -o $(EXEC) $(LDFLAGS) $(LIBDEPS) - $(GZIP) $(EXEC).8 > $(EXEC).8.gz - $(GZIP) $(EXEC).conf.5 > $(EXEC).conf.5.gz + $(GZIP_PROG) $(EXEC).8 > $(EXEC).8.gz + $(GZIP_PROG) $(EXEC).conf.5 > $(EXEC).conf.5.gz install: $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
multipathd/Makefile +1 -1
@@ -40,7 +40,7 @@ all : $(EXEC) $(EXEC): $(OBJS) $(multipathdir)/libmultipath.so $(mpathcmddir)/libmpathcmd.so $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(EXEC) $(LIBDEPS) - $(GZIP) $(EXEC).8 > $(EXEC).8.gz + $(GZIP_PROG) $(EXEC).8 > $(EXEC).8.gz cli_handlers.o: cli_handlers.c $(CC) $(CFLAGS) -Wno-unused-parameter -c -o $@ $<
Signature · 6 lines
2.34.1 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 4/4 multipath-tools: allow passing non-standard linux-headers location
On NixOS nothing is installed in /usr/include and instead lives in it's own prefix.
The change switches linux/nvme_ioctl.h discovery to user provided path.
--- Makefile.inc | 5 +++++ libmultipath/prioritizers/Makefile | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)
Makefile.inc +5 -0
@@ -68,6 +68,11 @@ ifndef LIBUDEV_INCDIR endif endif +# Allow user to override default location. +ifndef LINUX_HEADERS_INCDIR + LINUX_HEADERS_INCDIR = /usr/include +endif + prefix = exec_prefix = $(prefix) usr_prefix = $(prefix)
libmultipath/prioritizers/Makefile +1 -1
@@ -23,7 +23,7 @@ LIBS = \ libpriopath_latency.so \ libpriosysfs.so -ifneq ($(call check_file,/usr/include/linux/nvme_ioctl.h),0) +ifneq ($(call check_file,$(LINUX_HEADERS_INCDIR)/linux/nvme_ioctl.h),0) LIBS += libprioana.so CFLAGS += -I../nvme endif
Signature · 6 lines
2.34.1 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 2/4 multipath-tools: autodiscover libdevmapper.h headers
In reply to Sergei TrofimovichOn NixOS nothing is installed in /usr/include and instead lives in it's own prefix. pkg-config variables are expected to be used for installation discovery:
$ pkg-config --variable=includedir devmapper
/nix/store/c30fr0ahpa285sjkjgiinc2rr68ysmid-lvm2-2.03.14-dev/includeThe change switches libdevmapper.h discovery to pkg-config provided path.
--- Makefile.inc | 8 ++++++++ kpartx/Makefile | 2 +- libmultipath/Makefile | 10 +++++----- multipathd/Makefile | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-)
Makefile.inc +8 -0
@@ -52,6 +52,14 @@ ifndef SYSTEMDPATH SYSTEMDPATH=usr/lib endif +ifndef DEVMAPPER_INCDIR + ifeq ($(shell $(PKGCONFIG) --modversion devmapper >/dev/null 2>&1 && echo 1), 1) + DEVMAPPER_INCDIR = $(shell $(PKGCONFIG) --variable=includedir devmapper) + else + DEVMAPPER_INCDIR = /usr/include + endif +endif + prefix = exec_prefix = $(prefix) usr_prefix = $(prefix)
kpartx/Makefile +1 -1
@@ -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,$(DEVMAPPER_INCDIR)/libdevmapper.h),0) CFLAGS += -DLIBDM_API_COOKIE endif
libmultipath/Makefile +5 -5
@@ -21,15 +21,15 @@ ifdef SYSTEMD endif endif -ifneq ($(call check_func,dm_task_no_flush,/usr/include/libdevmapper.h),0) +ifneq ($(call check_func,dm_task_no_flush,$(DEVMAPPER_INCDIR)/libdevmapper.h),0) CFLAGS += -DLIBDM_API_FLUSH -D_GNU_SOURCE endif -ifneq ($(call check_func,dm_task_get_errno,/usr/include/libdevmapper.h),0) +ifneq ($(call check_func,dm_task_get_errno,$(DEVMAPPER_INCDIR)/libdevmapper.h),0) CFLAGS += -DLIBDM_API_GET_ERRNO endif -ifneq ($(call check_func,dm_task_set_cookie,/usr/include/libdevmapper.h),0) +ifneq ($(call check_func,dm_task_set_cookie,$(DEVMAPPER_INCDIR)/libdevmapper.h),0) CFLAGS += -DLIBDM_API_COOKIE endif
@@ -37,11 +37,11 @@ ifneq ($(call check_func,udev_monitor_set_receive_buffer_size,/usr/include/libud 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,$(DEVMAPPER_INCDIR)/libdevmapper.h),0) CFLAGS += -DLIBDM_API_DEFERRED endif -ifneq ($(call check_func,dm_hold_control_dev,/usr/include/libdevmapper.h),0) +ifneq ($(call check_func,dm_hold_control_dev,$(DEVMAPPER_INCDIR)/libdevmapper.h),0) CFLAGS += -DLIBDM_API_HOLD_CONTROL endif
multipathd/Makefile +1 -1
@@ -1,6 +1,6 @@ include ../Makefile.inc -ifneq ($(call check_func,dm_task_get_errno,/usr/include/libdevmapper.h),0) +ifneq ($(call check_func,dm_task_get_errno,$(DEVMAPPER_INCDIR)/libdevmapper.h),0) CFLAGS += -DLIBDM_API_GET_ERRNO endif
Signature · 6 lines
2.34.1 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 3/4 multipath-tools: autodiscover libudev.h headers
In reply to Sergei TrofimovichOn NixOS nothing is installed in /usr/include and instead lives in it's own prefix. pkg-config variables are expected to be used for installation discovery:
$ pkg-config --variable=includedir libudev
/nix/store/27mwkz5zhzw0gip8y7pvjyma5r0hzzaw-systemd-249.7-dev/includeThe change switches libudev.h discovery to pkg-config provided path.
--- Makefile.inc | 8 ++++++++ libmultipath/Makefile | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-)
Makefile.inc +8 -0
@@ -60,6 +60,14 @@ ifndef DEVMAPPER_INCDIR endif endif +ifndef LIBUDEV_INCDIR + ifeq ($(shell $(PKGCONFIG) --modversion libudev >/dev/null 2>&1 && echo 1), 1) + LIBUDEV_INCDIR = $(shell $(PKGCONFIG) --variable=includedir libudev) + else + LIBUDEV_INCDIR = /usr/include + endif +endif + prefix = exec_prefix = $(prefix) usr_prefix = $(prefix)
libmultipath/Makefile +1 -1
@@ -33,7 +33,7 @@ ifneq ($(call check_func,dm_task_set_cookie,$(DEVMAPPER_INCDIR)/libdevmapper.h), 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,$(LIBUDEV_INCDIR)/libudev.h),0) CFLAGS += -DLIBUDEV_API_RECVBUF endif
Signature · 6 lines
2.34.1 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
Quoted 11 lines · Sergei Trofimovich
gzipsupports (deprecated)GZIPenvironment variable. If it's already presentMakefilewould override it and pass it through causing
thre breakage:$ dev>GZIP=-n make gzip -9 -c mpath_persistent_reserve_in.3 > mpath_persistent_reserve_in.3.gz gzip: -c: option not valid in GZIP environment variable Try `gzip --help' for more information.
Quoted 5 lines
Fix build by renaming GZIP variable to
GZIP_PROGto avoid collision.CC Martin Wilck <[email protected]>CC Benjamin Marzinski <[email protected]>Signed-off-by Sergei Trofimovich <[email protected]>
For the series: Looks good, no breakage found, so
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel