]> granicus.if.org Git - zfs/blob - config/zfs-build.m4
Perform KABI checks in parallel
[zfs] / config / zfs-build.m4
1 AC_DEFUN([ZFS_AC_LICENSE], [
2         AC_MSG_CHECKING([zfs author])
3         AC_MSG_RESULT([$ZFS_META_AUTHOR])
4
5         AC_MSG_CHECKING([zfs license])
6         AC_MSG_RESULT([$ZFS_META_LICENSE])
7 ])
8
9 AC_DEFUN([ZFS_AC_DEBUG_ENABLE], [
10         DEBUG_CFLAGS="-Werror"
11         DEBUG_CPPFLAGS="-DDEBUG -UNDEBUG"
12         DEBUG_LDFLAGS=""
13         DEBUG_ZFS="_with_debug"
14         AC_DEFINE(ZFS_DEBUG, 1, [zfs debugging enabled])
15
16         KERNEL_DEBUG_CFLAGS="-Werror"
17         KERNEL_DEBUG_CPPFLAGS="-DDEBUG -UNDEBUG"
18 ])
19
20 AC_DEFUN([ZFS_AC_DEBUG_DISABLE], [
21         DEBUG_CFLAGS=""
22         DEBUG_CPPFLAGS="-UDEBUG -DNDEBUG"
23         DEBUG_LDFLAGS=""
24         DEBUG_ZFS="_without_debug"
25
26         KERNEL_DEBUG_CFLAGS=""
27         KERNEL_DEBUG_CPPFLAGS="-UDEBUG -DNDEBUG"
28 ])
29
30 dnl #
31 dnl # When debugging is enabled:
32 dnl # - Enable all ASSERTs (-DDEBUG)
33 dnl # - Promote all compiler warnings to errors (-Werror)
34 dnl #
35 AC_DEFUN([ZFS_AC_DEBUG], [
36         AC_MSG_CHECKING([whether assertion support will be enabled])
37         AC_ARG_ENABLE([debug],
38                 [AS_HELP_STRING([--enable-debug],
39                 [Enable compiler and code assertions @<:@default=no@:>@])],
40                 [],
41                 [enable_debug=no])
42
43         AS_CASE(["x$enable_debug"],
44                 ["xyes"],
45                 [ZFS_AC_DEBUG_ENABLE],
46                 ["xno"],
47                 [ZFS_AC_DEBUG_DISABLE],
48                 [AC_MSG_ERROR([Unknown option $enable_debug])])
49
50         AC_SUBST(DEBUG_CFLAGS)
51         AC_SUBST(DEBUG_CPPFLAGS)
52         AC_SUBST(DEBUG_LDFLAGS)
53         AC_SUBST(DEBUG_ZFS)
54
55         AC_SUBST(KERNEL_DEBUG_CFLAGS)
56         AC_SUBST(KERNEL_DEBUG_CPPFLAGS)
57
58         AC_MSG_RESULT([$enable_debug])
59 ])
60
61 AC_DEFUN([ZFS_AC_DEBUGINFO_ENABLE], [
62         DEBUG_CFLAGS="$DEBUG_CFLAGS -g -fno-inline"
63
64         KERNEL_DEBUG_CFLAGS="$KERNEL_DEBUG_CFLAGS -fno-inline"
65         KERNEL_MAKE="$KERNEL_MAKE CONFIG_DEBUG_INFO=y"
66
67         DEBUGINFO_ZFS="_with_debuginfo"
68 ])
69
70 AC_DEFUN([ZFS_AC_DEBUGINFO_DISABLE], [
71         DEBUGINFO_ZFS="_without_debuginfo"
72 ])
73
74 AC_DEFUN([ZFS_AC_DEBUGINFO], [
75         AC_MSG_CHECKING([whether debuginfo support will be forced])
76         AC_ARG_ENABLE([debuginfo],
77                 [AS_HELP_STRING([--enable-debuginfo],
78                 [Force generation of debuginfo @<:@default=no@:>@])],
79                 [],
80                 [enable_debuginfo=no])
81
82         AS_CASE(["x$enable_debuginfo"],
83                 ["xyes"],
84                 [ZFS_AC_DEBUGINFO_ENABLE],
85                 ["xno"],
86                 [ZFS_AC_DEBUGINFO_DISABLE],
87                 [AC_MSG_ERROR([Unknown option $enable_debuginfo])])
88
89         AC_SUBST(DEBUG_CFLAGS)
90         AC_SUBST(DEBUGINFO_ZFS)
91
92         AC_SUBST(KERNEL_DEBUG_CFLAGS)
93         AC_SUBST(KERNEL_MAKE)
94
95         AC_MSG_RESULT([$enable_debuginfo])
96 ])
97
98 dnl #
99 dnl # Disabled by default, provides basic memory tracking.  Track the total
100 dnl # number of bytes allocated with kmem_alloc() and freed with kmem_free().
101 dnl # Then at module unload time if any bytes were leaked it will be reported
102 dnl # on the console.
103 dnl #
104 AC_DEFUN([ZFS_AC_DEBUG_KMEM], [
105         AC_MSG_CHECKING([whether basic kmem accounting is enabled])
106         AC_ARG_ENABLE([debug-kmem],
107                 [AS_HELP_STRING([--enable-debug-kmem],
108                 [Enable basic kmem accounting @<:@default=no@:>@])],
109                 [],
110                 [enable_debug_kmem=no])
111
112         AS_IF([test "x$enable_debug_kmem" = xyes], [
113                 KERNEL_DEBUG_CPPFLAGS+=" -DDEBUG_KMEM"
114                 DEBUG_KMEM_ZFS="_with_debug_kmem"
115         ], [
116                 DEBUG_KMEM_ZFS="_without_debug_kmem"
117         ])
118
119         AC_SUBST(KERNEL_DEBUG_CPPFLAGS)
120         AC_SUBST(DEBUG_KMEM_ZFS)
121
122         AC_MSG_RESULT([$enable_debug_kmem])
123 ])
124
125 dnl #
126 dnl # Disabled by default, provides detailed memory tracking.  This feature
127 dnl # also requires --enable-debug-kmem to be set.  When enabled not only will
128 dnl # total bytes be tracked but also the location of every kmem_alloc() and
129 dnl # kmem_free().  When the module is unloaded a list of all leaked addresses
130 dnl # and where they were allocated will be dumped to the console.  Enabling
131 dnl # this feature has a significant impact on performance but it makes finding
132 dnl # memory leaks straight forward.
133 dnl #
134 AC_DEFUN([ZFS_AC_DEBUG_KMEM_TRACKING], [
135         AC_MSG_CHECKING([whether detailed kmem tracking is enabled])
136         AC_ARG_ENABLE([debug-kmem-tracking],
137                 [AS_HELP_STRING([--enable-debug-kmem-tracking],
138                 [Enable detailed kmem tracking  @<:@default=no@:>@])],
139                 [],
140                 [enable_debug_kmem_tracking=no])
141
142         AS_IF([test "x$enable_debug_kmem_tracking" = xyes], [
143                 KERNEL_DEBUG_CPPFLAGS+=" -DDEBUG_KMEM_TRACKING"
144                 DEBUG_KMEM_TRACKING_ZFS="_with_debug_kmem_tracking"
145         ], [
146                 DEBUG_KMEM_TRACKING_ZFS="_without_debug_kmem_tracking"
147         ])
148
149         AC_SUBST(KERNEL_DEBUG_CPPFLAGS)
150         AC_SUBST(DEBUG_KMEM_TRACKING_ZFS)
151
152         AC_MSG_RESULT([$enable_debug_kmem_tracking])
153 ])
154
155 AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
156         ZFS_AC_CONFIG_ALWAYS_CC_NO_UNUSED_BUT_SET_VARIABLE
157         ZFS_AC_CONFIG_ALWAYS_CC_NO_BOOL_COMPARE
158         ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN
159         ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_TRUNCATION
160         ZFS_AC_CONFIG_ALWAYS_CC_NO_OMIT_FRAME_POINTER
161         ZFS_AC_CONFIG_ALWAYS_CC_ASAN
162         ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_SIMD
163         ZFS_AC_CONFIG_ALWAYS_SYSTEM
164         ZFS_AC_CONFIG_ALWAYS_ARCH
165         ZFS_AC_CONFIG_ALWAYS_PYTHON
166         ZFS_AC_CONFIG_ALWAYS_PYZFS
167 ])
168
169 AC_DEFUN([ZFS_AC_CONFIG], [
170
171         dnl # Remove the previous build test directory.
172         rm -Rf build
173
174         AC_ARG_VAR([TEST_JOBS],
175             [simultaneous jobs during configure (defaults to $(nproc))])
176         if test "x$ac_cv_env_TEST_JOBS_set" != "xset"; then
177                 TEST_JOBS=$(nproc)
178         fi
179         AC_SUBST(TEST_JOBS)
180
181         ZFS_CONFIG=all
182         AC_ARG_WITH([config],
183                 AS_HELP_STRING([--with-config=CONFIG],
184                 [Config file 'kernel|user|all|srpm']),
185                 [ZFS_CONFIG="$withval"])
186         AC_ARG_ENABLE([linux-builtin],
187                 [AC_HELP_STRING([--enable-linux-builtin],
188                 [Configure for builtin in-tree kernel modules @<:@default=no@:>@])],
189                 [],
190                 [enable_linux_builtin=no])
191
192         AC_MSG_CHECKING([zfs config])
193         AC_MSG_RESULT([$ZFS_CONFIG]);
194         AC_SUBST(ZFS_CONFIG)
195
196         ZFS_AC_CONFIG_ALWAYS
197
198         case "$ZFS_CONFIG" in
199                 kernel) ZFS_AC_CONFIG_KERNEL ;;
200                 user)   ZFS_AC_CONFIG_USER   ;;
201                 all)    ZFS_AC_CONFIG_USER
202                         ZFS_AC_CONFIG_KERNEL ;;
203                 srpm)                        ;;
204                 *)
205                 AC_MSG_RESULT([Error!])
206                 AC_MSG_ERROR([Bad value "$ZFS_CONFIG" for --with-config,
207                               user kernel|user|all|srpm]) ;;
208         esac
209
210         AM_CONDITIONAL([CONFIG_USER],
211             [test "$ZFS_CONFIG" = user -o "$ZFS_CONFIG" = all])
212         AM_CONDITIONAL([CONFIG_KERNEL],
213             [test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] &&
214             [test "x$enable_linux_builtin" != xyes ])
215         AM_CONDITIONAL([CONFIG_QAT],
216             [test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] &&
217             [test "x$qatsrc" != x ])
218         AM_CONDITIONAL([WANT_DEVNAME2DEVID], [test "x$user_libudev" = xyes ])
219         AM_CONDITIONAL([WANT_MMAP_LIBAIO], [test "x$user_libaio" = xyes ])
220 ])
221
222 dnl #
223 dnl # Check for rpm+rpmbuild to build RPM packages.  If these tools
224 dnl # are missing it is non-fatal but you will not be able to build
225 dnl # RPM packages and will be warned if you try too.
226 dnl #
227 dnl # By default the generic spec file will be used because it requires
228 dnl # minimal dependencies.  Distribution specific spec files can be
229 dnl # placed under the 'rpm/<distribution>' directory and enabled using
230 dnl # the --with-spec=<distribution> configure option.
231 dnl #
232 AC_DEFUN([ZFS_AC_RPM], [
233         RPM=rpm
234         RPMBUILD=rpmbuild
235
236         AC_MSG_CHECKING([whether $RPM is available])
237         AS_IF([tmp=$($RPM --version 2>/dev/null)], [
238                 RPM_VERSION=$(echo $tmp | $AWK '/RPM/ { print $[3] }')
239                 HAVE_RPM=yes
240                 AC_MSG_RESULT([$HAVE_RPM ($RPM_VERSION)])
241         ],[
242                 HAVE_RPM=no
243                 AC_MSG_RESULT([$HAVE_RPM])
244         ])
245
246         AC_MSG_CHECKING([whether $RPMBUILD is available])
247         AS_IF([tmp=$($RPMBUILD --version 2>/dev/null)], [
248                 RPMBUILD_VERSION=$(echo $tmp | $AWK '/RPM/ { print $[3] }')
249                 HAVE_RPMBUILD=yes
250                 AC_MSG_RESULT([$HAVE_RPMBUILD ($RPMBUILD_VERSION)])
251         ],[
252                 HAVE_RPMBUILD=no
253                 AC_MSG_RESULT([$HAVE_RPMBUILD])
254         ])
255
256         RPM_DEFINE_COMMON='--define "$(DEBUG_ZFS) 1"'
257         RPM_DEFINE_COMMON+=' --define "$(DEBUG_KMEM_ZFS) 1"'
258         RPM_DEFINE_COMMON+=' --define "$(DEBUG_KMEM_TRACKING_ZFS) 1"'
259         RPM_DEFINE_COMMON+=' --define "$(DEBUGINFO_ZFS) 1"'
260         RPM_DEFINE_COMMON+=' --define "$(ASAN_ZFS) 1"'
261
262         RPM_DEFINE_UTIL=' --define "_initconfdir $(DEFAULT_INITCONF_DIR)"'
263
264         dnl # Make the next three RPM_DEFINE_UTIL additions conditional, since
265         dnl # their values may not be set when running:
266         dnl #
267         dnl #   ./configure --with-config=srpm
268         dnl #
269         AS_IF([test -n "$dracutdir" ], [
270                 RPM_DEFINE_UTIL='--define "_dracutdir $(dracutdir)"'
271         ])
272         AS_IF([test -n "$udevdir" ], [
273                 RPM_DEFINE_UTIL+=' --define "_udevdir $(udevdir)"'
274         ])
275         AS_IF([test -n "$udevruledir" ], [
276                 RPM_DEFINE_UTIL+=' --define "_udevdir $(udevruledir)"'
277         ])
278         RPM_DEFINE_UTIL+=' $(DEFINE_INITRAMFS)'
279         RPM_DEFINE_UTIL+=' $(DEFINE_SYSTEMD)'
280         RPM_DEFINE_UTIL+=' $(DEFINE_PYZFS)'
281         RPM_DEFINE_UTIL+=' $(DEFINE_PYTHON_VERSION)'
282         RPM_DEFINE_UTIL+=' $(DEFINE_PYTHON_PKG_VERSION)'
283
284         dnl # Override default lib directory on Debian/Ubuntu systems.  The
285         dnl # provided /usr/lib/rpm/platform/<arch>/macros files do not
286         dnl # specify the correct path for multiarch systems as described
287         dnl # by the packaging guidelines.
288         dnl #
289         dnl # https://wiki.ubuntu.com/MultiarchSpec
290         dnl # https://wiki.debian.org/Multiarch/Implementation
291         dnl #
292         AS_IF([test "$DEFAULT_PACKAGE" = "deb"], [
293                 MULTIARCH_LIBDIR="lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
294                 RPM_DEFINE_UTIL+=' --define "_lib $(MULTIARCH_LIBDIR)"'
295                 AC_SUBST(MULTIARCH_LIBDIR)
296         ])
297
298         RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)"'
299         RPM_DEFINE_KMOD+=' --define "ksrc $(LINUX)"'
300         RPM_DEFINE_KMOD+=' --define "kobj $(LINUX_OBJ)"'
301         RPM_DEFINE_KMOD+=' --define "_wrong_version_format_terminate_build 0"'
302
303         RPM_DEFINE_DKMS=''
304
305         SRPM_DEFINE_COMMON='--define "build_src_rpm 1"'
306         SRPM_DEFINE_UTIL=
307         SRPM_DEFINE_KMOD=
308         SRPM_DEFINE_DKMS=
309
310         RPM_SPEC_DIR="rpm/generic"
311         AC_ARG_WITH([spec],
312                 AS_HELP_STRING([--with-spec=SPEC],
313                 [Spec files 'generic|redhat']),
314                 [RPM_SPEC_DIR="rpm/$withval"])
315
316         AC_MSG_CHECKING([whether spec files are available])
317         AC_MSG_RESULT([yes ($RPM_SPEC_DIR/*.spec.in)])
318
319         AC_SUBST(HAVE_RPM)
320         AC_SUBST(RPM)
321         AC_SUBST(RPM_VERSION)
322
323         AC_SUBST(HAVE_RPMBUILD)
324         AC_SUBST(RPMBUILD)
325         AC_SUBST(RPMBUILD_VERSION)
326
327         AC_SUBST(RPM_SPEC_DIR)
328         AC_SUBST(RPM_DEFINE_UTIL)
329         AC_SUBST(RPM_DEFINE_KMOD)
330         AC_SUBST(RPM_DEFINE_DKMS)
331         AC_SUBST(RPM_DEFINE_COMMON)
332         AC_SUBST(SRPM_DEFINE_UTIL)
333         AC_SUBST(SRPM_DEFINE_KMOD)
334         AC_SUBST(SRPM_DEFINE_DKMS)
335         AC_SUBST(SRPM_DEFINE_COMMON)
336 ])
337
338 dnl #
339 dnl # Check for dpkg+dpkg-buildpackage to build DEB packages.  If these
340 dnl # tools are missing it is non-fatal but you will not be able to build
341 dnl # DEB packages and will be warned if you try too.
342 dnl #
343 AC_DEFUN([ZFS_AC_DPKG], [
344         DPKG=dpkg
345         DPKGBUILD=dpkg-buildpackage
346
347         AC_MSG_CHECKING([whether $DPKG is available])
348         AS_IF([tmp=$($DPKG --version 2>/dev/null)], [
349                 DPKG_VERSION=$(echo $tmp | $AWK '/Debian/ { print $[7] }')
350                 HAVE_DPKG=yes
351                 AC_MSG_RESULT([$HAVE_DPKG ($DPKG_VERSION)])
352         ],[
353                 HAVE_DPKG=no
354                 AC_MSG_RESULT([$HAVE_DPKG])
355         ])
356
357         AC_MSG_CHECKING([whether $DPKGBUILD is available])
358         AS_IF([tmp=$($DPKGBUILD --version 2>/dev/null)], [
359                 DPKGBUILD_VERSION=$(echo $tmp | \
360                     $AWK '/Debian/ { print $[4] }' | cut -f-4 -d'.')
361                 HAVE_DPKGBUILD=yes
362                 AC_MSG_RESULT([$HAVE_DPKGBUILD ($DPKGBUILD_VERSION)])
363         ],[
364                 HAVE_DPKGBUILD=no
365                 AC_MSG_RESULT([$HAVE_DPKGBUILD])
366         ])
367
368         AC_SUBST(HAVE_DPKG)
369         AC_SUBST(DPKG)
370         AC_SUBST(DPKG_VERSION)
371
372         AC_SUBST(HAVE_DPKGBUILD)
373         AC_SUBST(DPKGBUILD)
374         AC_SUBST(DPKGBUILD_VERSION)
375 ])
376
377 dnl #
378 dnl # Until native packaging for various different packing systems
379 dnl # can be added the least we can do is attempt to use alien to
380 dnl # convert the RPM packages to the needed package type.  This is
381 dnl # a hack but so far it has worked reasonable well.
382 dnl #
383 AC_DEFUN([ZFS_AC_ALIEN], [
384         ALIEN=alien
385
386         AC_MSG_CHECKING([whether $ALIEN is available])
387         AS_IF([tmp=$($ALIEN --version 2>/dev/null)], [
388                 ALIEN_VERSION=$(echo $tmp | $AWK '{ print $[3] }')
389                 HAVE_ALIEN=yes
390                 AC_MSG_RESULT([$HAVE_ALIEN ($ALIEN_VERSION)])
391         ],[
392                 HAVE_ALIEN=no
393                 AC_MSG_RESULT([$HAVE_ALIEN])
394         ])
395
396         AC_SUBST(HAVE_ALIEN)
397         AC_SUBST(ALIEN)
398         AC_SUBST(ALIEN_VERSION)
399 ])
400
401 dnl #
402 dnl # Using the VENDOR tag from config.guess set the default
403 dnl # package type for 'make pkg': (rpm | deb | tgz)
404 dnl #
405 AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
406         AC_MSG_CHECKING([linux distribution])
407         if test -f /etc/toss-release ; then
408                 VENDOR=toss ;
409         elif test -f /etc/fedora-release ; then
410                 VENDOR=fedora ;
411         elif test -f /etc/redhat-release ; then
412                 VENDOR=redhat ;
413         elif test -f /etc/gentoo-release ; then
414                 VENDOR=gentoo ;
415         elif test -f /etc/arch-release ; then
416                 VENDOR=arch ;
417         elif test -f /etc/SuSE-release ; then
418                 VENDOR=sles ;
419         elif test -f /etc/slackware-version ; then
420                 VENDOR=slackware ;
421         elif test -f /etc/lunar.release ; then
422                 VENDOR=lunar ;
423         elif test -f /etc/lsb-release ; then
424                 VENDOR=ubuntu ;
425         elif test -f /etc/debian_version ; then
426                 VENDOR=debian ;
427         elif test -f /etc/alpine-release ; then
428                 VENDOR=alpine ;
429         else
430                 VENDOR= ;
431         fi
432         AC_MSG_RESULT([$VENDOR])
433         AC_SUBST(VENDOR)
434
435         AC_MSG_CHECKING([default package type])
436         case "$VENDOR" in
437                 toss)       DEFAULT_PACKAGE=rpm  ;;
438                 redhat)     DEFAULT_PACKAGE=rpm  ;;
439                 fedora)     DEFAULT_PACKAGE=rpm  ;;
440                 gentoo)     DEFAULT_PACKAGE=tgz  ;;
441                 alpine)     DEFAULT_PACKAGE=tgz  ;;
442                 arch)       DEFAULT_PACKAGE=tgz  ;;
443                 sles)       DEFAULT_PACKAGE=rpm  ;;
444                 slackware)  DEFAULT_PACKAGE=tgz  ;;
445                 lunar)      DEFAULT_PACKAGE=tgz  ;;
446                 ubuntu)     DEFAULT_PACKAGE=deb  ;;
447                 debian)     DEFAULT_PACKAGE=deb  ;;
448                 *)          DEFAULT_PACKAGE=rpm  ;;
449         esac
450         AC_MSG_RESULT([$DEFAULT_PACKAGE])
451         AC_SUBST(DEFAULT_PACKAGE)
452
453         DEFAULT_INIT_DIR=$sysconfdir/init.d
454         AC_MSG_CHECKING([default init directory])
455         AC_MSG_RESULT([$DEFAULT_INIT_DIR])
456         AC_SUBST(DEFAULT_INIT_DIR)
457
458         AC_MSG_CHECKING([default init script type])
459         case "$VENDOR" in
460                 toss)       DEFAULT_INIT_SCRIPT=redhat ;;
461                 redhat)     DEFAULT_INIT_SCRIPT=redhat ;;
462                 fedora)     DEFAULT_INIT_SCRIPT=fedora ;;
463                 gentoo)     DEFAULT_INIT_SCRIPT=openrc ;;
464                 alpine)     DEFAULT_INIT_SCRIPT=openrc ;;
465                 arch)       DEFAULT_INIT_SCRIPT=lsb    ;;
466                 sles)       DEFAULT_INIT_SCRIPT=lsb    ;;
467                 slackware)  DEFAULT_INIT_SCRIPT=lsb    ;;
468                 lunar)      DEFAULT_INIT_SCRIPT=lunar  ;;
469                 ubuntu)     DEFAULT_INIT_SCRIPT=lsb    ;;
470                 debian)     DEFAULT_INIT_SCRIPT=lsb    ;;
471                 *)          DEFAULT_INIT_SCRIPT=lsb    ;;
472         esac
473         AC_MSG_RESULT([$DEFAULT_INIT_SCRIPT])
474         AC_SUBST(DEFAULT_INIT_SCRIPT)
475
476         AC_MSG_CHECKING([default init config directory])
477         case "$VENDOR" in
478                 alpine)     DEFAULT_INITCONF_DIR=/etc/conf.d    ;;
479                 gentoo)     DEFAULT_INITCONF_DIR=/etc/conf.d    ;;
480                 toss)       DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
481                 redhat)     DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
482                 fedora)     DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
483                 sles)       DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
484                 ubuntu)     DEFAULT_INITCONF_DIR=/etc/default   ;;
485                 debian)     DEFAULT_INITCONF_DIR=/etc/default   ;;
486                 *)          DEFAULT_INITCONF_DIR=/etc/default   ;;
487         esac
488         AC_MSG_RESULT([$DEFAULT_INITCONF_DIR])
489         AC_SUBST(DEFAULT_INITCONF_DIR)
490
491         AC_MSG_CHECKING([whether initramfs-tools is available])
492         if test -d /usr/share/initramfs-tools ; then
493                 DEFINE_INITRAMFS='--define "_initramfs 1"'
494                 AC_MSG_RESULT([yes])
495         else
496                 DEFINE_INITRAMFS=''
497                 AC_MSG_RESULT([no])
498         fi
499         AC_SUBST(DEFINE_INITRAMFS)
500 ])
501
502 dnl #
503 dnl # Default ZFS package configuration
504 dnl #
505 AC_DEFUN([ZFS_AC_PACKAGE], [
506         ZFS_AC_DEFAULT_PACKAGE
507         ZFS_AC_RPM
508         ZFS_AC_DPKG
509         ZFS_AC_ALIEN
510 ])