Skip to content

Commit a75268f

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 99d6dd3 commit a75268f

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
@@ -729,10 +729,26 @@ sub AddProject
729729
}
730730
if ($self->{options}->{gss})
731731
{
732-
$proj->AddIncludeDir($self->{options}->{gss} . '\inc\krb5');
733-
$proj->AddLibrary($self->{options}->{gss} . '\lib\i386\krb5_32.lib');
734-
$proj->AddLibrary($self->{options}->{gss} . '\lib\i386\comerr32.lib');
735-
$proj->AddLibrary($self->{options}->{gss} . '\lib\i386\gssapi32.lib');
732+
$proj->AddIncludeDir($self->{options}->{gss} . '\include');
733+
$proj->AddIncludeDir($self->{options}->{gss} . '\include\krb5');
734+
if ($self->{platform} eq 'Win32')
735+
{
736+
$proj->AddLibrary(
737+
$self->{options}->{gss} . '\lib\i386\krb5_32.lib');
738+
$proj->AddLibrary(
739+
$self->{options}->{gss} . '\lib\i386\comerr32.lib');
740+
$proj->AddLibrary(
741+
$self->{options}->{gss} . '\lib\i386\gssapi32.lib');
742+
}
743+
else
744+
{
745+
$proj->AddLibrary(
746+
$self->{options}->{gss} . '\lib\amd64\krb5_64.lib');
747+
$proj->AddLibrary(
748+
$self->{options}->{gss} . '\lib\amd64\comerr64.lib');
749+
$proj->AddLibrary(
750+
$self->{options}->{gss} . '\lib\amd64\gssapi64.lib');
751+
}
736752
}
737753
if ($self->{options}->{iconv})
738754
{

0 commit comments

Comments
 (0)