From: Charles Bailey Date: Mon, 23 Aug 1999 03:40:07 +0000 (+0000) Subject: When extension doesn't have a "main" object file to anchor linker search, pull in... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f0585323684fd5b018ff6d479ece5c134dabef3e;p=p5sagit%2Fp5-mst-13.2.git When extension doesn't have a "main" object file to anchor linker search, pull in all objct files p4raw-id: //depot/vmsperl@4031 --- diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm index a15e328..31ca690 100644 --- a/lib/ExtUtils/MM_VMS.pm +++ b/lib/ExtUtils/MM_VMS.pm @@ -1177,7 +1177,7 @@ static :: $(INST_ARCHAUTODIR)$(BASEEXT).opt $(NOECHO) $(NOOP) ') unless $self->{SKIPHASH}{'static'}; - push(@m,' + push @m,' $(INST_ARCHAUTODIR)$(BASEEXT).opt : $(BASEEXT).opt $(CP) $(MMS$SOURCE) $(MMS$TARGET) @@ -1185,9 +1185,26 @@ $(BASEEXT).opt : Makefile.PL $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e "use ExtUtils::Mksymlists;" - ',qq[-e "Mksymlists('NAME' => '$self->{NAME}', 'DL_FUNCS' => ], neatvalue($funcs),q[, 'DL_VARS' => ],neatvalue($vars), - q[, 'FUNCLIST' => ],neatvalue($funclist),')" - $(PERL) -e "print ""$(INST_STATIC)/Include=$(BASEEXT)\n$(INST_STATIC)/Library\n"";" >>$(MMS$TARGET) -'); + q[, 'FUNCLIST' => ],neatvalue($funclist),qq[)"\n]; + + push @m, ' $(PERL) -e "print ""$(INST_STATIC)/Include='; + if ($self->{OBJECT} =~ /\bBASEEXT\b/ or + $self->{OBJECT} =~ /\b$self->{BASEEXT}\b/i) { push @m, '$(BASEEXT)'; } + else { # We don't have a "main" object file, so pull 'em all in + my(@omods) = map { s/\.[^.]*$//; # Trim off file type + s[\$\(\w+_EXT\)][]; # even as a macro + s/.*[:>\/\]]//; # Trim off dir spec + $_; } split ' ', $self->eliminate_macros($self->{OBJECT}); + my($tmp,@lines,$elt) = ''; + my $tmp = shift @omods; + foreach $elt (@omods) { + $tmp .= ",$elt"; + if (length($tmp) > 80) { push @lines, $tmp; $tmp = ''; } + } + push @lines, $tmp; + push @m, '(', join( qq[, -\\n\\t"";" >>\$(MMS\$TARGET)\n\t\$(PERL) -e "print ""], @lines),')'; + } + push @m, '\n$(INST_STATIC)/Library\n"";" >>$(MMS$TARGET)',"\n"; if (length $self->{LDLOADLIBS}) { my($lib); my($line) = '';