diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm index bffad8f2a7d..2026d184794 100644 --- a/src/tools/msvc/Install.pm +++ b/src/tools/msvc/Install.pm @@ -3,7 +3,7 @@ package Install; # # Package that provides 'make install' functionality for msvc builds # -# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.34 2010/01/05 13:31:58 mha Exp $ +# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.35 2010/04/09 13:05:58 mha Exp $ # use strict; use warnings; @@ -19,16 +19,16 @@ our (@ISA,@EXPORT_OK); sub lcopy { - my $src = shift; - my $target = shift; + my $src = shift; + my $target = shift; - if (-f $target) - { - unlink $target || confess "Could not delete $target\n"; - } + if (-f $target) + { + unlink $target || confess "Could not delete $target\n"; + } - copy($src,$target) - || confess "Could not copy $src to $target\n"; + copy($src,$target) + || confess "Could not copy $src to $target\n"; } @@ -61,31 +61,35 @@ sub Install CopySolutionOutput($conf, $target); lcopy($target . '/lib/libpq.dll', $target . '/bin/libpq.dll'); - my $sample_files = []; - File::Find::find({wanted => - sub { /^.*\.sample\z/s && - push(@$sample_files, $File::Find::name); - } - }, - "src" ); - CopySetOfFiles('config files', $sample_files , $target . '/share/'); + my $sample_files = []; + File::Find::find( + { + wanted =>sub { + /^.*\.sample\z/s + &&push(@$sample_files, $File::Find::name); + } + }, + "src" + ); + CopySetOfFiles('config files', $sample_files, $target . '/share/'); CopyFiles( 'Import libraries', $target .'/lib/', - "$conf\\", "postgres\\postgres.lib","libpq\\libpq.lib", "libecpg\\libecpg.lib", "libpgport\\libpgport.lib" + "$conf\\", "postgres\\postgres.lib","libpq\\libpq.lib", "libecpg\\libecpg.lib", + "libpgport\\libpgport.lib" + ); + CopySetOfFiles( + 'timezone names', + [ glob('src\timezone\tznames\*.txt') ], + $target . '/share/timezonesets/' ); - CopySetOfFiles('timezone names', - [ glob('src\timezone\tznames\*.txt') ] , - $target . '/share/timezonesets/'); CopyFiles( 'timezone sets', $target . '/share/timezonesets/', 'src/timezone/tznames/', 'Default','Australia','India' ); - CopySetOfFiles('BKI files', [ glob("src\\backend\\catalog\\postgres.*") ], - $target .'/share/'); - CopySetOfFiles('SQL files', [ glob("src\\backend\\catalog\\*.sql") ], - $target . '/share/'); + CopySetOfFiles('BKI files', [ glob("src\\backend\\catalog\\postgres.*") ],$target .'/share/'); + CopySetOfFiles('SQL files', [ glob("src\\backend\\catalog\\*.sql") ],$target . '/share/'); CopyFiles( 'Information schema data', $target . '/share/', @@ -94,12 +98,16 @@ sub Install GenerateConversionScript($target); GenerateTimezoneFiles($target,$conf); GenerateTsearchFiles($target); - CopySetOfFiles('Stopword files', - [ glob ("src\\backend\\snowball\\stopwords\\*.stop") ], - $target . '/share/tsearch_data/'); - CopySetOfFiles('Dictionaries sample files', - [ glob ("src\\backend\\tsearch\\*_sample.*" ) ], - $target . '/share/tsearch_data/'); + CopySetOfFiles( + 'Stopword files', + [ glob("src\\backend\\snowball\\stopwords\\*.stop") ], + $target . '/share/tsearch_data/' + ); + CopySetOfFiles( + 'Dictionaries sample files', + [ glob("src\\backend\\tsearch\\*_sample.*") ], + $target . '/share/tsearch_data/' + ); CopyContribFiles($config,$target); CopyIncludeFiles($target); @@ -189,8 +197,10 @@ sub CopySolutionOutput # Static lib, such as libpgport, only used internally during build, don't install next; } - lcopy("$conf\\$pf\\$pf.$ext","$target\\$dir\\$pf.$ext") || croak "Could not copy $pf.$ext\n"; - lcopy("$conf\\$pf\\$pf.pdb","$target\\symbols\\$pf.pdb") || croak "Could not copy $pf.pdb\n"; + lcopy("$conf\\$pf\\$pf.$ext","$target\\$dir\\$pf.$ext") + || croak "Could not copy $pf.$ext\n"; + lcopy("$conf\\$pf\\$pf.pdb","$target\\symbols\\$pf.pdb") + || croak "Could not copy $pf.pdb\n"; print "."; } print "\n"; @@ -241,7 +251,8 @@ sub GenerateTimezoneFiles my @tzfiles = split /\s+/,$1; unshift @tzfiles,''; print "Generating timezone files..."; - system("$conf\\zic\\zic -d \"$target/share/timezone\" " . join(" src/timezone/data/", @tzfiles)); + system( + "$conf\\zic\\zic -d \"$target/share/timezone\" " . join(" src/timezone/data/", @tzfiles)); print "\n"; } @@ -260,6 +271,7 @@ sub GenerateTsearchFiles open($F,">$target/share/snowball_create.sql") || die "Could not write snowball_create.sql"; print $F read_file('src/backend/snowball/snowball_func.sql.in'); + while ($#pieces > 0) { my $lang = shift @pieces || last; @@ -267,7 +279,8 @@ sub GenerateTsearchFiles my $txt = $tmpl; my $stop = ''; - if (-s "src/backend/snowball/stopwords/$lang.stop") { + if (-s "src/backend/snowball/stopwords/$lang.stop") + { $stop = ", StopWords=$lang"; } @@ -383,9 +396,8 @@ sub CopyIncludeFiles { my $target = shift; - EnsureDirectories($target, 'include', 'include/libpq', - 'include/internal', 'include/internal/libpq', - 'include/server'); + EnsureDirectories($target, 'include', 'include/libpq','include/internal', + 'include/internal/libpq','include/server'); CopyFiles( 'Public headers', @@ -395,9 +407,11 @@ sub CopyIncludeFiles lcopy('src/include/libpq/libpq-fs.h', $target . '/include/libpq/') || croak 'Could not copy libpq-fs.h'; - CopyFiles('Libpq headers', - $target . '/include/', 'src/interfaces/libpq/', - 'libpq-fe.h', 'libpq-events.h'); + CopyFiles( + 'Libpq headers', + $target . '/include/', + 'src/interfaces/libpq/','libpq-fe.h', 'libpq-events.h' + ); CopyFiles( 'Libpq internal headers', $target .'/include/internal/', @@ -417,9 +431,7 @@ sub CopyIncludeFiles $target . '/include/server/', 'src/include/', 'pg_config.h', 'pg_config_os.h' ); - CopySetOfFiles('', - [ glob( "src\\include\\*.h" ) ], - $target . '/include/server/'); + CopySetOfFiles('',[ glob("src\\include\\*.h") ],$target . '/include/server/'); my $D; opendir($D, 'src/include') || croak "Could not opendir on src/include!\n"; @@ -430,8 +442,7 @@ sub CopyIncludeFiles next unless (-d 'src/include/' . $d); EnsureDirectories($target . '/include/server', $d); - system( - "xcopy /s /i /q /r /y src\\include\\$d\\*.h \"$target\\include\\server\\$d\\\"") + system("xcopy /s /i /q /r /y src\\include\\$d\\*.h \"$target\\include\\server\\$d\\\"") && croak("Failed to copy include directory $d\n"); } closedir($D); @@ -463,12 +474,16 @@ sub GenerateNLSFiles print "Installing NLS files..."; EnsureDirectories($target, "share/locale"); - my @flist; - File::Find::find({wanted => - sub { /^nls\.mk\z/s && - !push(@flist, $File::Find::name); - } - }, "src"); + my @flist; + File::Find::find( + { + wanted =>sub { + /^nls\.mk\z/s + &&!push(@flist, $File::Find::name); + } + }, + "src" + ); foreach (@flist) { my $prgm = DetermineCatalogName($_); @@ -484,8 +499,7 @@ sub GenerateNLSFiles EnsureDirectories($target, "share/locale/$lang", "share/locale/$lang/LC_MESSAGES"); system( "\"$nlspath\\bin\\msgfmt\" -o \"$target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm-$majorver.mo\" $_" - ) - && croak("Could not run msgfmt on $dir\\$_"); + )&& croak("Could not run msgfmt on $dir\\$_"); print "."; } } diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index 843c6e4b4fb..08eb14a78dd 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -3,7 +3,7 @@ package Mkvcbuild; # # Package that generates build files for msvc build # -# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.53 2010/02/15 17:10:50 mha Exp $ +# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.54 2010/04/09 13:05:58 mha Exp $ # use Carp; use Win32; @@ -75,9 +75,12 @@ sub mkvcbuild $postgres->FullExportDLL('postgres.lib'); my $snowball = $solution->AddProject('dict_snowball','dll','','src\backend\snowball'); - $snowball->RelocateFiles('src\backend\snowball\libstemmer', sub { - return shift !~ /dict_snowball.c$/; - }); + $snowball->RelocateFiles( + 'src\backend\snowball\libstemmer', + sub { + return shift !~ /dict_snowball.c$/; + } + ); $snowball->AddIncludeDir('src\include\snowball'); $snowball->AddReference($postgres); @@ -87,31 +90,31 @@ sub mkvcbuild if ($solution->{options}->{perl}) { - my $plperlsrc = "src\\pl\\plperl\\"; + my $plperlsrc = "src\\pl\\plperl\\"; my $plperl = $solution->AddProject('plperl','dll','PLs','src\pl\plperl'); $plperl->AddIncludeDir($solution->{options}->{perl} . '/lib/CORE'); $plperl->AddDefine('PLPERL_HAVE_UID_GID'); - foreach my $xs ('SPI.xs', 'Util.xs') - { - (my $xsc = $xs) =~ s/\.xs/.c/; - if (Solution::IsNewer("$plperlsrc$xsc","$plperlsrc$xs")) - { - print "Building $plperlsrc$xsc...\n"; - system( $solution->{options}->{perl} - . '/bin/perl ' - . $solution->{options}->{perl} - . '/lib/ExtUtils/xsubpp -typemap ' - . $solution->{options}->{perl} - . '/lib/ExtUtils/typemap ' - . "$plperlsrc$xs " - . ">$plperlsrc$xsc"); - if ((!(-f "$plperlsrc$xsc")) || -z "$plperlsrc$xsc") - { - unlink("$plperlsrc$xsc"); # if zero size - die "Failed to create $xsc.\n"; - } - } - } + foreach my $xs ('SPI.xs', 'Util.xs') + { + (my $xsc = $xs) =~ s/\.xs/.c/; + if (Solution::IsNewer("$plperlsrc$xsc","$plperlsrc$xs")) + { + print "Building $plperlsrc$xsc...\n"; + system( $solution->{options}->{perl} + . '/bin/perl ' + . $solution->{options}->{perl} + . '/lib/ExtUtils/xsubpp -typemap ' + . $solution->{options}->{perl} + . '/lib/ExtUtils/typemap ' + . "$plperlsrc$xs " + . ">$plperlsrc$xsc"); + if ((!(-f "$plperlsrc$xsc")) || -z "$plperlsrc$xsc") + { + unlink("$plperlsrc$xsc"); # if zero size + die "Failed to create $xsc.\n"; + } + } + } if ( Solution::IsNewer('src\pl\plperl\perlchunks.h','src\pl\plperl\plc_perlboot.pl') ||Solution::IsNewer('src\pl\plperl\perlchunks.h','src\pl\plperl\plc_safe_bad.pl') ||Solution::IsNewer('src\pl\plperl\perlchunks.h','src\pl\plperl\plc_safe_ok.pl')) @@ -133,28 +136,35 @@ sub mkvcbuild } } $plperl->AddReference($postgres); - my @perl_libs = grep {/perl\d+.lib$/ } - glob($solution->{options}->{perl} . '\lib\CORE\perl*.lib'); + my @perl_libs = + grep {/perl\d+.lib$/ }glob($solution->{options}->{perl} . '\lib\CORE\perl*.lib'); if (@perl_libs == 1) { $plperl->AddLibrary($perl_libs[0]); } - else - { - die "could not identify perl library version"; - } + else + { + die "could not identify perl library version"; + } } if ($solution->{options}->{python}) { + # Attempt to get python version and location. Assume python.exe in specified dir. - open(P, $solution->{options}->{python} . "\\python -c \"import sys;print(sys.prefix);print(str(sys.version_info[0])+str(sys.version_info[1]))\" |") || die "Could not query for python version!\n"; - my $pyprefix =
;chomp($pyprefix); - my $pyver =
;chomp($pyver); + open(P, + $solution->{options}->{python} + . "\\python -c \"import sys;print(sys.prefix);print(str(sys.version_info[0])+str(sys.version_info[1]))\" |" + ) || die "Could not query for python version!\n"; + my $pyprefix =
; + chomp($pyprefix); + my $pyver =
;
+ chomp($pyver);
close(P);
- # Sometimes (always?) if python is not present, the execution actually works, but gives no data...
- die "Failed to query python for version information\n" if (!(defined($pyprefix) && defined($pyver)));
+ # Sometimes (always?) if python is not present, the execution actually works, but gives no data...
+ die "Failed to query python for version information\n"
+ if (!(defined($pyprefix) && defined($pyver)));
my $plpython = $solution->AddProject('plpython','dll','PLs','src\pl\plpython');
$plpython->AddIncludeDir($pyprefix . '\include');
@@ -179,7 +189,7 @@ sub mkvcbuild
$libpq = $solution->AddProject('libpq','dll','interfaces','src\interfaces\libpq');
$libpq->AddDefine('FRONTEND');
- $libpq->AddDefine('UNSAFE_STAT_OK');
+ $libpq->AddDefine('UNSAFE_STAT_OK');
$libpq->AddIncludeDir('src\port');
$libpq->AddLibrary('wsock32.lib');
$libpq->AddLibrary('secur32.lib');
@@ -189,7 +199,8 @@ sub mkvcbuild
$libpq->ReplaceFile('src\interfaces\libpq\libpqrc.c','src\interfaces\libpq\libpq.rc');
$libpq->AddReference($libpgport);
- my $libpqwalreceiver = $solution->AddProject('libpqwalreceiver', 'dll', '', 'src\backend\replication\libpqwalreceiver');
+ my $libpqwalreceiver = $solution->AddProject('libpqwalreceiver', 'dll', '',
+ 'src\backend\replication\libpqwalreceiver');
$libpqwalreceiver->AddIncludeDir('src\interfaces\libpq');
$libpqwalreceiver->AddReference($postgres,$libpq);
@@ -314,12 +325,12 @@ sub mkvcbuild
if ($solution->{options}->{uuid})
{
- $contrib_extraincludes->{'uuid-ossp'} = [ $solution->{options}->{uuid} . '\include' ];
- $contrib_extralibs->{'uuid-ossp'} = [ $solution->{options}->{uuid} . '\lib\uuid.lib' ];
+ $contrib_extraincludes->{'uuid-ossp'} = [ $solution->{options}->{uuid} . '\include' ];
+ $contrib_extralibs->{'uuid-ossp'} = [ $solution->{options}->{uuid} . '\lib\uuid.lib' ];
}
- else
+ else
{
- push @contrib_excludes,'uuid-ossp';
+ push @contrib_excludes,'uuid-ossp';
}
# Pgcrypto makefile too complex to parse....
@@ -462,10 +473,10 @@ sub AddContrib
$mf =~ s{\\\s*[\r\n]+}{}mg;
my $proj = $solution->AddProject($dn, 'dll', 'contrib');
$mf =~ /^OBJS\s*=\s*(.*)$/gm || croak "Could not find objects in MODULE_big for $n\n";
- my $objs = $1;
+ my $objs = $1;
while ($objs =~ /\b([\w-]+\.o)\b/g)
{
- my $o = $1;
+ my $o = $1;
$o =~ s/\.o$/.c/;
$proj->AddFile('contrib\\' . $n . '\\' . $o);
}
@@ -479,9 +490,9 @@ sub AddContrib
$mf2 =~ /^SUBOBJS\s*=\s*(.*)$/gm
|| croak "Could not find objects in MODULE_big for $n, subdir $d\n";
$objs = $1;
- while ($objs =~ /\b([\w-]+\.o)\b/g)
- {
- my $o = $1;
+ while ($objs =~ /\b([\w-]+\.o)\b/g)
+ {
+ my $o = $1;
$o =~ s/\.o$/.c/;
$proj->AddFile('contrib\\' . $n . '\\' . $d . '\\' . $o);
}
@@ -506,7 +517,7 @@ sub AddContrib
my $objs = $1;
while ($objs =~ /\b([\w-]+\.o)\b/g)
{
- my $o = $1;
+ my $o = $1;
$o =~ s/\.o$/.c/;
$proj->AddFile('contrib\\' . $n . '\\' . $o);
}
diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm
index 8eee8c11875..aa9c123da65 100644
--- a/src/tools/msvc/Project.pm
+++ b/src/tools/msvc/Project.pm
@@ -3,7 +3,7 @@ package Project;
#
# Package that encapsulates a Visual C++ project file generation
#
-# $PostgreSQL: pgsql/src/tools/msvc/Project.pm,v 1.25 2010/01/05 11:12:50 mha Exp $
+# $PostgreSQL: pgsql/src/tools/msvc/Project.pm,v 1.26 2010/04/09 13:05:58 mha Exp $
#
use Carp;
use strict;
@@ -102,11 +102,13 @@ sub RemoveFile
sub RelocateFiles
{
my ($self, $targetdir, $proc) = @_;
- foreach my $f (keys %{$self->{files}}) {
+ foreach my $f (keys %{$self->{files}})
+ {
my $r = &$proc($f);
- if ($r) {
- $self->RemoveFile($f);
- $self->AddFile($targetdir . '\\' . basename($f));
+ if ($r)
+ {
+ $self->RemoveFile($f);
+ $self->AddFile($targetdir . '\\' . basename($f));
}
}
}
@@ -125,10 +127,10 @@ sub AddReference
sub AddLibrary
{
my ($self, $lib, $dbgsuffix) = @_;
-
+
if ($lib =~ m/\s/)
{
- $lib = '"' . $lib . """;
+ $lib = '"' . $lib . """;
}
push @{$self->{libraries}}, $lib;
@@ -348,9 +350,9 @@ sub Save
$self->FullExportDLL($self->{name} . ".lib");
}
- # Warning 4197 is about double exporting, disable this per
- # http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=99193
- $self->DisableLinkerWarnings('4197') if ($self->{platform} eq 'x64');
+ # Warning 4197 is about double exporting, disable this per
+ # http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=99193
+ $self->DisableLinkerWarnings('4197') if ($self->{platform} eq 'x64');
# Dump the project
open(F, ">$self->{name}.vcproj") || croak("Could not write to $self->{name}.vcproj\n");
@@ -405,7 +407,8 @@ EOF
my $of = $f;
$of =~ s/\.l$/.c/;
print F '>'
- . $self->GenerateCustomTool('Running flex on ' . $f, 'src\tools\msvc\pgflex.bat ' . $f,$of)
+ . $self->GenerateCustomTool('Running flex on ' . $f,
+ 'src\tools\msvc\pgflex.bat ' . $f,$of)
. '' . "\n";
}
elsif (defined($uniquefiles{$file}))
@@ -439,8 +442,8 @@ sub GenerateCustomTool
my ($self, $desc, $tool, $output, $cfg) = @_;
if (!defined($cfg))
{
- return $self->GenerateCustomTool($desc, $tool, $output, 'Debug') .
- $self->GenerateCustomTool($desc, $tool, $output, 'Release');
+ return $self->GenerateCustomTool($desc, $tool, $output, 'Debug')
+ .$self->GenerateCustomTool($desc, $tool, $output, 'Release');
}
return
"
; close(P); - if ($line !~ /^Microsoft\s*\(R\) Visual C\+\+ Project Builder - \D+(\d+)\.00\.\d+/) { - die "Unable to determine vcbuild version from first line of output!"; + if ($line !~ /^Microsoft\s*\(R\) Visual C\+\+ Project Builder - \D+(\d+)\.00\.\d+/) + { + die "Unable to determine vcbuild version from first line of output!"; } if ($1 == 8) { $self->{vcver} = '8.00' } elsif ($1 == 9) { $self->{vcver} = '9.00' } else { die "Unsupported version of Visual Studio: $1" } print "Detected Visual Studio version $self->{vcver}\n"; -# Determine if we are in 32 or 64-bit mode. Do this by seeing if CL has -# 64-bit only parameters. - $self->{platform} = 'Win32'; - open(P,"cl /? 2>NUL|") || die "cl command not found"; - while (
) { - if (/^\/favor:) { - $self->{platform} = 'x64'; - last; - } - } - close(P); - print "Detected hardware platform: $self->{platform}\n"; + # Determine if we are in 32 or 64-bit mode. Do this by seeing if CL has + # 64-bit only parameters. + $self->{platform} = 'Win32'; + open(P,"cl /? 2>NUL|") || die "cl command not found"; + while (
)
+ {
+ if (/^\/favor:)
+ {
+ $self->{platform} = 'x64';
+ last;
+ }
+ }
+ close(P);
+ print "Detected hardware platform: $self->{platform}\n";
}
-
# Return 1 if $oldfile is newer than $newfile, or if $newfile doesn't exist.
# Special case - if config.pl has changed, always return 1
sub IsNewer
@@ -95,8 +98,11 @@ sub IsNewer
my ($newfile, $oldfile) = @_;
if ($oldfile ne 'src\tools\msvc\config.pl' && $oldfile ne 'src\tools\msvc\config_default.pl')
{
- return 1 if (-f 'src\tools\msvc\config.pl') && IsNewer($newfile, 'src\tools\msvc\config.pl');
- return 1 if (-f 'src\tools\msvc\config_default.pl') && IsNewer($newfile, 'src\tools\msvc\config_default.pl');
+ return 1
+ if (-f 'src\tools\msvc\config.pl') && IsNewer($newfile, 'src\tools\msvc\config.pl');
+ return 1
+ if (-f 'src\tools\msvc\config_default.pl')
+ && IsNewer($newfile, 'src\tools\msvc\config_default.pl');
}
return 1 if (!(-e $newfile));
my @nstat = stat($newfile);
@@ -161,7 +167,7 @@ sub GenerateFiles
s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY(z)\n#define PG_VERSION_STR "PostgreSQL $self->{strver}, compiled by Visual C++ build " __STRINGIFY2(_MSC_VER) ", $bits-bit"};
print O;
}
- print O "#define PG_MAJORVERSION \"$self->{majorver}\"\n";
+ print O "#define PG_MAJORVERSION \"$self->{majorver}\"\n";
print O "#define LOCALEDIR \"/share/locale\"\n" if ($self->{options}->{nls});
print O "/* defines added by config steps */\n";
print O "#ifndef IGNORE_CONFIGURED_SETTINGS\n";
@@ -170,18 +176,15 @@ 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})
+ 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})
{
print O "#define USE_FLOAT4_BYVAL 1\n";
print O "#define FLOAT4PASSBYVAL true\n";
@@ -235,10 +238,23 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
close(I);
}
- $self->GenerateDefFile("src\\interfaces\\libpq\\libpqdll.def","src\\interfaces\\libpq\\exports.txt","LIBPQ");
- $self->GenerateDefFile("src\\interfaces\\ecpg\\ecpglib\\ecpglib.def","src\\interfaces\\ecpg\\ecpglib\\exports.txt","LIBECPG");
- $self->GenerateDefFile("src\\interfaces\\ecpg\\compatlib\\compatlib.def","src\\interfaces\\ecpg\\compatlib\\exports.txt","LIBECPG_COMPAT");
- $self->GenerateDefFile("src\\interfaces\\ecpg\\pgtypeslib\\pgtypeslib.def","src\\interfaces\\ecpg\\pgtypeslib\\exports.txt","LIBPGTYPES");
+ $self->GenerateDefFile("src\\interfaces\\libpq\\libpqdll.def",
+ "src\\interfaces\\libpq\\exports.txt","LIBPQ");
+ $self->GenerateDefFile(
+ "src\\interfaces\\ecpg\\ecpglib\\ecpglib.def",
+ "src\\interfaces\\ecpg\\ecpglib\\exports.txt",
+ "LIBECPG"
+ );
+ $self->GenerateDefFile(
+ "src\\interfaces\\ecpg\\compatlib\\compatlib.def",
+ "src\\interfaces\\ecpg\\compatlib\\exports.txt",
+ "LIBECPG_COMPAT"
+ );
+ $self->GenerateDefFile(
+ "src\\interfaces\\ecpg\\pgtypeslib\\pgtypeslib.def",
+ "src\\interfaces\\ecpg\\pgtypeslib\\exports.txt",
+ "LIBPGTYPES"
+ );
if (IsNewer('src\backend\utils\fmgrtab.c','src\include\catalog\pg_proc.h'))
{
@@ -251,9 +267,11 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
if (IsNewer('src\include\utils\probes.h','src\backend\utils\probes.d'))
{
- print "Generating probes.h...\n";
- system('psed -f src\backend\utils\Gen_dummy_probes.sed src\backend\utils\probes.d > src\include\utils\probes.h');
- }
+ print "Generating probes.h...\n";
+ system(
+'psed -f src\backend\utils\Gen_dummy_probes.sed src\backend\utils\probes.d > src\include\utils\probes.h'
+ );
+ }
if (IsNewer('src\interfaces\libpq\libpq.rc','src\interfaces\libpq\libpq.rc.in'))
{
@@ -279,12 +297,7 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
chdir('..\..\..');
}
- if (
- IsNewer(
- 'src\interfaces\ecpg\preproc\preproc.y',
- 'src\backend\parser\gram.y'
- )
- )
+ if (IsNewer('src\interfaces\ecpg\preproc\preproc.y','src\backend\parser\gram.y'))
{
print "Generating preproc.y...\n";
chdir('src\interfaces\ecpg\preproc');
@@ -307,8 +320,8 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
#define HAVE_LONG_LONG_INT_64
#define ENABLE_THREAD_SAFETY 1
EOF
- print O "#define USE_INTEGER_DATETIMES 1\n" if ($self->{options}->{integer_datetimes});
- print O "#endif\n";
+ print O "#define USE_INTEGER_DATETIMES 1\n" if ($self->{options}->{integer_datetimes});
+ print O "#endif\n";
close(O);
}
@@ -346,7 +359,9 @@ EOF
print "Generating postgres.bki and schemapg.h...\n";
chdir('src\backend\catalog');
my $bki_srcs = join(' ../../../src/include/catalog/', @allbki);
- system("perl genbki.pl -I../../../src/include/catalog --set-version=$self->{majorver} $bki_srcs");
+ system(
+"perl genbki.pl -I../../../src/include/catalog --set-version=$self->{majorver} $bki_srcs"
+ );
chdir('..\..\..');
copyFile('src\backend\catalog\schemapg.h', 'src\include\catalog\schemapg.h');
last;
@@ -417,7 +432,7 @@ sub AddProject
{
$proj->AddIncludeDir($self->{options}->{iconv} . '\include');
$proj->AddLibrary($self->{options}->{iconv} . '\lib\iconv.lib');
- }
+ }
if ($self->{options}->{xml})
{
$proj->AddIncludeDir($self->{options}->{xml} . '\include');
diff --git a/src/tools/msvc/build.pl b/src/tools/msvc/build.pl
index d3c299e2138..764e5942f6a 100644
--- a/src/tools/msvc/build.pl
+++ b/src/tools/msvc/build.pl
@@ -1,13 +1,13 @@
# -*-perl-*- hey - emacs - this is a perl file
-# $PostgreSQL: pgsql/src/tools/msvc/build.pl,v 1.2 2010/01/05 13:31:58 mha Exp $
+# $PostgreSQL: pgsql/src/tools/msvc/build.pl,v 1.3 2010/04/09 13:05:58 mha Exp $
BEGIN
{
-
- chdir("../../..") if (-d "../msvc" && -d "../../../src");
-
+
+ chdir("../../..") if (-d "../msvc" && -d "../../../src");
+
}
use lib "src/tools/msvc";
@@ -29,7 +29,6 @@ elsif (-e "./buildenv.pl" )
require "./buildenv.pl";
}
-
# set up the project
our $config;
require "config_default.pl";
diff --git a/src/tools/msvc/gendef.pl b/src/tools/msvc/gendef.pl
index 81ce9f4dbbf..487012fc344 100644
--- a/src/tools/msvc/gendef.pl
+++ b/src/tools/msvc/gendef.pl
@@ -1,12 +1,13 @@
my @def;
+
#
# Script that generates a .DEF file for all objects in a directory
-#
-# $PostgreSQL: pgsql/src/tools/msvc/gendef.pl,v 1.9 2010/01/01 17:34:25 mha Exp $
+#
+# $PostgreSQL: pgsql/src/tools/msvc/gendef.pl,v 1.10 2010/04/09 13:05:58 mha Exp $
#
-die "Usage: gendef.pl