]> granicus.if.org Git - postgresql/commitdiff
Redo MSVC build implementation for pg_xlogdump.
authorAndrew Dunstan <andrew@dunslane.net>
Mon, 25 Feb 2013 17:00:53 +0000 (12:00 -0500)
committerAndrew Dunstan <andrew@dunslane.net>
Mon, 25 Feb 2013 17:00:53 +0000 (12:00 -0500)
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.

src/tools/msvc/Mkvcbuild.pm
src/tools/msvc/clean.bat

index dbad6be5ec60a3cbaf61d1380d6497f9f44aa93b..8837ca0e99c6f90979a950d803eebca94bcf11e3 100644 (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};
index a2622ba2e40c5d667aaca6af5de89830f1b0a523..e06838cc1ef12c92b2bc9bc51ab1df91608cc86f 100755 (executable)
@@ -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