1 AC_DEFUN([ZFS_AC_LICENSE], [
2 AC_MSG_CHECKING([zfs author])
3 AC_MSG_RESULT([$ZFS_META_AUTHOR])
5 AC_MSG_CHECKING([zfs license])
6 AC_MSG_RESULT([$ZFS_META_LICENSE])
9 AC_DEFUN([ZFS_AC_DEBUG_ENABLE], [
10 DEBUG_CFLAGS="-Werror"
11 DEBUG_CPPFLAGS="-DDEBUG -UNDEBUG"
13 DEBUG_ZFS="_with_debug"
15 AC_DEFINE(ZFS_DEBUG, 1, [zfs debugging enabled])
17 KERNEL_DEBUG_CFLAGS="-Werror"
18 KERNEL_DEBUG_CPPFLAGS="-DDEBUG -UNDEBUG"
21 AC_DEFUN([ZFS_AC_DEBUG_DISABLE], [
23 DEBUG_CPPFLAGS="-UDEBUG -DNDEBUG"
25 DEBUG_ZFS="_without_debug"
28 KERNEL_DEBUG_CFLAGS=""
29 KERNEL_DEBUG_CPPFLAGS="-UDEBUG -DNDEBUG"
33 dnl # When debugging is enabled:
34 dnl # - Enable all ASSERTs (-DDEBUG)
35 dnl # - Promote all compiler warnings to errors (-Werror)
37 dnl # (If INVARIANTS is detected, we need to force DEBUG, or strange panics
40 AC_DEFUN([ZFS_AC_DEBUG], [
41 AC_MSG_CHECKING([whether assertion support will be enabled])
42 AC_ARG_ENABLE([debug],
43 [AS_HELP_STRING([--enable-debug],
44 [Enable compiler and code assertions @<:@default=no@:>@])],
48 AS_CASE(["x$enable_debug"],
50 [ZFS_AC_DEBUG_ENABLE],
52 [ZFS_AC_DEBUG_DISABLE],
53 [AC_MSG_ERROR([Unknown option $enable_debug])])
55 AS_CASE(["x$enable_invariants"],
60 [ZFS_AC_DEBUG_INVARIANTS_DETECT])
62 AS_CASE(["x$enable_invariants"],
64 [ZFS_AC_DEBUG_ENABLE],
67 [AC_MSG_ERROR([Unknown option $enable_invariants])])
69 AC_SUBST(DEBUG_CFLAGS)
70 AC_SUBST(DEBUG_CPPFLAGS)
71 AC_SUBST(DEBUG_LDFLAGS)
75 AC_SUBST(KERNEL_DEBUG_CFLAGS)
76 AC_SUBST(KERNEL_DEBUG_CPPFLAGS)
78 AC_MSG_RESULT([$enable_debug])
81 AC_DEFUN([ZFS_AC_DEBUGINFO_ENABLE], [
82 DEBUG_CFLAGS="$DEBUG_CFLAGS -g -fno-inline $NO_IPA_SRA"
84 KERNEL_DEBUG_CFLAGS="$KERNEL_DEBUG_CFLAGS -fno-inline $NO_IPA_SRA"
85 KERNEL_MAKE="$KERNEL_MAKE CONFIG_DEBUG_INFO=y"
87 DEBUGINFO_ZFS="_with_debuginfo"
90 AC_DEFUN([ZFS_AC_DEBUGINFO_DISABLE], [
91 DEBUGINFO_ZFS="_without_debuginfo"
94 AC_DEFUN([ZFS_AC_DEBUGINFO], [
95 AC_MSG_CHECKING([whether debuginfo support will be forced])
96 AC_ARG_ENABLE([debuginfo],
97 [AS_HELP_STRING([--enable-debuginfo],
98 [Force generation of debuginfo @<:@default=no@:>@])],
100 [enable_debuginfo=no])
102 AS_CASE(["x$enable_debuginfo"],
104 [ZFS_AC_DEBUGINFO_ENABLE],
106 [ZFS_AC_DEBUGINFO_DISABLE],
107 [AC_MSG_ERROR([Unknown option $enable_debuginfo])])
109 AC_SUBST(DEBUG_CFLAGS)
110 AC_SUBST(DEBUGINFO_ZFS)
112 AC_SUBST(KERNEL_DEBUG_CFLAGS)
113 AC_SUBST(KERNEL_MAKE)
115 AC_MSG_RESULT([$enable_debuginfo])
119 dnl # Disabled by default, provides basic memory tracking. Track the total
120 dnl # number of bytes allocated with kmem_alloc() and freed with kmem_free().
121 dnl # Then at module unload time if any bytes were leaked it will be reported
122 dnl # on the console.
124 AC_DEFUN([ZFS_AC_DEBUG_KMEM], [
125 AC_MSG_CHECKING([whether basic kmem accounting is enabled])
126 AC_ARG_ENABLE([debug-kmem],
127 [AS_HELP_STRING([--enable-debug-kmem],
128 [Enable basic kmem accounting @<:@default=no@:>@])],
130 [enable_debug_kmem=no])
132 AS_IF([test "x$enable_debug_kmem" = xyes], [
133 KERNEL_DEBUG_CPPFLAGS="${KERNEL_DEBUG_CPPFLAGS} -DDEBUG_KMEM"
134 DEBUG_KMEM_ZFS="_with_debug_kmem"
136 DEBUG_KMEM_ZFS="_without_debug_kmem"
139 AC_SUBST(KERNEL_DEBUG_CPPFLAGS)
140 AC_SUBST(DEBUG_KMEM_ZFS)
142 AC_MSG_RESULT([$enable_debug_kmem])
146 dnl # Disabled by default, provides detailed memory tracking. This feature
147 dnl # also requires --enable-debug-kmem to be set. When enabled not only will
148 dnl # total bytes be tracked but also the location of every kmem_alloc() and
149 dnl # kmem_free(). When the module is unloaded a list of all leaked addresses
150 dnl # and where they were allocated will be dumped to the console. Enabling
151 dnl # this feature has a significant impact on performance but it makes finding
152 dnl # memory leaks straight forward.
154 AC_DEFUN([ZFS_AC_DEBUG_KMEM_TRACKING], [
155 AC_MSG_CHECKING([whether detailed kmem tracking is enabled])
156 AC_ARG_ENABLE([debug-kmem-tracking],
157 [AS_HELP_STRING([--enable-debug-kmem-tracking],
158 [Enable detailed kmem tracking @<:@default=no@:>@])],
160 [enable_debug_kmem_tracking=no])
162 AS_IF([test "x$enable_debug_kmem_tracking" = xyes], [
163 KERNEL_DEBUG_CPPFLAGS="${KERNEL_DEBUG_CPPFLAGS} -DDEBUG_KMEM_TRACKING"
164 DEBUG_KMEM_TRACKING_ZFS="_with_debug_kmem_tracking"
166 DEBUG_KMEM_TRACKING_ZFS="_without_debug_kmem_tracking"
169 AC_SUBST(KERNEL_DEBUG_CPPFLAGS)
170 AC_SUBST(DEBUG_KMEM_TRACKING_ZFS)
172 AC_MSG_RESULT([$enable_debug_kmem_tracking])
175 AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS_DETECT_FREEBSD], [
176 AS_IF([sysctl -n kern.conftxt | grep -Fqx $'options\tINVARIANTS'],
177 [enable_invariants="yes"],
178 [enable_invariants="no"])
181 AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS_DETECT], [
182 AM_COND_IF([BUILD_FREEBSD],
183 [ZFS_AC_DEBUG_INVARIANTS_DETECT_FREEBSD],
184 [enable_invariants="no"])
188 dnl # Detected for the running kernel by default, enables INVARIANTS features
189 dnl # in the FreeBSD kernel module. This feature must be used when building
190 dnl # for a FreeBSD kernel with "options INVARIANTS" in the KERNCONF and must
191 dnl # not be used when the INVARIANTS option is absent.
193 AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS], [
194 AC_MSG_CHECKING([whether FreeBSD kernel INVARIANTS checks are enabled])
195 AC_ARG_ENABLE([invariants],
196 [AS_HELP_STRING([--enable-invariants],
197 [Enable FreeBSD kernel INVARIANTS checks [[default: detect]]])],
198 [], [ZFS_AC_DEBUG_INVARIANTS_DETECT])
200 AS_IF([test "x$enable_invariants" = xyes],
201 [WITH_INVARIANTS="true"],
202 [WITH_INVARIANTS=""])
203 AC_SUBST(WITH_INVARIANTS)
205 AC_MSG_RESULT([$enable_invariants])
208 AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
212 ZFS_AC_CONFIG_ALWAYS_CC_NO_CLOBBERED
213 ZFS_AC_CONFIG_ALWAYS_CC_INFINITE_RECURSION
214 ZFS_AC_CONFIG_ALWAYS_CC_IMPLICIT_FALLTHROUGH
215 ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN
216 ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_TRUNCATION
217 ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_ZERO_LENGTH
218 ZFS_AC_CONFIG_ALWAYS_CC_NO_OMIT_FRAME_POINTER
219 ZFS_AC_CONFIG_ALWAYS_CC_NO_IPA_SRA
220 ZFS_AC_CONFIG_ALWAYS_CC_ASAN
221 ZFS_AC_CONFIG_ALWAYS_CC_UBSAN
222 ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_SIMD
223 ZFS_AC_CONFIG_ALWAYS_SYSTEM
224 ZFS_AC_CONFIG_ALWAYS_ARCH
225 ZFS_AC_CONFIG_ALWAYS_PYTHON
226 ZFS_AC_CONFIG_ALWAYS_PYZFS
227 ZFS_AC_CONFIG_ALWAYS_SED
228 ZFS_AC_CONFIG_ALWAYS_CPPCHECK
229 ZFS_AC_CONFIG_ALWAYS_SHELLCHECK
230 ZFS_AC_CONFIG_ALWAYS_PARALLEL
233 AC_DEFUN([ZFS_AC_CONFIG], [
235 dnl # Remove the previous build test directory.
239 AC_ARG_WITH([config],
240 AS_HELP_STRING([--with-config=CONFIG],
241 [Config file 'kernel|user|all|srpm']),
242 [ZFS_CONFIG="$withval"])
243 AC_ARG_ENABLE([linux-builtin],
244 [AS_HELP_STRING([--enable-linux-builtin],
245 [Configure for builtin in-tree kernel modules @<:@default=no@:>@])],
247 [enable_linux_builtin=no])
249 AC_MSG_CHECKING([zfs config])
250 AC_MSG_RESULT([$ZFS_CONFIG]);
255 AM_COND_IF([BUILD_LINUX], [
256 AC_ARG_VAR([TEST_JOBS], [simultaneous jobs during configure])
257 if test "x$ac_cv_env_TEST_JOBS_set" != "xset"; then
265 ZFS_WANT_MODULES_LOAD_D=
267 case "$ZFS_CONFIG" in
268 kernel) ZFS_AC_CONFIG_KERNEL ;;
269 user) ZFS_AC_CONFIG_USER ;;
270 all) ZFS_AC_CONFIG_USER
271 ZFS_AC_CONFIG_KERNEL ;;
275 AC_MSG_RESULT([Error!])
276 AC_MSG_ERROR([Bad value "$ZFS_CONFIG" for --with-config,
277 user kernel|user|all|srpm]) ;;
280 AM_CONDITIONAL([INIT_SYSV], [test "x$ZFS_INIT_SYSV" = "xyes"])
281 AM_CONDITIONAL([INIT_SYSTEMD], [test "x$ZFS_INIT_SYSTEMD" = "xyes"])
282 AM_CONDITIONAL([WANT_MODULES_LOAD_D], [test "x$ZFS_WANT_MODULES_LOAD_D" = "xyes"])
284 AM_CONDITIONAL([CONFIG_USER],
285 [test "$ZFS_CONFIG" = user -o "$ZFS_CONFIG" = all])
286 AM_CONDITIONAL([CONFIG_KERNEL],
287 [test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] &&
288 [test "x$enable_linux_builtin" != xyes ])
289 AM_CONDITIONAL([CONFIG_QAT],
290 [test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] &&
291 [test "x$qatsrc" != x ])
292 AM_CONDITIONAL([WANT_DEVNAME2DEVID], [test "x$user_libudev" = xyes ])
293 AM_CONDITIONAL([WANT_MMAP_LIBAIO], [test "x$user_libaio" = xyes ])
294 AM_CONDITIONAL([PAM_ZFS_ENABLED], [test "x$enable_pam" = xyes])
298 dnl # Check for rpm+rpmbuild to build RPM packages. If these tools
299 dnl # are missing it is non-fatal but you will not be able to build
300 dnl # RPM packages and will be warned if you try too.
302 dnl # By default the generic spec file will be used because it requires
303 dnl # minimal dependencies. Distribution specific spec files can be
304 dnl # placed under the 'rpm/<distribution>' directory and enabled using
305 dnl # the --with-spec=<distribution> configure option.
307 AC_DEFUN([ZFS_AC_RPM], [
311 AC_MSG_CHECKING([whether $RPM is available])
312 AS_IF([tmp=$($RPM --version 2>/dev/null)], [
313 RPM_VERSION=$(echo $tmp | $AWK '/RPM/ { print $[3] }')
315 AC_MSG_RESULT([$HAVE_RPM ($RPM_VERSION)])
318 AC_MSG_RESULT([$HAVE_RPM])
321 AC_MSG_CHECKING([whether $RPMBUILD is available])
322 AS_IF([tmp=$($RPMBUILD --version 2>/dev/null)], [
323 RPMBUILD_VERSION=$(echo $tmp | $AWK '/RPM/ { print $[3] }')
325 AC_MSG_RESULT([$HAVE_RPMBUILD ($RPMBUILD_VERSION)])
328 AC_MSG_RESULT([$HAVE_RPMBUILD])
331 RPM_DEFINE_COMMON='--define "$(DEBUG_ZFS) 1"'
332 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUGINFO_ZFS) 1"'
333 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUG_KMEM_ZFS) 1"'
334 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUG_KMEM_TRACKING_ZFS) 1"'
335 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(ASAN_ZFS) 1"'
336 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(UBSAN_ZFS) 1"'
338 AS_IF([test "x$enable_debuginfo" = xyes], [
339 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "__strip /bin/true"'
342 RPM_DEFINE_UTIL=' --define "_initconfdir $(initconfdir)"'
344 dnl # Make the next three RPM_DEFINE_UTIL additions conditional, since
345 dnl # their values may not be set when running:
347 dnl # ./configure --with-config=srpm
349 AS_IF([test -n "$dracutdir" ], [
350 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_dracutdir $(dracutdir)"'
352 AS_IF([test -n "$udevdir" ], [
353 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_udevdir $(udevdir)"'
355 AS_IF([test -n "$udevruledir" ], [
356 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_udevruledir $(udevruledir)"'
358 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_SYSTEMD)'
359 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYZFS)'
360 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PAM)'
361 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYTHON_VERSION)'
362 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYTHON_PKG_VERSION)'
364 dnl # Override default lib directory on Debian/Ubuntu systems. The
365 dnl # provided /usr/lib/rpm/platform/<arch>/macros files do not
366 dnl # specify the correct path for multiarch systems as described
367 dnl # by the packaging guidelines.
369 dnl # https://wiki.ubuntu.com/MultiarchSpec
370 dnl # https://wiki.debian.org/Multiarch/Implementation
372 AS_IF([test "$DEFAULT_PACKAGE" = "deb"], [
373 MULTIARCH_LIBDIR="lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
374 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_lib $(MULTIARCH_LIBDIR)"'
375 AC_SUBST(MULTIARCH_LIBDIR)
378 dnl # Make RPM_DEFINE_KMOD additions conditional on CONFIG_KERNEL,
379 dnl # since the values will not be set otherwise. The spec files
380 dnl # provide defaults for them.
382 RPM_DEFINE_KMOD='--define "_wrong_version_format_terminate_build 0"'
383 AM_COND_IF([CONFIG_KERNEL], [
384 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernels $(LINUX_VERSION)"'
385 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "ksrc $(LINUX)"'
386 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kobj $(LINUX_OBJ)"'
387 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernel_cc KERNEL_CC=$(KERNEL_CC)"'
388 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernel_ld KERNEL_LD=$(KERNEL_LD)"'
389 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernel_llvm KERNEL_LLVM=$(KERNEL_LLVM)"'
394 SRPM_DEFINE_COMMON='--define "build_src_rpm 1"'
399 RPM_SPEC_DIR="rpm/generic"
401 AS_HELP_STRING([--with-spec=SPEC],
402 [Spec files 'generic|redhat']),
403 [RPM_SPEC_DIR="rpm/$withval"])
405 AC_MSG_CHECKING([whether spec files are available])
406 AC_MSG_RESULT([yes ($RPM_SPEC_DIR/*.spec.in)])
410 AC_SUBST(RPM_VERSION)
412 AC_SUBST(HAVE_RPMBUILD)
414 AC_SUBST(RPMBUILD_VERSION)
416 AC_SUBST(RPM_SPEC_DIR)
417 AC_SUBST(RPM_DEFINE_UTIL)
418 AC_SUBST(RPM_DEFINE_KMOD)
419 AC_SUBST(RPM_DEFINE_DKMS)
420 AC_SUBST(RPM_DEFINE_COMMON)
421 AC_SUBST(SRPM_DEFINE_UTIL)
422 AC_SUBST(SRPM_DEFINE_KMOD)
423 AC_SUBST(SRPM_DEFINE_DKMS)
424 AC_SUBST(SRPM_DEFINE_COMMON)
428 dnl # Check for dpkg+dpkg-buildpackage to build DEB packages. If these
429 dnl # tools are missing it is non-fatal but you will not be able to build
430 dnl # DEB packages and will be warned if you try too.
432 AC_DEFUN([ZFS_AC_DPKG], [
434 DPKGBUILD=dpkg-buildpackage
436 AC_MSG_CHECKING([whether $DPKG is available])
437 AS_IF([tmp=$($DPKG --version 2>/dev/null)], [
438 DPKG_VERSION=$(echo $tmp | $AWK '/Debian/ { print $[7] }')
440 AC_MSG_RESULT([$HAVE_DPKG ($DPKG_VERSION)])
443 AC_MSG_RESULT([$HAVE_DPKG])
446 AC_MSG_CHECKING([whether $DPKGBUILD is available])
447 AS_IF([tmp=$($DPKGBUILD --version 2>/dev/null)], [
448 DPKGBUILD_VERSION=$(echo $tmp | \
449 $AWK '/Debian/ { print $[4] }' | cut -f-4 -d'.')
451 AC_MSG_RESULT([$HAVE_DPKGBUILD ($DPKGBUILD_VERSION)])
454 AC_MSG_RESULT([$HAVE_DPKGBUILD])
459 AC_SUBST(DPKG_VERSION)
461 AC_SUBST(HAVE_DPKGBUILD)
463 AC_SUBST(DPKGBUILD_VERSION)
467 dnl # Until native packaging for various different packing systems
468 dnl # can be added the least we can do is attempt to use alien to
469 dnl # convert the RPM packages to the needed package type. This is
470 dnl # a hack but so far it has worked reasonable well.
472 AC_DEFUN([ZFS_AC_ALIEN], [
475 AC_MSG_CHECKING([whether $ALIEN is available])
476 AS_IF([tmp=$($ALIEN --version 2>/dev/null)], [
477 ALIEN_VERSION=$(echo $tmp | $AWK '{ print $[3] }')
478 ALIEN_MAJOR=$(echo ${ALIEN_VERSION} | $AWK -F'.' '{ print $[1] }')
479 ALIEN_MINOR=$(echo ${ALIEN_VERSION} | $AWK -F'.' '{ print $[2] }')
480 ALIEN_POINT=$(echo ${ALIEN_VERSION} | $AWK -F'.' '{ print $[3] }')
482 AC_MSG_RESULT([$HAVE_ALIEN ($ALIEN_VERSION)])
485 AC_MSG_RESULT([$HAVE_ALIEN])
490 AC_SUBST(ALIEN_VERSION)
491 AC_SUBST(ALIEN_MAJOR)
492 AC_SUBST(ALIEN_MINOR)
493 AC_SUBST(ALIEN_POINT)
497 dnl # Using the VENDOR tag from config.guess set the default
498 dnl # package type for 'make pkg': (rpm | deb | tgz)
500 AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
501 AC_MSG_CHECKING([os distribution])
502 AC_ARG_WITH([vendor],
503 [AS_HELP_STRING([--with-vendor],
504 [Distribution vendor @<:@default=check@:>@])],
505 [with_vendor=$withval],
507 AS_IF([test "x$with_vendor" = "xcheck"],[
508 if test -f /etc/toss-release ; then
510 elif test -f /etc/fedora-release ; then
512 elif test -f /etc/redhat-release ; then
514 elif test -f /etc/gentoo-release ; then
516 elif test -f /etc/arch-release ; then
518 elif test -f /etc/SuSE-release ; then
520 elif test -f /etc/slackware-version ; then
522 elif test -f /etc/lunar.release ; then
524 elif test -f /etc/lsb-release ; then
526 elif test -f /etc/debian_version ; then
528 elif test -f /etc/alpine-release ; then
530 elif test -f /bin/freebsd-version ; then
535 [ test "x${with_vendor}" != x],[
536 VENDOR="$with_vendor" ],
539 AC_MSG_RESULT([$VENDOR])
542 AC_MSG_CHECKING([default package type])
544 toss) DEFAULT_PACKAGE=rpm ;;
545 redhat) DEFAULT_PACKAGE=rpm ;;
546 fedora) DEFAULT_PACKAGE=rpm ;;
547 gentoo) DEFAULT_PACKAGE=tgz ;;
548 alpine) DEFAULT_PACKAGE=tgz ;;
549 arch) DEFAULT_PACKAGE=tgz ;;
550 sles) DEFAULT_PACKAGE=rpm ;;
551 slackware) DEFAULT_PACKAGE=tgz ;;
552 lunar) DEFAULT_PACKAGE=tgz ;;
553 ubuntu) DEFAULT_PACKAGE=deb ;;
554 debian) DEFAULT_PACKAGE=deb ;;
555 freebsd) DEFAULT_PACKAGE=pkg ;;
556 *) DEFAULT_PACKAGE=rpm ;;
558 AC_MSG_RESULT([$DEFAULT_PACKAGE])
559 AC_SUBST(DEFAULT_PACKAGE)
561 AC_MSG_CHECKING([default init directory])
563 freebsd) initdir=$sysconfdir/rc.d ;;
564 *) initdir=$sysconfdir/init.d;;
566 AC_MSG_RESULT([$initdir])
569 AC_MSG_CHECKING([default init script type and shell])
571 toss) DEFAULT_INIT_SCRIPT=redhat ;;
572 redhat) DEFAULT_INIT_SCRIPT=redhat ;;
573 fedora) DEFAULT_INIT_SCRIPT=fedora ;;
574 gentoo) DEFAULT_INIT_SCRIPT=openrc ;;
575 alpine) DEFAULT_INIT_SCRIPT=openrc ;;
576 arch) DEFAULT_INIT_SCRIPT=lsb ;;
577 sles) DEFAULT_INIT_SCRIPT=lsb ;;
578 slackware) DEFAULT_INIT_SCRIPT=lsb ;;
579 lunar) DEFAULT_INIT_SCRIPT=lunar ;;
580 ubuntu) DEFAULT_INIT_SCRIPT=lsb ;;
581 debian) DEFAULT_INIT_SCRIPT=lsb ;;
582 freebsd) DEFAULT_INIT_SCRIPT=freebsd;;
583 *) DEFAULT_INIT_SCRIPT=lsb ;;
587 gentoo) DEFAULT_INIT_SHELL="/sbin/openrc-run";;
588 alpine) DEFAULT_INIT_SHELL="/sbin/openrc-run";;
589 *) DEFAULT_INIT_SHELL="/bin/sh" ;;
592 AC_MSG_RESULT([$DEFAULT_INIT_SCRIPT:$DEFAULT_INIT_SHELL])
593 AC_SUBST(DEFAULT_INIT_SCRIPT)
594 AC_SUBST(DEFAULT_INIT_SHELL)
596 AC_MSG_CHECKING([default nfs server init script])
597 AS_IF([test "$VENDOR" = "debian"],
598 [DEFAULT_INIT_NFS_SERVER="nfs-kernel-server"],
599 [DEFAULT_INIT_NFS_SERVER="nfs"]
601 AC_MSG_RESULT([$DEFAULT_INIT_NFS_SERVER])
602 AC_SUBST(DEFAULT_INIT_NFS_SERVER)
604 AC_MSG_CHECKING([default init config directory])
606 alpine) initconfdir=/etc/conf.d ;;
607 gentoo) initconfdir=/etc/conf.d ;;
608 toss) initconfdir=/etc/sysconfig ;;
609 redhat) initconfdir=/etc/sysconfig ;;
610 fedora) initconfdir=/etc/sysconfig ;;
611 sles) initconfdir=/etc/sysconfig ;;
612 ubuntu) initconfdir=/etc/default ;;
613 debian) initconfdir=/etc/default ;;
614 freebsd) initconfdir=$sysconfdir/rc.conf.d;;
615 *) initconfdir=/etc/default ;;
617 AC_MSG_RESULT([$initconfdir])
618 AC_SUBST(initconfdir)
620 AC_MSG_CHECKING([whether initramfs-tools is available])
621 if test -d /usr/share/initramfs-tools ; then
622 RPM_DEFINE_INITRAMFS='--define "_initramfs 1"'
625 RPM_DEFINE_INITRAMFS=''
628 AC_SUBST(RPM_DEFINE_INITRAMFS)
632 dnl # Default ZFS package configuration
634 AC_DEFUN([ZFS_AC_PACKAGE], [
635 ZFS_AC_DEFAULT_PACKAGE
636 AS_IF([test x$VENDOR != xfreebsd], [