Imager::Probe now searches the directories specified by LD_LIBRARY_PATH,
DYLD_LIBRARY_PATH, LD_RUN_PATH and LIBRARY_PATH for libraries and
their corresponding s/\blib$/include/ directory for headers.
use Config;
use Cwd ();
-our $VERSION = "1.002";
+our $VERSION = "1.003";
my @alt_transfer = qw/altname incsuffix libbase/;
"/usr/lib",
"/usr/local/lib",
_gcc_lib_paths(),
+ _dyn_lib_paths(),
);
}
return grep !/gcc/ && -d, split /:/, $lib_line;
}
+sub _dyn_lib_paths {
+ return map { defined() ? split /\Q$Config{path_sep}/ : () }
+ map $ENV{$_},
+ qw(LD_RUN_PATH LD_LIBRARY_PATH DYLD_LIBRARY_PATH LIBRARY_PATH);
+}
+
sub _inc_paths {
my ($req) = @_;
),
"/usr/include",
"/usr/local/include",
+ _dyn_inc_paths(),
);
if ($req->{incsuffix}) {
return @paths;
}
+sub _dyn_inc_paths {
+ return map {
+ my $tmp = $_;
+ $tmp =~ s/\blib$/include/ ? $tmp : ()
+ } _dyn_lib_paths();
+}
+
sub _paths {
my (@in) = @_;