Linux-Media Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] configure.ac: Fix building without libudev
@ 2021-04-19 18:11 Niklas Söderlund
  0 siblings, 0 replies; only message in thread
From: Niklas Söderlund @ 2021-04-19 18:11 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media, Niklas Söderlund

Since the addition of the --without-libudev option automatic detection
of missing libudev have been broken and fails with,

    configure: error: Package requirements (libudev) were not met:

    Package 'libudev', required by 'virtual:world', not found

This is because autotools macro PKG_CHECK_MODULES action-if-not-found
behaves differently from most other macros,

    As most of the original autoconf macros, there are boolean values
    provided, for the cases when the check succeeded or failed. In
    contrast with almost all of the original macros, though, the default
    action-if-not-found will end the execution with an error for not
    having found the dependency.

As the AS_IF check following the PKG_CHECK_MODULES prints a warning if
libudev is not found the intention can't have been to fail configure if
libudev not found. Fix this by setting have_libudev=no instead of
failing due to the default action.

Fixes: 49316dc21f806d0c ("configure.ac: Add --without-libudev option to avoid automagic dep")
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 8470116df4b13311..f144a50d034fbda0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -299,7 +299,7 @@ AC_ARG_WITH([libudev],
 have_libudev=no
 
 AS_IF([test "x$with_libudev" != xno -o "x$enable_libdvbv5" != xno],
-      [PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, [])
+      [PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, have_libudev=no)
        AS_IF([test "x$have_libudev" = xyes],
              [AC_DEFINE([HAVE_LIBUDEV], [], [Use libudev])
               LIBUDEV_CFLAGS="$libudev_CFLAGS"
-- 
2.31.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19 18:11 [PATCH] configure.ac: Fix building without libudev Niklas Söderlund

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org
	public-inbox-index linux-media

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git