aboutsummaryrefslogtreecommitdiffstats
path: root/copy_dlls
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2016-01-24 21:51:21 +0100
committerJay Berkenbilt <ejb@ql.org>2017-07-26 12:24:07 +0200
commite0ee307a199fcf47523b395ce99052ec51e69476 (patch)
tree92441c40398bb68c7633dacd6cd55a07a771f56e /copy_dlls
parentd4d7612b5b14ad3b1fb2e21e04017369931ae203 (diff)
downloadqpdf-e0ee307a199fcf47523b395ce99052ec51e69476.tar.zst
Updates for newer Windows toolchain
Diffstat (limited to 'copy_dlls')
-rwxr-xr-xcopy_dlls37
1 files changed, 33 insertions, 4 deletions
diff --git a/copy_dlls b/copy_dlls
index ea7da779..c9355734 100755
--- a/copy_dlls
+++ b/copy_dlls
@@ -7,8 +7,8 @@ use File::Basename;
my $whoami = basename($0);
-usage() unless @ARGV == 3;
-my ($file, $destdir, $objdump) = @ARGV;
+usage() unless @ARGV == 4;
+my ($file, $destdir, $objdump, $windows_wordsize) = @ARGV;
my $filedir = dirname($file);
my %dlls = ();
@@ -40,10 +40,39 @@ if (! defined $format)
# DLLs.
my $sep = ($^O eq 'MSWin32' ? ';' : ':');
my @path = ($filedir, '.', split($sep, $ENV{'PATH'}));
+foreach my $var (qw(LIB))
+{
+ if (exists $ENV{$var})
+ {
+ push(@path, split($sep, $ENV{$var}));
+ }
+}
if (-f "$file.manifest")
{
unshift(@path, get_manifest_dirs("$file.manifest"));
}
+my $redist_suffix = (($windows_wordsize eq '64') ? "x64" : "x86");
+if (exists $ENV{'VCINSTALLDIR'})
+{
+ my $redist = $ENV{'VCINSTALLDIR'} . "/Redist/$redist_suffix";
+ if (opendir(D, $redist))
+ {
+ my @entries = readdir(D);
+ closedir(D);
+ foreach my $e (@entries)
+ {
+ if ($e =~ m/\.CRT$/i)
+ {
+ unshift(@path, "$redist/$e");
+ }
+ }
+ }
+}
+if (exists $ENV{'UNIVERSALCRTSDKDIR'})
+{
+ my $redist = $ENV{'UNIVERSALCRTSDKDIR'} . "/Redist/ucrt/DLLs/$redist_suffix";
+ unshift(@path, $redist);
+}
my @final = ();
my @notfound = ();
dll_loop:
@@ -75,7 +104,7 @@ foreach my $f (@final)
{
$f =~ s,\\,/,g;
print "Copying $f to $destdir\n";
- system("cp -p $f $destdir") == 0 or
+ system("cp -p '$f' '$destdir'") == 0 or
die "$whoami: copy $f to $destdir failed\n";
}
@@ -92,7 +121,7 @@ sub is_format
return 1;
}
my $result = 0;
- my $file_format = `file $file`;
+ my $file_format = `file "$file"`;
print "$file $format $file_format\n";
if ($? == 0)
{