]> git.imager.perl.org - imager.git/commitdiff
- add each library-directory/pkgconfig/ to the pkg-config search path
authorTony Cook <tony@develop=help.com>
Thu, 19 Aug 2010 07:55:27 +0000 (07:55 +0000)
committerTony Cook <tony@develop=help.com>
Thu, 19 Aug 2010 07:55:27 +0000 (07:55 +0000)
   in Imager::Probe.
 - Imager::Probe was calling ExtUtils::Liblist to initialize
   LD_RUN_PATH supplying an undefined value rather than the found
   directory.  Thanks to Justin Davis.

Changes
lib/Imager/Probe.pm

diff --git a/Changes b/Changes
index aea8b56bb6da28fb662d8a958cc4e99be30594ea..42dfbe35f90cb8159bebff291f84d38738c742ac 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,20 @@
 Imager release history.  Older releases can be found in Changes.old
 
+Imager 0.78 - unreleased
+===========
+
+ - add each library-directory/pkgconfig/ to the pkg-config search path
+   in Imager::Probe.
+   Thanks to Justin Davis.
+   https://rt.cpan.org/Ticket/Display.html?id=60491
+
+Bug fixes:
+
+ - Imager::Probe was calling ExtUtils::Liblist to initialize
+   LD_RUN_PATH supplying an undefined value rather than the found
+   directory.  Thanks to Justin Davis.
+   https://rt.cpan.org/Ticket/Display.html?id=60491
+
 Imager 0.77 - 11 Aug 2010
 ===========
 
index 38b4bee7d5b10df2175ff4b328325ea6a2ebabaa..e907544c145476496fdd0d90eade3af5fbf3c366 100644 (file)
@@ -70,6 +70,14 @@ sub is_exe {
 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' };
+
+  my $pathsep = $^O eq 'MSWin32' ? q{;} : q{:};
+  local $ENV{ 'PKG_CONFIG_PATH' } = join $pathsep, @pkgcfg_paths;
+
   is_exe('pkg-config') or return;
   my $redir = $^O eq 'MSWin32' ? '' : '2>/dev/null';
 
@@ -202,11 +210,11 @@ sub _probe_test {
   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;
   }