From 9656876b418cec476edc11a51de80aa1b61bf061 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Tue, 23 Jul 2024 18:28:32 +0100 Subject: [PATCH] configure.ac: Not all pkg-config support PKG_CHECK_MODULES_STATIC PKG_CHECK_MODULES_STATIC is only supported by pkg-config > 0.29 Use pkg-config --static instead. --- configure.ac | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 4a3a393fc4..21da465d56 100644 --- a/configure.ac +++ b/configure.ac @@ -520,12 +520,15 @@ if test "x$build_dtls" = "xyes"; then # Attempt to find MbedTLS using pkg-config. # When statically linking against libcoap, all transitive dependencies need to be specified as linker flags - # as well. Use PKG_CHECK_MODULES_STATIC for that. + # as well. Use pkg-config --static for that. if test "x$enable_static" = "xyes"; then - PKG_CHECK_MODULES_STATIC([MbedTLS], - [mbedtls], - [have_mbedtls="yes"; mbedtls_has_pkgconfig="yes"], - [have_mbedtls="no"; mbedtls_has_pkgconfig="no"]) + KEEP_PKG_CONFIG=$PKG_CONFIG + PKG_CONFIG="$PKG_CONFIG --static" + PKG_CHECK_MODULES([MbedTLS], + [mbedtls], + [have_mbedtls="yes"; mbedtls_has_pkgconfig="yes"], + [have_mbedtls="no"; mbedtls_has_pkgconfig="no"]) + PKG_CONFIG=$KEEP_PKG_CONFIG else PKG_CHECK_MODULES([MbedTLS], [mbedtls],