From 68dd8c6e5edb06391650496e88969215748ad6b3 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Fri, 9 Dec 2022 10:53:18 +0100 Subject: [PATCH] configure: drop AS_IF() macros AS_IF() is much less readable than a regular if/else and it's only called for by docs if the code inside the expansion uses AC_REQUIRE(). Convert AS_IF() occurrences to standard if/else syntax. Signed-off-by: Bartosz Golaszewski --- configure.ac | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 1c8f192..67c4f3c 100644 --- a/configure.ac +++ b/configure.ac @@ -113,12 +113,16 @@ AC_ARG_ENABLE([gpioset-interactive], AM_CONDITIONAL([WITH_GPIOSET_INTERACTIVE], [test "x$with_gpioset_interactive" = xtrue]) -AS_IF([test "x$with_tools" = xtrue], - [# These are only needed to build tools +if test "x$with_tools" = xtrue +then + # These are only needed to build tools AC_CHECK_FUNC([daemon], [], [FUNC_NOT_FOUND_TOOLS([daemon])]) - AS_IF([test "x$with_gpioset_interactive" = xtrue], - [PKG_CHECK_MODULES([LIBEDIT], [libedit >= 3.1])]) - ]) + + if test "x$with_gpioset_interactive" = xtrue + then + PKG_CHECK_MODULES([LIBEDIT], [libedit >= 3.1]) + fi +fi AC_ARG_ENABLE([tests], [AS_HELP_STRING([--enable-tests],[enable libgpiod tests [default=no]])], @@ -206,14 +210,21 @@ then AM_PATH_PYTHON([3.0], [], [AC_MSG_ERROR([python3 not found - needed for python bindings])]) AC_CHECK_PROG([has_python_config], [python3-config], [true], [false]) + if test "x$has_python_config" = xfalse then AC_MSG_ERROR([python3-config not found - needed for python bindings]) fi - AS_IF([test -z "$PYTHON_CPPFLAGS"], - [AC_SUBST(PYTHON_CPPFLAGS, [`$PYTHON-config --includes`])]) - AS_IF([test -z "$PYTHON_LIBS"], - [AC_SUBST(PYTHON_LIBS, [`$PYTHON-config --libs`])]) + + if test -z "$PYTHON_CPPFLAGS" + then + AC_SUBST(PYTHON_CPPFLAGS, [`$PYTHON-config --includes`]) + fi + + if test -z "$PYTHON_LIBS" + then + AC_SUBST(PYTHON_LIBS, [`$PYTHON-config --libs`]) + fi fi AC_ARG_ENABLE([bindings-rust], -- 2.30.2