All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Le Cuirot <chewi@gentoo.org>
To: linux-media@vger.kernel.org
Cc: James Le Cuirot <chewi@gentoo.org>
Subject: [PATCH v2] configure.ac: Add --without-libudev option to avoid automagic dep
Date: Mon, 24 Aug 2020 22:50:47 +0100	[thread overview]
Message-ID: <20200824215047.20916-1-chewi@gentoo.org> (raw)
In-Reply-To: <79c5bdb0-4082-7a3b-d614-4f87bf61f01c@xs4all.nl>

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>
---
 configure.ac | 27 +++++++++++++++++----------
 1 file 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])
 
-- 
2.26.2


  reply	other threads:[~2020-08-24 21:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-23 16:47 [PATCH] configure.ac: Add --without-libudev option to avoid automagic dep James Le Cuirot
2020-08-24  8:51 ` Hans Verkuil
2020-08-24 21:50   ` James Le Cuirot [this message]
2020-08-24 22:28   ` Rosen Penev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200824215047.20916-1-chewi@gentoo.org \
    --to=chewi@gentoo.org \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.