aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2016-09-08 01:40:53 -0400
committerNoah Misch <noah@leadboat.com>2016-09-08 01:40:53 -0400
commit976a9bbd0251ea112898f85314646801e7e6207d (patch)
tree62a1fc0c92446b490eaa69147e6af026065504db
parentc9cf432ef32a9d29323b9b079178c1a6be126ff8 (diff)
downloadpostgresql-976a9bbd0251ea112898f85314646801e7e6207d.tar.gz
postgresql-976a9bbd0251ea112898f85314646801e7e6207d.zip
MSVC: Place gendef.pl temporary file in the target directory.
Until now, it used the current working directory. This makes it safe for simultaneous invocations of gendef.pl, with different target directories, to run from a single current working directory, such as $(top_srcdir). The MSVC build system will soon rely on this. Christian Ullrich, reviewed by Michael Paquier.
-rw-r--r--src/tools/msvc/gendef.pl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tools/msvc/gendef.pl b/src/tools/msvc/gendef.pl
index 8ccaab35519..a6c43c2c392 100644
--- a/src/tools/msvc/gendef.pl
+++ b/src/tools/msvc/gendef.pl
@@ -3,6 +3,7 @@ my @def;
use warnings;
use strict;
use 5.8.0;
+use File::Spec::Functions qw(splitpath catpath);
use List::Util qw(max);
#
@@ -14,9 +15,11 @@ use List::Util qw(max);
sub dumpsyms
{
my ($objfile, $symfile) = @_;
- system("dumpbin /symbols /out:symbols.out $_ >NUL")
+ my ($symvol, $symdirs, $symbase) = splitpath($symfile);
+ my $tmpfile = catpath($symvol, $symdirs, "symbols.out");
+ system("dumpbin /symbols /out:$tmpfile $_ >NUL")
&& die "Could not call dumpbin";
- rename("symbols.out", $symfile);
+ rename($tmpfile, $symfile);
}
# Given a symbol file path, loops over its contents