Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3fe43df

Browse files
committed
Add zstd option to configure
1 parent96016f4 commit3fe43df

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed

‎configure

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,7 @@ LDFLAGS_EX
704704
ELF_SYS
705705
EGREP
706706
GREP
707+
with_zstd
707708
with_zlib
708709
with_system_tzdata
709710
with_libxslt
@@ -847,6 +848,7 @@ with_libxml
847848
with_libxslt
848849
with_system_tzdata
849850
with_zlib
851+
with_zstd
850852
with_gnu_ld
851853
enable_largefile
852854
enable_float4_byval
@@ -1540,6 +1542,7 @@ Optional Packages:
15401542
--with-system-tzdata=DIR
15411543
use system time zone data in DIR
15421544
--without-zlib do not use Zlib
1545+
--with-zstd build with libzstd
15431546
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
15441547

15451548
Some influential environment variables:
@@ -6174,6 +6177,88 @@ fi
61746177

61756178

61766179

6180+
#
6181+
# ZStd
6182+
#
6183+
6184+
6185+
6186+
# Check whether --with-zstd was given.
6187+
if test "${with_zstd+set}" = set; then :
6188+
withval=$with_zstd;
6189+
case $withval in
6190+
yes)
6191+
6192+
$as_echo "#define CFS_COMPRESSOR 6" >>confdefs.h
6193+
6194+
;;
6195+
no)
6196+
:
6197+
;;
6198+
*)
6199+
as_fn_error $? "no argument expected for --with-zstd option" "$LINENO" 5
6200+
;;
6201+
esac
6202+
6203+
else
6204+
with_zstd=no
6205+
6206+
fi
6207+
6208+
6209+
6210+
6211+
if test "$with_zstd" = yes ; then
6212+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZSTD_compress in -lzstd" >&5
6213+
$as_echo_n "checking for ZSTD_compress in -lzstd... " >&6; }
6214+
if ${ac_cv_lib_zstd_ZSTD_compress+:} false; then :
6215+
$as_echo_n "(cached) " >&6
6216+
else
6217+
ac_check_lib_save_LIBS=$LIBS
6218+
LIBS="-lzstd $LIBS"
6219+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6220+
/* end confdefs.h. */
6221+
6222+
/* Override any GCC internal prototype to avoid an error.
6223+
Use char because int might match the return type of a GCC
6224+
builtin and then its argument prototype would still apply. */
6225+
#ifdef __cplusplus
6226+
extern "C"
6227+
#endif
6228+
char ZSTD_compress ();
6229+
int
6230+
main ()
6231+
{
6232+
return ZSTD_compress ();
6233+
;
6234+
return 0;
6235+
}
6236+
_ACEOF
6237+
if ac_fn_c_try_link "$LINENO"; then :
6238+
ac_cv_lib_zstd_ZSTD_compress=yes
6239+
else
6240+
ac_cv_lib_zstd_ZSTD_compress=no
6241+
fi
6242+
rm -f core conftest.err conftest.$ac_objext \
6243+
conftest$ac_exeext conftest.$ac_ext
6244+
LIBS=$ac_check_lib_save_LIBS
6245+
fi
6246+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zstd_ZSTD_compress" >&5
6247+
$as_echo "$ac_cv_lib_zstd_ZSTD_compress" >&6; }
6248+
if test "x$ac_cv_lib_zstd_ZSTD_compress" = xyes; then :
6249+
cat >>confdefs.h <<_ACEOF
6250+
#define HAVE_LIBZSTD 1
6251+
_ACEOF
6252+
6253+
LIBS="-lzstd $LIBS"
6254+
6255+
else
6256+
as_fn_error $? "library 'zstd' is required for ZSTD support" "$LINENO" 5
6257+
fi
6258+
6259+
fi
6260+
6261+
61776262
#
61786263
# Elf
61796264
#

‎configure.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,17 @@ PGAC_ARG_BOOL(with, zlib, yes,
854854
[do not use Zlib])
855855
AC_SUBST(with_zlib)
856856

857+
#
858+
# ZStd
859+
#
860+
PGAC_ARG_BOOL(with, zstd, no, [build with libzstd], [AC_DEFINE([CFS_COMPRESSOR], 6, [Define to 6 to use libzstd support when building CFS. (--with-zstd)])])
861+
AC_SUBST(with_zstd)
862+
863+
if test "$with_zstd" = yes ; then
864+
AC_CHECK_LIB(zstd, ZSTD_compress, [], [AC_MSG_ERROR([library 'zstd' is required for ZSTD support])])
865+
fi
866+
867+
857868
#
858869
# Elf
859870
#

‎src/backend/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ ifeq ($(with_systemd),yes)
4949
LIBS += -lsystemd
5050
endif
5151

52+
ifeq ($(with_zstd),yes)
5253
LIBS += -lzstd
54+
endif
5355

5456

5557
# Extra compression libraries

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp