line |
stmt |
bran |
cond |
sub |
time |
code |
1
|
|
|
|
|
|
package ExtUtils::MM_Cygwin; |
2
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
826
|
use strict; |
|
1
|
|
|
|
3
|
|
|
1
|
|
|
|
42
|
|
4
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
6
|
use ExtUtils::MakeMaker::Config; |
|
1
|
|
|
|
2
|
|
|
1
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
5
|
use File::Spec; |
|
1
|
|
|
|
3
|
|
|
1
|
|
|
|
1012
|
|
7
|
|
|
|
|
|
|
8
|
|
|
|
|
|
require ExtUtils::MM_Unix; |
9
|
|
|
|
|
|
require ExtUtils::MM_Win32; |
10
|
|
|
|
|
|
our @ISA = qw( ExtUtils::MM_Unix ); |
11
|
|
|
|
|
|
|
12
|
|
|
|
|
|
our $VERSION = '6.74'; |
13
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
15
|
|
|
|
|
|
=head1 NAME |
16
|
|
|
|
|
|
|
17
|
|
|
|
|
|
ExtUtils::MM_Cygwin - methods to override UN*X behaviour in ExtUtils::MakeMaker |
18
|
|
|
|
|
|
|
19
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
21
|
|
|
|
|
|
use ExtUtils::MM_Cygwin; # Done internally by ExtUtils::MakeMaker if needed |
22
|
|
|
|
|
|
|
23
|
|
|
|
|
|
=head1 DESCRIPTION |
24
|
|
|
|
|
|
|
25
|
|
|
|
|
|
See ExtUtils::MM_Unix for a documentation of the methods provided there. |
26
|
|
|
|
|
|
|
27
|
|
|
|
|
|
=over 4 |
28
|
|
|
|
|
|
|
29
|
|
|
|
|
|
=item os_flavor |
30
|
|
|
|
|
|
|
31
|
|
|
|
|
|
We're Unix and Cygwin. |
32
|
|
|
|
|
|
|
33
|
|
|
|
|
|
=cut |
34
|
|
|
|
|
|
|
35
|
|
|
|
|
|
sub os_flavor { |
36
|
0
|
|
|
0
|
|
return('Unix', 'Cygwin'); |
37
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
39
|
|
|
|
|
|
=item cflags |
40
|
|
|
|
|
|
|
41
|
|
|
|
|
|
if configured for dynamic loading, triggers #define EXT in EXTERN.h |
42
|
|
|
|
|
|
|
43
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
45
|
|
|
|
|
|
sub cflags { |
46
|
0
|
|
|
0
|
|
my($self,$libperl)=@_; |
47
|
0
|
0
|
|
|
|
return $self->{CFLAGS} if $self->{CFLAGS}; |
48
|
0
|
0
|
|
|
|
return '' unless $self->needs_linking(); |
49
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
my $base = $self->SUPER::cflags($libperl); |
51
|
0
|
|
|
|
|
foreach (split /\n/, $base) { |
52
|
0
|
0
|
|
|
|
/^(\S*)\s*=\s*(\S*)$/ and $self->{$1} = $2; |
53
|
|
|
|
|
|
}; |
54
|
0
|
0
|
|
|
|
$self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true'); |
55
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
return $self->{CFLAGS} = qq{ |
57
|
|
|
|
|
|
CCFLAGS = $self->{CCFLAGS} |
58
|
|
|
|
|
|
OPTIMIZE = $self->{OPTIMIZE} |
59
|
|
|
|
|
|
PERLTYPE = $self->{PERLTYPE} |
60
|
|
|
|
|
|
}; |
61
|
|
|
|
|
|
|
62
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
65
|
|
|
|
|
|
=item replace_manpage_separator |
66
|
|
|
|
|
|
|
67
|
|
|
|
|
|
replaces strings '::' with '.' in MAN*POD man page names |
68
|
|
|
|
|
|
|
69
|
|
|
|
|
|
=cut |
70
|
|
|
|
|
|
|
71
|
|
|
|
|
|
sub replace_manpage_separator { |
72
|
0
|
|
|
0
|
|
my($self, $man) = @_; |
73
|
0
|
|
|
|
|
$man =~ s{/+}{.}g; |
74
|
0
|
|
|
|
|
return $man; |
75
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
77
|
|
|
|
|
|
=item init_linker |
78
|
|
|
|
|
|
|
79
|
|
|
|
|
|
points to libperl.a |
80
|
|
|
|
|
|
|
81
|
|
|
|
|
|
=cut |
82
|
|
|
|
|
|
|
83
|
|
|
|
|
|
sub init_linker { |
84
|
0
|
|
|
0
|
|
my $self = shift; |
85
|
|
|
|
|
|
|
86
|
0
|
0
|
|
|
|
if ($Config{useshrplib} eq 'true') { |
87
|
0
|
|
|
|
|
my $libperl = '$(PERL_INC)' .'/'. "$Config{libperl}"; |
88
|
0
|
0
|
|
|
|
if( $] >= 5.006002 ) { |
89
|
0
|
|
|
|
|
$libperl =~ s/a$/dll.a/; |
90
|
|
|
|
|
|
} |
91
|
0
|
|
|
|
|
$self->{PERL_ARCHIVE} = $libperl; |
92
|
|
|
|
|
|
} else { |
93
|
0
|
|
0
|
|
|
$self->{PERL_ARCHIVE} = |
94
|
|
|
|
|
|
'$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a"); |
95
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
97
|
0
|
|
0
|
|
|
$self->{PERL_ARCHIVE_AFTER} ||= ''; |
98
|
0
|
|
0
|
|
|
$self->{EXPORT_LIST} ||= ''; |
99
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
101
|
|
|
|
|
|
=item maybe_command |
102
|
|
|
|
|
|
|
103
|
|
|
|
|
|
Determine whether a file is native to Cygwin by checking whether it |
104
|
|
|
|
|
|
resides inside the Cygwin installation (using Windows paths). If so, |
105
|
|
|
|
|
|
use C to determine if it may be a command. |
106
|
|
|
|
|
|
Otherwise use the tests from C. |
107
|
|
|
|
|
|
|
108
|
|
|
|
|
|
=cut |
109
|
|
|
|
|
|
|
110
|
|
|
|
|
|
sub maybe_command { |
111
|
0
|
|
|
0
|
|
my ($self, $file) = @_; |
112
|
|
|
|
|
|
|
113
|
0
|
|
|
|
|
my $cygpath = Cygwin::posix_to_win_path('/', 1); |
114
|
0
|
|
|
|
|
my $filepath = Cygwin::posix_to_win_path($file, 1); |
115
|
|
|
|
|
|
|
116
|
0
|
0
|
|
|
|
return (substr($filepath,0,length($cygpath)) eq $cygpath) |
117
|
|
|
|
|
|
? $self->SUPER::maybe_command($file) # Unix |
118
|
|
|
|
|
|
: ExtUtils::MM_Win32->maybe_command($file); # Win32 |
119
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
121
|
|
|
|
|
|
=item dynamic_lib |
122
|
|
|
|
|
|
|
123
|
|
|
|
|
|
Use the default to produce the *.dll's. |
124
|
|
|
|
|
|
But for new archdir dll's use the same rebase address if the old exists. |
125
|
|
|
|
|
|
|
126
|
|
|
|
|
|
=cut |
127
|
|
|
|
|
|
|
128
|
|
|
|
|
|
sub dynamic_lib { |
129
|
0
|
|
|
0
|
|
my($self, %attribs) = @_; |
130
|
0
|
|
|
|
|
my $s = ExtUtils::MM_Unix::dynamic_lib($self, %attribs); |
131
|
0
|
|
|
|
|
my $ori = "$self->{INSTALLARCHLIB}/auto/$self->{FULLEXT}/$self->{BASEEXT}.$self->{DLEXT}"; |
132
|
0
|
0
|
|
|
|
if (-e $ori) { |
133
|
0
|
|
|
|
|
my $imagebase = `/bin/objdump -p $ori | /bin/grep ImageBase | /bin/cut -c12-`; |
134
|
0
|
|
|
|
|
chomp $imagebase; |
135
|
0
|
0
|
|
|
|
if ($imagebase gt "40000000") { |
136
|
0
|
|
|
|
|
my $LDDLFLAGS = $self->{LDDLFLAGS}; |
137
|
0
|
|
|
|
|
$LDDLFLAGS =~ s/-Wl,--enable-auto-image-base/-Wl,--image-base=0x$imagebase/; |
138
|
0
|
|
|
|
|
$s =~ s/ \$\(LDDLFLAGS\) / $LDDLFLAGS /m; |
139
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
} |
141
|
0
|
|
|
|
|
$s; |
142
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
144
|
|
|
|
|
|
=item all_target |
145
|
|
|
|
|
|
|
146
|
|
|
|
|
|
Build man pages, too |
147
|
|
|
|
|
|
|
148
|
|
|
|
|
|
=cut |
149
|
|
|
|
|
|
|
150
|
|
|
|
|
|
sub all_target { |
151
|
0
|
|
|
0
|
|
ExtUtils::MM_Unix::all_target(shift); |
152
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
154
|
|
|
|
|
|
=back |
155
|
|
|
|
|
|
|
156
|
|
|
|
|
|
=cut |
157
|
|
|
|
|
|
|
158
|
|
|
|
|
|
1; |