diff options
author | James Le Cuirot <chewi@gentoo.org> | 2020-08-24 22:50:47 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2020-08-25 10:56:57 +0200 |
commit | 49316dc21f806d0c22f231aefd37972caab652e2 (patch) | |
tree | 7e91c55751dc885a54ed7bafec1b0922e7804ac4 | |
parent | 89f66ef308e16a51090cf5682e74c6f4130a024d (diff) |
configure.ac: Add --without-libudev option to avoid automagic dep
configure currently checks for and links against libudev
unconditionally, If this was unwanted and the library is removed then
this can leave v4l-utils broken. This is a problem for distributions,
especially Gentoo Linux where it affects end users. libudev is
unlikely to be removed entirely but the 32-bit library may be removed
from a 64-bit system, breaking a 32-bit build of v4l-utils.
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r-- | configure.ac | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index d9f43ab5..e6134d08 100644 --- a/configure.ac +++ b/configure.ac @@ -291,16 +291,23 @@ else AC_MSG_WARN(ALSA library not available) fi -PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, have_libudev=no) -if test "x$have_libudev" = "xyes"; then - AC_DEFINE([HAVE_LIBUDEV], [], [Use libudev]) - LIBUDEV_CFLAGS="$libudev_CFLAGS" - LIBUDEV_LIBS="$libudev_LIBS" - AC_SUBST(LIBUDEV_CFLAGS) - AC_SUBST(LIBUDEV_LIBS) -else - AC_MSG_WARN(udev library not available) -fi +AC_ARG_WITH([libudev], + AS_HELP_STRING([--without-libudev], [Do not use udev library]), + [], + [with_libudev=yes]) + +have_libudev=no + +AS_IF([test "x$with_libudev" != xno -o "x$enable_libdvbv5" != xno], + [PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, []) + AS_IF([test "x$have_libudev" = xyes], + [AC_DEFINE([HAVE_LIBUDEV], [], [Use libudev]) + LIBUDEV_CFLAGS="$libudev_CFLAGS" + LIBUDEV_LIBS="$libudev_LIBS" + AC_SUBST(LIBUDEV_CFLAGS) + AC_SUBST(LIBUDEV_LIBS)], + AC_MSG_WARN(udev library not available) + )]) AC_SUBST([JPEG_LIBS]) |