summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source')
-rwxr-xr-xBuild/source/utils/epstopdf/epstopdf.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/Build/source/utils/epstopdf/epstopdf.pl b/Build/source/utils/epstopdf/epstopdf.pl
index 4f2c408ed83..1b948dc072d 100755
--- a/Build/source/utils/epstopdf/epstopdf.pl
+++ b/Build/source/utils/epstopdf/epstopdf.pl
@@ -46,6 +46,8 @@ use strict;
# whitespace at the end of the eps file.
#
+my $IsWin32 = ($^O =~ /MSWin32/i);
+
### program identification
my $program = "epstopdf";
my $filedate="2001/03/05";
@@ -58,6 +60,17 @@ my $GS = "gs";
$GS = "gswin32c" if $^O eq 'MSWin32';
$GS = "gswin32c" if $^O =~ /cygwin/;
+if ($IsWin32) {
+ $GS = `kpsecheck --ghostscript`;
+ $GS =~ m/^dll\s*:\s*(.+)/mio;
+ $GS = $1;
+ $GS =~ s/gsdll32.dll/gswin32c.exe/io;
+ if ($GS eq "") {
+ $GS = "gswin32c.exe";
+ }
+ $GS = "\"$GS\"" if ($GS =~ m/\s/);
+}
+
### options
$::opt_help=0;
$::opt_debug=0;