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 | fgrep -qx $'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_IMPLICIT_FALLTHROUGH
214 ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN
215 ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_TRUNCATION
216 ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_ZERO_LENGTH
217 ZFS_AC_CONFIG_ALWAYS_CC_NO_OMIT_FRAME_POINTER
218 ZFS_AC_CONFIG_ALWAYS_CC_NO_IPA_SRA
219 ZFS_AC_CONFIG_ALWAYS_CC_ASAN
220 ZFS_AC_CONFIG_ALWAYS_CC_UBSAN
221 ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_SIMD
222 ZFS_AC_CONFIG_ALWAYS_SYSTEM
223 ZFS_AC_CONFIG_ALWAYS_ARCH
224 ZFS_AC_CONFIG_ALWAYS_PYTHON
225 ZFS_AC_CONFIG_ALWAYS_PYZFS
226 ZFS_AC_CONFIG_ALWAYS_SED
227 ZFS_AC_CONFIG_ALWAYS_CPPCHECK
228 ZFS_AC_CONFIG_ALWAYS_SHELLCHECK
229 ZFS_AC_CONFIG_ALWAYS_PARALLEL
232 AC_DEFUN([ZFS_AC_CONFIG], [
234 dnl # Remove the previous build test directory.
238 AC_ARG_WITH([config],
239 AS_HELP_STRING([--with-config=CONFIG],
240 [Config file 'kernel|user|all|srpm']),
241 [ZFS_CONFIG="$withval"])
242 AC_ARG_ENABLE([linux-builtin],
243 [AS_HELP_STRING([--enable-linux-builtin],
244 [Configure for builtin in-tree kernel modules @<:@default=no@:>@])],
246 [enable_linux_builtin=no])
248 AC_MSG_CHECKING([zfs config])
249 AC_MSG_RESULT([$ZFS_CONFIG]);
254 AM_COND_IF([BUILD_LINUX], [
255 AC_ARG_VAR([TEST_JOBS], [simultaneous jobs during configure])
256 if test "x$ac_cv_env_TEST_JOBS_set" != "xset"; then
262 case "$ZFS_CONFIG" in
263 kernel) ZFS_AC_CONFIG_KERNEL ;;
264 user) ZFS_AC_CONFIG_USER ;;
265 all) ZFS_AC_CONFIG_USER
266 ZFS_AC_CONFIG_KERNEL ;;
269 AC_MSG_RESULT([Error!])
270 AC_MSG_ERROR([Bad value "$ZFS_CONFIG" for --with-config,
271 user kernel|user|all|srpm]) ;;
274 AM_CONDITIONAL([CONFIG_USER],
275 [test "$ZFS_CONFIG" = user -o "$ZFS_CONFIG" = all])
276 AM_CONDITIONAL([CONFIG_KERNEL],
277 [test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] &&
278 [test "x$enable_linux_builtin" != xyes ])
279 AM_CONDITIONAL([CONFIG_QAT],
280 [test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] &&
281 [test "x$qatsrc" != x ])
282 AM_CONDITIONAL([WANT_DEVNAME2DEVID], [test "x$user_libudev" = xyes ])
283 AM_CONDITIONAL([WANT_MMAP_LIBAIO], [test "x$user_libaio" = xyes ])
284 AM_CONDITIONAL([PAM_ZFS_ENABLED], [test "x$enable_pam" = xyes])
288 dnl # Check for rpm+rpmbuild to build RPM packages. If these tools
289 dnl # are missing it is non-fatal but you will not be able to build
290 dnl # RPM packages and will be warned if you try too.
292 dnl # By default the generic spec file will be used because it requires
293 dnl # minimal dependencies. Distribution specific spec files can be
294 dnl # placed under the 'rpm/<distribution>' directory and enabled using
295 dnl # the --with-spec=<distribution> configure option.
297 AC_DEFUN([ZFS_AC_RPM], [
301 AC_MSG_CHECKING([whether $RPM is available])
302 AS_IF([tmp=$($RPM --version 2>/dev/null)], [
303 RPM_VERSION=$(echo $tmp | $AWK '/RPM/ { print $[3] }')
305 AC_MSG_RESULT([$HAVE_RPM ($RPM_VERSION)])
308 AC_MSG_RESULT([$HAVE_RPM])
311 AC_MSG_CHECKING([whether $RPMBUILD is available])
312 AS_IF([tmp=$($RPMBUILD --version 2>/dev/null)], [
313 RPMBUILD_VERSION=$(echo $tmp | $AWK '/RPM/ { print $[3] }')
315 AC_MSG_RESULT([$HAVE_RPMBUILD ($RPMBUILD_VERSION)])
318 AC_MSG_RESULT([$HAVE_RPMBUILD])
321 RPM_DEFINE_COMMON='--define "$(DEBUG_ZFS) 1"'
322 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUGINFO_ZFS) 1"'
323 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUG_KMEM_ZFS) 1"'
324 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUG_KMEM_TRACKING_ZFS) 1"'
325 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(ASAN_ZFS) 1"'
326 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(UBSAN_ZFS) 1"'
328 RPM_DEFINE_UTIL=' --define "_initconfdir $(initconfdir)"'
330 dnl # Make the next three RPM_DEFINE_UTIL additions conditional, since
331 dnl # their values may not be set when running:
333 dnl # ./configure --with-config=srpm
335 AS_IF([test -n "$dracutdir" ], [
336 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_dracutdir $(dracutdir)"'
338 AS_IF([test -n "$udevdir" ], [
339 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_udevdir $(udevdir)"'
341 AS_IF([test -n "$udevruledir" ], [
342 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_udevruledir $(udevruledir)"'
344 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_SYSTEMD)'
345 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYZFS)'
346 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PAM)'
347 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYTHON_VERSION)'
348 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYTHON_PKG_VERSION)'
350 dnl # Override default lib directory on Debian/Ubuntu systems. The
351 dnl # provided /usr/lib/rpm/platform/<arch>/macros files do not
352 dnl # specify the correct path for multiarch systems as described
353 dnl # by the packaging guidelines.
355 dnl # https://wiki.ubuntu.com/MultiarchSpec
356 dnl # https://wiki.debian.org/Multiarch/Implementation
358 AS_IF([test "$DEFAULT_PACKAGE" = "deb"], [
359 MULTIARCH_LIBDIR="lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
360 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_lib $(MULTIARCH_LIBDIR)"'
361 AC_SUBST(MULTIARCH_LIBDIR)
364 dnl # Make RPM_DEFINE_KMOD additions conditional on CONFIG_KERNEL,
365 dnl # since the values will not be set otherwise. The spec files
366 dnl # provide defaults for them.
368 RPM_DEFINE_KMOD='--define "_wrong_version_format_terminate_build 0"'
369 AM_COND_IF([CONFIG_KERNEL], [
370 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernels $(LINUX_VERSION)"'
371 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "ksrc $(LINUX)"'
372 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kobj $(LINUX_OBJ)"'
373 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernel_cc KERNEL_CC=$(KERNEL_CC)"'
374 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernel_ld KERNEL_LD=$(KERNEL_LD)"'
375 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernel_llvm KERNEL_LLVM=$(KERNEL_LLVM)"'
380 SRPM_DEFINE_COMMON='--define "build_src_rpm 1"'
385 RPM_SPEC_DIR="rpm/generic"
387 AS_HELP_STRING([--with-spec=SPEC],
388 [Spec files 'generic|redhat']),
389 [RPM_SPEC_DIR="rpm/$withval"])
391 AC_MSG_CHECKING([whether spec files are available])
392 AC_MSG_RESULT([yes ($RPM_SPEC_DIR/*.spec.in)])
396 AC_SUBST(RPM_VERSION)
398 AC_SUBST(HAVE_RPMBUILD)
400 AC_SUBST(RPMBUILD_VERSION)
402 AC_SUBST(RPM_SPEC_DIR)
403 AC_SUBST(RPM_DEFINE_UTIL)
404 AC_SUBST(RPM_DEFINE_KMOD)
405 AC_SUBST(RPM_DEFINE_DKMS)
406 AC_SUBST(RPM_DEFINE_COMMON)
407 AC_SUBST(SRPM_DEFINE_UTIL)
408 AC_SUBST(SRPM_DEFINE_KMOD)
409 AC_SUBST(SRPM_DEFINE_DKMS)
410 AC_SUBST(SRPM_DEFINE_COMMON)
414 dnl # Check for dpkg+dpkg-buildpackage to build DEB packages. If these
415 dnl # tools are missing it is non-fatal but you will not be able to build
416 dnl # DEB packages and will be warned if you try too.
418 AC_DEFUN([ZFS_AC_DPKG], [
420 DPKGBUILD=dpkg-buildpackage
422 AC_MSG_CHECKING([whether $DPKG is available])
423 AS_IF([tmp=$($DPKG --version 2>/dev/null)], [
424 DPKG_VERSION=$(echo $tmp | $AWK '/Debian/ { print $[7] }')
426 AC_MSG_RESULT([$HAVE_DPKG ($DPKG_VERSION)])
429 AC_MSG_RESULT([$HAVE_DPKG])
432 AC_MSG_CHECKING([whether $DPKGBUILD is available])
433 AS_IF([tmp=$($DPKGBUILD --version 2>/dev/null)], [
434 DPKGBUILD_VERSION=$(echo $tmp | \
435 $AWK '/Debian/ { print $[4] }' | cut -f-4 -d'.')
437 AC_MSG_RESULT([$HAVE_DPKGBUILD ($DPKGBUILD_VERSION)])
440 AC_MSG_RESULT([$HAVE_DPKGBUILD])
445 AC_SUBST(DPKG_VERSION)
447 AC_SUBST(HAVE_DPKGBUILD)
449 AC_SUBST(DPKGBUILD_VERSION)
453 dnl # Until native packaging for various different packing systems
454 dnl # can be added the least we can do is attempt to use alien to
455 dnl # convert the RPM packages to the needed package type. This is
456 dnl # a hack but so far it has worked reasonable well.
458 AC_DEFUN([ZFS_AC_ALIEN], [
461 AC_MSG_CHECKING([whether $ALIEN is available])
462 AS_IF([tmp=$($ALIEN --version 2>/dev/null)], [
463 ALIEN_VERSION=$(echo $tmp | $AWK '{ print $[3] }')
464 ALIEN_MAJOR=$(echo ${ALIEN_VERSION} | $AWK -F'.' '{ print $[1] }')
465 ALIEN_MINOR=$(echo ${ALIEN_VERSION} | $AWK -F'.' '{ print $[2] }')
466 ALIEN_POINT=$(echo ${ALIEN_VERSION} | $AWK -F'.' '{ print $[3] }')
468 AC_MSG_RESULT([$HAVE_ALIEN ($ALIEN_VERSION)])
471 AC_MSG_RESULT([$HAVE_ALIEN])
476 AC_SUBST(ALIEN_VERSION)
477 AC_SUBST(ALIEN_MAJOR)
478 AC_SUBST(ALIEN_MINOR)
479 AC_SUBST(ALIEN_POINT)
483 dnl # Using the VENDOR tag from config.guess set the default
484 dnl # package type for 'make pkg': (rpm | deb | tgz)
486 AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
487 AC_MSG_CHECKING([os distribution])
488 AC_ARG_WITH([vendor],
489 [AS_HELP_STRING([--with-vendor],
490 [Distribution vendor @<:@default=check@:>@])],
491 [with_vendor=$withval],
493 AS_IF([test "x$with_vendor" = "xcheck"],[
494 if test -f /etc/toss-release ; then
496 elif test -f /etc/fedora-release ; then
498 elif test -f /etc/redhat-release ; then
500 elif test -f /etc/gentoo-release ; then
502 elif test -f /etc/arch-release ; then
504 elif test -f /etc/SuSE-release ; then
506 elif test -f /etc/slackware-version ; then
508 elif test -f /etc/lunar.release ; then
510 elif test -f /etc/lsb-release ; then
512 elif test -f /etc/debian_version ; then
514 elif test -f /etc/alpine-release ; then
516 elif test -f /bin/freebsd-version ; then
521 [ test "x${with_vendor}" != x],[
522 VENDOR="$with_vendor" ],
525 AC_MSG_RESULT([$VENDOR])
528 AC_MSG_CHECKING([default package type])
530 toss) DEFAULT_PACKAGE=rpm ;;
531 redhat) DEFAULT_PACKAGE=rpm ;;
532 fedora) DEFAULT_PACKAGE=rpm ;;
533 gentoo) DEFAULT_PACKAGE=tgz ;;
534 alpine) DEFAULT_PACKAGE=tgz ;;
535 arch) DEFAULT_PACKAGE=tgz ;;
536 sles) DEFAULT_PACKAGE=rpm ;;
537 slackware) DEFAULT_PACKAGE=tgz ;;
538 lunar) DEFAULT_PACKAGE=tgz ;;
539 ubuntu) DEFAULT_PACKAGE=deb ;;
540 debian) DEFAULT_PACKAGE=deb ;;
541 freebsd) DEFAULT_PACKAGE=pkg ;;
542 *) DEFAULT_PACKAGE=rpm ;;
544 AC_MSG_RESULT([$DEFAULT_PACKAGE])
545 AC_SUBST(DEFAULT_PACKAGE)
547 AC_MSG_CHECKING([default init directory])
549 freebsd) initdir=$sysconfdir/rc.d ;;
550 *) initdir=$sysconfdir/init.d;;
552 AC_MSG_RESULT([$initdir])
555 AC_MSG_CHECKING([default init script type and shell])
557 toss) DEFAULT_INIT_SCRIPT=redhat ;;
558 redhat) DEFAULT_INIT_SCRIPT=redhat ;;
559 fedora) DEFAULT_INIT_SCRIPT=fedora ;;
560 gentoo) DEFAULT_INIT_SCRIPT=openrc ;;
561 alpine) DEFAULT_INIT_SCRIPT=openrc ;;
562 arch) DEFAULT_INIT_SCRIPT=lsb ;;
563 sles) DEFAULT_INIT_SCRIPT=lsb ;;
564 slackware) DEFAULT_INIT_SCRIPT=lsb ;;
565 lunar) DEFAULT_INIT_SCRIPT=lunar ;;
566 ubuntu) DEFAULT_INIT_SCRIPT=lsb ;;
567 debian) DEFAULT_INIT_SCRIPT=lsb ;;
568 freebsd) DEFAULT_INIT_SCRIPT=freebsd;;
569 *) DEFAULT_INIT_SCRIPT=lsb ;;
573 gentoo) DEFAULT_INIT_SHELL="/sbin/openrc-run";;
574 alpine) DEFAULT_INIT_SHELL="/sbin/openrc-run";;
575 *) DEFAULT_INIT_SHELL="/bin/sh" ;;
578 AC_MSG_RESULT([$DEFAULT_INIT_SCRIPT:$DEFAULT_INIT_SHELL])
579 AC_SUBST(DEFAULT_INIT_SCRIPT)
580 AC_SUBST(DEFAULT_INIT_SHELL)
582 AC_MSG_CHECKING([default nfs server init script])
583 AS_IF([test "$VENDOR" = "debian"],
584 [DEFAULT_INIT_NFS_SERVER="nfs-kernel-server"],
585 [DEFAULT_INIT_NFS_SERVER="nfs"]
587 AC_MSG_RESULT([$DEFAULT_INIT_NFS_SERVER])
588 AC_SUBST(DEFAULT_INIT_NFS_SERVER)
590 AC_MSG_CHECKING([default init config directory])
592 alpine) initconfdir=/etc/conf.d ;;
593 gentoo) initconfdir=/etc/conf.d ;;
594 toss) initconfdir=/etc/sysconfig ;;
595 redhat) initconfdir=/etc/sysconfig ;;
596 fedora) initconfdir=/etc/sysconfig ;;
597 sles) initconfdir=/etc/sysconfig ;;
598 ubuntu) initconfdir=/etc/default ;;
599 debian) initconfdir=/etc/default ;;
600 freebsd) initconfdir=$sysconfdir/rc.conf.d;;
601 *) initconfdir=/etc/default ;;
603 AC_MSG_RESULT([$initconfdir])
604 AC_SUBST(initconfdir)
606 AC_MSG_CHECKING([whether initramfs-tools is available])
607 if test -d /usr/share/initramfs-tools ; then
608 RPM_DEFINE_INITRAMFS='--define "_initramfs 1"'
611 RPM_DEFINE_INITRAMFS=''
614 AC_SUBST(RPM_DEFINE_INITRAMFS)
618 dnl # Default ZFS package configuration
620 AC_DEFUN([ZFS_AC_PACKAGE], [
621 ZFS_AC_DEFAULT_PACKAGE
622 AS_IF([test x$VENDOR != xfreebsd], [