postgres.git / summary / log / commit / refs
commit 11f11e1e0103e56649e86dbaaf800a1b4a6d5ebe
Author: Andrew Dunstan <andrew@dunslane.net>
Date: Wed Feb 06 12:32:35 2019 +0000
First released in: 12.0, 9.4.21, 9.5.16, 9.6.12, 10.7, 11.2
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.
src/tools/msvc/build.pl | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/src/tools/msvc/build.pl b/src/tools/msvc/build.pl
index 2424c5d6003..dcec2189241 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);
[parent: 297d627e074a]