1
0
Fork 0
mirror of https://github.com/subsurface/subsurface.git synced 2025-02-19 22:16:15 +00:00

Fix the DLL search path order

The correct order on Windows is:
 1. Local directory (relative to the binary)
 2. $PATH
 3. System dirs

We insert our -L flags between 1 and 2 above.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Thiago Macieira 2013-10-11 11:05:41 -07:00 committed by Dirk Hohndel
parent 2a871fc3e4
commit 1fdbc2eaa4

View file

@ -2,7 +2,7 @@
use strict; use strict;
my %deploy; my %deploy;
my $objdump = $ENV{objdump} ? $ENV{objdump} : "objdump"; my $objdump = $ENV{objdump} ? $ENV{objdump} : "objdump";
my @searchdirs = split(/:/, $ENV{PATH}); my @searchdirs;
sub addDependenciesFor($) { sub addDependenciesFor($) {
open OBJDUMP, "-|", $objdump, "-p", $_[0] or die; open OBJDUMP, "-|", $objdump, "-p", $_[0] or die;
@ -46,11 +46,19 @@ for (@ARGV) {
if (-d $_) { if (-d $_) {
push @searchdirs, $_; push @searchdirs, $_;
} elsif (-f $_) { } elsif (-f $_) {
# Add $_'s path to the search list too
my $dirname = $_;
$dirname =~ s,/[^/]+$,,;
push @searchdirs, $dirname;
$deploy{$_} = $_; $deploy{$_} = $_;
addDependenciesFor($_); addDependenciesFor($_);
} }
} }
# Append PATH to @searchdirs
@searchdirs = (@searchdirs, split(/:/, $ENV{PATH}));
while (1) { while (1) {
findMissingDependencies(); findMissingDependencies();