Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We need at least version 1.0.0 of libzstd, to expose the API we need. #1490

Merged
merged 1 commit into from May 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 7 additions & 8 deletions Configure.pl
Expand Up @@ -364,7 +364,9 @@ sub uniq {
. "\t\$(CP) 3rdparty/dyncall/dyncallback/*.h \"\$(DESTDIR)\$(PREFIX)/include/dyncall\"\n";
}

if ($config{pkgconfig_works} && has_native_library('libzstd')) {
# The ZSTD_CStream API is only exposed starting at version 1.0.0
# Ubuntu 16.04 packages version 0.5.1, so an "exists" check is not good enough.
if ($config{pkgconfig_works} && has_native_library('libzstd', '1.0.0')) {
setup_native_library('libzstd');
$config{heapsnapformat} = 3;
}
Expand Down Expand Up @@ -1007,14 +1009,11 @@ sub setup_native_library {
}

sub has_native_library {
my $library = shift;
my $result_exists = `$config{pkgconfig} --exists $library`;
if ($? == 0) {
return 1;
}
else {
return 0;
my ($library, $version) = @_;
if (defined $version) {
return !system "$config{pkgconfig} --atleast-version=$version $library";
}
return !system "$config{pkgconfig} --exists $library"
}

__END__
Expand Down