Skip to content

Commit cf2e095

Browse files
committed
Fix MSVC scripts when building with GSSAPI/Kerberos
The deliverables of upstream Kerberos on Windows are installed with paths that do not match our MSVC scripts. First, the include folder was named "inc/" in our scripts, but the upstream MSIs use "include/". Second, the build would fail with 64-bit environments as the libraries are named differently. This commit adjusts the MSVC scripts to be compatible with the latest installations of upstream, and I have checked that the compilation was able to work with the 32-bit and 64-bit installations. Special thanks to Kondo Yuta for the help in investigating the situation in hamerkop, which had an incorrect configuration for the GSS compilation. Reported-by: Brian Ye Discussion: https://postgr.es/m/162128202219.27274.12616756784952017465@wrigleys.postgresql.org Backpatch-through: 9.6
1 parent b1a1f77 commit cf2e095

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

src/tools/msvc/Solution.pm

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,26 @@ sub AddProject
695695
}
696696
if ($self->{options}->{gss})
697697
{
698-
$proj->AddIncludeDir($self->{options}->{gss} . '\inc\krb5');
699-
$proj->AddLibrary($self->{options}->{gss} . '\lib\i386\krb5_32.lib');
700-
$proj->AddLibrary($self->{options}->{gss} . '\lib\i386\comerr32.lib');
701-
$proj->AddLibrary($self->{options}->{gss} . '\lib\i386\gssapi32.lib');
698+
$proj->AddIncludeDir($self->{options}->{gss} . '\include');
699+
$proj->AddIncludeDir($self->{options}->{gss} . '\include\krb5');
700+
if ($self->{platform} eq 'Win32')
701+
{
702+
$proj->AddLibrary(
703+
$self->{options}->{gss} . '\lib\i386\krb5_32.lib');
704+
$proj->AddLibrary(
705+
$self->{options}->{gss} . '\lib\i386\comerr32.lib');
706+
$proj->AddLibrary(
707+
$self->{options}->{gss} . '\lib\i386\gssapi32.lib');
708+
}
709+
else
710+
{
711+
$proj->AddLibrary(
712+
$self->{options}->{gss} . '\lib\amd64\krb5_64.lib');
713+
$proj->AddLibrary(
714+
$self->{options}->{gss} . '\lib\amd64\comerr64.lib');
715+
$proj->AddLibrary(
716+
$self->{options}->{gss} . '\lib\amd64\gssapi64.lib');
717+
}
702718
}
703719
if ($self->{options}->{iconv})
704720
{

0 commit comments

Comments
 (0)