xref: /freebsd/sys/contrib/openzfs/config/user-dracut.m4 (revision fe6060f10f634930ff71b7c50291ddc610da2475)
1AC_DEFUN([ZFS_AC_CONFIG_USER_DRACUT], [
2	AC_MSG_CHECKING(for dracut directory)
3	AC_ARG_WITH([dracutdir],
4		AS_HELP_STRING([--with-dracutdir=DIR],
5		[install dracut helpers @<:@default=check@:>@]),
6		[dracutdir=$withval],
7		[dracutdir=check])
8
9	AS_IF([test "x$dracutdir" = xcheck], [
10		path1=/usr/share/dracut
11		path2=/usr/lib/dracut
12		default=$path2
13
14		AS_IF([test -d "$path1"], [dracutdir="$path1"], [
15			AS_IF([test -d "$path2"], [dracutdir="$path2"],
16				[dracutdir="$default"])
17		])
18	])
19
20	AC_SUBST(dracutdir)
21	AC_MSG_RESULT([$dracutdir])
22])
23