From: Karel Zak Date: Mon, 26 Jun 2023 10:46:15 +0000 (+0200) Subject: build-sys: don't call pkg-config --static if unnecessary X-Git-Tag: v2.40-rc1~365 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08b35072b97d7a83988a5a5d5406efd0a109060b;p=thirdparty%2Futil-linux.git 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 --- 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 ])