This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade ExtUtils::CBuilder from version 0.280223 to 0.280224
[perl5.git] / dist / ExtUtils-CBuilder / lib / ExtUtils / CBuilder / Platform / android.pm
CommitLineData
c90d5ec5 1package ExtUtils::CBuilder::Platform::android;
83dcc064
SH
2$ExtUtils::CBuilder::Platform::android::VERSION = '0.280224';
3use warnings;
c90d5ec5
PR
4use strict;
5use File::Spec;
6use ExtUtils::CBuilder::Platform::Unix;
80b93e47 7use Config;
c90d5ec5 8
74d5bfab 9use vars qw(@ISA);
c90d5ec5
PR
10@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
11
12# The Android linker will not recognize symbols from
13# libperl unless the module explicitly depends on it.
14sub link {
15 my ($self, %args) = @_;
16
2a762175 17 if ($self->{config}{useshrplib} eq 'true') {
c90d5ec5
PR
18 $args{extra_linker_flags} = [
19 $self->split_like_shell($args{extra_linker_flags}),
20 '-L' . $self->perl_inc(),
21 '-lperl',
9f9de66f 22 $self->split_like_shell($Config{perllibs}),
c90d5ec5
PR
23 ];
24 }
25
0f8fd466
BF
26 # Several modules on CPAN rather rightfully expect being
27 # able to pass $so_file to DynaLoader::dl_load_file and
28 # have it Just Work. However, $so_file will more likely
29 # than not be a relative path, and unless the module
30 # author subclasses MakeMaker/Module::Build to modify
31 # LD_LIBRARY_PATH, which would be insane, Android's linker
32 # won't find the .so
33 # So we make this all work by returning an absolute path.
34 my($so_file, @so_tmps) = $self->SUPER::link(%args);
35 $so_file = File::Spec->rel2abs($so_file);
c172110d 36 return wantarray ? ($so_file, @so_tmps) : $so_file;
c90d5ec5
PR
37}
38
391;