Skip to content

Commit 7a4f2e1

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 521a812 commit 7a4f2e1

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

src/tools/msvc/Solution.pm

+20-4
Original file line numberDiff line numberDiff line change
@@ -642,10 +642,26 @@ sub AddProject
642642
}
643643
if ($self->{options}->{gss})
644644
{
645-
$proj->AddIncludeDir($self->{options}->{gss} . '\inc\krb5');
646-
$proj->AddLibrary($self->{options}->{gss} . '\lib\i386\krb5_32.lib');
647-
$proj->AddLibrary($self->{options}->{gss} . '\lib\i386\comerr32.lib');
648-
$proj->AddLibrary($self->{options}->{gss} . '\lib\i386\gssapi32.lib');
645+
$proj->AddIncludeDir($self->{options}->{gss} . '\include');
646+
$proj->AddIncludeDir($self->{options}->{gss} . '\include\krb5');
647+
if ($self->{platform} eq 'Win32')
648+
{
649+
$proj->AddLibrary(
650+
$self->{options}->{gss} . '\lib\i386\krb5_32.lib');
651+
$proj->AddLibrary(
652+
$self->{options}->{gss} . '\lib\i386\comerr32.lib');
653+
$proj->AddLibrary(
654+
$self->{options}->{gss} . '\lib\i386\gssapi32.lib');
655+
}
656+
else
657+
{
658+
$proj->AddLibrary(
659+
$self->{options}->{gss} . '\lib\amd64\krb5_64.lib');
660+
$proj->AddLibrary(
661+
$self->{options}->{gss} . '\lib\amd64\comerr64.lib');
662+
$proj->AddLibrary(
663+
$self->{options}->{gss} . '\lib\amd64\gssapi64.lib');
664+
}
649665
}
650666
if ($self->{options}->{iconv})
651667
{

0 commit comments

Comments
 (0)