X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FExtUtils%2FMM_Win95.pm;h=fe3c170c6b64f4c81ea8f114f2c1c3c53090c25c;hb=53273a086103cdbbf7ebdd5f1a18b2c0777cbc1b;hp=a6eddaeb3953316d7215f15af67b4ce8e00dafd5;hpb=f582e4890c8c9d8f1af27c006641dda54d419af6;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/ExtUtils/MM_Win95.pm b/lib/ExtUtils/MM_Win95.pm index a6eddae..fe3c170 100644 --- a/lib/ExtUtils/MM_Win95.pm +++ b/lib/ExtUtils/MM_Win95.pm @@ -1,11 +1,15 @@ package ExtUtils::MM_Win95; use vars qw($VERSION @ISA); -$VERSION = 0.02; +$VERSION = 0.03; require ExtUtils::MM_Win32; @ISA = qw(ExtUtils::MM_Win32); +use Config; +my $DMAKE = $Config{'make'} =~ /^dmake/i; +my $NMAKE = $Config{'make'} =~ /^nmake/i; + =head1 NAME @@ -20,50 +24,214 @@ ExtUtils::MM_Win95 - method to customize MakeMaker for Win9X This is a subclass of ExtUtils::MM_Win32 containing changes necessary to get MakeMaker playing nice with command.com and other Win9Xisms. +=head2 Overriden methods + +Most of these make up for limitations in the Win9x command shell. +Namely the lack of && and that a chdir is global, so you have to chdir +back at the end. + +=over 4 + +=item dist_test + +&& and chdir problem. + =cut sub dist_test { my($self) = shift; return q{ disttest : distdir - cd $(DISTVNAME) - $(ABSPERLRUN) Makefile.PL - $(MAKE) $(PASTHRU) - $(MAKE) test $(PASTHRU) - cd .. + cd $(DISTVNAME) + $(ABSPERLRUN) Makefile.PL + $(MAKE) $(PASTHRU) + $(MAKE) test $(PASTHRU) + cd .. }; } +=item subdir_x + +&& and chdir problem. + +Also, dmake has an odd way of making a command series silent. + +=cut + +sub subdir_x { + my($self, $subdir) = @_; + + # Win-9x has nasty problem in command.com that can't cope with + # &&. Also, Dmake has an odd way of making a commandseries silent: + if ($DMAKE) { + return sprintf <<'EOT', $subdir; + +subdirs :: +@[ + cd %s + $(MAKE) all $(PASTHRU) + cd .. +] +EOT + } + else { + return sprintf <<'EOT', $subdir; + +subdirs :: + $(NOECHO)cd %s + $(NOECHO)$(MAKE) all $(PASTHRU) + $(NOECHO)cd .. +EOT + } +} + +=item xs_c + +The && problem. + +=cut + sub xs_c { my($self) = shift; return '' unless $self->needs_linking(); ' .xs.c: - $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\ - $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c + $(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c ' } + +=item xs_cpp + +The && problem + +=cut + sub xs_cpp { my($self) = shift; return '' unless $self->needs_linking(); ' .xs.cpp: - $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\ - $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.cpp + $(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.cpp '; } -# many makes are too dumb to use xs_c then c_o +=item xs_o + +The && problem. + +=cut + sub xs_o { my($self) = shift; return '' unless $self->needs_linking(); ' .xs$(OBJ_EXT): - $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\ - $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c + $(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c '; } +=item clean_subdirs_target + +&& and chdir problem. + +=cut + +sub clean_subdirs_target { + my($self) = shift; + + # No subdirectories, no cleaning. + return <<'NOOP_FRAG' unless @{$self->{DIR}}; +clean_subdirs : + $(NOECHO)$(NOOP) +NOOP_FRAG + + + my $clean = "clean_subdirs :\n"; + + for my $dir (@{$self->{DIR}}) { + $clean .= sprintf <<'MAKE_FRAG', $dir; + cd %s + $(TEST_F) $(FIRST_MAKEFILE) + $(MAKE) clean + cd .. +MAKE_FRAG + } + + return $clean; +} + + +=item realclean_subdirs_target + +&& and chdir problem. + +=cut + +sub realclean_subdirs_target { + my $self = shift; + + return <<'NOOP_FRAG' unless @{$self->{DIR}}; +realclean_subdirs : + $(NOECHO)$(NOOP) +NOOP_FRAG + + my $rclean = "realclean_subdirs :\n"; + + foreach my $dir (@{$self->{DIR}}){ + $rclean .= sprintf <<'RCLEAN', $dir; + -cd %s + -$(PERLRUN) -e "exit unless -f shift; system q{$(MAKE) realclean}" $(FIRST_MAKEFILE) + -cd .. +RCLEAN + + } + + return $rclean; +} + + +=item max_exec_len + +Win98 chokes on things like Encode if we set the max length to nmake's max +of 2K. So we go for a more conservative value of 1K. + +=cut + +sub max_exec_len { + my $self = shift; + + return $self->{_MAX_EXEC_LEN} ||= 1024; +} + + +=item os_flavor + +Win95 and Win98 and WinME are collectively Win9x and Win32 + +=cut + +sub os_flavor { + my $self = shift; + return ($self->SUPER::os_flavor, 'Win9x'); +} + + +=back + + +=head1 AUTHOR + +Code originally inside MM_Win32. Original author unknown. + +Currently maintained by Michael G Schwern C. + +Send patches and ideas to C. + +See http://www.makemaker.org. + +=cut + + 1;