Subject: | (un)load_plugin needs some extra code to handle Android's linker |
The tests on t/t60dyntest.t fail because, well, android's linker. Long story short, the linker doesn't handle relative paths like Linux's normal linker would -- it won't check the current directory, for example.
The diff below fixes things in Imager.pm instead; I'm not sure if it'd be better to just patch the test itself.
diff --git a/Imager.pm b/Imager.pm
index 2722019..64e54b0 100644
--- a/Imager.pm
+++ b/Imager.pm
@@ -520,6 +520,10 @@ END {
sub load_plugin {
my ($filename)=@_;
my $i;
+ if ($^O eq 'android') {
+ require File::Spec;
+ $filename = File::Spec->rel2abs($filename);
+ }
my ($DSO_handle,$str)=DSO_open($filename);
if (!defined($DSO_handle)) { $Imager::ERRSTR="Couldn't load plugin '$filename'\n"; return undef; }
my %funcs=DSO_funclist($DSO_handle);
@@ -543,6 +547,11 @@ sub load_plugin {
sub unload_plugin {
my ($filename)=@_;
+ if ($^O eq 'android') {
+ require File::Spec;
+ $filename = File::Spec->rel2abs($filename);
+ }
+
if (!$DSOs{$filename}) { $ERRSTR="plugin '$filename' not loaded."; return undef; }
my ($DSO_handle,$funcref)=@{$DSOs{$filename}};
for(keys %{$funcref}) {