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 <kzak@redhat.com>
This commit is contained in:
Karel Zak 2023-06-26 12:46:15 +02:00
parent 3a4d70419c
commit 08b35072b9

View file

@ -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
])