From d086f2119509af2e26a0d7a587b9e176df814998 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 21 Nov 2015 11:38:09 +0100 Subject: configure.ac: Use AS_IF() instead of shell-if for PKG_CONFIG https://autotools.io/pkgconfig/pkg_check_modules.html > If you have the first call to PKG_CHECK_MODULES inside a bash > conditional block, the expansion of PKG_PROG_PKG_CONFIG will also be > conditional > You can solve this problem in two ways; you can either explicitly call > PKG_PROG_PKG_CONFIG outside of any conditional, forcing checking for > pkg-config as soon as possible; or you can rewrite your conditionals > to use the proper syntax --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 126e9a56..74c266e1 100644 --- a/configure.ac +++ b/configure.ac @@ -89,9 +89,9 @@ AC_ARG_ENABLE([pcsc], [AS_HELP_STRING([--disable-pcsc], [Build without PC/SC sup [ enable_pcsc="yes" ]) -if test "x$enable_pcsc" = "xyes" ; then +AS_IF([test "x$enable_pcsc" = "xyes"], [ PKG_CHECK_MODULES(PCSC, libpcsclite) -fi +]) AM_CONDITIONAL(ENABLE_PCSC, test "x$enable_pcsc" = "xyes") AC_ARG_ENABLE(talloc, @@ -109,12 +109,12 @@ AC_ARG_ENABLE(system-talloc, )], [enable_system_talloc=$enableval], [enable_system_talloc="no"]) AM_CONDITIONAL(ENABLE_SYSTEM_TALLOC, [test x"$enable_system_talloc" = x"yes"]) -if test x"$enable_system_talloc" = x"yes"; then +AS_IF([test x"$enable_system_talloc" = x"yes"], [ PKG_CHECK_MODULES(TALLOC, talloc) if test x"$enable_talloc" = x"yes"; then AC_MSG_ERROR([You cannot enable both internal and system talloc]) fi -fi +]) AC_ARG_ENABLE(plugin, [AS_HELP_STRING( -- cgit v1.2.3