]> granicus.if.org Git - zfs/blob - config/zfs-build.m4
Fix for ARC sysctls ignored at runtime
[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         ZFS_AC_CONFIG_ALWAYS_SED
168 ])
169
170 AC_DEFUN([ZFS_AC_CONFIG], [
171
172         dnl # Remove the previous build test directory.
173         rm -Rf build
174
175         AC_ARG_VAR([TEST_JOBS],
176             [simultaneous jobs during configure (defaults to $(nproc))])
177         if test "x$ac_cv_env_TEST_JOBS_set" != "xset"; then
178                 TEST_JOBS=$(nproc)
179         fi
180         AC_SUBST(TEST_JOBS)
181
182         ZFS_CONFIG=all
183         AC_ARG_WITH([config],
184                 AS_HELP_STRING([--with-config=CONFIG],
185                 [Config file 'kernel|user|all|srpm']),
186                 [ZFS_CONFIG="$withval"])
187         AC_ARG_ENABLE([linux-builtin],
188                 [AC_HELP_STRING([--enable-linux-builtin],
189                 [Configure for builtin in-tree kernel modules @<:@default=no@:>@])],
190                 [],
191                 [enable_linux_builtin=no])
192
193         AC_MSG_CHECKING([zfs config])
194         AC_MSG_RESULT([$ZFS_CONFIG]);
195         AC_SUBST(ZFS_CONFIG)
196
197         ZFS_AC_CONFIG_ALWAYS
198
199         case "$ZFS_CONFIG" in
200                 kernel) ZFS_AC_CONFIG_KERNEL ;;
201                 user)   ZFS_AC_CONFIG_USER   ;;
202                 all)    ZFS_AC_CONFIG_USER
203                         ZFS_AC_CONFIG_KERNEL ;;
204                 srpm)                        ;;
205                 *)
206                 AC_MSG_RESULT([Error!])
207                 AC_MSG_ERROR([Bad value "$ZFS_CONFIG" for --with-config,
208                               user kernel|user|all|srpm]) ;;
209         esac
210
211         AM_CONDITIONAL([CONFIG_USER],
212             [test "$ZFS_CONFIG" = user -o "$ZFS_CONFIG" = all])
213         AM_CONDITIONAL([CONFIG_KERNEL],
214             [test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] &&
215             [test "x$enable_linux_builtin" != xyes ])
216         AM_CONDITIONAL([CONFIG_QAT],
217             [test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] &&
218             [test "x$qatsrc" != x ])
219         AM_CONDITIONAL([WANT_DEVNAME2DEVID], [test "x$user_libudev" = xyes ])
220         AM_CONDITIONAL([WANT_MMAP_LIBAIO], [test "x$user_libaio" = xyes ])
221 ])
222
223 dnl #
224 dnl # Check for rpm+rpmbuild to build RPM packages.  If these tools
225 dnl # are missing it is non-fatal but you will not be able to build
226 dnl # RPM packages and will be warned if you try too.
227 dnl #
228 dnl # By default the generic spec file will be used because it requires
229 dnl # minimal dependencies.  Distribution specific spec files can be
230 dnl # placed under the 'rpm/<distribution>' directory and enabled using
231 dnl # the --with-spec=<distribution> configure option.
232 dnl #
233 AC_DEFUN([ZFS_AC_RPM], [
234         RPM=rpm
235         RPMBUILD=rpmbuild
236
237         AC_MSG_CHECKING([whether $RPM is available])
238         AS_IF([tmp=$($RPM --version 2>/dev/null)], [
239                 RPM_VERSION=$(echo $tmp | $AWK '/RPM/ { print $[3] }')
240                 HAVE_RPM=yes
241                 AC_MSG_RESULT([$HAVE_RPM ($RPM_VERSION)])
242         ],[
243                 HAVE_RPM=no
244                 AC_MSG_RESULT([$HAVE_RPM])
245         ])
246
247         AC_MSG_CHECKING([whether $RPMBUILD is available])
248         AS_IF([tmp=$($RPMBUILD --version 2>/dev/null)], [
249                 RPMBUILD_VERSION=$(echo $tmp | $AWK '/RPM/ { print $[3] }')
250                 HAVE_RPMBUILD=yes
251                 AC_MSG_RESULT([$HAVE_RPMBUILD ($RPMBUILD_VERSION)])
252         ],[
253                 HAVE_RPMBUILD=no
254                 AC_MSG_RESULT([$HAVE_RPMBUILD])
255         ])
256
257         RPM_DEFINE_COMMON='--define "$(DEBUG_ZFS) 1"'
258         RPM_DEFINE_COMMON+=' --define "$(DEBUG_KMEM_ZFS) 1"'
259         RPM_DEFINE_COMMON+=' --define "$(DEBUG_KMEM_TRACKING_ZFS) 1"'
260         RPM_DEFINE_COMMON+=' --define "$(DEBUGINFO_ZFS) 1"'
261         RPM_DEFINE_COMMON+=' --define "$(ASAN_ZFS) 1"'
262
263         RPM_DEFINE_UTIL=' --define "_initconfdir $(DEFAULT_INITCONF_DIR)"'
264
265         dnl # Make the next three RPM_DEFINE_UTIL additions conditional, since
266         dnl # their values may not be set when running:
267         dnl #
268         dnl #   ./configure --with-config=srpm
269         dnl #
270         AS_IF([test -n "$dracutdir" ], [
271                 RPM_DEFINE_UTIL='--define "_dracutdir $(dracutdir)"'
272         ])
273         AS_IF([test -n "$udevdir" ], [
274                 RPM_DEFINE_UTIL+=' --define "_udevdir $(udevdir)"'
275         ])
276         AS_IF([test -n "$udevruledir" ], [
277                 RPM_DEFINE_UTIL+=' --define "_udevdir $(udevruledir)"'
278         ])
279         RPM_DEFINE_UTIL+=' $(DEFINE_INITRAMFS)'
280         RPM_DEFINE_UTIL+=' $(DEFINE_SYSTEMD)'
281         RPM_DEFINE_UTIL+=' $(DEFINE_PYZFS)'
282         RPM_DEFINE_UTIL+=' $(DEFINE_PYTHON_VERSION)'
283         RPM_DEFINE_UTIL+=' $(DEFINE_PYTHON_PKG_VERSION)'
284
285         dnl # Override default lib directory on Debian/Ubuntu systems.  The
286         dnl # provided /usr/lib/rpm/platform/<arch>/macros files do not
287         dnl # specify the correct path for multiarch systems as described
288         dnl # by the packaging guidelines.
289         dnl #
290         dnl # https://wiki.ubuntu.com/MultiarchSpec
291         dnl # https://wiki.debian.org/Multiarch/Implementation
292         dnl #
293         AS_IF([test "$DEFAULT_PACKAGE" = "deb"], [
294                 MULTIARCH_LIBDIR="lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
295                 RPM_DEFINE_UTIL+=' --define "_lib $(MULTIARCH_LIBDIR)"'
296                 AC_SUBST(MULTIARCH_LIBDIR)
297         ])
298
299         RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)"'
300         RPM_DEFINE_KMOD+=' --define "ksrc $(LINUX)"'
301         RPM_DEFINE_KMOD+=' --define "kobj $(LINUX_OBJ)"'
302         RPM_DEFINE_KMOD+=' --define "_wrong_version_format_terminate_build 0"'
303
304         RPM_DEFINE_DKMS=''
305
306         SRPM_DEFINE_COMMON='--define "build_src_rpm 1"'
307         SRPM_DEFINE_UTIL=
308         SRPM_DEFINE_KMOD=
309         SRPM_DEFINE_DKMS=
310
311         RPM_SPEC_DIR="rpm/generic"
312         AC_ARG_WITH([spec],
313                 AS_HELP_STRING([--with-spec=SPEC],
314                 [Spec files 'generic|redhat']),
315                 [RPM_SPEC_DIR="rpm/$withval"])
316
317         AC_MSG_CHECKING([whether spec files are available])
318         AC_MSG_RESULT([yes ($RPM_SPEC_DIR/*.spec.in)])
319
320         AC_SUBST(HAVE_RPM)
321         AC_SUBST(RPM)
322         AC_SUBST(RPM_VERSION)
323
324         AC_SUBST(HAVE_RPMBUILD)
325         AC_SUBST(RPMBUILD)
326         AC_SUBST(RPMBUILD_VERSION)
327
328         AC_SUBST(RPM_SPEC_DIR)
329         AC_SUBST(RPM_DEFINE_UTIL)
330         AC_SUBST(RPM_DEFINE_KMOD)
331         AC_SUBST(RPM_DEFINE_DKMS)
332         AC_SUBST(RPM_DEFINE_COMMON)
333         AC_SUBST(SRPM_DEFINE_UTIL)
334         AC_SUBST(SRPM_DEFINE_KMOD)
335         AC_SUBST(SRPM_DEFINE_DKMS)
336         AC_SUBST(SRPM_DEFINE_COMMON)
337 ])
338
339 dnl #
340 dnl # Check for dpkg+dpkg-buildpackage to build DEB packages.  If these
341 dnl # tools are missing it is non-fatal but you will not be able to build
342 dnl # DEB packages and will be warned if you try too.
343 dnl #
344 AC_DEFUN([ZFS_AC_DPKG], [
345         DPKG=dpkg
346         DPKGBUILD=dpkg-buildpackage
347
348         AC_MSG_CHECKING([whether $DPKG is available])
349         AS_IF([tmp=$($DPKG --version 2>/dev/null)], [
350                 DPKG_VERSION=$(echo $tmp | $AWK '/Debian/ { print $[7] }')
351                 HAVE_DPKG=yes
352                 AC_MSG_RESULT([$HAVE_DPKG ($DPKG_VERSION)])
353         ],[
354                 HAVE_DPKG=no
355                 AC_MSG_RESULT([$HAVE_DPKG])
356         ])
357
358         AC_MSG_CHECKING([whether $DPKGBUILD is available])
359         AS_IF([tmp=$($DPKGBUILD --version 2>/dev/null)], [
360                 DPKGBUILD_VERSION=$(echo $tmp | \
361                     $AWK '/Debian/ { print $[4] }' | cut -f-4 -d'.')
362                 HAVE_DPKGBUILD=yes
363                 AC_MSG_RESULT([$HAVE_DPKGBUILD ($DPKGBUILD_VERSION)])
364         ],[
365                 HAVE_DPKGBUILD=no
366                 AC_MSG_RESULT([$HAVE_DPKGBUILD])
367         ])
368
369         AC_SUBST(HAVE_DPKG)
370         AC_SUBST(DPKG)
371         AC_SUBST(DPKG_VERSION)
372
373         AC_SUBST(HAVE_DPKGBUILD)
374         AC_SUBST(DPKGBUILD)
375         AC_SUBST(DPKGBUILD_VERSION)
376 ])
377
378 dnl #
379 dnl # Until native packaging for various different packing systems
380 dnl # can be added the least we can do is attempt to use alien to
381 dnl # convert the RPM packages to the needed package type.  This is
382 dnl # a hack but so far it has worked reasonable well.
383 dnl #
384 AC_DEFUN([ZFS_AC_ALIEN], [
385         ALIEN=alien
386
387         AC_MSG_CHECKING([whether $ALIEN is available])
388         AS_IF([tmp=$($ALIEN --version 2>/dev/null)], [
389                 ALIEN_VERSION=$(echo $tmp | $AWK '{ print $[3] }')
390                 HAVE_ALIEN=yes
391                 AC_MSG_RESULT([$HAVE_ALIEN ($ALIEN_VERSION)])
392         ],[
393                 HAVE_ALIEN=no
394                 AC_MSG_RESULT([$HAVE_ALIEN])
395         ])
396
397         AC_SUBST(HAVE_ALIEN)
398         AC_SUBST(ALIEN)
399         AC_SUBST(ALIEN_VERSION)
400 ])
401
402 dnl #
403 dnl # Using the VENDOR tag from config.guess set the default
404 dnl # package type for 'make pkg': (rpm | deb | tgz)
405 dnl #
406 AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
407         AC_MSG_CHECKING([linux distribution])
408         if test -f /etc/toss-release ; then
409                 VENDOR=toss ;
410         elif test -f /etc/fedora-release ; then
411                 VENDOR=fedora ;
412         elif test -f /etc/redhat-release ; then
413                 VENDOR=redhat ;
414         elif test -f /etc/gentoo-release ; then
415                 VENDOR=gentoo ;
416         elif test -f /etc/arch-release ; then
417                 VENDOR=arch ;
418         elif test -f /etc/SuSE-release ; then
419                 VENDOR=sles ;
420         elif test -f /etc/slackware-version ; then
421                 VENDOR=slackware ;
422         elif test -f /etc/lunar.release ; then
423                 VENDOR=lunar ;
424         elif test -f /etc/lsb-release ; then
425                 VENDOR=ubuntu ;
426         elif test -f /etc/debian_version ; then
427                 VENDOR=debian ;
428         elif test -f /etc/alpine-release ; then
429                 VENDOR=alpine ;
430         else
431                 VENDOR= ;
432         fi
433         AC_MSG_RESULT([$VENDOR])
434         AC_SUBST(VENDOR)
435
436         AC_MSG_CHECKING([default package type])
437         case "$VENDOR" in
438                 toss)       DEFAULT_PACKAGE=rpm  ;;
439                 redhat)     DEFAULT_PACKAGE=rpm  ;;
440                 fedora)     DEFAULT_PACKAGE=rpm  ;;
441                 gentoo)     DEFAULT_PACKAGE=tgz  ;;
442                 alpine)     DEFAULT_PACKAGE=tgz  ;;
443                 arch)       DEFAULT_PACKAGE=tgz  ;;
444                 sles)       DEFAULT_PACKAGE=rpm  ;;
445                 slackware)  DEFAULT_PACKAGE=tgz  ;;
446                 lunar)      DEFAULT_PACKAGE=tgz  ;;
447                 ubuntu)     DEFAULT_PACKAGE=deb  ;;
448                 debian)     DEFAULT_PACKAGE=deb  ;;
449                 *)          DEFAULT_PACKAGE=rpm  ;;
450         esac
451         AC_MSG_RESULT([$DEFAULT_PACKAGE])
452         AC_SUBST(DEFAULT_PACKAGE)
453
454         DEFAULT_INIT_DIR=$sysconfdir/init.d
455         AC_MSG_CHECKING([default init directory])
456         AC_MSG_RESULT([$DEFAULT_INIT_DIR])
457         AC_SUBST(DEFAULT_INIT_DIR)
458
459         AC_MSG_CHECKING([default init script type])
460         case "$VENDOR" in
461                 toss)       DEFAULT_INIT_SCRIPT=redhat ;;
462                 redhat)     DEFAULT_INIT_SCRIPT=redhat ;;
463                 fedora)     DEFAULT_INIT_SCRIPT=fedora ;;
464                 gentoo)     DEFAULT_INIT_SCRIPT=openrc ;;
465                 alpine)     DEFAULT_INIT_SCRIPT=openrc ;;
466                 arch)       DEFAULT_INIT_SCRIPT=lsb    ;;
467                 sles)       DEFAULT_INIT_SCRIPT=lsb    ;;
468                 slackware)  DEFAULT_INIT_SCRIPT=lsb    ;;
469                 lunar)      DEFAULT_INIT_SCRIPT=lunar  ;;
470                 ubuntu)     DEFAULT_INIT_SCRIPT=lsb    ;;
471                 debian)     DEFAULT_INIT_SCRIPT=lsb    ;;
472                 *)          DEFAULT_INIT_SCRIPT=lsb    ;;
473         esac
474         AC_MSG_RESULT([$DEFAULT_INIT_SCRIPT])
475         AC_SUBST(DEFAULT_INIT_SCRIPT)
476
477         AC_MSG_CHECKING([default init config directory])
478         case "$VENDOR" in
479                 alpine)     DEFAULT_INITCONF_DIR=/etc/conf.d    ;;
480                 gentoo)     DEFAULT_INITCONF_DIR=/etc/conf.d    ;;
481                 toss)       DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
482                 redhat)     DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
483                 fedora)     DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
484                 sles)       DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
485                 ubuntu)     DEFAULT_INITCONF_DIR=/etc/default   ;;
486                 debian)     DEFAULT_INITCONF_DIR=/etc/default   ;;
487                 *)          DEFAULT_INITCONF_DIR=/etc/default   ;;
488         esac
489         AC_MSG_RESULT([$DEFAULT_INITCONF_DIR])
490         AC_SUBST(DEFAULT_INITCONF_DIR)
491
492         AC_MSG_CHECKING([whether initramfs-tools is available])
493         if test -d /usr/share/initramfs-tools ; then
494                 DEFINE_INITRAMFS='--define "_initramfs 1"'
495                 AC_MSG_RESULT([yes])
496         else
497                 DEFINE_INITRAMFS=''
498                 AC_MSG_RESULT([no])
499         fi
500         AC_SUBST(DEFINE_INITRAMFS)
501 ])
502
503 dnl #
504 dnl # Default ZFS package configuration
505 dnl #
506 AC_DEFUN([ZFS_AC_PACKAGE], [
507         ZFS_AC_DEFAULT_PACKAGE
508         ZFS_AC_RPM
509         ZFS_AC_DPKG
510         ZFS_AC_ALIEN
511 ])