From: Brian Fraser Date: Thu, 6 Feb 2014 01:38:41 +0000 (-0300) Subject: DynaLoader: On Android, define DLOPEN_WONT_DO_RELATIVE_PATHS X-Git-Tag: upstream/5.20.0~472 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da3056236f3adff9cb89b3fa6b5247a94527f38e;p=platform%2Fupstream%2Fperl.git DynaLoader: On Android, define DLOPEN_WONT_DO_RELATIVE_PATHS Android's linker will actually do relative paths just fine; the problem is that it won't search from the current directory, only on /vendor/lib, /system/lib, and whatever is in LD_LIBRARY_PATH. While the core handles that just fine, bits of CPAN rather rightfully expect this to work: use lib 'foo' # puts foo/ in @INC use My::Module::In::Foo; # calls dlopen() with foo/My/Module/... # which will likely fail So we take this route instead. --- diff --git a/MANIFEST b/MANIFEST index bb3e30b..7cdecc5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3589,6 +3589,7 @@ ext/DynaLoader/dl_vms.xs VMS implementation ext/DynaLoader/dl_win32.xs Win32 implementation ext/DynaLoader/DynaLoader_pm.PL Dynamic Loader perl module ext/DynaLoader/hints/aix.pl Hint for DynaLoader for named architecture +ext/DynaLoader/hints/android.pl Hint for DynaLoader for named architecture ext/DynaLoader/hints/gnukfreebsd.pl Hint for DynaLoader for named architecture ext/DynaLoader/hints/gnuknetbsd.pl Hint for DynaLoader for named architecture ext/DynaLoader/hints/linux.pl Hint for DynaLoader for named architecture diff --git a/ext/DynaLoader/hints/android.pl b/ext/DynaLoader/hints/android.pl new file mode 100644 index 0000000..2b9a7aa --- /dev/null +++ b/ext/DynaLoader/hints/android.pl @@ -0,0 +1,11 @@ +# Android's linker will actually do relative paths just fine; the problem +# is that it won't search from the current directory, only on +# /vendor/lib, /system/lib, and whatever is in LD_LIBRARY_PATH. +# The core handles that just fine, but bits of CPAN rather rightfully +# expect things like these to work: +# use lib 'foo' # puts foo/ in @INC +# use My::Module::In::Foo; # calls dlopen() with foo/My/Module/... +# # which will likely fail +# So we take this route instead. +$self->{CCFLAGS} = $Config{ccflags} . ' -DDLOPEN_WONT_DO_RELATIVE_PATHS'; +1;