aboutsummaryrefslogtreecommitdiffstats
path: root/config/user-dracut.m4
diff options
context:
space:
mode:
authorTurbo Fredriksson <[email protected]>2014-06-06 16:07:58 +0200
committerBrian Behlendorf <[email protected]>2014-06-11 16:32:57 -0700
commit2ee4e7da9081207e847088be682c0eee48a2284a (patch)
tree4ae547d0eae7eef08d5f23927db80160ce6988b7 /config/user-dracut.m4
parent7f6884f419f822f89609f6ed7595f78d12c31834 (diff)
Accept udev and dracut paths specified by ./configure
There are two common locations where udev and dracut components are commonly installed. When building packages using the 'make rpm|deb' targets check those common locations and pass them to rpmbuild. For non-standard configurations these values can be provided by the the following configure options: --with-udevdir=DIR install udev helpers [default=check] --with-udevruledir=DIR install udev rules [[UDEVDIR/rules.d]] --with-dracutdir=DIR install dracut helpers [default=check] When rebuilding using the source packages the per-distribution default values specified in the spec file will be used. This is the preferred way to build packages for a distribution but the ability to override the defaults is provided as a convenience. Signed-off-by: Turbo Fredriksson <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2310 Closes #1680
Diffstat (limited to 'config/user-dracut.m4')
-rw-r--r--config/user-dracut.m420
1 files changed, 17 insertions, 3 deletions
diff --git a/config/user-dracut.m4 b/config/user-dracut.m4
index 6d96edc27..95f800bda 100644
--- a/config/user-dracut.m4
+++ b/config/user-dracut.m4
@@ -1,8 +1,22 @@
AC_DEFUN([ZFS_AC_CONFIG_USER_DRACUT], [
- AC_ARG_WITH(dracutdir,
+ AC_MSG_CHECKING(for dracut directory)
+ AC_ARG_WITH([dracutdir],
AC_HELP_STRING([--with-dracutdir=DIR],
- [install dracut helpers [[EPREFIX/lib/dracut]]]),
- dracutdir=$withval, dracutdir='${exec_prefix}/lib/dracut')
+ [install dracut helpers @<:@default=check@:>@]),
+ [dracutdir=$withval],
+ [dracutdir=check])
+
+ AS_IF([test "x$dracutdir" = xcheck], [
+ path1=/usr/share/dracut
+ path2=/usr/lib/dracut
+ default=$path2
+
+ AS_IF([test -d "$path1"], [dracutdir="$path1"], [
+ AS_IF([test -d "$path2"], [dracutdir="$path2"],
+ [dracutdir="$default"])
+ ])
+ ])
AC_SUBST(dracutdir)
+ AC_MSG_RESULT([$dracutdir])
])