Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2b45933

Browse files
committed
meson: Add support for detecting gss without pkg-config
This is required as MIT Kerberos does provide neither pkg-config nor cmakedependency information on windows.Reported-by: Dave Page <dpage@pgadmin.org>Reviewed-by: Tristan Partin <tristan@partin.io>Discussion:https://postgr.es/m/20240709065101.xhc74r3mdg2lmn4w@awork3.anarazel.deBackpatch: 16-, where meson support was added
1 parentcc50694 commit2b45933

File tree

1 file changed

+44
-6
lines changed

1 file changed

+44
-6
lines changed

‎meson.build

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -620,33 +620,66 @@ gssapiopt = get_option('gssapi')
620620
krb_srvtab=''
621621
have_gssapi=false
622622
ifnot gssapiopt.disabled()
623-
gssapi=dependency('krb5-gssapi',required:gssapiopt)
623+
gssapi=dependency('krb5-gssapi',required:false)
624624
have_gssapi= gssapi.found()
625625

626+
if have_gssapi
627+
gssapi_deps= [gssapi]
628+
elifnot have_gssapi
629+
# Hardcoded lookup for gssapi. This is necessary as gssapi on windows does
630+
# not install neither pkg-config nor cmake dependency information.
631+
if host_system=='windows'
632+
is_64= cc.sizeof('void *',args: test_c_args)==8
633+
if is_64
634+
gssapi_search_libs= ['gssapi64','krb5_64','comerr64']
635+
else
636+
gssapi_search_libs= ['gssapi32','krb5_32','comerr32']
637+
endif
638+
else
639+
gssapi_search_libs= ['gssapi_krb5']
640+
endif
641+
642+
gssapi_deps= []
643+
foreachlibname: gssapi_search_libs
644+
lib= cc.find_library(libname,dirs: test_lib_d,required:false)
645+
if lib.found()
646+
have_gssapi=true
647+
gssapi_deps+= lib
648+
endif
649+
endforeach
650+
651+
if have_gssapi
652+
# Meson before 0.57.0 did not support using check_header() etc with
653+
# declare_dependency(). Thus the tests below use the library looked up
654+
# above. Once we require a newer meson version, we can simplify.
655+
gssapi=declare_dependency(dependencies: gssapi_deps)
656+
endif
657+
endif
658+
626659
ifnot have_gssapi
627-
elif cc.check_header('gssapi/gssapi.h',dependencies:gssapi,required:false,
660+
elif cc.check_header('gssapi/gssapi.h',dependencies:gssapi_deps,required:false,
628661
args: test_c_args,include_directories: postgres_inc)
629662
cdata.set('HAVE_GSSAPI_GSSAPI_H',1)
630-
elif cc.check_header('gssapi.h',dependencies:gssapi,required: gssapiopt,
663+
elif cc.check_header('gssapi.h',dependencies:gssapi_deps,required: gssapiopt,
631664
args: test_c_args,include_directories: postgres_inc)
632665
cdata.set('HAVE_GSSAPI_H',1)
633666
else
634667
have_gssapi=false
635668
endif
636669

637670
ifnot have_gssapi
638-
elif cc.check_header('gssapi/gssapi_ext.h',dependencies:gssapi,required:false,
671+
elif cc.check_header('gssapi/gssapi_ext.h',dependencies:gssapi_deps,required:false,
639672
args: test_c_args,include_directories: postgres_inc)
640673
cdata.set('HAVE_GSSAPI_GSSAPI_EXT_H',1)
641-
elif cc.check_header('gssapi_ext.h',dependencies:gssapi,required: gssapiopt,
674+
elif cc.check_header('gssapi_ext.h',dependencies:gssapi_deps,required: gssapiopt,
642675
args: test_c_args,include_directories: postgres_inc)
643676
cdata.set('HAVE_GSSAPI_EXT_H',1)
644677
else
645678
have_gssapi=false
646679
endif
647680

648681
ifnot have_gssapi
649-
elif cc.has_function('gss_store_cred_into',dependencies:gssapi,
682+
elif cc.has_function('gss_store_cred_into',dependencies:gssapi_deps,
650683
args: test_c_args,include_directories: postgres_inc)
651684
cdata.set('ENABLE_GSS',1)
652685

@@ -657,6 +690,11 @@ if not gssapiopt.disabled()
657690
else
658691
have_gssapi=false
659692
endif
693+
694+
ifnot have_gssapiand gssapiopt.enabled()
695+
error('dependency lookup for gssapi failed')
696+
endif
697+
660698
endif
661699
ifnot have_gssapi
662700
gssapi= not_found_dep

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp