aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/win-ldd.pl
diff options
context:
space:
mode:
authorGravatar Thiago Macieira <thiago@macieira.org>2013-10-11 11:05:41 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-11 12:05:43 -0700
commit1fdbc2eaa4e69a377c033865693a67e634b3db30 (patch)
treee70163879ace8bbff55c9fb2b980c44b165d97f1 /scripts/win-ldd.pl
parent2a871fc3e4fdd7fd06193ffbe6c9a80310f35e07 (diff)
downloadsubsurface-1fdbc2eaa4e69a377c033865693a67e634b3db30.tar.gz
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>
Diffstat (limited to 'scripts/win-ldd.pl')
-rw-r--r--scripts/win-ldd.pl10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/win-ldd.pl b/scripts/win-ldd.pl
index 4144d792d..6907016bb 100644
--- a/scripts/win-ldd.pl
+++ b/scripts/win-ldd.pl
@@ -2,7 +2,7 @@
use strict;
my %deploy;
my $objdump = $ENV{objdump} ? $ENV{objdump} : "objdump";
-my @searchdirs = split(/:/, $ENV{PATH});
+my @searchdirs;
sub addDependenciesFor($) {
open OBJDUMP, "-|", $objdump, "-p", $_[0] or die;
@@ -46,11 +46,19 @@ for (@ARGV) {
if (-d $_) {
push @searchdirs, $_;
} elsif (-f $_) {
+ # Add $_'s path to the search list too
+ my $dirname = $_;
+ $dirname =~ s,/[^/]+$,,;
+ push @searchdirs, $dirname;
+
$deploy{$_} = $_;
addDependenciesFor($_);
}
}
+# Append PATH to @searchdirs
+@searchdirs = (@searchdirs, split(/:/, $ENV{PATH}));
+
while (1) {
findMissingDependencies();