| 1 | package ExtUtils::MM_Cygwin; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use ExtUtils::MakeMaker::Config; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use File::Spec; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | require ExtUtils::MM_Unix; | |||||||||||||||||||||||||||
| 9 | 1 | require ExtUtils::MM_Win32; | |||||||||||||||||||||||||||
| 10 | 1 | our @ISA = qw( ExtUtils::MM_Unix ); | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 1 | our $VERSION = '7.13_01'; | |||||||||||||||||||||||||||
| 13 | 1 | $VERSION = eval $VERSION; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | =head1 NAME | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | ExtUtils::MM_Cygwin - methods to override UN*X behaviour in ExtUtils::MakeMaker | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | use ExtUtils::MM_Cygwin; # Done internally by ExtUtils::MakeMaker if needed | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | See ExtUtils::MM_Unix for a documentation of the methods provided there. | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | =over 4 | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | =item os_flavor | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | We're Unix and Cygwin. | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | =cut | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | sub os_flavor { | ||||||||||||||||||||||||||||
| 37 | 0 | ▶ | return('Unix', 'Cygwin'); | ||||||||||||||||||||||||||
|
Subroutine
os_flavor: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | =item cflags | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | if configured for dynamic loading, triggers #define EXT in EXTERN.h | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | =cut | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | sub cflags { | ||||||||||||||||||||||||||||
| 47 | 0 | ▶ | my($self,$libperl)=@_; | ||||||||||||||||||||||||||
|
Subroutine
cflags: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||
| 48 | 0 | ▶ | return $self->{CFLAGS} if $self->{CFLAGS}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 49 | 0 | ▶ | return '' unless $self->needs_linking(); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 0 | my $base = $self->SUPER::cflags($libperl); | |||||||||||||||||||||||||||
| 52 | 0 | foreach (split /\n/, $base) { | |||||||||||||||||||||||||||
| 53 | 0 | ▶ | /^(\S*)\s*=\s*(\S*)$/ and $self->{$1} = $2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 54 | }; | ||||||||||||||||||||||||||||
| 55 | 0 | ▶ | $self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 0 | return $self->{CFLAGS} = qq{ | |||||||||||||||||||||||||||
| 58 | CCFLAGS = $self->{CCFLAGS} | ||||||||||||||||||||||||||||
| 59 | OPTIMIZE = $self->{OPTIMIZE} | ||||||||||||||||||||||||||||
| 60 | PERLTYPE = $self->{PERLTYPE} | ||||||||||||||||||||||||||||
| 61 | }; | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | =item replace_manpage_separator | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | replaces strings '::' with '.' in MAN*POD man page names | ||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | =cut | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | sub replace_manpage_separator { | ||||||||||||||||||||||||||||
| 73 | 0 | ▶ | my($self, $man) = @_; | ||||||||||||||||||||||||||
|
Subroutine
replace_manpage_separator: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 74 | 0 | $man =~ s{/+}{.}g; | |||||||||||||||||||||||||||
| 75 | 0 | return $man; | |||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | =item init_linker | ||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | points to libperl.a | ||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | =cut | ||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | sub init_linker { | ||||||||||||||||||||||||||||
| 85 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
init_linker: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | 0 | ▶ | if ($Config{useshrplib} eq 'true') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 88 | 0 | my $libperl = '$(PERL_INC)' .'/'. "$Config{libperl}"; | |||||||||||||||||||||||||||
| 89 | 0 | ▶ | if( $] >= 5.006002 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 90 | 0 | $libperl =~ s/a$/dll.a/; | |||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||
| 92 | 0 | $self->{PERL_ARCHIVE} = $libperl; | |||||||||||||||||||||||||||
| 93 | } else { | ||||||||||||||||||||||||||||
| 94 | $self->{PERL_ARCHIVE} = | ||||||||||||||||||||||||||||
| 95 | 0 | ▶ | '$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a"); | ||||||||||||||||||||||||||
|
Condition0%0/2
"$ExtUtils::MM_Cygwin::Config{'libperl'}" || 'libperl.a'
MC/DC0%0/1
"$ExtUtils::MM_Cygwin::Config{'libperl'}" || 'libperl.a'
"$ExtUtils::MM_Cygwin::Config{'libperl'}"
Truth table0%0/2
A
A= "$ExtUtils::MM_Cygwin::Config{'libperl'}"
| |||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | 0 | ▶ | $self->{PERL_ARCHIVEDEP} ||= ''; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"PERL_ARCHIVEDEP"} ||= ""
MC/DC0%0/1
$self->{"PERL_ARCHIVEDEP"} ||= ""
$self->{"PERL_ARCHIVEDEP"}
Truth table0%0/2
A
A= $self->{"PERL_ARCHIVEDEP"}
| |||||||||||||||||||||||||||||
| 99 | 0 | ▶ | $self->{PERL_ARCHIVE_AFTER} ||= ''; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"PERL_ARCHIVE_AFTER"} ||= ""
MC/DC0%0/1
$self->{"PERL_ARCHIVE_AFTER"} ||= ""
$self->{"PERL_ARCHIVE_AFTER"}
Truth table0%0/2
A
A= $self->{"PERL_ARCHIVE_AFTER"}
| |||||||||||||||||||||||||||||
| 100 | 0 | ▶ | $self->{EXPORT_LIST} ||= ''; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"EXPORT_LIST"} ||= ""
MC/DC0%0/1
$self->{"EXPORT_LIST"} ||= ""
$self->{"EXPORT_LIST"}
Truth table0%0/2
A
A= $self->{"EXPORT_LIST"}
| |||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | =item maybe_command | ||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | Determine whether a file is native to Cygwin by checking whether it | ||||||||||||||||||||||||||||
| 106 | resides inside the Cygwin installation (using Windows paths). If so, | ||||||||||||||||||||||||||||
| 107 | use C<ExtUtils::MM_Unix> to determine if it may be a command. | ||||||||||||||||||||||||||||
| 108 | Otherwise use the tests from C<ExtUtils::MM_Win32>. | ||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | =cut | ||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | sub maybe_command { | ||||||||||||||||||||||||||||
| 113 | 0 | ▶ | my ($self, $file) = @_; | ||||||||||||||||||||||||||
|
Subroutine
maybe_command: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||
| 115 | 0 | my $cygpath = Cygwin::posix_to_win_path('/', 1); | |||||||||||||||||||||||||||
| 116 | 0 | my $filepath = Cygwin::posix_to_win_path($file, 1); | |||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||
| 118 | 0 | ▶ | return (substr($filepath,0,length($cygpath)) eq $cygpath) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 119 | ? $self->SUPER::maybe_command($file) # Unix | ||||||||||||||||||||||||||||
| 120 | : ExtUtils::MM_Win32->maybe_command($file); # Win32 | ||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||
| 123 | =item dynamic_lib | ||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | Use the default to produce the *.dll's. | ||||||||||||||||||||||||||||
| 126 | But for new archdir dll's use the same rebase address if the old exists. | ||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||
| 128 | =cut | ||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||
| 130 | sub dynamic_lib { | ||||||||||||||||||||||||||||
| 131 | 0 | ▶ | my($self, %attribs) = @_; | ||||||||||||||||||||||||||
|
Subroutine
dynamic_lib: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||
| 132 | 0 | my $s = ExtUtils::MM_Unix::dynamic_lib($self, %attribs); | |||||||||||||||||||||||||||
| 133 | 0 | ▶ | return '' unless $s; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 134 | 0 | ▶ | return $s unless %{$self->{XS}}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||
| 136 | # do an ephemeral rebase so the new DLL fits to the current rebase map | ||||||||||||||||||||||||||||
| 137 | 0 | ▶ | $s .= "\t/bin/find \$\(INST_ARCHLIB\)/auto -xdev -name \\*.$self->{DLEXT} | /bin/rebase -sOT -" if (( $Config{myarchname} eq 'i686-cygwin' ) and not ( exists $ENV{CYGPORT_PACKAGE_VERSION} )); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin" and not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
MC/DC0%0/2
$ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin" and not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
$ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin"
not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
Truth table0%0/3
A and not(B)
A= $ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin"B= not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
| |||||||||||||||||||||||||||||
| 138 | 0 | $s; | |||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||
| 141 | =item install | ||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||
| 143 | Rebase dll's with the global rebase database after installation. | ||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||
| 145 | =cut | ||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||
| 147 | sub install { | ||||||||||||||||||||||||||||
| 148 | 0 | ▶ | my($self, %attribs) = @_; | ||||||||||||||||||||||||||
|
Subroutine
install: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||
| 149 | 0 | my $s = ExtUtils::MM_Unix::install($self, %attribs); | |||||||||||||||||||||||||||
| 150 | 0 | ▶ | return '' unless $s; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 151 | 0 | ▶ | return $s unless %{$self->{XS}}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||
| 153 | 0 | my $INSTALLDIRS = $self->{INSTALLDIRS}; | |||||||||||||||||||||||||||
| 154 | 0 | ▶ | my $INSTALLLIB = $self->{"INSTALL". ($INSTALLDIRS eq 'perl' ? 'ARCHLIB' : uc($INSTALLDIRS)."ARCH")}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 155 | 0 | my $dop = "\$\(DESTDIR\)$INSTALLLIB/auto/"; | |||||||||||||||||||||||||||
| 156 | 0 | my $dll = "$dop/$self->{FULLEXT}/$self->{BASEEXT}.$self->{DLEXT}"; | |||||||||||||||||||||||||||
| 157 | 0 | ▶ | $s =~ s|^(pure_install :: pure_\$\(INSTALLDIRS\)_install\n\t)\$\(NOECHO\) \$\(NOOP\)\n|$1\$(CHMOD) \$(PERM_RWX) $dll\n\t/bin/find $dop -xdev -name \\*.$self->{DLEXT} \| /bin/rebase -sOT -\n|m if (( $Config{myarchname} eq 'i686-cygwin') and not ( exists $ENV{CYGPORT_PACKAGE_VERSION} )); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin" and not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
MC/DC0%0/2
$ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin" and not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
$ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin"
not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
Truth table0%0/3
A and not(B)
A= $ExtUtils::MM_Cygwin::Config{"myarchname"} eq "i686-cygwin"B= not exists $ENV{"CYGPORT_PACKAGE_VERSION"}
| |||||||||||||||||||||||||||||
| 158 | 0 | $s; | |||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||
| 161 | =item all_target | ||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | Build man pages, too | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | =cut | ||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||
| 167 | sub all_target { | ||||||||||||||||||||||||||||
| 168 | 0 | ▶ | ExtUtils::MM_Unix::all_target(shift); | ||||||||||||||||||||||||||
|
Subroutine
all_target: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||
| 171 | =back | ||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||
| 173 | =cut | ||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||
| 175 | 1 | 1; | |||||||||||||||||||||||||||