aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2019-02-06 07:32:35 -0500
committerAndrew Dunstan <andrew@dunslane.net>2019-02-06 07:49:27 -0500
commit1f28906bfe4c769325bb6e9ca29e4869099e7e6c (patch)
tree186f12f657aefbaee23c1268fc1836f5cfedb0e3 /src
parent1a6244216dcc576db617872b7bb6322cdeace4a0 (diff)
downloadpostgresql-1f28906bfe4c769325bb6e9ca29e4869099e7e6c.tar.gz
postgresql-1f28906bfe4c769325bb6e9ca29e4869099e7e6c.zip
Unify searchpath and do file logic in MSVC build scripts.
Commit f83419b739 failed to notice that mkvcbuild.pl and build.pl use different searchpath and do-file logic, breaking the latter, so it is adjusted to use the same logic as mkvcbuild.pl.
Diffstat (limited to 'src')
-rw-r--r--src/tools/msvc/build.pl19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/tools/msvc/build.pl b/src/tools/msvc/build.pl
index b5c8b087a42..df0b868a36f 100644
--- a/src/tools/msvc/build.pl
+++ b/src/tools/msvc/build.pl
@@ -4,19 +4,18 @@
use strict;
-BEGIN
-{
-
- chdir("../../..") if (-d "../msvc" && -d "../../../src");
-
-}
-
-use lib "src/tools/msvc";
+use File::Basename;
+use File::Spec;
+BEGIN { use lib File::Spec->rel2abs(dirname(__FILE__)); }
use Cwd;
use Mkvcbuild;
+chdir('..\..\..') if (-d '..\msvc' && -d '..\..\..\src');
+die 'Must run from root or msvc directory'
+ unless (-d 'src\tools\msvc' && -d 'src');
+
# buildenv.pl is for specifying the build environment settings
# it should contain lines like:
# $ENV{PATH} = "c:/path/to/bison/bin;$ENV{PATH}";
@@ -32,8 +31,8 @@ elsif (-e "./buildenv.pl")
# set up the project
our $config;
-do "./config_default.pl";
-do "./config.pl" if (-f "src/tools/msvc/config.pl");
+do "./src/tools/msvc/config_default.pl";
+do "./src/tools/msvc/config.pl" if (-f "src/tools/msvc/config.pl");
my $vcver = Mkvcbuild::mkvcbuild($config);