From: Torbjörn SVENSSON <[email protected]>
Replace the local zstd library check with AC_ZSTD.
libbacktrace/ChangeLog:
* aclocal.m4: Include pkg.m4 and zstd.m4.
* configure: Regenerate.
* configure.ac: Use AC_ZSTD for zstd detection.
Signed-off-by: Torbjörn SVENSSON <[email protected]>
---
libbacktrace/aclocal.m4 | 2 +
libbacktrace/configure | 473 ++++++++++++++++++++++++++++++++++++--
libbacktrace/configure.ac | 5 +-
3 files changed, 460 insertions(+), 20 deletions(-)
diff --git a/libbacktrace/aclocal.m4 b/libbacktrace/aclocal.m4
index df92f64c55b98..950d707f62587 100644
--- a/libbacktrace/aclocal.m4
+++ b/libbacktrace/aclocal.m4
@@ -859,9 +859,11 @@ m4_include([../config/gcc-plugin.m4])
m4_include([../config/lead-dot.m4])
m4_include([../config/multi.m4])
m4_include([../config/override.m4])
+m4_include([../config/pkg.m4])
m4_include([../config/stdint.m4])
m4_include([../config/unwind_ipinfo.m4])
m4_include([../config/warnings.m4])
+m4_include([../config/zstd.m4])
m4_include([../libtool.m4])
m4_include([../ltoptions.m4])
m4_include([../ltsugar.m4])
diff --git a/libbacktrace/configure b/libbacktrace/configure
index 0428486d10df6..ae5cf4fbf3f5f 100755
--- a/libbacktrace/configure
+++ b/libbacktrace/configure
@@ -657,6 +657,15 @@ HAVE_COMPRESSED_DEBUG_ZSTD_FALSE
HAVE_COMPRESSED_DEBUG_ZSTD_TRUE
HAVE_ZSTD_FALSE
HAVE_ZSTD_TRUE
+ZSTD_LIBS
+ZSTD_CFLAGS
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
+ZSTD_LDFLAGS
+ZSTD_CPPFLAGS
+ZSTD_LIB
+ZSTD_INCLUDE
HAVE_COMPRESSED_DEBUG_ZLIB_GABI_FALSE
HAVE_COMPRESSED_DEBUG_ZLIB_GABI_TRUE
HAVE_COMPRESSED_DEBUG_ZLIB_GNU_FALSE
@@ -819,6 +828,9 @@ enable_werror
with_system_libunwind
enable_host_pie
enable_host_shared
+with_zstd
+with_zstd_include
+with_zstd_lib
'
ac_precious_vars='build_alias
host_alias
@@ -829,6 +841,11 @@ LDFLAGS
LIBS
CPPFLAGS
CPP
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+ZSTD_CFLAGS
+ZSTD_LIBS
OBJCOPY
DSYMUTIL
NM'
@@ -1480,6 +1497,15 @@ Optional Packages:
both]
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-system-libunwind use installed libunwind
+ --with-zstd=VALUE VALUE may be 'auto' (detect with pkg-config;
+ default), 'yes' (require zstd), 'no' (disable it),
+ or a PATH for the installation prefix. When VALUE is
+ a PATH, this is equivalent to
+ --with-zstd-include=PATH/include and
+ --with-zstd-lib=PATH/lib
+ --with-zstd-include=PATH
+ specify directory for installed zstd include files
+ --with-zstd-lib=PATH specify directory for the installed zstd library
Some influential environment variables:
CC C compiler command
@@ -1490,6 +1516,13 @@ Some influential environment variables:
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
+ PKG_CONFIG path to pkg-config utility
+ PKG_CONFIG_PATH
+ directories to add to pkg-config's search path
+ PKG_CONFIG_LIBDIR
+ path overriding pkg-config's built-in search path
+ ZSTD_CFLAGS C compiler flags for ZSTD, overriding pkg-config
+ ZSTD_LIBS linker flags for ZSTD, overriding pkg-config
OBJCOPY location of objcopy
DSYMUTIL location of dsymutil
NM location of nm
@@ -12026,7 +12059,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12029 "configure"
+#line 12062 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12132,7 +12165,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12135 "configure"
+#line 12168 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14423,13 +14456,344 @@ else
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZSTD_compress in -lzstd"
>&5
-$as_echo_n "checking for ZSTD_compress in -lzstd... " >&6; }
-if ${ac_cv_lib_zstd_ZSTD_compress+:} false; then :
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a
program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lzstd $LIBS"
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a
path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext"
>&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with
args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the
test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext"
>&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not
prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet"
>&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=0.9.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at
least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... "
>&6; }
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ PKG_CONFIG=""
+ fi
+fi
+
+ZSTD_INCLUDE=
+
+ZSTD_LIB=
+
+ZSTD_CPPFLAGS=
+
+ZSTD_LDFLAGS=
+
+
+# Check whether --with-zstd was given.
+if test "${with_zstd+set}" = set; then :
+ withval=$with_zstd; with_zstd=$withval
+else
+ with_zstd=auto
+fi
+
+
+# Check whether --with-zstd-include was given.
+if test "${with_zstd_include+set}" = set; then :
+ withval=$with_zstd_include;
+fi
+
+
+# Check whether --with-zstd-lib was given.
+if test "${with_zstd_lib+set}" = set; then :
+ withval=$with_zstd_lib;
+fi
+
+zstd_enabled=no
+zstd_pkg_config=no
+zstd_use_pkg_config=no
+ZSTD_LIBRARY_DIR=
+ZSTD_PKG_LIBS=
+case "x$with_zstd" in
+ xno)
+ ;;
+ xyes|xauto)
+ zstd_enabled=yes
+ zstd_use_pkg_config=yes
+ ;;
+ *)
+ zstd_enabled=yes
+ ZSTD_INCLUDE=$with_zstd/include
+ ZSTD_LIBRARY_DIR=$with_zstd/lib
+ ;;
+esac
+
+if test "$zstd_use_pkg_config" = yes; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libzstd >= 1.4.0" >&5
+$as_echo_n "checking for libzstd >= 1.4.0... " >&6; }
+
+if test -n "$ZSTD_CFLAGS"; then
+ pkg_cv_ZSTD_CFLAGS="$ZSTD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists
--print-errors \"libzstd >= 1.4.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libzstd >= 1.4.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_ZSTD_CFLAGS=`$PKG_CONFIG --cflags "libzstd >= 1.4.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$ZSTD_LIBS"; then
+ pkg_cv_ZSTD_LIBS="$ZSTD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists
--print-errors \"libzstd >= 1.4.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libzstd >= 1.4.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_ZSTD_LIBS=`$PKG_CONFIG --libs "libzstd >= 1.4.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+if test $pkg_failed = no; then
+ pkg_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $pkg_cv_ZSTD_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+ pkg_failed=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$pkg_save_LDFLAGS
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ ZSTD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors
--cflags --libs "libzstd >= 1.4.0" 2>&1`
+ else
+ ZSTD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs
"libzstd >= 1.4.0" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$ZSTD_PKG_ERRORS" >&5
+
+
+ if test "$with_zstd" = yes; then
+ as_fn_error $? "--with-zstd=yes was given, but pkg-config could not find
+ libzstd >= 1.4.0" "$LINENO" 5
+ elif test "x$with_zstd_include" != x \
+ || test "x$with_zstd_lib" != x; then
+ # Try the explicitly supplied paths below.
+ :
+ else
+ zstd_enabled=no
+ fi
+
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+ if test "$with_zstd" = yes; then
+ as_fn_error $? "--with-zstd=yes was given, but pkg-config could not find
+ libzstd >= 1.4.0" "$LINENO" 5
+ elif test "x$with_zstd_include" != x \
+ || test "x$with_zstd_lib" != x; then
+ # Try the explicitly supplied paths below.
+ :
+ else
+ zstd_enabled=no
+ fi
+
+else
+ ZSTD_CFLAGS=$pkg_cv_ZSTD_CFLAGS
+ ZSTD_LIBS=$pkg_cv_ZSTD_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+ zstd_pkg_config=yes
+ ZSTD_CPPFLAGS="$ZSTD_CFLAGS"
+ ZSTD_PKG_LIBS="$ZSTD_LIBS"
+ ZSTD_LIB="$ZSTD_PKG_LIBS"
+
+fi
+fi
+
+if test "$zstd_enabled" = yes; then
+ if test "x$with_zstd_include" != x; then
+ if test "$zstd_pkg_config" = yes; then
+ ZSTD_CPPFLAGS="-I$with_zstd_include $ZSTD_CPPFLAGS"
+ else
+ ZSTD_INCLUDE=$with_zstd_include
+ fi
+ fi
+ if test "x$with_zstd_lib" != x; then
+ ZSTD_LIBRARY_DIR=$with_zstd_lib
+ fi
+ if test "$zstd_pkg_config" != yes; then
+ if test "x$ZSTD_INCLUDE" != x \
+ && test "x$ZSTD_INCLUDE" != xno; then
+ ZSTD_CPPFLAGS=-I$ZSTD_INCLUDE
+ fi
+ if test "x$ZSTD_LIBRARY_DIR" != x \
+ && test "x$ZSTD_LIBRARY_DIR" != xno; then
+ ZSTD_LDFLAGS=-L$ZSTD_LIBRARY_DIR
+ fi
+ elif test "x$ZSTD_LIBRARY_DIR" != x; then
+ ZSTD_LDFLAGS=-L$ZSTD_LIBRARY_DIR
+ fi
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ saved_LDFLAGS="$LDFLAGS"
+ CPPFLAGS="$CPPFLAGS $ZSTD_CPPFLAGS"
+ LDFLAGS="$LDFLAGS $ZSTD_LDFLAGS"
+
+ # Check for a usable zstd library and header.
+ zstd_lib_usable=no
+ save_LIBS="$LIBS"
+ LIBS="$ZSTD_PKG_LIBS"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext
$LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
ZSTD_compress" >&5
+$as_echo_n "checking for library containing ZSTD_compress... " >&6; }
+if ${ac_cv_search_ZSTD_compress+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -14448,24 +14812,99 @@ return ZSTD_compress ();
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_zstd_ZSTD_compress=yes
-else
- ac_cv_lib_zstd_ZSTD_compress=no
+for ac_lib in '' zstd; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_ZSTD_compress=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ conftest$ac_exeext
+ if ${ac_cv_search_ZSTD_compress+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_ZSTD_compress+:} false; then :
+
+else
+ ac_cv_search_ZSTD_compress=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ZSTD_compress"
>&5
+$as_echo "$ac_cv_search_ZSTD_compress" >&6; }
+ac_res=$ac_cv_search_ZSTD_compress
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ zstd_lib_usable=yes
+else
+ zstd_lib_usable=no
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_zstd_ZSTD_compress" >&5
-$as_echo "$ac_cv_lib_zstd_ZSTD_compress" >&6; }
-if test "x$ac_cv_lib_zstd_ZSTD_compress" = xyes; then :
+
+ ZSTD_LIB="$LIBS"
+ LIBS="$save_LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zstd.h" >&5
+$as_echo_n "checking for zstd.h... " >&6; }
+if ${ac_cv_zstd_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <zstd.h>
+ #if ZSTD_VERSION_NUMBER < 10400
+ #error "need zstd 1.4.0 or better"
+ #endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_zstd_h=yes
+else
+ ac_cv_zstd_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_zstd_h" >&5
+$as_echo "$ac_cv_zstd_h" >&6; }
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext
$LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ if test "$zstd_lib_usable" = yes && test "$ac_cv_zstd_h" = yes; then
$as_echo "#define HAVE_ZSTD 1" >>confdefs.h
+ elif test "$with_zstd" != auto; then
+ as_fn_error $? "Unable to find a usable zstd library and zstd.h. See
+ config.log for details." "$LINENO" 5
+ else
+ # In auto mode, an unusable installation simply disables zstd.
+ zstd_enabled=no
+ ZSTD_CPPFLAGS=
+ ZSTD_LDFLAGS=
+ ZSTD_LIB=
+ fi
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
fi
- if test "$ac_cv_lib_zstd_ZSTD_compress" = yes; then
+ if test "$zstd_enabled" = yes; then
HAVE_ZSTD_TRUE=
HAVE_ZSTD_FALSE='#'
else
diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac
index 91830fe6f2f94..ec9fd349f8a51 100644
--- a/libbacktrace/configure.ac
+++ b/libbacktrace/configure.ac
@@ -545,9 +545,8 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM(,)],
LDFLAGS=$LDFLAGS_hold])
AM_CONDITIONAL(HAVE_COMPRESSED_DEBUG_ZLIB_GABI, test
"$libgo_cv_ld_compress_zlib_gabi" = yes)
-AC_CHECK_LIB([zstd], [ZSTD_compress],
- [AC_DEFINE(HAVE_ZSTD, 1, [Define if -lzstd is available.])])
-AM_CONDITIONAL(HAVE_ZSTD, test "$ac_cv_lib_zstd_ZSTD_compress" = yes)
+AC_ZSTD
+AM_CONDITIONAL(HAVE_ZSTD, test "$zstd_enabled" = yes)
dnl Test whether the linker supports --compress-debug-sections=zstd option.
AC_CACHE_CHECK([whether --compress-debug-sections=zstd is supported],
--
2.54.0