xref: /freebsd/sys/contrib/openzfs/config/user-udev.m4 (revision af23369a6deaaeb612ab266eb88b8bb8d560c322)
1AC_DEFUN([ZFS_AC_CONFIG_USER_UDEV], [
2	AC_MSG_CHECKING(for udev directories)
3	AC_ARG_WITH(udevdir,
4		AS_HELP_STRING([--with-udevdir=DIR],
5		[install udev helpers @<:@default=check@:>@]),
6		[udevdir=$withval],
7		[udevdir=check])
8
9	AS_IF([test "x$udevdir" = xcheck], [
10		path1=/lib/udev
11		path2=/usr/lib/udev
12		default=$path2
13
14		AS_IF([test -d "$path1"], [udevdir="$path1"], [
15			AS_IF([test -d "$path2"], [udevdir="$path2"],
16				[udevdir="$default"])
17		])
18	])
19
20	AC_ARG_WITH(udevruledir,
21		AS_HELP_STRING([--with-udevruledir=DIR],
22		[install udev rules [[UDEVDIR/rules.d]]]),
23		[udevruledir=$withval],
24		[udevruledir="${udevdir}/rules.d"])
25
26	AC_SUBST(udevdir)
27	AC_SUBST(udevruledir)
28	AC_MSG_RESULT([$udevdir;$udevruledir])
29])
30