I've found a problem with the "distclean" target in Perl on Win32 (at least) which causes subsequent builds of a distclean'ed source tree to fail.
If I run "nmake" followed by "nmake distclean" followed by "nmake" again then I get this error: ===== lib -out:libsdbm.lib sdbm.obj pair.obj hash.obj Microsoft (R) Library Manager Version 6.00.8447 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. ..\..\..\miniperl.exe "-I..\..\..\lib" "-I..\..\..\lib" -MExtUtils::Command -e chmod 755 libsdbm.lib The system cannot find the path specified. NMAKE : fatal error U1077: '..\..\..\miniperl.exe' : return code '0x1' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop. Unsuccessful make(SDBM_File): code=512 at buildext.pl line 98. NMAKE : fatal error U1077: '..\miniperl.exe' : return code '0x2' Stop. ===== The problem is that ext/SDBM_File/sdbm/blibdirs gets left behind which means that the blibdirs target in ext/SDBM_File/sdbm/Makefile doesn't get run. Running that target would have created the directory lib/auto/sdbm which the $(INST_STATIC) target tries to output "extralibs.ld" into. (The "system cannot find the path specified" error relates to this missing directory.) The reason that ext/SDBM_File/sdbm/blibdirs got left behind is that "nmake distclean" itself actually had an error (but it carried on anyway, so the error tends to go unnoticed): ===== Making clean in SDBM_File nmake -nologo clean cd sdbm && ..\..\miniperl.exe "-I..\..\lib" "-I..\..\lib" -MExtUtils::Command -e test_f Makefile && nmake clean '..\..\miniperl.exe' is not recognized as an internal or external command,operable program or batch file. ===== That error arises from this section in ext/SDBM_File/Makefile: clean_subdirs : -cd sdbm && $(TEST_F) $(FIRST_MAKEFILE) && $(MAKE) clean The problem is that $(TEST_F) is TEST_F = $(PERLRUN) -MExtUtils::Command -e test_f where $(PERLRUN) begins "..\..\miniperl.exe". That's fine for use within the SDBM_File directory itself, but clearly the relative path there is wrong after we have cd'ed into the sdbm sub-directory. The attached patch (against the most recent snapshot) changes the use of $(PERLRUN) to $(ABSPERLRUN) in $(TEST_F) and similar "tools", and also in "oneliners". Presumably other platforms have the same problem too (?), so I've changed MM_Unix.pm and MM_VMS.pm as well as MM_Win32.pm. - Steve ------------------------------------------------ Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.
--- lib/ExtUtils/MM_Unix.pm.orig 2003-11-17 22:55:22.000000000 +0000 +++ lib/ExtUtils/MM_Unix.pm 2004-03-04 15:04:01.396854300 +0000 @@ -1963,9 +1963,9 @@ $self->{CP} ||= "cp"; $self->{MV} ||= "mv"; $self->{CHMOD} ||= "chmod"; - $self->{MKPATH} ||= '$(PERLRUN) "-MExtUtils::Command" -e mkpath'; + $self->{MKPATH} ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e mkpath'; $self->{EQUALIZE_TIMESTAMP} ||= - '$(PERLRUN) "-MExtUtils::Command" -e eqtime'; + '$(ABSPERLRUN) "-MExtUtils::Command" -e eqtime'; $self->{UNINST} ||= 0; $self->{VERBINST} ||= 0; @@ -1974,11 +1974,11 @@ install([EMAIL PROTECTED], '$(VERBINST)', 0, '$(UNINST)'); CODE $self->{DOC_INSTALL} ||= - '$(PERLRUN) "-MExtUtils::Command::MM" -e perllocal_install'; + '$(ABSPERLRUN) "-MExtUtils::Command::MM" -e perllocal_install'; $self->{UNINSTALL} ||= - '$(PERLRUN) "-MExtUtils::Command::MM" -e uninstall'; + '$(ABSPERLRUN) "-MExtUtils::Command::MM" -e uninstall'; $self->{WARN_IF_OLD_PACKLIST} ||= - '$(PERLRUN) "-MExtUtils::Command::MM" -e warn_if_old_packlist'; + '$(ABSPERLRUN) "-MExtUtils::Command::MM" -e warn_if_old_packlist'; $self->{UMASK_NULL} ||= "umask 0"; $self->{DEV_NULL} ||= "> /dev/null 2>&1"; @@ -3613,7 +3613,7 @@ $switches = join ' ', @$switches; - return qq{\$(PERLRUN) $switches -e $cmd}; + return qq{\$(ABSPERLRUN) $switches -e $cmd}; } --- lib/ExtUtils/MM_VMS.pm.orig 2003-11-04 00:13:06.000000000 +0000 +++ lib/ExtUtils/MM_VMS.pm 2004-03-04 15:06:14.454751400 +0000 @@ -408,14 +408,14 @@ $self->{MAKE_APERL_FILE} ||= 'Makeaperl.MMS'; $self->{MAKEFILE_OLD} ||= '$(FIRST_MAKEFILE)_old'; - $self->{ECHO} ||= '$(PERLRUN) -le "print [EMAIL PROTECTED]"'; - $self->{ECHO_N} ||= '$(PERLRUN) -e "print [EMAIL PROTECTED]"'; - $self->{TOUCH} ||= '$(PERLRUN) "-MExtUtils::Command" -e touch'; - $self->{CHMOD} ||= '$(PERLRUN) "-MExtUtils::Command" -e chmod'; - $self->{RM_F} ||= '$(PERLRUN) "-MExtUtils::Command" -e rm_f'; - $self->{RM_RF} ||= '$(PERLRUN) "-MExtUtils::Command" -e rm_rf'; - $self->{TEST_F} ||= '$(PERLRUN) "-MExtUtils::Command" -e test_f'; - $self->{EQUALIZE_TIMESTAMP} ||= '$(PERLRUN) -we "open F,qq{>>$ARGV[1]};close F;utime(0,(stat($ARGV[0]))[9]+1,$ARGV[1])"'; + $self->{ECHO} ||= '$(ABSPERLRUN) -le "print [EMAIL PROTECTED]"'; + $self->{ECHO_N} ||= '$(ABSPERLRUN) -e "print [EMAIL PROTECTED]"'; + $self->{TOUCH} ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e touch'; + $self->{CHMOD} ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e chmod'; + $self->{RM_F} ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e rm_f'; + $self->{RM_RF} ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e rm_rf'; + $self->{TEST_F} ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e test_f'; + $self->{EQUALIZE_TIMESTAMP} ||= '$(ABSPERLRUN) -we "open F,qq{>>$ARGV[1]};close F;utime(0,(stat($ARGV[0]))[9]+1,$ARGV[1])"'; $self->{MOD_INSTALL} ||= $self->oneliner(<<'CODE', ['-MExtUtils::Install']); @@ -2122,7 +2122,7 @@ # Switches must be quoted else they will be lowercased. $switches = join ' ', map { qq{"$_"} } @$switches; - return qq{\$(PERLRUN) $switches -e $cmd}; + return qq{\$(ABSPERLRUN) $switches -e $cmd}; } --- lib/ExtUtils/MM_Win32.pm.orig 2003-10-30 07:38:02.000000000 +0000 +++ lib/ExtUtils/MM_Win32.pm 2004-03-04 15:02:58.039912300 +0000 @@ -171,14 +171,14 @@ $self->{ECHO} ||= $self->oneliner('print [EMAIL PROTECTED]', ['-l']); $self->{ECHO_N} ||= $self->oneliner('print [EMAIL PROTECTED]'); - $self->{TOUCH} ||= '$(PERLRUN) -MExtUtils::Command -e touch'; - $self->{CHMOD} ||= '$(PERLRUN) -MExtUtils::Command -e chmod'; - $self->{CP} ||= '$(PERLRUN) -MExtUtils::Command -e cp'; - $self->{RM_F} ||= '$(PERLRUN) -MExtUtils::Command -e rm_f'; - $self->{RM_RF} ||= '$(PERLRUN) -MExtUtils::Command -e rm_rf'; - $self->{MV} ||= '$(PERLRUN) -MExtUtils::Command -e mv'; + $self->{TOUCH} ||= '$(ABSPERLRUN) -MExtUtils::Command -e touch'; + $self->{CHMOD} ||= '$(ABSPERLRUN) -MExtUtils::Command -e chmod'; + $self->{CP} ||= '$(ABSPERLRUN) -MExtUtils::Command -e cp'; + $self->{RM_F} ||= '$(ABSPERLRUN) -MExtUtils::Command -e rm_f'; + $self->{RM_RF} ||= '$(ABSPERLRUN) -MExtUtils::Command -e rm_rf'; + $self->{MV} ||= '$(ABSPERLRUN) -MExtUtils::Command -e mv'; $self->{NOOP} ||= 'rem'; - $self->{TEST_F} ||= '$(PERLRUN) -MExtUtils::Command -e test_f'; + $self->{TEST_F} ||= '$(ABSPERLRUN) -MExtUtils::Command -e test_f'; $self->{DEV_NULL} ||= '> NUL'; $self->{LD} ||= $Config{ld} || 'link'; @@ -451,7 +451,7 @@ $switches = join ' ', @$switches; - return qq{\$(PERLRUN) $switches -e $cmd}; + return qq{\$(ABSPERLRUN) $switches -e $cmd}; } --- t/oneliner.t.orig 2002-12-17 08:53:02.000000000 +0000 +++ t/oneliner.t 2004-03-04 15:10:31.371693500 +0000 @@ -28,7 +28,7 @@ sub try_oneliner { my($code, $switches, $expect, $name) = @_; my $cmd = $mm->oneliner($code, $switches); - $cmd =~ s{\$\(PERLRUN\)}{$^X}; + $cmd =~ s{\$\(ABSPERLRUN\)}{$^X}; # VMS likes to put newlines at the end of commands if there isn't # one already. --- t/split_command.t.orig 2003-03-29 08:43:12.000000000 +0000 +++ t/split_command.t 2004-03-04 15:11:43.323790700 +0000 @@ -54,7 +54,7 @@ sub _run { my @cmds = @_; - s{\$\(PERLRUN\)}{$perl} foreach @cmds; + s{\$\(ABSPERLRUN\)}{$perl} foreach @cmds; if( $Is_VMS ) { s{-\n}{} foreach @cmds }