46 | | # Parrot can't necessarily handle a pre-existing installed shared |
47 | | # libparrot.so. At this point, we don't know the actual name |
48 | | # of the shared parrot library. So we try some candidates. |
49 | | # See RT #52288: the check for old_versions should be improved |
50 | | my @libs = ('libparrot.so'); |
51 | | my @libpaths = ('/usr/local/lib', '/usr/lib', $conf->data->get('libdir')); |
52 | | if ($^O eq 'MSWin32') { |
53 | | push @libpaths, (split /;/, $ENV{PATH}); |
54 | | @libs = ('libparrot.dll', 'libparrot.lib', 'libparrot.dll.a'); |
55 | | } |
56 | | if ($^O eq 'cygwin') { |
57 | | @libs = ('libparrot.dll.a'); |
58 | | } |
59 | | if (defined $ENV{LD_LIBRARY_PATH}) { |
60 | | push @libpaths, (split /:/, $ENV{LD_LIBRARY_PATH}); |
61 | | } |
62 | | if (defined $ENV{LD_RUN_PATH}) { |
63 | | push @libpaths, (split /:/, $ENV{LD_RUN_PATH}); |
64 | | } |
65 | | if (defined $ENV{DYLD_LIBRARY_PATH}) { |
66 | | push @libpaths, (split /:/, $ENV{DYLD_LIBRARY_PATH}); |
67 | | } |
68 | | foreach my $f (@libs) { |
69 | | foreach my $d (@libpaths) { |
70 | | my $oldversion = File::Spec->catfile($d, $f); |
71 | | if (-e $oldversion) { |
72 | | warn("\nWarning: Building a shared parrot library may conflict " . |
73 | | "with your previously-installed $oldversion\n"); |
74 | | } |
75 | | } |
76 | | } |
77 | | |