From 08b35072b97d7a83988a5a5d5406efd0a109060b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 26 Jun 2023 12:46:15 +0200 Subject: [PATCH] build-sys: don't call pkg-config --static if unnecessary Addresses: https://github.com/util-linux/util-linux/issues/2327 Signed-off-by: Karel Zak --- m4/ul.m4 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/m4/ul.m4 b/m4/ul.m4 index 7245794620..b767a481de 100644 --- a/m4/ul.m4 +++ b/m4/ul.m4 @@ -30,10 +30,12 @@ dnl dnl Calls pkg-config --static dnl AC_DEFUN([UL_PKG_STATIC], [ - if AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$2"]); then - $1=`$PKG_CONFIG --libs --static "$2"` - else - AC_MSG_ERROR([pkg-config description of $2, needed for static build, is not available]) + if test "$enable_static" != xno; then + if AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$2"]); then + $1=`$PKG_CONFIG --libs --static "$2"` + else + AC_MSG_ERROR([pkg-config description of $2, needed for static build, is not available]) + fi fi ]) -- 2.47.3