Skip to content

Commit

Permalink
configure.ac: Add an option to disable host udev version checks
Browse files Browse the repository at this point in the history
In cross-compilation environment, the build host might have an outdated
udev or no udev at all. But the user may still want to build with the
enabled udev rule (for its udev-enabled target).

This patch adds a "--disable-udevchecks" option the disable build host
udev version check at configure-time and unconditionally install the
enabled udev rule. Without this new option, the behavior stays the same
(checks enabled).

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Roland Kammerer <roland.kammerer@linbit.com>
  • Loading branch information
ycongal-smile authored and rck committed Mar 5, 2024
1 parent 1caa041 commit f2b5a73
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ AC_ARG_WITH([udev],
[AS_HELP_STRING([--with-udev],
[Enable udev integration])],
[WITH_UDEV=$withval])
AC_ARG_ENABLE([udevchecks],
[AS_HELP_STRING([--disable-udevchecks],
[Disable host udev version checks])],
[],
[enable_udevchecks=yes])
AC_ARG_WITH([xen],
[AS_HELP_STRING([--with-xen],
[Enable Xen integration])],
Expand Down Expand Up @@ -315,7 +320,7 @@ if test -z $GIT; then
AC_MSG_WARN(Cannot update buildtag without git. You may safely ignore this warning when building from a tarball.)
fi

if test $UDEVADM = false && test $UDEVINFO = false; then
if test "x$enable_udevchecks" != "xno" && test $UDEVADM = false && test $UDEVINFO = false; then
if test "$WITH_UDEV" = "yes"; then
AC_MSG_WARN([udev support enabled, but neither udevadm nor udevinfo found on this system.])
fi
Expand Down Expand Up @@ -423,7 +428,7 @@ else
test -z $INITDIR && INITDIR="$sysconfdir/init.d"

dnl Our udev rules file is known to work only with udev >= 85
if test "$WITH_UDEV" = "yes"; then
if test "x$enable_udevchecks" != "xno" && test "$WITH_UDEV" = "yes"; then
udev_version=$( set -- $($UDEVADM version); echo $1 )
if test -z "$udev_version"; then
udev_version=$( set -- $($UDEVINFO -V); echo $3 )
Expand Down

0 comments on commit f2b5a73

Please sign in to comment.