linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: linux-media@vger.kernel.org,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>
Subject: [PATCH] configure.ac: Fix building without libudev
Date: Mon, 19 Apr 2021 20:11:07 +0200	[thread overview]
Message-ID: <20210419181107.566469-1-niklas.soderlund@ragnatech.se> (raw)

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


                 reply	other threads:[~2021-04-19 18:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210419181107.566469-1-niklas.soderlund@ragnatech.se \
    --to=niklas.soderlund@ragnatech.se \
    --cc=hverkuil-cisco@xs4all.nl \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).