commit 99b440451cacec81e68a946230cdbe9a95e342a4 Author: Alexey Tourbin Date: Wed Sep 15 07:18:09 2010 +0400 MM_Unix.pm: link perl extensions with -lperl -lpthread diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm index 66a24d7..f793e4a 100644 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm @@ -970,18 +970,24 @@ Defines the macros for the C section. sub xs_dynamic_lib_macros { my ($self, $attribs) = @_; + + my $extra_libs = ''; + $extra_libs .= ' -L$(PERL_INC) -lperl' if $Config{useshrplib}; + $extra_libs .= ' -lpthread' if $Config{perllibs} =~ /pthread/; + my $otherldflags = $attribs->{OTHERLDFLAGS} || ""; my $inst_dynamic_dep = $attribs->{INST_DYNAMIC_DEP} || ""; my $armaybe = $self->_xs_armaybe($attribs); my $ld_opt = $Is{OS2} ? '$(OPTIMIZE) ' : ''; # Useful on other systems too? my $ld_fix = $Is{OS2} ? '|| ( $(RM_F) $@ && sh -c false )' : ''; - sprintf <<'EOF', $armaybe, $ld_opt.$otherldflags, $inst_dynamic_dep, $ld_fix; + sprintf <<'EOF', $armaybe, $ld_opt.$otherldflags, $inst_dynamic_dep, $ld_fix, $extra_libs; # This section creates the dynamically loadable objects from relevant # objects and possibly $(MYEXTLIB). ARMAYBE = %s OTHERLDFLAGS = %s INST_DYNAMIC_DEP = %s INST_DYNAMIC_FIX = %s +EXTRALINK_LIBS = %s EOF } @@ -1046,7 +1052,7 @@ sub xs_make_dynamic_lib { push @m, sprintf <<'MAKE', $ld_run_path_shell, $ldrun, $ldfrom, $self->xs_obj_opt('$@'), $libs, $exportlist; %s$(LD) %s $(LDDLFLAGS) %s $(OTHERLDFLAGS) %s $(MYEXTLIB) \ $(PERL_ARCHIVE) %s $(PERL_ARCHIVE_AFTER) %s \ - $(INST_DYNAMIC_FIX) + $(INST_DYNAMIC_FIX) $(EXTRALINK_LIBS) $(CHMOD) $(PERM_RWX) $@ MAKE join '', @m;