sub _probe_pkg {
my ($req) = @_;
+ # Setup pkg-config's environment variable to search non-standard paths
+ # which may be provided by --libdirs.
+ my @pkgcfg_paths = map { "$_/pkgconfig" } _lib_paths( $req );
+ push @pkgcfg_paths, $ENV{ 'PKG_CONFIG_PATH' } if $ENV{ 'PKG_CONFIG_PATH' };
+
+ local $ENV{ 'PKG_CONFIG_PATH' } = join $Config{path_sep}, @pkgcfg_paths;
+
is_exe('pkg-config') or return;
my $redir = $^O eq 'MSWin32' ? '' : '2>/dev/null';
require Devel::CheckLib;
# setup LD_RUN_PATH to match link time
my ($extra, $bs_load, $ld_load, $ld_run_path) =
- ExtUtils::Liblist->ext($req->{LIBS}, $req->{verbose});
+ ExtUtils::Liblist->ext($result->{LIBS}, $req->{verbose});
local $ENV{LD_RUN_PATH};
if ($ld_run_path) {
- print "Setting LD_RUN_PATH=$ld_run_path for TIFF probe\n"
+ print "Setting LD_RUN_PATH=$ld_run_path for $req->{name} probe\n"
if $req->{verbose};
$ENV{LD_RUN_PATH} = $ld_run_path;
}
Devel::CheckLib::check_lib
(
debug => $req->{verbose},
- LIBS => $result->{LIBS},
+ LIBS => [ $result->{LIBS} ],
INC => $result->{INC},
header => $req->{testcodeheaders},
function => $req->{testcode},
);
unless ($good) {
- print "$req->{name}: Test code failed checklib probe: $@\n"
- if $req->{verbose};
+ print "$req->{name}: Test code failed: $@";
return;
}