Makefile cleanups.
Subsystems (2)
Benjamin Marzinski
maintainercover Makefile cleanups.
Two small, and I hope sensible, changes to Makefile.inc
Benjamin Marzinski (2):
Makefile.inc: always use /usr/share/man for mandir Makefile.inc: always use /usr/include for includedir
Makefile.inc | 5 ++--- create-config.mk | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-)
Signature · 1 line
2.41.0
Benjamin Marzinski
maintainerPATCH 1/2 Makefile.inc: always use /usr/share/man for mandir
The current build system, with nothing overridden, will install the man pages in /share/man, which AFAIK isn't correct for any distribution.
--- Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile.inc +1 -1
@@ -60,7 +60,7 @@ modulesloaddir := $(systemd_prefix)lib/modules-load.d libudevdir := $(systemd_prefix)lib/udev udevrulesdir := $(libudevdir)/rules.d bindir := $(exec_prefix)sbin -mandir := $(usr_prefix)share/man +mandir := /usr/share/man LIB := $(if $(shell test -d /lib64 && echo 1),lib64,lib) syslibdir := $(prefix)$(LIB) usrlibdir := $(usr_prefix)$(LIB)
Signature · 1 line
2.41.0
Re: [PATCH 1/2] Makefile.inc: always use /usr/share/man for mandir
Quoted 20 lines · Benjamin Marzinski
The current build system, with nothing overridden, will install the man
pages in /share/man, which AFAIK isn't correct for any distribution.Signed-off-by Benjamin Marzinski <[email protected]>---
Makefile.inc | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)Makefile.inc +0
-0@@ -60,7 +60,7 @@ modulesloaddir :=$(systemd_prefix)lib/modules-load.d
libudevdir := $(systemd_prefix)lib/udev
udevrulesdir := $(libudevdir)/rules.d
bindir := $(exec_prefix)sbinMakefile.inc +1
-1-mandir := $(usr_prefix)share/man +mandir := /usr/share/man
Quoted 3 lines
LIB := $(if $(shell test -d /lib64 && echo 1),lib64,lib)
syslibdir := $(prefix)$(LIB)
usrlibdir := $(usr_prefix)$(LIB)
Hm. You are right for the default case, but the current code works correctly for prefix=/usr/local, for example. Also, I don't like using no hard-coded values for the secondary paths like "mandir" and "bindir".
What about this instead?
Makefile.inc +1 -1
@@ -36,7 +36,7 @@ prefix := # Prefix for binaries exec_prefix := $(prefix) # Prefix for non-essential libraries (libdmmp) -usr_prefix := $(prefix) +usr_prefix := $(if $(prefix),$(prefix),/usr) # Prefix for configfuration files (multipath.conf) etc_prefix := $(prefix) # Where to install systemd-related files. systemd is usually installed
under /usr
This will put the man pages under /usr/man is prefix is empty (the default case) and under $(prefix)/man otherwise (i.e. /usr/man if prefix=/usr).
Thanks,
Martin
Benjamin Marzinski
maintainerPATCH 2/2 Makefile.inc: always use /usr/include for includedir
In reply to Benjamin MarzinskiThe current build system, with nothing overridden, will install the header files to /include, which AFAIK isn't correct for any distribution.
--- Makefile.inc | 3 +-- create-config.mk | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-)
Makefile.inc +1 -2
@@ -64,7 +64,7 @@ mandir := /usr/share/man LIB := $(if $(shell test -d /lib64 && echo 1),lib64,lib) syslibdir := $(prefix)$(LIB) usrlibdir := $(usr_prefix)$(LIB) -includedir := $(usr_prefix)include +includedir := /usr/include pkgconfdir := $(usrlibdir)/pkgconfig plugindir := $(prefix)$(LIB)/multipath configdir := $(etc_prefix)etc/multipath/conf.d
@@ -73,7 +73,6 @@ statedir := $(etc_prefix)etc/multipath runtimedir := $(if $(shell test -L /var/run -o ! -d /var/run && echo 1),/run,/var/run) devmapper_incdir := $(or $(shell $(PKG_CONFIG) --variable=includedir devmapper),/usr/include) libudev_incdir := $(or $(shell $(PKG_CONFIG) --variable=includedir libudev),/usr/include) -kernel_incdir := /usr/include ifeq ($(V),) Q := @
create-config.mk +2 -2
@@ -103,7 +103,7 @@ ifneq ($(call check_func,dm_hold_control_dev,$(devmapper_incdir)/libdevmapper.h) DEFINES += LIBDM_API_HOLD_CONTROL endif -ifneq ($(call check_var,ELS_DTAG_LNK_INTEGRITY,$(kernel_incdir)/scsi/fc/fc_els.h),0) +ifneq ($(call check_var,ELS_DTAG_LNK_INTEGRITY,$(includedir)/scsi/fc/fc_els.h),0) DEFINES += FPIN_EVENT_HANDLER FPIN_SUPPORT = 1 endif
@@ -117,7 +117,7 @@ ifneq ($(call check_func,mnt_table_parse_swaps,$(libmount_h)),0) DEFINES += LIBMOUNT_SUPPORTS_SWAP endif -ifneq ($(call check_file,$(kernel_incdir)/linux/nvme_ioctl.h),0) +ifneq ($(call check_file,$(includedir)/linux/nvme_ioctl.h),0) ANA_SUPPORT := 1 endif
Signature · 1 line
2.41.0
Re: [PATCH 2/2] Makefile.inc: always use /usr/include for includedir
Quoted 5 lines · Benjamin Marzinski
The current build system, with nothing overridden, will install the header files to /include, which AFAIK isn't correct for any distribution.
Signed-off-by Benjamin Marzinski <[email protected]>
I have the same comment as for patch 1/2 - correct for the default case, but the more obvious fix would be changing the default of usr_prefix (our current default prefix="" usr_prefix="" is arguably bad).
Also, I bet that there are cases out there where the assumption that paths for multipath and kernel headers are equal would fail.
I'm going to submit my suggestion here; I'm of course open to further discussion.
Thanks
Martin