ExtUtils::MakeMaker 6.10_03 -> 6.10_04
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / Liblist / Kid.pm
index 9030eda..5d05680 100644 (file)
@@ -148,9 +148,6 @@ sub _unix_os2_ext {
                next;
            }
            warn "'-l$thislib' found at $fullname\n" if $verbose;
-           my($fullnamedir) = dirname($fullname);
-           push @ld_run_path, $fullnamedir 
-              unless $ld_run_path_seen{$fullnamedir}++;
            push @libs, $fullname unless $libs_seen{$fullname}++;
            $found++;
            $found_lib++;
@@ -161,6 +158,13 @@ sub _unix_os2_ext {
            my $is_dyna = ($fullname !~ /\Q$Config_libext\E\z/);
            my $in_perl = ($libs =~ /\B-l\Q${thislib}\E\b/s);
 
+            # include the path to the lib once in the dynamic linker path
+            # but only if it is a dynamic lib and not in Perl itself
+            my($fullnamedir) = dirname($fullname);
+            push @ld_run_path, $fullnamedir
+                 if $is_dyna && !$in_perl &&
+                    !$ld_run_path_seen{$fullnamedir}++;
+
            # Do not add it into the list if it is already linked in
            # with the main perl executable.
            # We have to special-case the NeXT, because math and ndbm