develooper Front page | perl.perl5.porters | Postings from March 2003

[PATCH 5.8.1 @19053] OS/2 MakeMaker

Thread Next
From:
Ilya Zakharevich
Date:
March 31, 2003 12:38
Subject:
[PATCH 5.8.1 @19053] OS/2 MakeMaker
Message ID:
20030331203742.GA3595@math.berkeley.edu
This is the first of my current series of patches to the recent 5.1.x.

Thanks,
Ilya

-	Replaces $(RM) [which is not defined any more] by $(RM_F)

-	Remove .dll on non-successful build (the linker marks the failed
	.dll as invalid in the loader header instead of removing the file).

-	fixin() was assuming that rename() can overwrite its target.

--- ./lib/ExtUtils/MM_OS2.pm-pre	Fri Jul 19 16:49:46 2002
+++ ./lib/ExtUtils/MM_OS2.pm	Wed Mar 26 16:07:08 2003
@@ -38,7 +38,7 @@ sub dist {
     my($self, %attribs) = @_;
 
     $attribs{TO_UNIX} ||= sprintf <<'MAKE_TEXT', $self->{NOECHO};
-%s$(TEST_F) tmp.zip && $(RM) tmp.zip; $(ZIP) -ll -mr tmp.zip $(DISTVNAME) && unzip -o tmp.zip && $(RM) tmp.zip
+%s$(TEST_F) tmp.zip && $(RM_F) tmp.zip; $(ZIP) -ll -mr tmp.zip $(DISTVNAME) && unzip -o tmp.zip && $(RM_F) tmp.zip
 MAKE_TEXT
 
     return $self->SUPER::dist(%attribs);
--- ./lib/ExtUtils/MM_Unix.pm-pre	Sun Nov  3 22:34:38 2002
+++ ./lib/ExtUtils/MM_Unix.pm	Thu Mar 27 01:55:14 2003
@@ -976,12 +976,15 @@ sub dynamic_lib {
     $armaybe = 'ar' if ($^O eq 'dec_osf' and $armaybe eq ':');
     my(@m);
     my $ld_opt = $Is_OS2 ? '$(OPTIMIZE) ' : '';	# Useful on other systems too?
+    # Linker doesn't remove file on failure, only marks EXE header as invalid
+    my $ld_fix = $Is_OS2 ? '|| ( $(RM_F) $@ && sh -c false )' : '';	# Useful on other systems too?
     push(@m,'
 # This section creates the dynamically loadable $(INST_DYNAMIC)
 # from $(OBJECT) and possibly $(MYEXTLIB).
 ARMAYBE = '.$armaybe.'
 OTHERLDFLAGS = '.$ld_opt.$otherldflags.'
 INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
+INST_DYNAMIC_FIX = '.$ld_fix.'
 
 $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
 ');
@@ -1022,7 +1025,7 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $
 
     push(@m,
 '	LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) '.$ldrun.' $(LDDLFLAGS) '.$ldfrom.
-' $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) $(PERL_ARCHIVE) '.$libs.' $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST)');
+' $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) $(PERL_ARCHIVE) '.$libs.' $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST) $(INST_DYNAMIC_FIX)');
     push @m, '
 	$(CHMOD) $(PERM_RWX) $@
 ';
@@ -1198,6 +1201,8 @@ eval 'exec $interpreter $arg -S \$0 \${1
 	close FIXIN;
 	close FIXOUT;
 
+	chmod 0666, "$file.bak";
+	unlink "$file.bak";
 	unless ( rename($file, "$file.bak") ) {	
 	    warn "Can't rename $file to $file.bak: $!";
 	    next;

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About