1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-06 13:46:51 +03:00
Files
postgres/src/tools/msvc/build.pl
Andrew Dunstan aabb7000dc Add perl replacements for build.bat and vcregress.bat. In due course
the .bat files will be altered to become tiny wrappers for these scripts,
and one or two other .bat files will disappear.
2007-09-23 21:52:56 +00:00

68 lines
1.1 KiB
Perl

# -*-perl-*- hey - emacs - this is a perl file
# $PostgreSQL: pgsql/src/tools/msvc/build.pl,v 1.1 2007/09/23 21:52:56 adunstan Exp $
BEGIN
{
chdir("../../..") if (-d "../msvc" && -d "../../../src");
}
use lib "src/tools/msvc";
use Cwd;
use Mkvcbuild;
# buildenv.pl is for specifying the build environment settings
# it should contain lines like:
# $ENV{PATH} = "c:/path/to/bison/bin;$ENV{PATH}";
if ( -e "src/tools/msvc/buildenv.pl")
{
require "src/tools/msvc/buildenv.pl";
}
elsif (-e "./buildenv.pl" )
{
require "./buildenv.pl";
}
# set up the project
our $config;
require "config.pl";
Mkvcbuild::mkvcbuild($config);
# check what sort of build we are doing
my $bconf = $ENV{CONFIG} || "Release";
my $buildwhat = $ARGV[1] || "";
if ($ARGV[0] eq 'DEBUG')
{
$bconf = "Debug";
}
elsif ($ARGV[0] ne "RELEASE")
{
$buildwhat = $ARGV[0] || "";
}
# ... and do it
if ($buildwhat)
{
system("vcbuild $buildwhat.vcproj $bconf");
}
else
{
system("msbuild pgsql.sln /verbosity:detailed /p:Configuration=$bconf");
}
# report status
$status = $? >> 8;
exit $status;