Skip to content

Commit b3f9148

Browse files
authored
Merge pull request #158 from postgres/master
Sync Fork from Upstream Repo
2 parents 9f8e95c + 091e22b commit b3f9148

File tree

756 files changed

+59713
-17361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

756 files changed

+59713
-17361
lines changed

configure

Lines changed: 295 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,9 @@ with_gnu_ld
699699
LD
700700
LDFLAGS_SL
701701
LDFLAGS_EX
702+
LZ4_LIBS
703+
LZ4_CFLAGS
704+
with_lz4
702705
with_zlib
703706
with_system_tzdata
704707
with_libxslt
@@ -864,6 +867,7 @@ with_libxml
864867
with_libxslt
865868
with_system_tzdata
866869
with_zlib
870+
with_lz4
867871
with_gnu_ld
868872
with_ssl
869873
with_openssl
@@ -891,6 +895,8 @@ ICU_LIBS
891895
XML2_CONFIG
892896
XML2_CFLAGS
893897
XML2_LIBS
898+
LZ4_CFLAGS
899+
LZ4_LIBS
894900
LDFLAGS_EX
895901
LDFLAGS_SL
896902
PERL
@@ -1569,6 +1575,7 @@ Optional Packages:
15691575
--with-system-tzdata=DIR
15701576
use system time zone data in DIR
15711577
--without-zlib do not use Zlib
1578+
--with-lz4 build with LZ4 support
15721579
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
15731580
--with-ssl=LIB use LIB for SSL/TLS support (openssl)
15741581
--with-openssl obsolete spelling of --with-ssl=openssl
@@ -1596,6 +1603,8 @@ Some influential environment variables:
15961603
XML2_CONFIG path to xml2-config utility
15971604
XML2_CFLAGS C compiler flags for XML2, overriding pkg-config
15981605
XML2_LIBS linker flags for XML2, overriding pkg-config
1606+
LZ4_CFLAGS C compiler flags for LZ4, overriding pkg-config
1607+
LZ4_LIBS linker flags for LZ4, overriding pkg-config
15991608
LDFLAGS_EX extra linker flags for linking executables only
16001609
LDFLAGS_SL extra linker flags for linking shared libraries only
16011610
PERL Perl program
@@ -8563,6 +8572,147 @@ fi
85638572

85648573

85658574

