Skip to content
Browse files

when probing for TIFF, set LD_RUN_PATH just as the Makefile does so

the probe can find the library for the test run.
  • Loading branch information...
1 parent 5558f89 commit 10b85929cebd3212415ae519ef00a37fd1185842 Tony Cook committed Aug 3, 2010
Showing with 17 additions and 1 deletion.
  1. +4 −0 Changes
  2. +13 −1 Makefile.PL
View
4 Changes
@@ -25,6 +25,10 @@ Bugs:
- added hardinvertall filter which also inverts the alpha channel
(sorry for the mess)
+ - when probing for TIFF, set LD_RUN_PATH just as the Makefile does so
+ the probe can find the library for the test run.
+ https://rt.cpan.org/Ticket/Display.html?id=57518
+
Imager 0.75 - 20 Jun 2010
===========
View
14 Makefile.PL
@@ -6,6 +6,7 @@ use Config;
use File::Spec;
use Getopt::Long;
use ExtUtils::Manifest qw(maniread);
+use ExtUtils::Liblist;
use vars qw(%formats $VERBOSE $INCPATH $LIBPATH $NOLOG $DEBUG_MALLOC $MANUAL $CFLAGS $LFLAGS $DFLAGS);
use lib 'inc';
use Devel::CheckLib;
@@ -1026,6 +1027,17 @@ sub postcheck_tiff {
$lib = "tiff";
}
+ # setup LD_RUN_PATH to match link time
+ my $lopts = join " " , map("-L$_", @{$format->{libdir}}), " -ltiff";
+ my ($extra, $bs_load, $ld_load, $ld_run_path) =
+ ExtUtils::Liblist->ext($lopts, $VERBOSE);
+ local $ENV{LD_RUN_PATH};
+
+ if ($ld_run_path) {
+ print "Setting LD_RUN_PATH=$ld_run_path for TIFF probe\n" if $VERBOSE;
+ $ENV{LD_RUN_PATH} = $ld_run_path;
+ }
+
my $good =
eval {
assert_lib
@@ -1052,7 +1064,7 @@ FUNCTION
};
unless ($good && -s $tiffver_name
- && open(VERS, "< probe/tiffver.txt")) {
+ && open(VERS, "< $tiffver_name")) {
unlink $tiffver_name unless $KEEP_FILES;
print <<EOS;
**tiff: cannot determine libtiff version number

0 comments on commit 10b8592

Please sign in to comment.
Something went wrong with that request. Please try again.