summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorAndrew Dunstan2008-05-03 00:24:06 +0000
committerAndrew Dunstan2008-05-03 00:24:06 +0000
commitd61eecb5a17d1b9373ca75fb4d6de4e35ba3f640 (patch)
treeb0900c3ff218a91aa4a0a841b1e5c6e5826b2d74 /src/tools
parent47391591ba6aa1c7153372f09d1f88c98a0165d4 (diff)
Provide for MSVC config equivalents of recently added configure options. Remove
any hardcoding of those options. Along the way, reorder the expression used to calculate RELSEG_SIZE to make it slightly clearer. For now wal_segsize is only allowed to have a value of 1 on Windows - we can relax that when we get full large file support in the backend.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/msvc/Solution.pm30
-rw-r--r--src/tools/msvc/config.pl3
2 files changed, 31 insertions, 2 deletions
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 02606889678..e257aa1445c 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -3,7 +3,7 @@ package Solution;
#
# Package that encapsulates a Visual C++ solution file generation
#
-# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.40 2008/04/21 18:37:28 mha Exp $
+# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.41 2008/05/03 00:24:06 adunstan Exp $
#
use Carp;
use strict;
@@ -34,6 +34,23 @@ sub new
die "XML requires both XSLT and ICONV\n";
}
}
+ $options->{blocksize} = 8
+ unless $options->{blocksize}; # undef or 0 means default
+ die "Bad blocksize $options->{blocksize}"
+ unless grep {$_ == $options->{blocksize}} (1,2,4,8,16,32);
+ $options->{segsize} = 1
+ unless $options->{segsize}; # undef or 0 means default
+ # only allow segsize 1 for now, as we can't do large files yet in windows
+ die "Bad segsize $options->{segsize}"
+ unless $options->{segsize} == 1;
+ $options->{wal_blocksize} = 8
+ unless $options->{wal_blocksize}; # undef or 0 means default
+ die "Bad wal_blocksize $options->{wal_blocksize}"
+ unless grep {$_ == $options->{wal_blocksize}} (1,2,4,8,16,32,64);
+ $options->{wal_segsize} = 16
+ unless $options->{wal_segsize}; # undef or 0 means default
+ die "Bad wal_segsize $options->{wal_segsize}"
+ unless grep {$_ == $options->{wal_segsize}} (1,2,4,8,16,32,64);
return $self;
}
@@ -116,7 +133,16 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
print O "#define USE_LDAP 1\n" if ($self->{options}->{ldap});
print O "#define HAVE_LIBZ 1\n" if ($self->{options}->{zlib});
print O "#define USE_SSL 1\n" if ($self->{options}->{openssl});
- print O "#define ENABLE_NLS 1\n" if ($self->{options}->{nls});
+ print O "#define ENABLE_NLS 1\n" if ($self->{options}->{nls});
+
+ print O "#define BLCKSZ ",1024 * $self->{options}->{blocksize},"\n";
+ print O "#define RELSEG_SIZE ",
+ (1024 / $self->{options}->{blocksize}) *
+ $self->{options}->{segsize} * 1024, "\n";
+ print O "#define XLOG_BLCKSZ ",
+ 1024 * $self->{options}->{wal_blocksize},"\n";
+ print O "#define XLOG_SEG_SIZE (",
+ $self->{options}->{wal_segsize}," * 1024 * 1024)\n";
if ($self->{options}->{float4byval})
{
diff --git a/src/tools/msvc/config.pl b/src/tools/msvc/config.pl
index bebb9a7c494..1e3750535de 100644
--- a/src/tools/msvc/config.pl
+++ b/src/tools/msvc/config.pl
@@ -7,6 +7,9 @@ our $config = {
# integer_datetimes=>1, # --enable-integer-datetimes - on is now default
# float4byval=>1, # --disable-float4-byval, on by default
# float8byval=>0, # --disable-float8-byval, off by default
+ # blocksize => 8, # --with-blocksize, 8kB by default
+ # wal_blocksize => 8, # --with-wal-blocksize, 8kb by default
+ # wal_segsize => 16, # --with-wal-segsize, 16MB by default
nls=>undef, # --enable-nls=<path>
tcl=>'c:\tcl', # --with-tls=<path>
perl=>'c:\perl', # --with-perl