configure: better error message for [lib]debuginfod missing dependencies

Message ID 20241022163642.1837970-1-mark@klomp.org
State Superseded
Headers
Series configure: better error message for [lib]debuginfod missing dependencies |

Commit Message

Mark Wielaard Oct. 22, 2024, 4:36 p.m. UTC
  When dependencies for libdebuginfod, debuginfod or ima verification are
missing and these features are explicitly enabled the user might not
immediately know which of the dependicies are missing. Move the checks
around a little so checks for dependencies are done immediately before
the enable error message. And add the possible reason to the error to
make things more clear.

     * configure.ac: Move libcurl and json-c tests before libdebuginfod
     check, move libmicrohttpd, sqlite3 and libarchive tests before
     debuginfod check and move librpm, libcrypto and imaevm.h tests
     before ima verification check.

https://sourceware.org/bugzilla/show_bug.cgi?id=32294

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Mark Wielaard Oct. 23, 2024, 1:11 p.m. UTC | #1
On Tue, 2024-10-22 at 18:36 +0200, Mark Wielaard wrote:
> When dependencies for libdebuginfod, debuginfod or ima verification are
> missing and these features are explicitly enabled the user might not
> immediately know which of the dependicies are missing. Move the checks
> around a little so checks for dependencies are done immediately before
> the enable error message. And add the possible reason to the error to
> make things more clear.
> 
>      * configure.ac: Move libcurl and json-c tests before libdebuginfod
>      check, move libmicrohttpd, sqlite3 and libarchive tests before
>      debuginfod check and move librpm, libcrypto and imaevm.h tests
>      before ima verification check.

Oops. The patch doesn't match the ChangeLog. Looks like I forgot to
commit/amend my local changes. I'll sent a V2.

> https://sourceware.org/bugzilla/show_bug.cgi?id=32294
> 
> Signed-off-by: Mark Wielaard <mark@klomp.org>
> ---
>  configure.ac | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index f191488f9402..0a62fece137e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -855,8 +855,8 @@ elif test "x$enable_libdebuginfod" = "xdummy"; then
>     true
>  elif test "x$have_jsonc$have_libcurl" = "xyesyes"; then
>     enable_libdebuginfod=yes
> -elif test "x$enable_libdebuginfod" = "xyes" -o "x$enable_libdebuginfod" = "xdummy"; then
> -   AC_MSG_ERROR([unable to build libdebuginfod])
> +elif test "x$enable_libdebuginfod" = "xyes"; then
> +   AC_MSG_ERROR([unable to build libdebuginfod, missing libjson-c or libcurl])
>  else
>     enable_libdebuginfod=no
>  fi
  

Patch

diff --git a/configure.ac b/configure.ac
index f191488f9402..0a62fece137e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -855,8 +855,8 @@  elif test "x$enable_libdebuginfod" = "xdummy"; then
    true
 elif test "x$have_jsonc$have_libcurl" = "xyesyes"; then
    enable_libdebuginfod=yes
-elif test "x$enable_libdebuginfod" = "xyes" -o "x$enable_libdebuginfod" = "xdummy"; then
-   AC_MSG_ERROR([unable to build libdebuginfod])
+elif test "x$enable_libdebuginfod" = "xyes"; then
+   AC_MSG_ERROR([unable to build libdebuginfod, missing libjson-c or libcurl])
 else
    enable_libdebuginfod=no
 fi