8575+
#
8576+
# LZ4
8577+
#
8578+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with LZ4 support" >&5
8579+
$as_echo_n "checking whether to build with LZ4 support... " >&6; }
8580+
8581+
8582+
8583+
# Check whether --with-lz4 was given.
8584+
if test "${with_lz4+set}" = set; then :
8585+
withval=$with_lz4;
8586+
case $withval in
8587+
yes)
8588+
8589+
$as_echo "#define USE_LZ4 1" >>confdefs.h
8590+
8591+
;;
8592+
no)
8593+
:
8594+
;;
8595+
*)
8596+
as_fn_error $? "no argument expected for --with-lz4 option" "$LINENO" 5
8597+
;;
8598+
esac
8599+
8600+
else
8601+
with_lz4=no
8602+
8603+
fi
8604+
8605+
8606+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_lz4" >&5
8607+
$as_echo "$with_lz4" >&6; }
8608+
8609+
8610+
if test "$with_lz4" = yes; then
8611+
8612+
pkg_failed=no
8613+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for liblz4" >&5
8614+
$as_echo_n "checking for liblz4... " >&6; }
8615+
8616+
if test -n "$LZ4_CFLAGS"; then
8617+
pkg_cv_LZ4_CFLAGS="$LZ4_CFLAGS"
8618+
elif test -n "$PKG_CONFIG"; then
8619+
if test -n "$PKG_CONFIG" && \
8620+
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblz4\""; } >&5
8621+
($PKG_CONFIG --exists --print-errors "liblz4") 2>&5
8622+
ac_status=$?
8623+
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
8624+
test $ac_status = 0; }; then
8625+
pkg_cv_LZ4_CFLAGS=`$PKG_CONFIG --cflags "liblz4" 2>/dev/null`
8626+
test "x$?" != "x0" && pkg_failed=yes
8627+
else
8628+
pkg_failed=yes
8629+
fi
8630+
else
8631+
pkg_failed=untried
8632+
fi
8633+
if test -n "$LZ4_LIBS"; then
8634+
pkg_cv_LZ4_LIBS="$LZ4_LIBS"
8635+
elif test -n "$PKG_CONFIG"; then
8636+
if test -n "$PKG_CONFIG" && \
8637+
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblz4\""; } >&5
8638+
($PKG_CONFIG --exists --print-errors "liblz4") 2>&5
8639+
ac_status=$?
8640+
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
8641+
test $ac_status = 0; }; then
8642+
pkg_cv_LZ4_LIBS=`$PKG_CONFIG --libs "liblz4" 2>/dev/null`
8643+
test "x$?" != "x0" && pkg_failed=yes
8644+
else
8645+
pkg_failed=yes
8646+
fi
8647+
else
8648+
pkg_failed=untried
8649+
fi
8650+
8651+
8652+
8653+
if test $pkg_failed = yes; then
8654+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8655+
$as_echo "no" >&6; }
8656+
8657+
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
8658+
_pkg_short_errors_supported=yes
8659+
else
8660+
_pkg_short_errors_supported=no
8661+
fi
8662+
if test $_pkg_short_errors_supported = yes; then
8663+
LZ4_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "liblz4" 2>&1`
8664+
else
8665+
LZ4_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "liblz4" 2>&1`
8666+
fi
8667+
# Put the nasty error message in config.log where it belongs
8668+
echo "$LZ4_PKG_ERRORS" >&5
8669+
8670+
as_fn_error $? "Package requirements (liblz4) were not met:
8671+
8672+
$LZ4_PKG_ERRORS
8673+
8674+
Consider adjusting the PKG_CONFIG_PATH environment variable if you
8675+
installed software in a non-standard prefix.
8676+
8677+
Alternatively, you may set the environment variables LZ4_CFLAGS
8678+
and LZ4_LIBS to avoid the need to call pkg-config.
8679+
See the pkg-config man page for more details." "$LINENO" 5
8680+
elif test $pkg_failed = untried; then
8681+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8682+
$as_echo "no" >&6; }
8683+
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
8684+
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
8685+
as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
8686+
is in your PATH or set the PKG_CONFIG environment variable to the full
8687+
path to pkg-config.
8688+
8689+
Alternatively, you may set the environment variables LZ4_CFLAGS
8690+
and LZ4_LIBS to avoid the need to call pkg-config.
8691+
See the pkg-config man page for more details.
8692+
8693+
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
8694+
See \`config.log' for more details" "$LINENO" 5; }
8695+
else
8696+
LZ4_CFLAGS=$pkg_cv_LZ4_CFLAGS
8697+
LZ4_LIBS=$pkg_cv_LZ4_LIBS
8698+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
8699+
$as_echo "yes" >&6; }
8700+
8701+
fi
8702+
# We only care about -I, -D, and -L switches;
8703+
# note that -llz4 will be added by AC_CHECK_LIB below.
8704+
for pgac_option in $LZ4_CFLAGS; do
8705+
case $pgac_option in
8706+
-I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";;
8707+
esac
8708+
done
8709+
for pgac_option in $LZ4_LIBS; do
8710+
case $pgac_option in
8711+
-L*) LDFLAGS="$LDFLAGS $pgac_option";;
8712+
esac
8713+
done
8714+
fi
8715+
85668716
#
85678717
# Assignments
85688718
#
@@ -11922,6 +12072,65 @@ if test "$ac_res" != no; then :
1192212072
fi
1192312073

1192412074

12075+
if test "$enable_thread_safety" = yes; then
12076+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_barrier_wait" >&5
12077+
$as_echo_n "checking for library containing pthread_barrier_wait... " >&6; }
12078+
if ${ac_cv_search_pthread_barrier_wait+:} false; then :
12079+
$as_echo_n "(cached) " >&6
12080+
else
12081+
ac_func_search_save_LIBS=$LIBS
12082+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12083+
/* end confdefs.h. */
12084+
12085+
/* Override any GCC internal prototype to avoid an error.
12086+
Use char because int might match the return type of a GCC
12087+
builtin and then its argument prototype would still apply. */
12088+
#ifdef __cplusplus
12089+
extern "C"
12090+
#endif
12091+
char pthread_barrier_wait ();
12092+
int
12093+
main ()
12094+
{
12095+
return pthread_barrier_wait ();
12096+
;
12097+
return 0;
12098+
}
12099+
_ACEOF
12100+
for ac_lib in '' pthread; do
12101+
if test -z "$ac_lib"; then
12102+
ac_res="none required"
12103+
else
12104+
ac_res=-l$ac_lib
12105+
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
12106+
fi
12107+
if ac_fn_c_try_link "$LINENO"; then :
12108+
ac_cv_search_pthread_barrier_wait=$ac_res
12109+
fi
12110+
rm -f core conftest.err conftest.$ac_objext \
12111+
conftest$ac_exeext
12112+
if ${ac_cv_search_pthread_barrier_wait+:} false; then :
12113+
break
12114+
fi
12115+
done
12116+
if ${ac_cv_search_pthread_barrier_wait+:} false; then :
12117+
12118+
else
12119+
ac_cv_search_pthread_barrier_wait=no
12120+
fi
12121+
rm conftest.$ac_ext
12122+
LIBS=$ac_func_search_save_LIBS
12123+
fi
12124+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_barrier_wait" >&5
12125+
$as_echo "$ac_cv_search_pthread_barrier_wait" >&6; }
12126+
ac_res=$ac_cv_search_pthread_barrier_wait
12127+
if test "$ac_res" != no; then :
12128+
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
12129+
12130+
fi
12131+
12132+
fi
12133+
1192512134
if test "$with_readline" = yes; then
1192612135

1192712136

@@ -12433,7 +12642,7 @@ done
1243312642
# defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it
1243412643
# doesn't have these OpenSSL 1.1.0 functions. So check for individual
1243512644
# functions.
12436-
for ac_func in OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data
12645+
for ac_func in OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free
1243712646
do :
1243812647
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
1243912648
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -12617,6 +12826,56 @@ fi
1261712826

1261812827
fi
1261912828

12829+
if test "$with_lz4" = yes ; then
12830+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LZ4_compress_default in -llz4" >&5
12831+
$as_echo_n "checking for LZ4_compress_default in -llz4... " >&6; }
12832+
if ${ac_cv_lib_lz4_LZ4_compress_default+:} false; then :
12833+
$as_echo_n "(cached) " >&6
12834+
else
12835+
ac_check_lib_save_LIBS=$LIBS
12836+
LIBS="-llz4 $LIBS"
12837+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12838+
/* end confdefs.h. */
12839+
12840+
/* Override any GCC internal prototype to avoid an error.
12841+
Use char because int might match the return type of a GCC
12842+
builtin and then its argument prototype would still apply. */
12843+
#ifdef __cplusplus
12844+
extern "C"
12845+
#endif
12846+
char LZ4_compress_default ();
12847+
int
12848+
main ()
12849+
{
12850+
return LZ4_compress_default ();
12851+
;
12852+
return 0;
12853+
}
12854+
_ACEOF
12855+
if ac_fn_c_try_link "$LINENO"; then :
12856+
ac_cv_lib_lz4_LZ4_compress_default=yes
12857+
else
12858+
ac_cv_lib_lz4_LZ4_compress_default=no
12859+
fi
12860+
rm -f core conftest.err conftest.$ac_objext \
12861+
conftest$ac_exeext conftest.$ac_ext
12862+
LIBS=$ac_check_lib_save_LIBS
12863+
fi
12864+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lz4_LZ4_compress_default" >&5
12865+
$as_echo "$ac_cv_lib_lz4_LZ4_compress_default" >&6; }
12866+
if test "x$ac_cv_lib_lz4_LZ4_compress_default" = xyes; then :
12867+
cat >>confdefs.h <<_ACEOF
12868+
#define HAVE_LIBLZ4 1
12869+
_ACEOF
12870+
12871+
LIBS="-llz4 $LIBS"
12872+
12873+
else
12874+
as_fn_error $? "library 'lz4' is required for LZ4 support" "$LINENO" 5
12875+
fi
12876+
12877+
fi
12878+
1262012879
# Note: We can test for libldap_r only after we know PTHREAD_LIBS
1262112880
if test "$with_ldap" = yes ; then
1262212881
_LIBS="$LIBS"
@@ -13320,6 +13579,23 @@ Use --without-zlib to disable zlib support." "$LINENO" 5
1332013579
fi
1332113580

1332213581

13582+
fi
13583+
13584+
if test "$with_lz4" = yes; then
13585+
for ac_header in lz4.h
13586+
do :
13587+
ac_fn_c_check_header_mongrel "$LINENO" "lz4.h" "ac_cv_header_lz4_h" "$ac_includes_default"
13588+
if test "x$ac_cv_header_lz4_h" = xyes; then :
13589+
cat >>confdefs.h <<_ACEOF
13590+
#define HAVE_LZ4_H 1
13591+
_ACEOF
13592+
13593+
else
13594+
as_fn_error $? "lz4.h header file is required for LZ4" "$LINENO" 5
13595+
fi
13596+
13597+
done
13598+
1332313599
fi
1332413600

1332513601
if test "$with_gssapi" = yes ; then
@@ -15180,7 +15456,7 @@ fi
1518015456
LIBS_including_readline="$LIBS"
1518115457
LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
1518215458

15183-
for ac_func in backtrace_symbols clock_gettime copyfile fdatasync getifaddrs getpeerucred getrlimit kqueue mbstowcs_l memset_s poll posix_fallocate ppoll pstat pthread_is_threaded_np readlink readv setproctitle setproctitle_fast setsid shm_open strchrnul strsignal symlink sync_file_range uselocale wcstombs_l writev
15459+
for ac_func in backtrace_symbols clock_gettime copyfile fdatasync getifaddrs getpeerucred getrlimit kqueue mbstowcs_l memset_s poll posix_fallocate ppoll pstat pthread_is_threaded_np readlink readv setproctitle setproctitle_fast setsid shm_open strchrnul strsignal symlink syncfs sync_file_range uselocale wcstombs_l writev
1518415460
do :
1518515461
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
1518615462
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -15989,6 +16265,23 @@ fi
1598916265

1599016266

1599116267

16268+
if test "$enable_thread_safety" = yes; then
16269+
ac_fn_c_check_func "$LINENO" "pthread_barrier_wait" "ac_cv_func_pthread_barrier_wait"
16270+
if test "x$ac_cv_func_pthread_barrier_wait" = xyes; then :
16271+
$as_echo "#define HAVE_PTHREAD_BARRIER_WAIT 1" >>confdefs.h
16272+
16273+
else
16274+
case " $LIBOBJS " in
16275+
*" pthread_barrier_wait.$ac_objext "* ) ;;
16276+
*) LIBOBJS="$LIBOBJS pthread_barrier_wait.$ac_objext"
16277+
;;
16278+
esac
16279+
16280+
fi
16281+
16282+
16283+
fi
16284+
1599216285
if test "$PORTNAME" = "win32" -o "$PORTNAME" = "cygwin"; then
1599316286
# Cygwin and (apparently, based on test results) Mingw both
1599416287
# have a broken strtof(), so substitute the same replacement

0 commit comments

Comments
 (0)