]> git.proxmox.com Git - mirror_zfs.git/commitdiff
autoconf: use include directives instead of recursing down etc
authorнаб <nabijaczleweli@nabijaczleweli.xyz>
Sat, 9 Apr 2022 23:19:15 +0000 (01:19 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 10 May 2022 17:19:58 +0000 (10:19 -0700)
dist diff:
  -zfs-2.1.99/etc/systemd/system/50-zfs.preset.in
  +zfs-2.1.99/etc/systemd/system/50-zfs.preset

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13316

21 files changed:
Makefile.am
config/CppCheck.am
config/Shellcheck.am
config/user-systemd.m4
config/user-sysvinit.m4
config/zfs-build.m4
configure.ac
etc/Makefile.am
etc/default/Makefile.am [deleted file]
etc/init.d/Makefile.am [deleted file]
etc/modules-load.d/.gitignore [deleted file]
etc/modules-load.d/Makefile.am [deleted file]
etc/sudoers.d/Makefile.am [deleted file]
etc/systemd/Makefile.am [deleted file]
etc/systemd/system-generators/Makefile.am [deleted file]
etc/systemd/system/.gitignore
etc/systemd/system/50-zfs.preset [new file with mode: 0644]
etc/systemd/system/50-zfs.preset.in [deleted file]
etc/systemd/system/Makefile.am [deleted file]
etc/zfs/Makefile.am [deleted file]
tests/Makefile.am

index ca2093781dc058ca5b2d7b81628c71e0a8a78210..e1d311c1328fcec6f92b0e934ddb429269e75dfb 100644 (file)
@@ -4,9 +4,9 @@ INSTALL_DATA_HOOKS =
 ALL_LOCAL =
 CHECKS = shellcheck checkbashisms
 
-include $(top_srcdir)/config/Shellcheck.am
 include $(top_srcdir)/config/Rules.am
 include $(top_srcdir)/config/CppCheck.am
+include $(top_srcdir)/config/Shellcheck.am
 include $(top_srcdir)/config/Substfiles.am
 
 ACLOCAL_AMFLAGS = -I config
@@ -16,11 +16,11 @@ if BUILD_LINUX
 include $(srcdir)/%D%/rpm/Makefile.am
 endif
 
-CPPCHECKDIRS += etc/systemd/system-generators
 if CONFIG_USER
-SUBDIRS += . tests etc
+SUBDIRS += . tests
 include $(srcdir)/%D%/cmd/Makefile.am
 include $(srcdir)/%D%/contrib/Makefile.am
+include $(srcdir)/%D%/etc/Makefile.am
 include $(srcdir)/%D%/lib/Makefile.am
 include $(srcdir)/%D%/man/Makefile.am
 include $(srcdir)/%D%/scripts/Makefile.am
@@ -98,7 +98,7 @@ dist-hook:
 PHONY += codecheck $(CHECKS)
 codecheck: $(CHECKS)
 
-SHELLCHECKDIRS = etc tests
+SHELLCHECKDIRS = tests
 SHELLCHECKSCRIPTS += autogen.sh
 
 PHONY += checkstyle
index 3fa6bddda89a3650a66c4412a1d77f18b2890c84..d0f1d6f1920f87fc391f62fca0eec6193acfa091 100644 (file)
@@ -13,9 +13,9 @@ CPPCHECKTARGETS =
 cppcheck-recursive-%:
        $(MAKE) -C $(subst ^,/,$(subst cppcheck-recursive-,,$@)) cppcheck
 
-_CTGT = $(subst -,_,$(subst .,_,$(subst cppcheck-for-,,$@)))
+_CTGT = $(subst cppcheck-for-,,$@)
 cppcheck-for-%:
        @[ -n "$($(_CTGT)_SOURCES)$(dist_$(_CTGT)_SOURCES)$(nodist_$(_CTGT)_SOURCES)" ]
        $(CPPCHECK) -j$(CPU_COUNT) $(CPPCHECKFLAGS) $(patsubst -U%,,$(patsubst -D%,,$(filter-out $(AM_CPPFLAGS_NOCHECK),$(or $($(_CTGT)_CPPFLAGS),$(AM_CPPFLAGS))))) $($(_CTGT)_SOURCES) $(dist_$(_CTGT)_SOURCES) $(nodist_$(_CTGT)_SOURCES)
 
-cppcheck: $(addprefix cppcheck-for-,$(CPPCHECKTARGETS)) $(addprefix cppcheck-recursive-,$(subst /,^,$(CPPCHECKDIRS)))
+cppcheck: $(addprefix cppcheck-for-,$(subst -,_,$(subst .,_,$(subst /,_,$(CPPCHECKTARGETS))))) $(addprefix cppcheck-recursive-,$(CPPCHECKDIRS))
index 873fb8eae079ea9f0d1d195885b86c2eb956aa9f..9002b76dee3a630167d609bc0c46c24f1a9a79f5 100644 (file)
@@ -12,7 +12,7 @@ JUST_SHELLCHECK_OPTS    = $(addprefix shellcheck-here-,$(subst /,^,$(1)))
 JUST_CHECKBASHISMS_OPTS = $(addprefix checkbashisms-here-,$(subst /,^,$(1)))
 SHELLCHECK_OPTS         = $(call JUST_SHELLCHECK_OPTS,$(1)) $(call JUST_CHECKBASHISMS_OPTS,$(1))
 
-.PHONY: shellcheck shellcheck-recursive
+PHONY += shellcheck shellcheck-recursive
 
 shellcheck-recursive:
        @set -e; for dir in $(SHELLCHECKDIRS); do $(MAKE) -C $$dir shellcheck; done
@@ -28,7 +28,7 @@ endif
 shellcheck: $(SHELLCHECKSCRIPTS) $(call JUST_SHELLCHECK_OPTS,$(SHELLCHECKSCRIPTS)) shellcheck-recursive
 
 
-.PHONY: checkbashisms checkbashisms-recursive
+PHONY += checkbashisms checkbashisms-recursive
 
 checkbashisms-recursive:
        @set -e; for dir in $(SHELLCHECKDIRS); do $(MAKE) -C $$dir checkbashisms; done
index 63f02ad2a82b9f062a0c333aaaf3b0da1ce24572..e4fd0b57c2b7b4628683839c262bbf51eb81c5d8 100644 (file)
@@ -35,16 +35,15 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_SYSTEMD], [
        AC_MSG_RESULT([$enable_systemd])
 
        AS_IF([test "x$enable_systemd" = xyes], [
-               ZFS_INIT_SYSTEMD=systemd
-               ZFS_MODULE_LOAD=modules-load.d
                DEFINE_SYSTEMD='--with systemd --define "_unitdir $(systemdunitdir)" --define "_presetdir $(systemdpresetdir)" --define "_generatordir $(systemdgeneratordir)"'
                modulesloaddir=$systemdmodulesloaddir
        ],[
                DEFINE_SYSTEMD='--without systemd'
        ])
 
-       AC_SUBST(ZFS_INIT_SYSTEMD)
-       AC_SUBST(ZFS_MODULE_LOAD)
+       ZFS_INIT_SYSTEMD=$enable_systemd
+       ZFS_WANT_MODULES_LOAD_D=$enable_systemd
+
        AC_SUBST(DEFINE_SYSTEMD)
        AC_SUBST(systemdunitdir)
        AC_SUBST(systemdpresetdir)
index b6b63f1cfa36b9ea8a7006dfbc4061dab2a9a783..cf3c8129f0d232cb1ef3100d8bd7c3ecde414511 100644 (file)
@@ -2,10 +2,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_SYSVINIT], [
        AC_ARG_ENABLE(sysvinit,
                AS_HELP_STRING([--enable-sysvinit],
                [install SysV init scripts [default: yes]]),
-               [],enable_sysvinit=yes)
+               [], enable_sysvinit=yes)
 
