Pre-YAPC consting fun
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / MM_Win95.pm
index 0c50461..d0e2cb2 100644 (file)
@@ -1,14 +1,12 @@
 package ExtUtils::MM_Win95;
 
 use vars qw($VERSION @ISA);
-$VERSION = 0.03;
+$VERSION = '0.04';
 
 require ExtUtils::MM_Win32;
 @ISA = qw(ExtUtils::MM_Win32);
 
-use Config;\r
-my $DMAKE = 1 if $Config{'make'} =~ /^dmake/i;
-my $NMAKE = 1 if $Config{'make'} =~ /^nmake/i;
+use ExtUtils::MakeMaker::Config;
 
 
 =head1 NAME
@@ -26,64 +24,11 @@ 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.
+Most of these make up for limitations in the Win9x/nmake command shell.
+Mostly its lack of &&.
 
 =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 ..
-};
-}
-
-=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
 
@@ -96,7 +41,7 @@ sub xs_c {
     return '' unless $self->needs_linking();
     '
 .xs.c:
-       $(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c
+       $(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c
        '
 }
 
@@ -112,7 +57,7 @@ sub xs_cpp {
     return '' unless $self->needs_linking();
     '
 .xs.cpp:
-       $(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.cpp
+       $(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.cpp
        ';
 }
 
@@ -127,68 +72,23 @@ sub xs_o {
     return '' unless $self->needs_linking();
     '
 .xs$(OBJ_EXT):
-       $(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c
+       $(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c
        $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
        ';
 }
 
-=item clean_subdirs_target
 
-&& and chdir problem.
+=item max_exec_len
 
-=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.
+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 realclean_subdirs_target {
+sub max_exec_len {
     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;
+    return $self->{_MAX_EXEC_LEN} ||= 1024;
 }