Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
dgsga committed Mar 2, 2024
1 parent 97c30b9 commit 7687183
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 34 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Checks
on:
push:
branches:
- dgsga-meson-builds
- dgsga-meson-build
paths-ignore:
- "CONTRIBUTORS"
- "NEWS"
Expand Down Expand Up @@ -339,10 +339,8 @@ jobs:
talloc
run: |
meson setup build \
-Dwith-libgcrypt-dir=/usr/pkg \
-Dwith-tracker-pkgconfig-version=3.0 \
-Dpkg_config_path=/usr/pkg/lib/pkgconfig \
-Dwith-ldap=/usr/pkg
ninja -C build
build-dflybsd:
Expand Down
4 changes: 2 additions & 2 deletions etc/afpd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ libafpd = static_library(
link_with: [afpd_internal_deps, libatalk],
dependencies: [
afpd_external_deps,
gssapi,
gss,
kerberos,
libgcrypt,
libcnid_deps,
Expand Down Expand Up @@ -168,7 +168,7 @@ executable(
link_with: [afpd_internal_deps, libatalk],
dependencies: [
afpd_external_deps,
gssapi,
gss,
kerberos,
libgcrypt,
libcnid_deps,
Expand Down
10 changes: 5 additions & 5 deletions etc/uams/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ uams_dhx2_pam = static_library(
install_dir: libdir / 'netatalk',
)

if with_gssapi
if have_gssapi
uams_gss_sources = ['uams_gss.c']

uams_gss = shared_module(
'uams_gss',
uams_gss_sources,
include_directories: root_includes,
dependencies: [kerberos, gssapi],
include_directories: [gssapi_includes, root_includes],
dependencies: [gss, kerberos],
c_args: kerberos_c_args,
name_prefix: '',
name_suffix: 'so',
Expand All @@ -103,8 +103,8 @@ if with_gssapi
uams_gss = static_library(
'uams_gss',
uams_gss_sources,
include_directories: root_includes,
dependencies: [kerberos, gssapi],
include_directories: [gssapi_includes, root_includes],
dependencies: [gss, kerberos],
c_args: kerberos_c_args,
name_prefix: '',
install: true,
Expand Down
74 changes: 52 additions & 22 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,7 @@ check_headers = [
'attr/xattr.h',
'dlfcn.h',
'dns_sd.h',
'gssapi.h',
'gssapi/gssapi_generic.h',
'gssapi/gssapi_krb5.h',
'gssapi/gssapi.h',
'inttypes.h',
'kerberosv5/krb5.h',
'krb5.h',
'krb5/krb5.h',
'langinfo.h',
'linux/dqblk/xfs.h',
'linux/xfs/fs.h',
Expand Down Expand Up @@ -536,8 +529,26 @@ with_ssl = crypt.found() or crypto.found()
# Check for GSSAPI
#

with_gssapi = get_option('with-gssapi')
gssapi_includes = []
gssapi_headers = [
'gssapi.h',
'gssapi/gssapi_generic.h',
'gssapi/gssapi_krb5.h',
'gssapi/gssapi.h',
]

foreach header : gssapi_headers
if cc.has_header(
header,
include_directories: include_directories(with_gssapi / 'include'),
)
cdata.set('HAVE_' + header.underscorify().to_upper(), 1)
endif

endforeach

if get_option('with-gssapi') == ''
if with_gssapi == ''
gss = cc.find_library('gss', dirs: libsearch_dirs, required: false)
if not gss.found()
gss = cc.find_library('gssapi', dirs: libsearch_dirs, required: false)
Expand All @@ -551,26 +562,31 @@ if get_option('with-gssapi') == ''
endif
else
if get_option('with-gssapi') != ''
gss = cc.find_library('gssapi', dirs: with_gssapi, required: false)
gss = cc.find_library(
'gssapi',
dirs: with_gssapi / 'lib',
required: false,
)
gssapi_includes += include_directories(with_gssapi / 'include')
endif
endif

if not gss.found()
with_gssapi = false
have_gssapi = false
else
with_gssapi = (
have_gssapi = (
gss.found()
and cc.has_function(
'gss_acquire_cred',
dependencies: gss,
)
)
if get_option('with-gssapi') != '' and not with_gssapi
if with_gssapi != '' and not have_gssapi
error('GSSAPI support requested but not found')
endif
endif

if with_gssapi
if have_gssapi
# Heimdal/MIT compatibility fix
if cc.has_header_symbol('gssapi.h', 'GSS_C_NT_HOSTBASED_SERVICE')
cdata.set('HAVE_GSS_C_NT_HOSTBASED_SERVICE', 1)
Expand All @@ -582,20 +598,31 @@ endif
# Check for Kerberos V
#

kerberos = cc.find_library('krb5', dirs: lib_dir, required: false)
kerberos = cc.find_library('krb5', dirs: libsearch_dirs, required: false)
krb5_config = find_program('krb5-config', required: false)
kerberos_c_args = []
kerberos_headers = [
'kerberosv5/krb5.h',
'krb5.h',
'krb5/krb5.h',
]

foreach header : kerberos_headers
if cc.has_header(header)
cdata.set('HAVE_' + header.underscorify().to_upper(), 1)
endif
endforeach

if get_option('with-kerberos').disabled()
with_kerberos = false
have_kerberos = false
else
with_kerberos = kerberos.found()
if get_option('with-kerberos').enabled() and not with_kerberos
have_kerberos = kerberos.found()
if get_option('with-kerberos').enabled() and not have_kerberos
error('Kerberos support requested but not found')
endif
endif

if with_kerberos
if have_kerberos
if host_os == 'sunos'
kerberos_c_args += run_command(
krb5_config,
Expand Down Expand Up @@ -624,7 +651,7 @@ endif
if get_option('enable-krbV-uam').disabled()
enable_krbV_uam = false
else
enable_krbV_uam = with_gssapi
enable_krbV_uam = have_gssapi
if get_option('enable-krbV-uam').enabled() and not with_gssapi
warning('Need GSSAPI support to build Kerberos V UAM')
endif
Expand Down Expand Up @@ -796,6 +823,9 @@ if libgcrypt_dir != ''
)
else
libgcrypt = dependency('libgcrypt', required: false)
if not libgcrypt.found()
libgcrypt = cc.find_library('libgcrypt', dirs: libsearch_dirs, required: false)
endif
endif

libgcrypt_config = find_program(
Expand Down Expand Up @@ -1066,7 +1096,7 @@ if with_ldap != ''
include_directories: include_directories(with_ldap / 'include'),
)
else
ldap = cc.find_library('ldap', dirs: lib_dir, required: false)
ldap = cc.find_library('ldap', dirs: libsearch_dirs, required: false)
endif

have_ldap = (ldap.found() and cc.has_function('ldap_init', dependencies: ldap))
Expand Down Expand Up @@ -1688,8 +1718,8 @@ summary_info = {
' ACL support': with_acls,
' AFP stats via dbus': with_afpstats,
' dtrace probes': with_dtrace,
' GSSAPI support': with_gssapi,
' Kerberos support': with_kerberos,
' GSSAPI support': have_gssapi,
' Kerberos support': have_kerberos,
' LDAP support': have_ldap,
' Zeroconf support': enable_zeroconf,
}
Expand Down
4 changes: 2 additions & 2 deletions test/afpd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ afpdtestlib = static_library(
link_with: [test_internal_deps, libatalk],
dependencies: [
test_external_deps,
gssapi,
gss,
kerberos,
libgcrypt,
libcnid_deps,
Expand Down Expand Up @@ -142,7 +142,7 @@ afpdtest = executable(
include_directories: root_includes,
dependencies: [
test_external_deps,
gssapi,
gss,
kerberos,
libgcrypt,
libcnid_deps,
Expand Down

0 comments on commit 7687183

Please sign in to comment.