From: Andrew Dunstan Date: Mon, 25 Feb 2013 17:00:53 +0000 (-0500) Subject: Redo MSVC build implementation for pg_xlogdump. X-Git-Tag: REL9_3_BETA1~300 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a64e33f030f3ba379a0d3e22fe6bcda9dc3bbc60;p=postgresql 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. --- diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index dbad6be5ec..8837ca0e99 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -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}; diff --git a/src/tools/msvc/clean.bat b/src/tools/msvc/clean.bat index a2622ba2e4..e06838cc1e 100755 --- a/src/tools/msvc/clean.bat +++ b/src/tools/msvc/clean.bat @@ -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