2025-03-10 14:08:51 +02:00
|
|
|
project('krb5')
|
2025-03-11 10:12:00 +01:00
|
|
|
current_source_dir = meson.current_source_dir()
|
2025-03-10 14:08:51 +02:00
|
|
|
krb5 = disabler()
|
|
|
|
krb5_config = find_program('krb5-config', required: false)
|
2025-03-11 10:12:00 +01:00
|
|
|
|
2025-03-10 14:08:51 +02:00
|
|
|
if krb5_config.found()
|
2025-03-18 15:30:24 +02:00
|
|
|
# Detect vendor.
|
|
|
|
vendor_cmd = run_command([krb5_config, '--vendor'], check: false)
|
|
|
|
vendor = 'unknown'
|
|
|
|
if vendor_cmd.returncode() == 0
|
|
|
|
vendor = vendor_cmd.stdout().strip()
|
|
|
|
else
|
|
|
|
all = run_command([krb5_config, '--all'], check: false)
|
|
|
|
if all.returncode() == 0
|
|
|
|
foreach i : all.stdout().split('\n')
|
|
|
|
if i.startswith('Vendor')
|
|
|
|
vendor = i.split(':')[1].strip()
|
|
|
|
break
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2025-03-10 14:08:51 +02:00
|
|
|
cflags = run_command([krb5_config, '--cflags', 'gssapi'], check: false)
|
|
|
|
libs = run_command([krb5_config, '--libs', 'gssapi'], check: false)
|
|
|
|
version = run_command([krb5_config, '--version'], check: false)
|
2025-03-18 15:30:24 +02:00
|
|
|
if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0
|
2025-03-10 14:08:51 +02:00
|
|
|
krb5_version = version.stdout().strip()
|
|
|
|
krb5 = declare_dependency(
|
|
|
|
compile_args: cflags.stdout().split(),
|
|
|
|
link_args: libs.stdout().split(),
|
|
|
|
version: krb5_version,
|
2025-03-13 00:03:28 +01:00
|
|
|
variables: {
|
|
|
|
'cflags': cflags.stdout().strip(),
|
|
|
|
'libs': libs.stdout().strip(),
|
|
|
|
'vendor': vendor,
|
|
|
|
},
|
2025-03-10 14:08:51 +02:00
|
|
|
)
|
|
|
|
endif
|
|
|
|
endif
|