X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FErrno%2FMakefile.PL;h=cc45afbfa22eed8e6eef148648b1bd2788bba5b6;hb=d22862789d0938361a070647ab6fe995d674f77c;hp=604d4fb8e8c4345f7dc8f4104771e1d02cf3ed7e;hpb=69158f75613eae787b94b6b4c3c353cf740e0e09;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/Errno/Makefile.PL b/ext/Errno/Makefile.PL index 604d4fb..cc45afb 100644 --- a/ext/Errno/Makefile.PL +++ b/ext/Errno/Makefile.PL @@ -1,20 +1,35 @@ use ExtUtils::MakeMaker; +use Config; -@VMS = ($^O eq 'VMS') ? (MAN3PODS => {}) : (); +my $arch = "$Config{'archname'}-$Config{'osvers'}"; +my $got = ""; +if (-e 'arch.txt') { + open my $in, "<", "arch.txt" or die "Can't read 'arch.txt': $!"; + $got = <$in>; + close $in; +} +if ($got ne $arch) { + if (-e "Errno.pm") { + print "Removing old 'Errno.pm'\n"; + unlink "Errno.pm" + or die "Failed to remove out of date 'Errno.pm': $!"; + } + open my $out, ">", "arch.txt" or die "Can't write 'arch.txt': $!"; + print $out $arch; + close $out; +} WriteMakefile( NAME => 'Errno', VERSION_FROM => 'Errno_pm.PL', - MAN3PODS => {}, # Pods will be built by installman. PL_FILES => {'Errno_pm.PL'=>'Errno.pm'}, PM => {'Errno.pm' => '$(INST_LIBDIR)/Errno.pm'}, - 'clean' => {FILES => 'Errno.pm'}, + 'clean' => {FILES => 'Errno.pm arch.txt'}, 'dist' => { COMPRESS => 'gzip -9f', SUFFIX => '.gz', DIST_DEFAULT => 'd/Errno.pm tardist', }, - @VMS, ); sub MY::postamble {