summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2014-02-05 22:38:41 -0300
committerBrian Fraser <fraserbn@gmail.com>2014-02-05 23:12:17 -0300
commitda3056236f3adff9cb89b3fa6b5247a94527f38e (patch)
treeb4ee1c66fa4fb41c9093898ec57893621d302f11 /ext
parentc172110d040a37bfa910a9d0785a260671569c5c (diff)
downloadperl-da3056236f3adff9cb89b3fa6b5247a94527f38e.tar.gz
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.
Diffstat (limited to 'ext')
-rw-r--r--ext/DynaLoader/hints/android.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/DynaLoader/hints/android.pl b/ext/DynaLoader/hints/android.pl
new file mode 100644
index 0000000000..2b9a7aafbf
--- /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;