From: Bartosz Golaszewski Date: Mon, 12 Dec 2022 20:16:36 +0000 (+0100) Subject: configure: restore AS_IF() when using PKG_CHECK_MODULES() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8e745cd4bec8bc7e73e402dbc59154dc9dd37860;p=qemu-gpiodev%2Flibgpiod.git configure: restore AS_IF() when using PKG_CHECK_MODULES() pkg-config fails if we only try to build the tests without building the tools. I'm not sure why that happens and can't find any other fix than restore the AS_IF() for the 'with_tools' block. Surprisingly: PKG_CHECK_MODULES() works fine elsewhere. Add a FIXME in the configure.ac and investigate later. Fixes: 68dd8c6e5edb ("configure: drop AS_IF() macros") Signed-off-by: Bartosz Golaszewski --- diff --git a/configure.ac b/configure.ac index d657636..0effa7c 100644 --- a/configure.ac +++ b/configure.ac @@ -116,19 +116,17 @@ AC_ARG_ENABLE([gpioset-interactive], AM_CONDITIONAL([WITH_GPIOSET_INTERACTIVE], [test "x$with_gpioset_interactive" = xtrue]) -if test "x$with_tools" = xtrue -then - # These are only needed to build tools +# FIXME Figure out why this AS_IF() cannot be dropped without causing the other +# PKG_CHECK_MODULES() expansions fail to execute pkg-config. +AS_IF([test "x$with_tools" = xtrue], + [# These are only needed to build tools AC_CHECK_FUNC([daemon], [], [FUNC_NOT_FOUND_TOOLS([daemon])]) AC_CHECK_FUNC([asprintf], [], [FUNC_NOT_FOUND_LIB([asprintf])]) AC_CHECK_FUNC([scandir], [], [FUNC_NOT_FOUND_LIB([scandir])]) AC_CHECK_FUNC([alphasort], [], [FUNC_NOT_FOUND_LIB([alphasort])]) - - if test "x$with_gpioset_interactive" = xtrue - then - PKG_CHECK_MODULES([LIBEDIT], [libedit >= 3.1]) - fi -fi + AS_IF([test "x$with_gpioset_interactive" = xtrue], + [PKG_CHECK_MODULES([LIBEDIT], [libedit >= 3.1])]) + ]) AC_ARG_ENABLE([tests], [AS_HELP_STRING([--enable-tests],[enable libgpiod tests [default=no]])],