-       AS_IF([test "x$enable_sysvinit" = xyes],
-               [ZFS_INIT_SYSV=init.d])
-
-       AC_SUBST(ZFS_INIT_SYSV)
+       ZFS_INIT_SYSV=$enable_sysvinit
 ])
index 726b4b420c77097e57553f49ae63d2631c9ba3e2..59bca557925229dd734ec155a2e415cbc6993bd9 100644 (file)
@@ -259,6 +259,10 @@ AC_DEFUN([ZFS_AC_CONFIG], [
                AC_SUBST(TEST_JOBS)
        ])
 
+       ZFS_INIT_SYSV=
+       ZFS_INIT_SYSTEMD=
+       ZFS_WANT_MODULES_LOAD_D=
+
        case "$ZFS_CONFIG" in
                kernel) ZFS_AC_CONFIG_KERNEL ;;
                user)   ZFS_AC_CONFIG_USER   ;;
@@ -271,6 +275,10 @@ AC_DEFUN([ZFS_AC_CONFIG], [
                              user kernel|user|all|srpm]) ;;
        esac
 
+       AM_CONDITIONAL([INIT_SYSV],           [test "x$ZFS_INIT_SYSV" = "xyes"])
+       AM_CONDITIONAL([INIT_SYSTEMD],        [test "x$ZFS_INIT_SYSTEMD" = "xyes"])
+       AM_CONDITIONAL([WANT_MODULES_LOAD_D], [test "x$ZFS_WANT_MODULES_LOAD_D" = "xyes"])
+
        AM_CONDITIONAL([CONFIG_USER],
            [test "$ZFS_CONFIG" = user -o "$ZFS_CONFIG" = all])
        AM_CONDITIONAL([CONFIG_KERNEL],
index f536ff2fc2a4343a5066c5237265000cb7cb27a0..c5af86c605c7602be71d89f7fcacaeeafac4a100 100644 (file)
@@ -66,15 +66,6 @@ ZFS_AC_DEBUG_INVARIANTS
 
 AC_CONFIG_FILES([
        Makefile
-       etc/Makefile
-       etc/default/Makefile
-       etc/init.d/Makefile
-       etc/modules-load.d/Makefile
-       etc/sudoers.d/Makefile
-       etc/systemd/Makefile
-       etc/systemd/system-generators/Makefile
-       etc/systemd/system/Makefile
-       etc/zfs/Makefile
        include/Makefile
        lib/libzfs/libzfs.pc
        lib/libzfsbootenv/libzfsbootenv.pc
index 179c2400978c848fd36f79feffa40a49f0b75c82..ffe5fad2b4a929d5433d949753206a73739b42dc 100644 (file)
@@ -1,9 +1,95 @@
-include $(top_srcdir)/config/Shellcheck.am
+sudoersddir = $(sysconfdir)/sudoers.d
+sudoersd_DATA = \
+       %D%/sudoers.d/zfs
+
+EXTRA_DIST += $(sudoersd_DATA)
+
+
+sysconf_zfsdir = $(sysconfdir)/zfs
+
+dist_sysconf_zfs_DATA = \
+       %D%/zfs/vdev_id.conf.alias.example \
+       %D%/zfs/vdev_id.conf.multipath.example \
+       %D%/zfs/vdev_id.conf.sas_direct.example \
+       %D%/zfs/vdev_id.conf.sas_switch.example \
+       %D%/zfs/vdev_id.conf.scsi.example
+
+sysconf_zfs_SCRIPTS = \
+       %D%/zfs/zfs-functions
+
+SUBSTFILES          += $(sysconf_zfs_SCRIPTS)
+SHELLCHECKSCRIPTS   += $(sysconf_zfs_SCRIPTS)
+$(call SHELLCHECK_OPTS,$(sysconf_zfs_SCRIPTS)): SHELLCHECK_SHELL = sh
 
-SUBDIRS = zfs sudoers.d
-SHELLCHECKDIRS = default $(ZFS_INIT_SYSV) zfs
 
 if BUILD_LINUX
-SUBDIRS += default $(ZFS_INIT_SYSTEMD) $(ZFS_INIT_SYSV) $(ZFS_MODULE_LOAD)
+initconf_SCRIPTS = \
+       %D%/default/zfs
+
+SUBSTFILES          += $(initconf_SCRIPTS)
+SHELLCHECKSCRIPTS   += $(initconf_SCRIPTS)
+$(call SHELLCHECK_OPTS,$(initconf_SCRIPTS)): SHELLCHECK_SHELL = sh
+
+
+if INIT_SYSV
+EXTRA_DIST += $(addprefix %D%/,init.d/README.md)
+
+init_SCRIPTS = \
+       %D%/init.d/zfs-import \
+       %D%/init.d/zfs-load-key \
+       %D%/init.d/zfs-mount \
+       %D%/init.d/zfs-share \
+       %D%/init.d/zfs-zed
+
+SUBSTFILES        += $(init_SCRIPTS)
+SHELLCHECKSCRIPTS += $(init_SCRIPTS)
+$(call SHELLCHECK_OPTS,$(init_SCRIPTS)): SHELLCHECK_SHELL = sh
+endif
+
+
+if INIT_SYSTEMD
+dist_systemdpreset_DATA = \
+       %D%/systemd/system/50-zfs.preset
+
+systemdunit_DATA = \
+       %D%/systemd/system/zfs-import-cache.service \
+       %D%/systemd/system/zfs-import-scan.service \
+       %D%/systemd/system/zfs-import.target \
+       %D%/systemd/system/zfs-mount.service \
+       %D%/systemd/system/zfs-scrub-monthly@.timer \
+       %D%/systemd/system/zfs-scrub-weekly@.timer \
+       %D%/systemd/system/zfs-scrub@.service \
+       %D%/systemd/system/zfs-share.service \
+       %D%/systemd/system/zfs-volume-wait.service \
+       %D%/systemd/system/zfs-volumes.target \
+       %D%/systemd/system/zfs-zed.service \
+       %D%/systemd/system/zfs.target
+
+SUBSTFILES += $(systemdunit_DATA)
+
+INSTALL_DATA_HOOKS += systemd-install-data-hook
+systemd-install-data-hook:
+       $(MKDIR_P) "$(DESTDIR)$(systemdunitdir)"
+       ln -sf /dev/null "$(DESTDIR)$(systemdunitdir)/zfs-import.service"
+
+
+systemdgenerator_PROGRAMS = \
+       %D%/systemd/system-generators/zfs-mount-generator
+
+%C%_systemd_system_generators_zfs_mount_generator_SOURCES = \
+       %D%/systemd/system-generators/zfs-mount-generator.c
+
+%C%_systemd_system_generators_zfs_mount_generator_LDADD = \
+       libzfs.la
+
+%C%_systemd_system_generators_zfs_mount_generator_LDFLAGS = -pthread
+
+CPPCHECKTARGETS += $(systemdgenerator_PROGRAMS)
+endif
+
+
+if WANT_MODULES_LOAD_D
+dist_modulesload_DATA = \
+       %D%/modules-load.d/zfs.conf
+endif
 endif
-DIST_SUBDIRS = default init.d zfs systemd modules-load.d sudoers.d
diff --git a/etc/default/Makefile.am b/etc/default/Makefile.am
deleted file mode 100644 (file)
index 98f22b8..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-CLEANFILES =
-EXTRA_DIST =
-include $(top_srcdir)/config/Substfiles.am
-include $(top_srcdir)/config/Shellcheck.am
-
-initconf_SCRIPTS = zfs
-
-SUBSTFILES += $(initconf_SCRIPTS)
-
-SHELLCHECK_SHELL = sh
-SHELLCHECKSCRIPTS += $(initconf_SCRIPTS)
diff --git a/etc/init.d/Makefile.am b/etc/init.d/Makefile.am
deleted file mode 100644 (file)
index 0a997f4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-CLEANFILES =
-EXTRA_DIST =
-include $(top_srcdir)/config/Substfiles.am
-include $(top_srcdir)/config/Shellcheck.am
-
-EXTRA_DIST += README.md
-
-init_SCRIPTS = zfs-import zfs-load-key zfs-mount zfs-share zfs-zed
-
-SUBSTFILES += $(init_SCRIPTS)
-
-SHELLCHECK_SHELL = sh
-SHELLCHECKSCRIPTS += $(init_SCRIPTS)
diff --git a/etc/modules-load.d/.gitignore b/etc/modules-load.d/.gitignore
deleted file mode 100644 (file)
index fee9217..0000000
+++ /dev/null
@@ -1 +0,0 @@
-*.conf
diff --git a/etc/modules-load.d/Makefile.am b/etc/modules-load.d/Makefile.am
deleted file mode 100644 (file)
index 8a29557..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-dist_modulesload_DATA = \
-       zfs.conf
diff --git a/etc/sudoers.d/Makefile.am b/etc/sudoers.d/Makefile.am
deleted file mode 100644 (file)
index 6f7ac8d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-sudoersddir = $(sysconfdir)/sudoers.d
-sudoersd_DATA = zfs
-
-EXTRA_DIST = \
-       zfs
diff --git a/etc/systemd/Makefile.am b/etc/systemd/Makefile.am
deleted file mode 100644 (file)
index 7b47b93..0000000
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = system system-generators
diff --git a/etc/systemd/system-generators/Makefile.am b/etc/systemd/system-generators/Makefile.am
deleted file mode 100644 (file)
index ee51d1c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-systemdgenerator_PROGRAMS = \
-       zfs-mount-generator
-
-zfs_mount_generator_SOURCES = \
-       zfs-mount-generator.c
-
-zfs_mount_generator_LDADD = \
-       $(abs_top_builddir)/libzfs.la
-
-zfs_mount_generator_LDFLAGS = -pthread
-
-include $(top_srcdir)/config/CppCheck.am
-CPPCHECKTARGETS += zfs-mount-generator
index 4813c65a25a8ca2c91d730a67630c3a1e10f7056..95d33fdd436da9baf585d9b237a7e6e98d264237 100644 (file)
@@ -1,4 +1,3 @@
 *.service
 *.target
-*.preset
 *.timer
diff --git a/etc/systemd/system/50-zfs.preset b/etc/systemd/system/50-zfs.preset
new file mode 100644 (file)
index 0000000..e4056a9
--- /dev/null
@@ -0,0 +1,9 @@
+# ZFS is enabled by default
+enable zfs-import-cache.service
+disable zfs-import-scan.service
+enable zfs-import.target
+enable zfs-mount.service
+enable zfs-share.service
+enable zfs-zed.service
+enable zfs-volume-wait.service
+enable zfs.target
diff --git a/etc/systemd/system/50-zfs.preset.in b/etc/systemd/system/50-zfs.preset.in
deleted file mode 100644 (file)
index e4056a9..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# ZFS is enabled by default
-enable zfs-import-cache.service
-disable zfs-import-scan.service
-enable zfs-import.target
-enable zfs-mount.service
-enable zfs-share.service
-enable zfs-zed.service
-enable zfs-volume-wait.service
-enable zfs.target
diff --git a/etc/systemd/system/Makefile.am b/etc/systemd/system/Makefile.am
deleted file mode 100644 (file)
index b5fcddb..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-CLEANFILES =
-EXTRA_DIST =
-include $(top_srcdir)/config/Substfiles.am
-
-systemdpreset_DATA = \
-       50-zfs.preset
-
-systemdunit_DATA = \
-       zfs-zed.service \
-       zfs-import-cache.service \
-       zfs-import-scan.service \
-       zfs-mount.service \
-       zfs-share.service \
-       zfs-volume-wait.service \
-       zfs-import.target \
-       zfs-volumes.target \
-       zfs.target \
-       zfs-scrub-monthly@.timer \
-       zfs-scrub-weekly@.timer \
-       zfs-scrub@.service
-
-SUBSTFILES += $(systemdpreset_DATA) $(systemdunit_DATA)
-
-install-data-hook:
-       $(MKDIR_P) "$(DESTDIR)$(systemdunitdir)"
-       ln -sf /dev/null "$(DESTDIR)$(systemdunitdir)/zfs-import.service"
diff --git a/etc/zfs/Makefile.am b/etc/zfs/Makefile.am
deleted file mode 100644 (file)
index f62c687..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-CLEANFILES =
-EXTRA_DIST =
-include $(top_srcdir)/config/Substfiles.am
-include $(top_srcdir)/config/Shellcheck.am
-
-pkgsysconfdir = $(sysconfdir)/zfs
-
-dist_pkgsysconf_DATA = \
-       vdev_id.conf.alias.example \
-       vdev_id.conf.sas_direct.example \
-       vdev_id.conf.sas_switch.example \
-       vdev_id.conf.multipath.example \
-       vdev_id.conf.scsi.example
-
-pkgsysconf_SCRIPTS = \
-       zfs-functions
-
-SUBSTFILES += $(pkgsysconf_SCRIPTS)
-
-SHELLCHECK_SHELL = sh
-SHELLCHECKSCRIPTS += $(pkgsysconf_SCRIPTS)
index 73191549863ea9909267dcca468918ca8241dfc1..e839957d4c98989c94d58fda83e7ccba2dabc483 100644 (file)
@@ -1,3 +1,4 @@
+PHONY =
 include $(top_srcdir)/config/Shellcheck.am
 
 SUBDIRS = runfiles test-runner zfs-tests