summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-11-29 10:59:30 +0100
committerMartin Liska <mliska@suse.cz>2022-12-23 09:44:05 +0100
commita5b07cdf9c491fb7a4a16598c482c68b718f59b9 (patch)
tree5d92b6cf6cb6840869010a0a222649068659a8c9 /configure.ac
parentd868db89553bd9b994c24842441f5ad3c1ed0d84 (diff)
downloadelfutils-a5b07cdf9c491fb7a4a16598c482c68b718f59b9.tar.gz
support ZSTD compression algorithm
config/ChangeLog: * libelf.pc.in: Add LIBLZSTD to Requires.private. ChangeLog: * configure.ac: Detect ZSTD streaming API. libelf/ChangeLog: * Makefile.am: Use zstd_LIBS. * elf_compress.c: (__libelf_compress): Split into ... (__libelf_compress_zlib): ... this. (do_zstd_cleanup): New. (zstd_cleanup): New. (__libelf_compress_zstd): New. (__libelf_decompress): Switch in between zlib and zstd. (__libelf_decompress_zlib): Renamed from __libelf_decompress. (__libelf_decompress_zstd): New. (__libelf_decompress_elf): Dispatch in between compression algorithms. (elf_compress): Likewise. * elf_compress_gnu.c (elf_compress_gnu): Call with ELFCOMPRESS_ZLIB. * libelfP.h (__libelf_compress): Add new argument. (__libelf_decompress): Add chtype argument. src/ChangeLog: * elfcompress.c (enum ch_type): Add ZSTD. (parse_opt): Parse "zstd". (get_section_chtype): New. (process_file): Support zstd compression. (main): Add zstd to help. * readelf.c (elf_ch_type_name): Rewrite with switch. tests/ChangeLog: * Makefile.am: Add ELFUTILS_ZSTD if zstd is enabled. * run-compress-test.sh: Test zstd compression algorithm for debug sections.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 59be27ac..b2597f8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -420,10 +420,22 @@ AC_SUBST([LIBLZMA])
eu_ZIPLIB(zstd,ZSTD,zstd,ZSTD_decompress,[ZSTD (zst)])
AS_IF([test "x$with_zstd" = xyes], [LIBZSTD="libzstd"], [LIBLZSTD=""])
AC_SUBST([LIBZSTD])
+zstd_LIBS="$LIBS"
+AC_SUBST([zstd_LIBS])
zip_LIBS="$LIBS"
LIBS="$save_LIBS"
AC_SUBST([zip_LIBS])
+dnl zstd compression support requires libzstd 1.4.0+
+AS_IF([test "x$with_zstd" = xyes], [
+ PKG_PROG_PKG_CONFIG
+ PKG_CHECK_MODULES([ZSTD_COMPRESS],[libzstd >= 1.4.0],
+ [with_zstd_compress="yes"],[with_zstd_compress="no"])],
+ [with_zstd_compress="no"])
+AM_CONDITIONAL(USE_ZSTD_COMPRESS, test "x$with_zstd_compress" = "xyes")
+AS_IF([test "x$with_zstd_compress" = "xyes"],
+ [AC_DEFINE([USE_ZSTD_COMPRESS], [1], [zstd compression support])])
+
AC_CHECK_DECLS([memrchr, rawmemchr],[],[],
[#define _GNU_SOURCE
#include <string.h>])
@@ -829,6 +841,7 @@ AC_MSG_NOTICE([
bzip2 support : ${with_bzlib}
lzma/xz support : ${with_lzma}
zstd support : ${with_zstd}
+ zstd compression support : ${with_zstd_compress}
libstdc++ demangle support : ${enable_demangler}
File textrel check : ${enable_textrelcheck}
Symbol versioning : ${enable_symbol_versioning}