line |
stmt |
bran |
cond |
sub |
time |
code |
1
|
|
|
|
|
|
package ExtUtils::MM_OS2; |
2
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
868
|
use strict; |
|
1
|
|
|
|
3
|
|
|
1
|
|
|
|
47
|
|
4
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
5
|
use ExtUtils::MakeMaker qw(neatvalue); |
|
1
|
|
|
|
3
|
|
|
1
|
|
|
|
53
|
|
6
|
1
|
|
|
1
|
6
|
use File::Spec; |
|
1
|
|
|
|
2
|
|
|
1
|
|
|
|
1216
|
|
7
|
|
|
|
|
|
|
8
|
|
|
|
|
|
our $VERSION = '6.74'; |
9
|
|
|
|
|
|
|
10
|
|
|
|
|
|
require ExtUtils::MM_Any; |
11
|
|
|
|
|
|
require ExtUtils::MM_Unix; |
12
|
|
|
|
|
|
our @ISA = qw(ExtUtils::MM_Any ExtUtils::MM_Unix); |
13
|
|
|
|
|
|
|
14
|
|
|
|
|
|
=pod |
15
|
|
|
|
|
|
|
16
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
18
|
|
|
|
|
|
ExtUtils::MM_OS2 - methods to override UN*X behaviour in ExtUtils::MakeMaker |
19
|
|
|
|
|
|
|
20
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
22
|
|
|
|
|
|
use ExtUtils::MM_OS2; # Done internally by ExtUtils::MakeMaker if needed |
23
|
|
|
|
|
|
|
24
|
|
|
|
|
|
=head1 DESCRIPTION |
25
|
|
|
|
|
|
|
26
|
|
|
|
|
|
See ExtUtils::MM_Unix for a documentation of the methods provided |
27
|
|
|
|
|
|
there. This package overrides the implementation of these methods, not |
28
|
|
|
|
|
|
the semantics. |
29
|
|
|
|
|
|
|
30
|
|
|
|
|
|
=head1 METHODS |
31
|
|
|
|
|
|
|
32
|
|
|
|
|
|
=over 4 |
33
|
|
|
|
|
|
|
34
|
|
|
|
|
|
=item init_dist |
35
|
|
|
|
|
|
|
36
|
|
|
|
|
|
Define TO_UNIX to convert OS2 linefeeds to Unix style. |
37
|
|
|
|
|
|
|
38
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
40
|
|
|
|
|
|
sub init_dist { |
41
|
0
|
|
|
0
|
|
my($self) = @_; |
42
|
|
|
|
|
|
|
43
|
0
|
|
0
|
|
|
$self->{TO_UNIX} ||= <<'MAKE_TEXT'; |
44
|
|
|
|
|
|
$(NOECHO) $(TEST_F) tmp.zip && $(RM_F) tmp.zip; $(ZIP) -ll -mr tmp.zip $(DISTVNAME) && unzip -o tmp.zip && $(RM_F) tmp.zip |
45
|
|
|
|
|
|
MAKE_TEXT |
46
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
$self->SUPER::init_dist; |
48
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
50
|
|
|
|
|
|
sub dlsyms { |
51
|
0
|
|
|
0
|
|
my($self,%attribs) = @_; |
52
|
|
|
|
|
|
|
53
|
0
|
|
0
|
|
|
my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {}; |
54
|
0
|
|
0
|
|
|
my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || []; |
55
|
0
|
|
0
|
|
|
my($funclist) = $attribs{FUNCLIST} || $self->{FUNCLIST} || []; |
56
|
0
|
|
0
|
|
|
my($imports) = $attribs{IMPORTS} || $self->{IMPORTS} || {}; |
57
|
0
|
|
|
|
|
my(@m); |
58
|
0
|
|
|
|
|
(my $boot = $self->{NAME}) =~ s/:/_/g; |
59
|
|
|
|
|
|
|
60
|
0
|
0
|
|
|
|
if (not $self->{SKIPHASH}{'dynamic'}) { |
61
|
0
|
|
|
|
|
push(@m," |
62
|
|
|
|
|
|
$self->{BASEEXT}.def: Makefile.PL |
63
|
|
|
|
|
|
", |
64
|
|
|
|
|
|
' $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e \'use ExtUtils::Mksymlists; \\ |
65
|
|
|
|
|
|
Mksymlists("NAME" => "$(NAME)", "DLBASE" => "$(DLBASE)", ', |
66
|
|
|
|
|
|
'"VERSION" => "$(VERSION)", "DISTNAME" => "$(DISTNAME)", ', |
67
|
|
|
|
|
|
'"INSTALLDIRS" => "$(INSTALLDIRS)", ', |
68
|
|
|
|
|
|
'"DL_FUNCS" => ',neatvalue($funcs), |
69
|
|
|
|
|
|
', "FUNCLIST" => ',neatvalue($funclist), |
70
|
|
|
|
|
|
', "IMPORTS" => ',neatvalue($imports), |
71
|
|
|
|
|
|
', "DL_VARS" => ', neatvalue($vars), ');\' |
72
|
|
|
|
|
|
'); |
73
|
|
|
|
|
|
} |
74
|
0
|
0
|
0
|
|
|
if ($self->{IMPORTS} && %{$self->{IMPORTS}}) { |
|
0
|
|
|
|
|
|
75
|
|
|
|
|
|
# Make import files (needed for static build) |
76
|
0
|
0
|
0
|
|
|
-d 'tmp_imp' or mkdir 'tmp_imp', 0777 or die "Can't mkdir tmp_imp"; |
77
|
0
|
0
|
|
|
|
open my $imp, '>', 'tmpimp.imp' or die "Can't open tmpimp.imp"; |
78
|
0
|
|
|
|
|
while (my($name, $exp) = each %{$self->{IMPORTS}}) { |
|
0
|
|
|
|
|
|
79
|
0
|
0
|
|
|
|
my ($lib, $id) = ($exp =~ /(.*)\.(.*)/) or die "Malformed IMPORT `$exp'"; |
80
|
0
|
|
|
|
|
print $imp "$name $lib $id ?\n"; |
81
|
|
|
|
|
|
} |
82
|
0
|
0
|
|
|
|
close $imp or die "Can't close tmpimp.imp"; |
83
|
|
|
|
|
|
# print "emximp -o tmpimp$Config::Config{lib_ext} tmpimp.imp\n"; |
84
|
0
|
0
|
|
|
|
system "emximp -o tmpimp$Config::Config{lib_ext} tmpimp.imp" |
85
|
|
|
|
|
|
and die "Cannot make import library: $!, \$?=$?"; |
86
|
|
|
|
|
|
# May be running under miniperl, so have no glob... |
87
|
0
|
0
|
|
|
|
eval { unlink ; 1 } or system "rm tmp_imp/*"; |
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
88
|
0
|
0
|
|
|
|
system "cd tmp_imp; $Config::Config{ar} x ../tmpimp$Config::Config{lib_ext}" |
89
|
|
|
|
|
|
and die "Cannot extract import objects: $!, \$?=$?"; |
90
|
|
|
|
|
|
} |
91
|
0
|
|
|
|
|
join('',@m); |
92
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
94
|
|
|
|
|
|
sub static_lib { |
95
|
0
|
|
|
0
|
|
my($self) = @_; |
96
|
0
|
|
|
|
|
my $old = $self->ExtUtils::MM_Unix::static_lib(); |
97
|
0
|
0
|
0
|
|
|
return $old unless $self->{IMPORTS} && %{$self->{IMPORTS}}; |
|
0
|
|
|
|
|
|
98
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
my @chunks = split /\n{2,}/, $old; |
100
|
0
|
0
|
|
|
|
shift @chunks unless length $chunks[0]; # Empty lines at the start |
101
|
0
|
|
|
|
|
$chunks[0] .= <<'EOC'; |
102
|
|
|
|
|
|
|
103
|
|
|
|
|
|
$(AR) $(AR_STATIC_ARGS) $@ tmp_imp/* && $(RANLIB) $@ |
104
|
|
|
|
|
|
EOC |
105
|
0
|
|
|
|
|
return join "\n\n". '', @chunks; |
106
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
108
|
|
|
|
|
|
sub replace_manpage_separator { |
109
|
0
|
|
|
0
|
|
my($self,$man) = @_; |
110
|
0
|
|
|
|
|
$man =~ s,/+,.,g; |
111
|
0
|
|
|
|
|
$man; |
112
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
114
|
|
|
|
|
|
sub maybe_command { |
115
|
0
|
|
|
0
|
|
my($self,$file) = @_; |
116
|
0
|
|
|
|
|
$file =~ s,[/\\]+,/,g; |
117
|
0
|
0
|
0
|
|
|
return $file if -x $file && ! -d _; |
118
|
0
|
0
|
0
|
|
|
return "$file.exe" if -x "$file.exe" && ! -d _; |
119
|
0
|
0
|
0
|
|
|
return "$file.cmd" if -x "$file.cmd" && ! -d _; |
120
|
0
|
|
|
|
|
return; |
121
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
123
|
|
|
|
|
|
=item init_linker |
124
|
|
|
|
|
|
|
125
|
|
|
|
|
|
=cut |
126
|
|
|
|
|
|
|
127
|
|
|
|
|
|
sub init_linker { |
128
|
0
|
|
|
0
|
|
my $self = shift; |
129
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
$self->{PERL_ARCHIVE} = "\$(PERL_INC)/libperl\$(LIB_EXT)"; |
131
|
|
|
|
|
|
|
132
|
0
|
0
|
|
|
|
$self->{PERL_ARCHIVE_AFTER} = $OS2::is_aout |
133
|
|
|
|
|
|
? '' |
134
|
|
|
|
|
|
: '$(PERL_INC)/libperl_override$(LIB_EXT)'; |
135
|
0
|
|
|
|
|
$self->{EXPORT_LIST} = '$(BASEEXT).def'; |
136
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
138
|
|
|
|
|
|
=item os_flavor |
139
|
|
|
|
|
|
|
140
|
|
|
|
|
|
OS/2 is OS/2 |
141
|
|
|
|
|
|
|
142
|
|
|
|
|
|
=cut |
143
|
|
|
|
|
|
|
144
|
|
|
|
|
|
sub os_flavor { |
145
|
0
|
|
|
0
|
|
return('OS/2'); |
146
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
148
|
|
|
|
|
|
=back |
149
|
|
|
|
|
|
|
150
|
|
|
|
|
|
=cut |
151
|
|
|
|
|
|
|
152
|
|
|
|
|
|
1; |