Redo MSVC build implementation for pg_xlogdump.

The previous commit didn't work on MSVC editions earlier than
Visual Studio 2011, apparently. This works by copying files into the
contrib directory, and making provision to clean them up, which should
work on all editions.
This commit is contained in:
Andrew Dunstan 2013-02-25 12:00:53 -05:00
parent aa05c37e82
commit a64e33f030
2 changed files with 18 additions and 4 deletions

View File

@ -13,6 +13,7 @@ use Project;
use Solution;
use Cwd;
use File::Copy;
use File::Basename;
use Config;
use VSObjectFactory;
use List::Util qw(first);
@ -49,8 +50,6 @@ my $contrib_extraincludes =
my $contrib_extrasource = {
'cube' => [ 'cubescan.l', 'cubeparse.y' ],
'seg' => [ 'segscan.l', 'segparse.y' ],
'pg_xlogdump' => [ '../../src/backend/access/transam/xlogreader.c',
map { "../../$_" } glob('src/backend/access/rmgrdesc/*desc.c') ],
};
my @contrib_excludes = ('pgcrypto', 'intagg', 'sepgsql');
@ -586,9 +585,19 @@ sub mkvcbuild
$pgregress->AddDefine('HOST_TUPLE="i686-pc-win32vc"');
$pgregress->AddReference($libpgport, $libpgcommon);
my $pg_xlogdump = (grep {$_->{name} eq 'pg_xlogdump'} @{$solution->{projects}->{contrib}} )[0];
delete $pg_xlogdump->{files}->{'contrib\\pg_xlogdump\\xlogreader.c'};
# fix up pg_xlogdump once it's been set up
# files symlinked on Unix are copied on windows
my $pg_xlogdump = (grep {$_->{name} eq 'pg_xlogdump'}
@{$solution->{projects}->{contrib}} )[0];
$pg_xlogdump->AddDefine('FRONTEND');
foreach my $xf (glob('src/backend/access/rmgrdesc/*desc.c') )
{
my $bf = basename $xf;
copy($xf,"contrib/pg_xlogdump/$bf");
$pg_xlogdump->AddFile("contrib\\pg_xlogdump\\$bf");
}
copy('src/backend/access/transam/xlogreader.c',
'contrib/pg_xlogdump/xlogreader.c');
$solution->Save();
return $solution->{vcver};

View File

@ -78,6 +78,11 @@ REM Clean up datafiles built with contrib
REM cd contrib
REM for /r %%f in (*.sql) do if exist %%f.in del %%f
REM clean up files copied into contrib\pg_xlogdump
if exist contrib\pg_xlogdump\xlogreader.c del /q contrib\pg_xlogdump\xlogreader.c
for %%f in (contrib\pg_xlogdump\*desc.c) do if not %%f==contrib\pg_xlogdump\rmgrdesc.c del /q %%f
cd %D%
REM Clean up ecpg regression test files