summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Hinderer <seb@tarides.com>2023-04-17 14:50:36 +0200
committerSébastien Hinderer <seb@tarides.com>2023-04-18 16:54:26 +0200
commit580c500c8a378adde77a7133bbd76cf1d8a7cef6 (patch)
tree4aab4020681dfad34c5f68c251058b76fbe1712b
parent250c12c478fb69af40e3c5f0662356271754a89b (diff)
downloadocaml-580c500c8a378adde77a7133bbd76cf1d8a7cef6.tar.gz
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.
-rwxr-xr-xconfigure10
-rw-r--r--configure.ac10
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,