From 7687183b03e08e46958e1b120058a1947a382639 Mon Sep 17 00:00:00 2001 From: dgsga <181612+dgsga@users.noreply.github.com> Date: Sat, 2 Mar 2024 11:28:28 +0000 Subject: [PATCH] Update --- .github/workflows/meson.yml | 4 +- etc/afpd/meson.build | 4 +- etc/uams/meson.build | 10 ++--- meson.build | 74 ++++++++++++++++++++++++++----------- test/afpd/meson.build | 4 +- 5 files changed, 62 insertions(+), 34 deletions(-) diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index 8c17f85908..ff53d38c45 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -2,7 +2,7 @@ name: Checks on: push: branches: - - dgsga-meson-builds + - dgsga-meson-build paths-ignore: - "CONTRIBUTORS" - "NEWS" @@ -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: diff --git a/etc/afpd/meson.build b/etc/afpd/meson.build index 727727f603..59f8e39f7c 100644 --- a/etc/afpd/meson.build +++ b/etc/afpd/meson.build @@ -90,7 +90,7 @@ libafpd = static_library( link_with: [afpd_internal_deps, libatalk], dependencies: [ afpd_external_deps, - gssapi, + gss, kerberos, libgcrypt, libcnid_deps, @@ -168,7 +168,7 @@ executable( link_with: [afpd_internal_deps, libatalk], dependencies: [ afpd_external_deps, - gssapi, + gss, kerberos, libgcrypt, libcnid_deps, diff --git a/etc/uams/meson.build b/etc/uams/meson.build index 8af47376f9..dc6ae1ee51 100644 --- a/etc/uams/meson.build +++ b/etc/uams/meson.build @@ -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', @@ -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, diff --git a/meson.build b/meson.build index 9a3acaf65e..2c61c88b97 100644 --- a/meson.build +++ b/meson.build @@ -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', @@ -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) @@ -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) @@ -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, @@ -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 @@ -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( @@ -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)) @@ -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, } diff --git a/test/afpd/meson.build b/test/afpd/meson.build index e76cd5096b..cddc37915d 100644 --- a/test/afpd/meson.build +++ b/test/afpd/meson.build @@ -65,7 +65,7 @@ afpdtestlib = static_library( link_with: [test_internal_deps, libatalk], dependencies: [ test_external_deps, - gssapi, + gss, kerberos, libgcrypt, libcnid_deps, @@ -142,7 +142,7 @@ afpdtest = executable( include_directories: root_includes, dependencies: [ test_external_deps, - gssapi, + gss, kerberos, libgcrypt, libcnid_deps,