Not to be a pest.... but I was thinking about this patch that I submitted.
Since I noticed that you merged it, I thought I'd say thanks and give you
some food for thought....
That patch should probably be modified so that it only runs if $Config{dlext} eq "so"
that way it will only run on unix/unixlike systems (not on windows). I don't
think that that code could ever do anything bad on windows, but I've not
tested it. Just a thought...
-Rob
Robert Wyrick wrote:
<snipped for brevity>
------------------------------------------------------------------------
*** PAR-0.85/lib/PAR/Packer.pm Fri Jul 2 03:05:36 2004
--- PAR-0.85-rew/lib/PAR/Packer.pm Thu Nov 18 20:43:19 2004
***************
*** 1274,1283 ****
return (readline($handle) eq "PK\x03\x04");
}
sub _find_shlib {
my ($self, $file, $script_name) = @_;
! return $file if -e $file;
if (not exists $ENV{ $Config{ldlibpthname} }) {
print "Can't find $file. Environment variable "
--- 1274,1310 ----
return (readline($handle) eq "PK\x03\x04");
}
+ # _chase_lib - find the runtime link of a shared library
+ # Logic based on info found at the following sites:
+ # http://lists.debian.org/lsb-spec/1999/05/msg00011.html
+ # http://docs.sun.com/app/docs/doc/806-0641/6j9vuqujh?a=view#chapter5-97360
+ sub _chase_lib {
+ my ($self, $file) = @_;
+ while(-l $file)
+ {
+ if($file =~ /^(.*?\.$Config{dlext}\.\d+)\..*/)
+ {
+ return $1 if -e $1;
+ }
+ return $file if $file =~ /\.$Config{dlext}\.\d+$/;
+ my $dir = File::Basename::dirname($file);
+ $file = readlink $file;
+ unless(File::Spec->file_name_is_absolute($file))
+ {
+ $file = File::Spec->rel2abs($file, $dir);
+ }
+ }
+ if($file =~ /^(.*?\.$Config{dlext}\.\d+)\..*/)
+ {
+ return $1 if -e $1;
+ }
+ return $file;
+ }
+ sub _find_shlib {
my ($self, $file, $script_name) = @_;
! return $self->_chase_lib($file) if -e $file;
if (not exists $ENV{ $Config{ldlibpthname} }) {
print "Can't find $file. Environment variable "
***************
*** 1289,1297 ****
split(/\Q$Config{path_sep}\E/, $ENV{ $Config{ldlibpthname} }))
{
my $abs = File::Spec->catfile($dir, $file);
! return $abs if -e $abs;
$abs = File::Spec->catfile($dir, "$file.$Config{dlext}");
! return $abs if -e $abs;
}
# be extra magical and prepend "lib" to the filename
--- 1316,1324 ----
split(/\Q$Config{path_sep}\E/, $ENV{ $Config{ldlibpthname} }))
{
my $abs = File::Spec->catfile($dir, $file);
! return $self->_chase_lib($abs) if -e $abs;
$abs = File::Spec->catfile($dir, "$file.$Config{dlext}");
! return $self->_chase_lib($abs) if -e $abs;
}
# be extra magical and prepend "lib" to the filename
