aboutsummaryrefslogtreecommitdiffstats
path: root/config/zfs-build.m4
diff options
context:
space:
mode:
authorArvind Sankar <[email protected]>2020-07-11 19:35:58 -0400
committerBrian Behlendorf <[email protected]>2020-07-14 17:33:44 -0700
commit38e2e9ce8327284b2d516874308300aa96102fe9 (patch)
tree0761f7f696e4da7888a0c99ffb3a91a63ecefdd4 /config/zfs-build.m4
parentbdb518c13abb9eca8d6f8f1d9e2096dc5163a9e7 (diff)
Centralize variable substitution
A bunch of places need to edit files to incorporate the configured paths i.e. bindir, sbindir etc. Move this logic into a common file. Create arc_summary by copying arc_summary[23] as appropriate at build time instead of install time. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Arvind Sankar <[email protected]> Closes #10559
Diffstat (limited to 'config/zfs-build.m4')
-rw-r--r--config/zfs-build.m458
1 files changed, 39 insertions, 19 deletions
diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
index dea3f6137..54b61de09 100644
--- a/config/zfs-build.m4
+++ b/config/zfs-build.m4
@@ -266,7 +266,7 @@ AC_DEFUN([ZFS_AC_RPM], [
RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUG_KMEM_TRACKING_ZFS) 1"'
RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(ASAN_ZFS) 1"'
- RPM_DEFINE_UTIL=' --define "_initconfdir $(DEFAULT_INITCONF_DIR)"'
+ RPM_DEFINE_UTIL=' --define "_initconfdir $(initconfdir)"'
dnl # Make the next three RPM_DEFINE_UTIL additions conditional, since
dnl # their values may not be set when running:
@@ -469,13 +469,13 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
AC_MSG_CHECKING([default init directory])
case "$VENDOR" in
- freebsd) DEFAULT_INIT_DIR=$sysconfdir/rc.d ;;
- *) DEFAULT_INIT_DIR=$sysconfdir/init.d;;
+ freebsd) initdir=$sysconfdir/rc.d ;;
+ *) initdir=$sysconfdir/init.d;;
esac
- AC_MSG_RESULT([$DEFAULT_INIT_DIR])
- AC_SUBST(DEFAULT_INIT_DIR)
+ AC_MSG_RESULT([$initdir])
+ AC_SUBST(initdir)
- AC_MSG_CHECKING([default init script type])
+ AC_MSG_CHECKING([default init script type and shell])
case "$VENDOR" in
toss) DEFAULT_INIT_SCRIPT=redhat ;;
redhat) DEFAULT_INIT_SCRIPT=redhat ;;
@@ -491,24 +491,44 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
freebsd) DEFAULT_INIT_SCRIPT=freebsd;;
*) DEFAULT_INIT_SCRIPT=lsb ;;
esac
- AC_MSG_RESULT([$DEFAULT_INIT_SCRIPT])
+
+ # On gentoo, it's possible that OpenRC isn't installed. Check if
+ # /sbin/openrc-run exists, and if not, fall back to generic defaults.
+
+ DEFAULT_INIT_SHELL="/bin/sh"
+ AS_IF([test "$DEFAULT_INIT_SCRIPT" = "openrc"], [
+ AS_IF([test -x "/sbin/openrc-run"],
+ [DEFAULT_INIT_SHELL="/sbin/openrc-run"],
+ [DEFAULT_INIT_SCRIPT=lsb])
+ ])
+
+ AC_MSG_RESULT([$DEFAULT_INIT_SCRIPT:$DEFAULT_INIT_SHELL])
AC_SUBST(DEFAULT_INIT_SCRIPT)
+ AC_SUBST(DEFAULT_INIT_SHELL)
+
+ AC_MSG_CHECKING([default nfs server init script])
+ AS_IF([test "$VENDOR" = "debian"],
+ [DEFAULT_INIT_NFS_SERVER="nfs-kernel-server"],
+ [DEFAULT_INIT_NFS_SERVER="nfs"]
+ )
+ AC_MSG_RESULT([$DEFAULT_INIT_NFS_SERVER])
+ AC_SUBST(DEFAULT_INIT_NFS_SERVER)
AC_MSG_CHECKING([default init config directory])
case "$VENDOR" in
- alpine) DEFAULT_INITCONF_DIR=/etc/conf.d ;;
- gentoo) DEFAULT_INITCONF_DIR=/etc/conf.d ;;
- toss) DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
- redhat) DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
- fedora) DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
- sles) DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
- ubuntu) DEFAULT_INITCONF_DIR=/etc/default ;;
- debian) DEFAULT_INITCONF_DIR=/etc/default ;;
- freebsd) DEFAULT_INITCONF_DIR=$sysconfdir/rc.conf.d;;
- *) DEFAULT_INITCONF_DIR=/etc/default ;;
+ alpine) initconfdir=/etc/conf.d ;;
+ gentoo) initconfdir=/etc/conf.d ;;
+ toss) initconfdir=/etc/sysconfig ;;
+ redhat) initconfdir=/etc/sysconfig ;;
+ fedora) initconfdir=/etc/sysconfig ;;
+ sles) initconfdir=/etc/sysconfig ;;
+ ubuntu) initconfdir=/etc/default ;;
+ debian) initconfdir=/etc/default ;;
+ freebsd) initconfdir=$sysconfdir/rc.conf.d;;
+ *) initconfdir=/etc/default ;;
esac
- AC_MSG_RESULT([$DEFAULT_INITCONF_DIR])
- AC_SUBST(DEFAULT_INITCONF_DIR)
+ AC_MSG_RESULT([$initconfdir])
+ AC_SUBST(initconfdir)
AC_MSG_CHECKING([whether initramfs-tools is available])
if test -d /usr/share/initramfs-tools ; then