mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-01 16:01:23 +02:00
Fix vcbuild failures and chkpass dependency caused by 854adb8
Switching the Windows build scripts to use forward slashes instead of backslashes has caused a couple of issues in VC builds: - The file tree list was not correctly generated, build script generating vcproj file missing tree dependencies when listing items in Filter. - VC builds do not accept file paths with forward slashes, perhaps it could be possible to use a Condition but it seems safer to simply enforce the file paths to use backslashes in the vcproj files. - chkpass had an unneeded dependency with libpgport and libpgcommon to make build succeed but actually it is not necessary as crypt.c is already listed for this project and should be replaced with a fake name as it is a unique file. Michael Paquier
This commit is contained in:
parent
f95425478a
commit
06ca28d5ab
@ -143,7 +143,7 @@ EOF
|
|||||||
|
|
||||||
# File already exists, so fake a new name
|
# File already exists, so fake a new name
|
||||||
my $obj = $dir;
|
my $obj = $dir;
|
||||||
$obj =~ s/\\/_/g;
|
$obj =~ s!/!_!g;
|
||||||
|
|
||||||
print $f <<EOF;
|
print $f <<EOF;
|
||||||
<ClCompile Include="$fileNameWithPath">
|
<ClCompile Include="$fileNameWithPath">
|
||||||
|
@ -33,12 +33,10 @@ my $contrib_defines = { 'refint' => 'REFINT_VERBOSE' };
|
|||||||
my @contrib_uselibpq =
|
my @contrib_uselibpq =
|
||||||
('dblink', 'oid2name', 'postgres_fdw', 'vacuumlo');
|
('dblink', 'oid2name', 'postgres_fdw', 'vacuumlo');
|
||||||
my @contrib_uselibpgport = (
|
my @contrib_uselibpgport = (
|
||||||
'chkpass',
|
|
||||||
'oid2name',
|
'oid2name',
|
||||||
'pg_standby',
|
'pg_standby',
|
||||||
'vacuumlo');
|
'vacuumlo');
|
||||||
my @contrib_uselibpgcommon = (
|
my @contrib_uselibpgcommon = (
|
||||||
'chkpass',
|
|
||||||
'oid2name',
|
'oid2name',
|
||||||
'pg_standby',
|
'pg_standby',
|
||||||
'vacuumlo');
|
'vacuumlo');
|
||||||
|
@ -75,43 +75,48 @@ EOF
|
|||||||
my $dir = $1;
|
my $dir = $1;
|
||||||
my $file = $2;
|
my $file = $2;
|
||||||
|
|
||||||
# Walk backwards down the directory stack and close any dirs we're done with
|
# Walk backwards down the directory stack and close any dirs
|
||||||
|
# we're done with.
|
||||||
while ($#dirstack >= 0)
|
while ($#dirstack >= 0)
|
||||||
{
|
{
|
||||||
if (join('\\', @dirstack) eq
|
if (join('/', @dirstack) eq
|
||||||
substr($dir, 0, length(join('\\', @dirstack))))
|
substr($dir, 0, length(join('/', @dirstack))))
|
||||||
{
|
{
|
||||||
last if (length($dir) == length(join('\\', @dirstack)));
|
last if (length($dir) == length(join('/', @dirstack)));
|
||||||
last
|
last
|
||||||
if (substr($dir, length(join('\\', @dirstack)), 1) eq '\\');
|
if (substr($dir, length(join('/', @dirstack)), 1) eq '/');
|
||||||
}
|
}
|
||||||
print $f ' ' x $#dirstack . " </Filter>\n";
|
print $f ' ' x $#dirstack . " </Filter>\n";
|
||||||
pop @dirstack;
|
pop @dirstack;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Now walk forwards and create whatever directories are needed
|
# Now walk forwards and create whatever directories are needed
|
||||||
while (join('\\', @dirstack) ne $dir)
|
while (join('/', @dirstack) ne $dir)
|
||||||
{
|
{
|
||||||
my $left = substr($dir, length(join('\\', @dirstack)));
|
my $left = substr($dir, length(join('/', @dirstack)));
|
||||||
$left =~ s/^\\//;
|
$left =~ s/^\///;
|
||||||
my @pieces = split /\\/, $left;
|
my @pieces = split /\//, $left;
|
||||||
push @dirstack, $pieces[0];
|
push @dirstack, $pieces[0];
|
||||||
print $f ' ' x $#dirstack
|
print $f ' ' x $#dirstack
|
||||||
. " <Filter Name=\"$pieces[0]\" Filter=\"\">\n";
|
. " <Filter Name=\"$pieces[0]\" Filter=\"\">\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# VC builds do not like file paths with forward slashes.
|
||||||
|
my $fileNameWithPathFormatted = $fileNameWithPath;
|
||||||
|
$fileNameWithPathFormatted =~ s/\//\\/g;
|
||||||
|
|
||||||
print $f ' ' x $#dirstack
|
print $f ' ' x $#dirstack
|
||||||
. " <File RelativePath=\"$fileNameWithPath\"";
|
. " <File RelativePath=\"$fileNameWithPathFormatted\"";
|
||||||
if ($fileNameWithPath =~ /\.y$/)
|
if ($fileNameWithPath =~ /\.y$/)
|
||||||
{
|
{
|
||||||
my $of = $fileNameWithPath;
|
my $of = $fileNameWithPath;
|
||||||
$of =~ s/\.y$/.c/;
|
$of =~ s/\.y$/.c/;
|
||||||
$of =~
|
$of =~
|
||||||
s{^src\\pl\\plpgsql\\src\\gram.c$}{src\\pl\\plpgsql\\src\\pl_gram.c};
|
s{^src/pl/plpgsql/src/gram.c$}{src/pl/plpgsql/src/pl_gram.c};
|
||||||
print $f '>'
|
print $f '>'
|
||||||
. $self->GenerateCustomTool(
|
. $self->GenerateCustomTool(
|
||||||
'Running bison on ' . $fileNameWithPath,
|
'Running bison on ' . $fileNameWithPath,
|
||||||
"perl src\\tools\\msvc\\pgbison.pl $fileNameWithPath", $of)
|
"perl src/tools/msvc/pgbison.pl $fileNameWithPath", $of)
|
||||||
. '</File>' . "\n";
|
. '</File>' . "\n";
|
||||||
}
|
}
|
||||||
elsif ($fileNameWithPath =~ /\.l$/)
|
elsif ($fileNameWithPath =~ /\.l$/)
|
||||||
@ -121,7 +126,7 @@ s{^src\\pl\\plpgsql\\src\\gram.c$}{src\\pl\\plpgsql\\src\\pl_gram.c};
|
|||||||
print $f '>'
|
print $f '>'
|
||||||
. $self->GenerateCustomTool(
|
. $self->GenerateCustomTool(
|
||||||
'Running flex on ' . $fileNameWithPath,
|
'Running flex on ' . $fileNameWithPath,
|
||||||
"perl src\\tools\\msvc\\pgflex.pl $fileNameWithPath", $of)
|
"perl src/tools/msvc/pgflex.pl $fileNameWithPath", $of)
|
||||||
. '</File>' . "\n";
|
. '</File>' . "\n";
|
||||||
}
|
}
|
||||||
elsif (defined($uniquefiles{$file}))
|
elsif (defined($uniquefiles{$file}))
|
||||||
@ -129,7 +134,7 @@ s{^src\\pl\\plpgsql\\src\\gram.c$}{src\\pl\\plpgsql\\src\\pl_gram.c};
|
|||||||
|
|
||||||
# File already exists, so fake a new name
|
# File already exists, so fake a new name
|
||||||
my $obj = $dir;
|
my $obj = $dir;
|
||||||
$obj =~ s/\\/_/g;
|
$obj =~ s!/!_!g;
|
||||||
print $f
|
print $f
|
||||||
"><FileConfiguration Name=\"Debug|$self->{platform}\"><Tool Name=\"VCCLCompilerTool\" ObjectFile=\".\\debug\\$self->{name}\\$obj"
|
"><FileConfiguration Name=\"Debug|$self->{platform}\"><Tool Name=\"VCCLCompilerTool\" ObjectFile=\".\\debug\\$self->{name}\\$obj"
|
||||||
. "_$file.obj\" /></FileConfiguration><FileConfiguration Name=\"Release|$self->{platform}\"><Tool Name=\"VCCLCompilerTool\" ObjectFile=\".\\release\\$self->{name}\\$obj"
|
. "_$file.obj\" /></FileConfiguration><FileConfiguration Name=\"Release|$self->{platform}\"><Tool Name=\"VCCLCompilerTool\" ObjectFile=\".\\release\\$self->{name}\\$obj"
|
||||||
|
Loading…
Reference in New Issue
Block a user