Skip to content

Commit

Permalink
Makefile.PL: play nicely with Devel::CheckLib
Browse files Browse the repository at this point in the history
When pkg-config is used to discover the appropriate header and library
locations, the new code forgot to update a hash that is passed to the
cc_assert_lib function later on.

This means that on systems with non-traditional locations for openssl or
ldns libraries, the cc_assert_lib didn’t check the locations previously
discovered by pkg-config.

This commit should ensure that cc_assert_lib finds those libraries when
testing for their presence.
  • Loading branch information
marc-vanderwal committed Nov 26, 2024
1 parent 2bb440a commit 85f37cb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,17 @@ sub custom_assets
if (defined (my $includes = ExtUtils::PkgConfig->cflags_only_I($pcname))) {
my @inc = map { s/^-I//r } (split /\s+/, $includes);
say "Adding include paths for $name using pkg-config: " . join(", ", @inc);

cc_include_paths @inc;
$assert_lib_args{$key}{incpath} = \@inc;
}
if ((my $libs = $pkg_info{libs}) ne '') {
say "Adding library paths and names for $name using pkg-config: $libs";
cc_libs (split /\s+/, $libs);
my @libs = (split /\s+/, $libs);
my @libpaths = grep { /^-L/ } @libs;

cc_libs @libs;
$assert_lib_args{$key}{libpath} = \@libs;
}
}
}
Expand Down

0 comments on commit 85f37cb

Please sign in to comment.