package ExtUtils::MM_Win32; # clobber this one with extreme prejudice because of the gawd-awful bs # it is, for thinking that mingw gcc is still this clunky. sub dynamic_lib { my($self, %attribs) = @_; return '' unless $self->needs_linking(); #might be because of a subdir return '' unless $self->has_link_code; my($otherldflags) = $attribs{OTHERLDFLAGS}; my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || ""; my($ldfrom) = '$(LDFROM)'; my $tabchar = "\t"; my(@m); my $dllname = $self->{BASEEXT} . "." . $self->{DLEXT}; $dllname =~ /(....)(.{0,4})/; my $baseaddr = unpack("n", $1 ^ $2); $otherldflags .= sprintf("-Wl,--image-base,0x%x0000 ", $baseaddr); push(@m,' # This section creates the dynamically loadable $(INST_DYNAMIC) # (ms windows DLL file) from $(OBJECT) and possibly $(MYEXTLIB). OTHERLDFLAGS =' .($otherldflags ? " $otherldflags" : "") .' INST_DYNAMIC_DEP =' .($inst_dynamic_dep ? " $inst_dynamic_dep" : "") .' $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) \ $(INST_ARCHAUTODIR)$(DFSEP).exists \ $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP) '); push(@m, $tabchar, q{$(CC) -o $@ $(LDDLFLAGS) } . $ldfrom ." \\\n" . q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) } ); # return our assembled Makefile text: join('',@m); } # END of sub