This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Minor test improvement
[perl5.git] / lib / ExtUtils / MM_OS2.pm
CommitLineData
1e44e2bf
PP
1package ExtUtils::MM_OS2;
2
3#use Config;
4#use Cwd;
5#use File::Basename;
6require Exporter;
7
8Exporter::import('ExtUtils::MakeMaker',
9 qw( $Verbose &neatvalue));
10
1e44e2bf
PP
11unshift @MM::ISA, 'ExtUtils::MM_OS2';
12
13sub dlsyms {
14 my($self,%attribs) = @_;
15
16 my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {};
17 my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || [];
762efda7 18 my($funclist) = $attribs{FUNCLIST} || $self->{FUNCLIST} || [];
1e44e2bf
PP
19 my($imports) = $attribs{IMPORTS} || $self->{IMPORTS} || {};
20 my(@m);
21 (my $boot = $self->{NAME}) =~ s/:/_/g;
22
23 if (not $self->{SKIPHASH}{'dynamic'}) {
24 push(@m,"
25$self->{BASEEXT}.def: Makefile.PL
26",
27 ' $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e \'use ExtUtils::Mksymlists; \\
28 Mksymlists("NAME" => "', $self->{NAME},
29 '", "DLBASE" => "',$self->{DLBASE},
30 '", "DL_FUNCS" => ',neatvalue($funcs),
762efda7 31 '", "FUNCLIST" => ',neatvalue($funclist),
1e44e2bf 32 ', "IMPORTS" => ',neatvalue($imports),
3aefca04
IZ
33 ', "VERSION" => "',$self->{VERSION},
34 '", "DL_VARS" => ', neatvalue($vars), ');\'
1e44e2bf
PP
35');
36 }
37 join('',@m);
38}
39
40sub replace_manpage_separator {
41 my($self,$man) = @_;
42 $man =~ s,/+,.,g;
43 $man;
44}
45
46sub maybe_command {
47 my($self,$file) = @_;
13bc20ff 48 $file =~ s,[/\\]+,/,g;
1e44e2bf
PP
49 return $file if -x $file && ! -d _;
50 return "$file.exe" if -x "$file.exe" && ! -d _;
51 return "$file.cmd" if -x "$file.cmd" && ! -d _;
52 return;
53}
54
55sub file_name_is_absolute {
56 my($self,$file) = @_;
57 $file =~ m{^([a-z]:)?[\\/]}i ;
58}
59
68dc0745
PP
60sub perl_archive
61{
62 return "\$(PERL_INC)/libperl\$(LIB_EXT)";
63}
64
65sub export_list
66{
67 my ($self) = @_;
68 return "$self->{BASEEXT}.def";
69}
70
1e44e2bf
PP
711;
72__END__
73
74=head1 NAME
75
76ExtUtils::MM_OS2 - methods to override UN*X behaviour in ExtUtils::MakeMaker
77
a5f75d66
AD
78=head1 SYNOPSIS
79
80 use ExtUtils::MM_OS2; # Done internally by ExtUtils::MakeMaker if needed
81
1e44e2bf
PP
82=head1 DESCRIPTION
83
84See ExtUtils::MM_Unix for a documentation of the methods provided
85there. This package overrides the implementation of these methods, not
86the semantics.
87