This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add more encoding tables.
[perl5.git] / lib / ExtUtils / MM_Cygwin.pm
CommitLineData
f89d6eaa
FE
1package ExtUtils::MM_Cygwin;
2
3use Config;
4#use Cwd;
5#use File::Basename;
6require Exporter;
7
8Exporter::import('ExtUtils::MakeMaker',
9 qw( $Verbose &neatvalue));
10
11unshift @MM::ISA, 'ExtUtils::MM_Cygwin';
12
13sub canonpath {
14 my($self,$path) = @_;
15 $path =~ s|\\|/|g;
16 return $self->ExtUtils::MM_Unix::canonpath($path);
17}
18
19sub cflags {
20 my($self,$libperl)=@_;
21 return $self->{CFLAGS} if $self->{CFLAGS};
22 my $base =$self->ExtUtils::MM_Unix::cflags($libperl);
23 foreach (split /\n/, $base) {
24 / *= */ and $self->{$`} = $';
25 };
26 $self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true');
f89d6eaa
FE
27
28 return $self->{CFLAGS} = qq{
29CCFLAGS = $self->{CCFLAGS}
30OPTIMIZE = $self->{OPTIMIZE}
31PERLTYPE = $self->{PERLTYPE}
32LARGE = $self->{LARGE}
33SPLIT = $self->{SPLIT}
34};
35
36}
37
38sub manifypods {
39 my($self, %attribs) = @_;
40 return "\nmanifypods : pure_all\n\t$self->{NOECHO}\$(NOOP)\n" unless
41 %{$self->{MAN3PODS}} or %{$self->{MAN1PODS}};
42 my($dist);
43 my($pod2man_exe);
44 if (defined $self->{PERL_SRC}) {
45 $pod2man_exe = $self->catfile($self->{PERL_SRC},'pod','pod2man');
46 } else {
47 $pod2man_exe = $self->catfile($Config{scriptdirexp},'pod2man');
48 }
49 unless ($self->perl_script($pod2man_exe)) {
50 # No pod2man but some MAN3PODS to be installed
51 print <<END;
52
53Warning: I could not locate your pod2man program. Please make sure,
54 your pod2man program is in your PATH before you execute 'make'
55
56END
57 $pod2man_exe = "-S pod2man";
58 }
59 my(@m);
60 push @m,
61qq[POD2MAN_EXE = $pod2man_exe\n],
62qq[POD2MAN = \$(PERL) -we '%m=\@ARGV;for (keys %m){' \\\n],
63q[-e 'next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M "],
64 $self->{MAKEFILE}, q[";' \\
65-e 'print "Manifying $$m{$$_}\n"; $$m{$$_} =~ s/::/./g;' \\
66-e 'system(qq[$$^X ].q["-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" $(POD2MAN_EXE) ].qq[$$_>$$m{$$_}])==0 or warn "Couldn\\047t install $$m{$$_}\n";' \\
67-e 'chmod(oct($(PERM_RW))), $$m{$$_} or warn "chmod $(PERM_RW) $$m{$$_}: $$!\n";}'
68];
69 push @m, "\nmanifypods : pure_all ";
70 push @m, join " \\\n\t", keys %{$self->{MAN1PODS}}, keys %{$self->{MAN3PODS}};
71
72 push(@m,"\n");
73 if (%{$self->{MAN1PODS}} || %{$self->{MAN3PODS}}) {
74 push @m, "\t$self->{NOECHO}\$(POD2MAN) \\\n\t";
75 push @m, join " \\\n\t", %{$self->{MAN1PODS}}, %{$self->{MAN3PODS}};
76 }
77 join('', @m);
78}
79
80sub perl_archive
81{
82 return '$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a");
83}
84
851;
86__END__
87
88=head1 NAME
89
90ExtUtils::MM_Cygwin - methods to override UN*X behaviour in ExtUtils::MakeMaker
91
92=head1 SYNOPSIS
93
94 use ExtUtils::MM_Cygwin; # Done internally by ExtUtils::MakeMaker if needed
95
96=head1 DESCRIPTION
97
98See ExtUtils::MM_Unix for a documentation of the methods provided there.
99
100=over
101
102=item canonpath
103
104replaces backslashes with forward ones. then acts as *nixish.
105
106=item cflags
107
108if configured for dynamic loading, triggers #define EXT in EXTERN.h
109
110=item manifypods
111
112replaces strings '::' with '.' in man page names
113
114=item perl_archive
115
116points to libperl.a
1cab015a
FE
117
118=back
119
120=cut
121