]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: don't call pkg-config --static if unnecessary
authorKarel Zak <kzak@redhat.com>
Mon, 26 Jun 2023 10:46:15 +0000 (12:46 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 26 Jun 2023 10:48:30 +0000 (12:48 +0200)
Addresses: https://github.com/util-linux/util-linux/issues/2327
Signed-off-by: Karel Zak <kzak@redhat.com>
m4/ul.m4

index 72457946201d192ad7c51df6a040fb62a8260543..b767a481de7be336f9939058629f8dfadc4c4b52 100644 (file)
--- 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
 ])