From 580c500c8a378adde77a7133bbd76cf1d8a7cef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Hinderer?= Date: Mon, 17 Apr 2023 14:50:36 +0200 Subject: configure: use a variable to refer to pkg-config This is to prepare the next commit: when cross-compiling the right pkg-config to use is the one giving information on the host system. --- configure | 10 ++++++---- configure.ac | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/configure b/configure index eca34d36e2..9566a16b87 100755 --- a/configure +++ b/configure @@ -18013,19 +18013,21 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext +PKG_CONFIG=pkg-config + ## ZSTD compression library zstd_status="" if test x"$with_zstd" != "xno" then : # Try pkg-config first, as it gives the most reliable results - if pkg-config libzstd 2>/dev/null + if ${PKG_CONFIG} libzstd 2>/dev/null then : # Now check the version - if pkg-config --atleast-version 1.4 libzstd + if ${PKG_CONFIG} --atleast-version 1.4 libzstd then : - zstd_libs=`pkg-config --libs libzstd` - zstd_flags=`pkg-config --cflags libzstd` + zstd_libs=`${PKG_CONFIG} --libs libzstd` + zstd_flags=`${PKG_CONFIG} --cflags libzstd` zstd_status="ok" else $as_nop zstd_status="zstd library too old: version 1.4 or later is needed" diff --git a/configure.ac b/configure.ac index 32c5f703e6..96ce6cf1c1 100644 --- a/configure.ac +++ b/configure.ac @@ -1950,16 +1950,18 @@ AC_LINK_IFELSE( AC_DEFINE([HAS_BSD_GETAFFINITY_NP])], [AC_MSG_RESULT([pthread_getaffinity_np not found])])]) +PKG_CONFIG=pkg-config + ## ZSTD compression library zstd_status="" AS_IF([test x"$with_zstd" != "xno"], # Try pkg-config first, as it gives the most reliable results - AS_IF([pkg-config libzstd 2>/dev/null], + AS_IF([${PKG_CONFIG} libzstd 2>/dev/null], # Now check the version - [AS_IF([pkg-config --atleast-version 1.4 libzstd], - [zstd_libs=`pkg-config --libs libzstd` - zstd_flags=`pkg-config --cflags libzstd` + [AS_IF([${PKG_CONFIG} --atleast-version 1.4 libzstd], + [zstd_libs=`${PKG_CONFIG} --libs libzstd` + zstd_flags=`${PKG_CONFIG} --cflags libzstd` zstd_status="ok"], [zstd_status="zstd library too old: version 1.4 or later is needed"])], # Otherwise, try to find zstd the old way, -- cgit v1.2.1