diff options
author | Michael Paquier <michael@paquier.xyz> | 2021-05-27 20:11:00 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2021-05-27 20:11:00 +0900 |
commit | 025110663448a8c877f4b591495f2e5d187d8936 (patch) | |
tree | 502a3090ae68ec39cd37c0b29cf8dac30c184fcb | |
parent | 388e75ad33489b77cfb9a8590a91e9287d8fb960 (diff) | |
download | postgresql-025110663448a8c877f4b591495f2e5d187d8936.tar.gz postgresql-025110663448a8c877f4b591495f2e5d187d8936.zip |
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
-rw-r--r-- | src/tools/msvc/Solution.pm | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 3c5fe5dddcb..97f012bbb5e 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -1023,10 +1023,26 @@ sub AddProject } if ($self->{options}->{gss}) { - $proj->AddIncludeDir($self->{options}->{gss} . '\inc\krb5'); - $proj->AddLibrary($self->{options}->{gss} . '\lib\i386\krb5_32.lib'); - $proj->AddLibrary($self->{options}->{gss} . '\lib\i386\comerr32.lib'); - $proj->AddLibrary($self->{options}->{gss} . '\lib\i386\gssapi32.lib'); + $proj->AddIncludeDir($self->{options}->{gss} . '\include'); + $proj->AddIncludeDir($self->{options}->{gss} . '\include\krb5'); + if ($self->{platform} eq 'Win32') + { + $proj->AddLibrary( + $self->{options}->{gss} . '\lib\i386\krb5_32.lib'); + $proj->AddLibrary( + $self->{options}->{gss} . '\lib\i386\comerr32.lib'); + $proj->AddLibrary( + $self->{options}->{gss} . '\lib\i386\gssapi32.lib'); + } + else + { + $proj->AddLibrary( + $self->{options}->{gss} . '\lib\amd64\krb5_64.lib'); + $proj->AddLibrary( + $self->{options}->{gss} . '\lib\amd64\comerr64.lib'); + $proj->AddLibrary( + $self->{options}->{gss} . '\lib\amd64\gssapi64.lib'); + } } if ($self->{options}->{iconv}) { |