Re: New harness is failing things
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / MM_Cygwin.pm
CommitLineData
f89d6eaa 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 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}}) {
b53af0b8 74 grep { $self->{MAN1PODS}{$_} =~ s/::/./g } keys %{$self->{MAN1PODS}};
75 grep { $self->{MAN3PODS}{$_} =~ s/::/./g } keys %{$self->{MAN3PODS}};
f89d6eaa 76 push @m, "\t$self->{NOECHO}\$(POD2MAN) \\\n\t";
77 push @m, join " \\\n\t", %{$self->{MAN1PODS}}, %{$self->{MAN3PODS}};
78 }
79 join('', @m);
80}
81
82sub perl_archive
83{
84 return '$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a");
85}
86
871;
88__END__
89
90=head1 NAME
91
92ExtUtils::MM_Cygwin - methods to override UN*X behaviour in ExtUtils::MakeMaker
93
94=head1 SYNOPSIS
95
96 use ExtUtils::MM_Cygwin; # Done internally by ExtUtils::MakeMaker if needed
97
98=head1 DESCRIPTION
99
100See ExtUtils::MM_Unix for a documentation of the methods provided there.
101
102=over
103
104=item canonpath
105
106replaces backslashes with forward ones. then acts as *nixish.
107
108=item cflags
109
110if configured for dynamic loading, triggers #define EXT in EXTERN.h
111
112=item manifypods
113
114replaces strings '::' with '.' in man page names
115
116=item perl_archive
117
118points to libperl.a
1cab015a 119
120=back
121
122=cut
123