summaryrefslogtreecommitdiff
path: root/ext/Errno/Makefile.PL
diff options
context:
space:
mode:
Diffstat (limited to 'ext/Errno/Makefile.PL')
-rw-r--r--ext/Errno/Makefile.PL19
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/Errno/Makefile.PL b/ext/Errno/Makefile.PL
index 604d4fb8e8..527f700dba 100644
--- a/ext/Errno/Makefile.PL
+++ b/ext/Errno/Makefile.PL
@@ -1,7 +1,26 @@
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',