summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Thiago Macieira <thiago@macieira.org>2013-10-11 11:05:42 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-11 12:05:47 -0700
commit336acb3e18d22bfdea1255cb9c1b0b549f01c17c (patch)
treec7d947c6e53ec5515572c8b0ced56ac4d8329a08
parent1fdbc2eaa4e69a377c033865693a67e634b3db30 (diff)
downloadsubsurface-336acb3e18d22bfdea1255cb9c1b0b549f01c17c.tar.gz
Ignore the Windows system directories when searching for DLLs
We don't want to deploy kernel32.dll or such. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--scripts/win-ldd.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/win-ldd.pl b/scripts/win-ldd.pl
index 6907016bb..8a25c3434 100644
--- a/scripts/win-ldd.pl
+++ b/scripts/win-ldd.pl
@@ -3,6 +3,7 @@ use strict;
my %deploy;
my $objdump = $ENV{objdump} ? $ENV{objdump} : "objdump";
my @searchdirs;
+my @systemdirs = (qr|^c:/windows|i, qr|^c:/winnt|i, qr|/c/windows|i, qr|/c/winnt|);
sub addDependenciesFor($) {
open OBJDUMP, "-|", $objdump, "-p", $_[0] or die;
@@ -59,6 +60,18 @@ for (@ARGV) {
# Append PATH to @searchdirs
@searchdirs = (@searchdirs, split(/:/, $ENV{PATH}));
+# Remove system dirs from @searchdirs
+@searchdirs = grep {
+ my $sys = 0;
+ for my $rx (@systemdirs) {
+ if ($_ =~ $rx) {
+ $sys = 1;
+ last;
+ }
+ }
+ !$sys;
+} @searchdirs;
+
while (1) {
findMissingDependencies();