This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: 5.8.1 and gcc-3.2.3 (& Win98)
[perl5.git] / lib / ExtUtils / MM_Win95.pm
CommitLineData
f6d6199c
MS
1package ExtUtils::MM_Win95;
2
3use vars qw($VERSION @ISA);
dedf98bc 4$VERSION = 0.03;
f6d6199c
MS
5
6require ExtUtils::MM_Win32;
7@ISA = qw(ExtUtils::MM_Win32);
479d2113 8
fdabeebc 9use Config;
479d2113
MS
10my $DMAKE = 1 if $Config{'make'} =~ /^dmake/i;
11my $NMAKE = 1 if $Config{'make'} =~ /^nmake/i;
12
f6d6199c 13
f582e489
MS
14=head1 NAME
15
16ExtUtils::MM_Win95 - method to customize MakeMaker for Win9X
17
18=head1 SYNOPSIS
19
20 You should not be using this module directly.
21
22=head1 DESCRIPTION
23
24This is a subclass of ExtUtils::MM_Win32 containing changes necessary
25to get MakeMaker playing nice with command.com and other Win9Xisms.
26
479d2113
MS
27=head2 Overriden methods
28
29Most of these make up for limitations in the Win9x command shell.
30Namely the lack of && and that a chdir is global, so you have to chdir
31back at the end.
32
33=over 4
34
35=item dist_test
36
37&& and chdir problem.
38
f582e489 39=cut
f6d6199c 40
e0678a30
MS
41sub dist_test {
42 my($self) = shift;
43 return q{
44disttest : distdir
415c4738
MB
45 cd $(DISTVNAME)
46 $(ABSPERLRUN) Makefile.PL
47 $(MAKE) $(PASTHRU)
48 $(MAKE) test $(PASTHRU)
49 cd ..
e0678a30
MS
50};
51}
52
479d2113
MS
53=item subdir_x
54
55&& and chdir problem.
56
57Also, dmake has an odd way of making a command series silent.
58
59=cut
60
61sub subdir_x {
62 my($self, $subdir) = @_;
63
64 # Win-9x has nasty problem in command.com that can't cope with
65 # &&. Also, Dmake has an odd way of making a commandseries silent:
66 if ($DMAKE) {
67 return sprintf <<'EOT', $subdir;
68
69subdirs ::
70@[
71 cd %s
72 $(MAKE) all $(PASTHRU)
73 cd ..
74]
75EOT
76 }
77 else {
78 return sprintf <<'EOT', $subdir;
79
80subdirs ::
81 $(NOECHO)cd %s
82 $(NOECHO)$(MAKE) all $(PASTHRU)
83 $(NOECHO)cd ..
84EOT
85 }
86}
87
88=item xs_c
89
90The && problem.
91
92=cut
93
f6d6199c
MS
94sub xs_c {
95 my($self) = shift;
96 return '' unless $self->needs_linking();
97 '
98.xs.c:
479d2113 99 $(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c
f6d6199c
MS
100 '
101}
102
479d2113
MS
103
104=item xs_cpp
105
106The && problem
107
108=cut
109
f6d6199c
MS
110sub xs_cpp {
111 my($self) = shift;
112 return '' unless $self->needs_linking();
113 '
114.xs.cpp:
479d2113 115 $(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.cpp
f6d6199c
MS
116 ';
117}
118
479d2113
MS
119=item xs_o
120
121The && problem.
122
123=cut
124
f6d6199c
MS
125sub xs_o {
126 my($self) = shift;
127 return '' unless $self->needs_linking();
f8f79f57
GM
128 # Having to choose between .xs -> .c -> .o and .xs -> .o confuses dmake.
129 return '' if $DMAKE;
f6d6199c
MS
130 '
131.xs$(OBJ_EXT):
479d2113 132 $(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c
f6d6199c
MS
133 $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
134 ';
135}
4da32025 136
479d2113
MS
137=item clean_subdirs_target
138
139&& and chdir problem.
140
141=cut
142
143sub clean_subdirs_target {
144 my($self) = shift;
145
146 # No subdirectories, no cleaning.
147 return <<'NOOP_FRAG' unless @{$self->{DIR}};
148clean_subdirs :
149 $(NOECHO)$(NOOP)
150NOOP_FRAG
151
152
153 my $clean = "clean_subdirs :\n";
154
155 for my $dir (@{$self->{DIR}}) {
156 $clean .= sprintf <<'MAKE_FRAG', $dir;
157 cd %s
158 $(TEST_F) $(FIRST_MAKEFILE)
159 $(MAKE) clean
160 cd ..
161MAKE_FRAG
162 }
163
164 return $clean;
165}
166
167
168=item realclean_subdirs_target
169
170&& and chdir problem.
171
172=cut
173
174sub realclean_subdirs_target {
175 my $self = shift;
176
177 return <<'NOOP_FRAG' unless @{$self->{DIR}};
178realclean_subdirs :
179 $(NOECHO)$(NOOP)
180NOOP_FRAG
181
182 my $rclean = "realclean_subdirs :\n";
183
184 foreach my $dir (@{$self->{DIR}}){
185 $rclean .= sprintf <<'RCLEAN', $dir;
186 -cd %s
187 -$(PERLRUN) -e "exit unless -f shift; system q{$(MAKE) realclean}" $(FIRST_MAKEFILE)
188 -cd ..
189RCLEAN
190
191 }
192
193 return $rclean;
194}
195
196
dedf98bc
MS
197=item os_flavor
198
199Win95 and Win98 and WinME are collectively Win9x and Win32
200
201=cut
202
203sub os_flavor {
204 my $self = shift;
205 return ($self->SUPER::os_flavor, 'Win9x');
206}
207
208
479d2113
MS
209=back
210
211
212=head1 AUTHOR
213
214Code originally inside MM_Win32. Original author unknown.
215
216Currently maintained by Michael G Schwern <schwern@pobox.com>.
217
218Send patches and ideas to <F<makemaker@perl.org>>.
219
220See http://www.makemaker.org.
221
222=cut
223
224
4da32025 2251;