diff options
author | Michael G. Schwern <schwern@pobox.com> | 2003-03-30 18:42:58 -0800 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-03-31 09:54:52 +0000 |
commit | 479d2113ccb2226821ef75027b9186d1d0e367e9 (patch) | |
tree | a9b0815b35ca20eb8b0e60c5a7881b0ed3033e7e /lib/ExtUtils/MM_Win95.pm | |
parent | f18b2318c1a1ea8f33016f2bf34abc4ac137b8e3 (diff) | |
download | perl-479d2113ccb2226821ef75027b9186d1d0e367e9.tar.gz |
ExtUtils::MakeMaker 6.03 -> 6.06_05ish
Message-ID: <20030331104257.GB15327@windhund.schwern.org>
p4raw-id: //depot/perl@19099
Diffstat (limited to 'lib/ExtUtils/MM_Win95.pm')
-rw-r--r-- | lib/ExtUtils/MM_Win95.pm | 172 |
1 files changed, 162 insertions, 10 deletions
diff --git a/lib/ExtUtils/MM_Win95.pm b/lib/ExtUtils/MM_Win95.pm index 010900f5c3..1854d5d953 100644 --- a/lib/ExtUtils/MM_Win95.pm +++ b/lib/ExtUtils/MM_Win95.pm @@ -5,7 +5,11 @@ $VERSION = 0.02; require ExtUtils::MM_Win32; @ISA = qw(ExtUtils::MM_Win32); -use Config; + +use Config;
+my $DMAKE = 1 if $Config{'make'} =~ /^dmake/i; +my $NMAKE = 1 if $Config{'make'} =~ /^nmake/i; + =head1 NAME @@ -20,6 +24,18 @@ 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 { @@ -34,38 +50,174 @@ disttest : distdir }; } +=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(); - # having to choose between .xs -> .c -> .o and .xs -> .o confuses dmake - return '' if $Config{make} eq 'dmake'; ' .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 + +Setting to 2500, a value obtained by experimentation. + +=cut + +sub max_exec_len { + my $self = shift; + + return $self->{_MAX_EXEC_LEN} ||= 2500; +} + +=back + + +=head1 AUTHOR + +Code originally inside MM_Win32. Original author unknown. + +Currently maintained by Michael G Schwern <schwern@pobox.com>. + +Send patches and ideas to <F<makemaker@perl.org>>. + +See http://www.makemaker.org. + +=cut + + 1; |