This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
IO test: adjust require for non CORE perl
[perl5.git] / make_ext.pl
index 8270092..9bc4718 100644 (file)
@@ -204,10 +204,11 @@ elsif (IS_VMS) {
 {
     # Cwd needs to be built before Encode recurses into subdirectories.
     # Pod::Simple needs to be built before Pod::Functions
+    # lib needs to be built before IO-Compress
     # This seems to be the simplest way to ensure this ordering:
     my (@first, @other);
     foreach (@extspec) {
-       if ($_ eq 'Cwd' || $_ eq 'Pod/Simple') {
+       if ($_ eq 'Cwd' || $_ eq 'Pod/Simple' || $_ eq 'lib') {
            push @first, $_;
        } else {
            push @other, $_;
@@ -287,7 +288,7 @@ sub build_extension {
     
     if (-f $makefile) {
        $makefile_no_minus_f = 0;
-       open my $mfh, $makefile or die "Cannot open $makefile: $!";
+       open my $mfh, '<', $makefile or die "Cannot open $makefile: $!";
        while (<$mfh>) {
            # Plagiarised from CPAN::Distribution
            last if /MakeMaker post_initialize section/;
@@ -302,7 +303,7 @@ sub build_extension {
            last unless defined $oldv;
            require ExtUtils::MM_Unix;
            defined (my $newv = parse_version MM $vmod) or last;
-           if ($newv ne $oldv) {
+           if (version->parse($newv) ne $oldv) {
                close $mfh or die "close $makefile: $!";
                _unlink($makefile);
                {