Commit fd6913a1 authored by Magnus Hagander's avatar Magnus Hagander

perltidy run over msvc build system

parent 912bc4f0
...@@ -56,10 +56,11 @@ sub Install ...@@ -56,10 +56,11 @@ sub Install
my $majorver = DetermineMajorVersion(); my $majorver = DetermineMajorVersion();
print "Installing version $majorver for $conf in $target\n"; print "Installing version $majorver for $conf in $target\n";
EnsureDirectories($target, 'bin', 'lib', 'share', 'share/timezonesets', EnsureDirectories(
'share/extension', 'share/contrib', $target, 'bin', 'lib', 'share',
'doc', 'doc/extension', 'doc/contrib', 'share/timezonesets','share/extension', 'share/contrib','doc',
'symbols', 'share/tsearch_data'); 'doc/extension', 'doc/contrib','symbols', 'share/tsearch_data'
);
CopySolutionOutput($conf, $target); CopySolutionOutput($conf, $target);
lcopy($target . '/lib/libpq.dll', $target . '/bin/libpq.dll'); lcopy($target . '/lib/libpq.dll', $target . '/bin/libpq.dll');
...@@ -127,10 +128,7 @@ sub Install ...@@ -127,10 +128,7 @@ sub Install
}, },
@pldirs @pldirs
); );
CopySetOfFiles( CopySetOfFiles('PL Extension files', $pl_extension_files,$target . '/share/extension/');
'PL Extension files', $pl_extension_files,
$target . '/share/extension/'
);
GenerateNLSFiles($target,$config->{nls},$majorver) if ($config->{nls}); GenerateNLSFiles($target,$config->{nls},$majorver) if ($config->{nls});
...@@ -350,9 +348,10 @@ sub CopyContribFiles ...@@ -350,9 +348,10 @@ sub CopyContribFiles
foreach my $f (split /\s+/,$flist) foreach my $f (split /\s+/,$flist)
{ {
lcopy('contrib/' . $d . '/' . $f . '.control', lcopy(
$target . '/share/extension/' . $f . '.control') 'contrib/' . $d . '/' . $f . '.control',
|| croak("Could not copy file $f.control in contrib $d"); $target . '/share/extension/' . $f . '.control'
)|| croak("Could not copy file $f.control in contrib $d");
print '.'; print '.';
} }
} }
...@@ -383,8 +382,7 @@ sub CopyContribFiles ...@@ -383,8 +382,7 @@ sub CopyContribFiles
foreach my $f (split /\s+/,$flist) foreach my $f (split /\s+/,$flist)
{ {
lcopy('contrib/' . $d . '/' . $f, lcopy('contrib/' . $d . '/' . $f,$target . '/share/tsearch_data/' . basename($f))
$target . '/share/tsearch_data/' . basename($f))
|| croak("Could not copy file $f in contrib $d"); || croak("Could not copy file $f in contrib $d");
print '.'; print '.';
} }
...@@ -402,8 +400,7 @@ sub CopyContribFiles ...@@ -402,8 +400,7 @@ sub CopyContribFiles
if ($d eq 'spi'); if ($d eq 'spi');
foreach my $f (split /\s+/,$flist) foreach my $f (split /\s+/,$flist)
{ {
lcopy('contrib/' . $d . '/' . $f, lcopy('contrib/' . $d . '/' . $f,$target . '/doc/' . $moduledir . '/' . $f)
$target . '/doc/' . $moduledir . '/' . $f)
|| croak("Could not copy file $f in contrib $d"); || croak("Could not copy file $f in contrib $d");
print '.'; print '.';
} }
...@@ -473,8 +470,8 @@ sub CopyIncludeFiles ...@@ -473,8 +470,8 @@ sub CopyIncludeFiles
$target . '/include/server/', $target . '/include/server/',
'src/include/', 'pg_config.h', 'pg_config_os.h' 'src/include/', 'pg_config.h', 'pg_config_os.h'
); );
CopyFiles('Grammar header', $target . '/include/server/parser/', CopyFiles('Grammar header', $target . '/include/server/parser/','src/backend/parser/',
'src/backend/parser/', 'gram.h'); 'gram.h');
CopySetOfFiles('',[ glob("src\\include\\*.h") ],$target . '/include/server/'); CopySetOfFiles('',[ glob("src\\include\\*.h") ],$target . '/include/server/');
my $D; my $D;
opendir($D, 'src/include') || croak "Could not opendir on src/include!\n"; opendir($D, 'src/include') || croak "Could not opendir on src/include!\n";
......
...@@ -172,6 +172,7 @@ sub mkvcbuild ...@@ -172,6 +172,7 @@ sub mkvcbuild
if ($solution->{options}->{python}) if ($solution->{options}->{python})
{ {
# Attempt to get python version and location. # Attempt to get python version and location.
# Assume python.exe in specified dir. # Assume python.exe in specified dir.
open(P, open(P,
...@@ -190,8 +191,8 @@ sub mkvcbuild ...@@ -190,8 +191,8 @@ sub mkvcbuild
if (!(defined($pyprefix) && defined($pyver))); if (!(defined($pyprefix) && defined($pyver)));
my $pymajorver = substr($pyver, 0, 1); my $pymajorver = substr($pyver, 0, 1);
my $plpython = $solution->AddProject('plpython' . $pymajorver, 'dll', my $plpython =
'PLs', 'src\pl\plpython'); $solution->AddProject('plpython' . $pymajorver, 'dll','PLs', 'src\pl\plpython');
$plpython->AddIncludeDir($pyprefix . '\include'); $plpython->AddIncludeDir($pyprefix . '\include');
$plpython->AddLibrary($pyprefix . "\\Libs\\python$pyver.lib"); $plpython->AddLibrary($pyprefix . "\\Libs\\python$pyver.lib");
$plpython->AddReference($postgres); $plpython->AddReference($postgres);
......
...@@ -273,23 +273,30 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY ...@@ -273,23 +273,30 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
); );
} }
if ($self->{options}->{python} && IsNewer('src\pl\plpython\spiexceptions.h','src\include\backend\errcodes.txt')) if ($self->{options}->{python}
&& IsNewer('src\pl\plpython\spiexceptions.h','src\include\backend\errcodes.txt'))
{ {
print "Generating spiexceptions.h...\n"; print "Generating spiexceptions.h...\n";
system('perl src\pl\plpython\generate-spiexceptions.pl src\backend\utils\errcodes.txt > src\pl\plpython\spiexceptions.h'); system(
'perl src\pl\plpython\generate-spiexceptions.pl src\backend\utils\errcodes.txt > src\pl\plpython\spiexceptions.h'
);
} }
if (IsNewer('src\include\utils\errcodes.h','src\backend\utils\errcodes.txt')) if (IsNewer('src\include\utils\errcodes.h','src\backend\utils\errcodes.txt'))
{ {
print "Generating errcodes.h...\n"; print "Generating errcodes.h...\n";
system('perl src\backend\utils\generate-errcodes.pl src\backend\utils\errcodes.txt > src\backend\utils\errcodes.h'); system(
'perl src\backend\utils\generate-errcodes.pl src\backend\utils\errcodes.txt > src\backend\utils\errcodes.h'
);
copyFile('src\backend\utils\errcodes.h','src\include\utils\errcodes.h'); copyFile('src\backend\utils\errcodes.h','src\include\utils\errcodes.h');
} }
if (IsNewer('src\pl\plpgsql\src\plerrcodes.h','src\backend\utils\errcodes.txt')) if (IsNewer('src\pl\plpgsql\src\plerrcodes.h','src\backend\utils\errcodes.txt'))
{ {
print "Generating plerrcodes.h...\n"; print "Generating plerrcodes.h...\n";
system('perl src\pl\plpgsql\src\generate-plerrcodes.pl src\backend\utils\errcodes.txt > src\pl\plpgsql\src\plerrcodes.h'); system(
'perl src\pl\plpgsql\src\generate-plerrcodes.pl src\backend\utils\errcodes.txt > src\pl\plpgsql\src\plerrcodes.h'
);
} }
if (IsNewer('src\interfaces\libpq\libpq.rc','src\interfaces\libpq\libpq.rc.in')) if (IsNewer('src\interfaces\libpq\libpq.rc','src\interfaces\libpq\libpq.rc.in'))
......
...@@ -9,7 +9,6 @@ use strict; ...@@ -9,7 +9,6 @@ use strict;
use File::Copy; use File::Copy;
use Cwd qw(abs_path getcwd); use Cwd qw(abs_path getcwd);
my $startdir = getcwd(); my $startdir = getcwd();
my $openjade = 'openjade-1.3.1'; my $openjade = 'openjade-1.3.1';
...@@ -34,11 +33,9 @@ missing() if @notfound; ...@@ -34,11 +33,9 @@ missing() if @notfound;
my $arg = shift; my $arg = shift;
renamefiles(); renamefiles();
chdir 'doc/src/sgml'; chdir 'doc/src/sgml';
$ENV{SGML_CATALOG_FILES} = "$docroot/$openjade/dsssl/catalog;" . $ENV{SGML_CATALOG_FILES} = "$docroot/$openjade/dsssl/catalog;" ."$docroot/docbook/docbook.cat";
"$docroot/docbook/docbook.cat";
my $cmd; my $cmd;
...@@ -46,41 +43,43 @@ my $cmd; ...@@ -46,41 +43,43 @@ my $cmd;
# can't die on "failure" # can't die on "failure"
$cmd = $cmd =
"perl mk_feature_tables.pl YES " . "perl mk_feature_tables.pl YES "
"../../../src/backend/catalog/sql_feature_packages.txt " . ."../../../src/backend/catalog/sql_feature_packages.txt "
"../../../src/backend/catalog/sql_features.txt " . ."../../../src/backend/catalog/sql_features.txt "
"> features-supported.sgml"; ."> features-supported.sgml";
system($cmd); die "features_supported" if $?; system($cmd);
$cmd = die "features_supported" if $?;
"perl mk_feature_tables.pl NO " .
"\"../../../src/backend/catalog/sql_feature_packages.txt\" " .
"\"../../../src/backend/catalog/sql_features.txt\" " .
"> features-unsupported.sgml";
system($cmd); die "features_unsupported" if $?;
$cmd = $cmd =
"perl generate-errcodes-table.pl \"../../../src/backend/utils/errcodes.txt\" " . "perl mk_feature_tables.pl NO "
"> errcodes-table.sgml"; ."\"../../../src/backend/catalog/sql_feature_packages.txt\" "
system($cmd); die "errcodes-table" if $?; ."\"../../../src/backend/catalog/sql_features.txt\" "
."> features-unsupported.sgml";
system($cmd);
die "features_unsupported" if $?;
$cmd ="perl generate-errcodes-table.pl \"../../../src/backend/utils/errcodes.txt\" "
."> errcodes-table.sgml";
system($cmd);
die "errcodes-table" if $?;
print "Running first build...\n"; print "Running first build...\n";
$cmd = $cmd =
"\"$docroot/$openjade/bin/openjade\" -V html-index -wall " . "\"$docroot/$openjade/bin/openjade\" -V html-index -wall "
"-wno-unused-param -wno-empty -D . -c \"$docroot/$dsssl/catalog\" " . ."-wno-unused-param -wno-empty -D . -c \"$docroot/$dsssl/catalog\" "
"-d stylesheet.dsl -i output-html -t sgml postgres.sgml 2>&1 " . ."-d stylesheet.dsl -i output-html -t sgml postgres.sgml 2>&1 "
"| findstr /V \"DTDDECL catalog entries are not supported\" "; ."| findstr /V \"DTDDECL catalog entries are not supported\" ";
system($cmd); # die "openjade" if $?; system($cmd); # die "openjade" if $?;
print "Running collateindex...\n"; print "Running collateindex...\n";
$cmd = $cmd ="perl \"$docroot/$dsssl/bin/collateindex.pl\" -f -g -i bookindex "
"perl \"$docroot/$dsssl/bin/collateindex.pl\" -f -g -i bookindex " . ."-o bookindex.sgml HTML.index";
"-o bookindex.sgml HTML.index"; system($cmd);
system($cmd); die "collateindex" if $?; die "collateindex" if $?;
mkdir "html"; mkdir "html";
print "Running second build...\n"; print "Running second build...\n";
$cmd = $cmd =
"\"$docroot/$openjade/bin/openjade\" -wall -wno-unused-param -wno-empty " . "\"$docroot/$openjade/bin/openjade\" -wall -wno-unused-param -wno-empty "
"-D . -c \"$docroot/$dsssl/catalog\" -d stylesheet.dsl -t sgml " . ."-D . -c \"$docroot/$dsssl/catalog\" -d stylesheet.dsl -t sgml "
"-i output-html -i include-index postgres.sgml 2>&1 " . ."-i output-html -i include-index postgres.sgml 2>&1 "
"| findstr /V \"DTDDECL catalog entries are not supported\" "; ."| findstr /V \"DTDDECL catalog entries are not supported\" ";
system($cmd); # die "openjade" if $?; system($cmd); # die "openjade" if $?;
...@@ -94,6 +93,7 @@ exit; ...@@ -94,6 +93,7 @@ exit;
sub renamefiles sub renamefiles
{ {
# Rename ISO entity files # Rename ISO entity files
my $savedir = getcwd(); my $savedir = getcwd();
chdir "$docroot/docbook"; chdir "$docroot/docbook";
...@@ -116,7 +116,6 @@ sub missing ...@@ -116,7 +116,6 @@ sub missing
sub noversion sub noversion
{ {
print STDERR "Could not find version.sgml. ", print STDERR "Could not find version.sgml. ","Please run mkvcbuild.pl first!\n";
"Please run mkvcbuild.pl first!\n";
exit 1; exit 1;
} }
...@@ -145,8 +145,7 @@ sub isolationcheck ...@@ -145,8 +145,7 @@ sub isolationcheck
my @args = ( my @args = (
"../../../$Config/pg_isolation_regress/pg_isolation_regress", "../../../$Config/pg_isolation_regress/pg_isolation_regress",
"--psqldir=../../../$Config/psql", "--psqldir=../../../$Config/psql",
"--inputdir=.", "--inputdir=.","--schedule=./isolation_schedule"
"--schedule=./isolation_schedule"
); );
push(@args,$maxconn) if $maxconn; push(@args,$maxconn) if $maxconn;
system(@args); system(@args);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment