diff --git a/meson.build b/meson.build index 0204ad190a..9a3acaf65e 100644 --- a/meson.build +++ b/meson.build @@ -24,7 +24,7 @@ cpu = host_machine.cpu_family() host_os = host_machine.system() message(host_os) target_os = target_machine.system() -bsd_oses = [freebsd', 'openbsd', 'dragonfly'] +bsd_oses = ['freebsd', 'openbsd', 'dragonfly'] #if cpu in ['ppc64', 's390x', 'sparc64', x86_64] # if host.os.contains(['bsd', 'dragonfly']) @@ -100,10 +100,15 @@ root_includes = include_directories( 'include', 'etc/afpd', ) + if host_os in bsd_oses root_includes += include_directories('/usr/local/include') endif +if host_os == 'netbsd' + root_includes += include_directories('/usr/pkg/include') +endif + ############# # Libraries # ############# @@ -113,7 +118,11 @@ netatalk_common_link_args = [] if host_os in bsd_oses libsearch_dirs += '/usr/local/lib' -endif' +endif + +if host_os == 'netbsd' + libsearch_dirs += '/usr/pkg/lib' +endif socket = cc.find_library('socket', required: false) if socket.found() @@ -155,7 +164,7 @@ yacc = find_program('yacc', required: false) ################# header_dir = [] -if host_os == 'openbsd' +if host_os in bsd_oses header_dir += '/usr/local/include' endif @@ -358,7 +367,7 @@ if get_option('with-bdb') == '' bdb_includes += include_directories('/usr/local/include' / dir) endif endforeach - if bdb_header == '' + if host_os == 'netbsd' foreach dir : bdb_subdirs if fs.exists('/usr/pkg/include' / dir / 'db.h') bdb_header += '/usr/pkg/include' / dir / 'db.h' @@ -527,31 +536,36 @@ with_ssl = crypt.found() or crypto.found() # Check for GSSAPI # -lib_dir = [] -if host_os == 'dragonfly' - lib_dir += '/usr/local/lib' +if get_option('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) + endif + if not gss.found() + gss = cc.find_library( + 'gssapi_krb5', + dirs: libsearch_dirs, + required: false, + ) + endif +else + if get_option('with-gssapi') != '' + gss = cc.find_library('gssapi', dirs: with_gssapi, required: false) + endif endif -gss = cc.find_library('gss', dirs: lib_dir, required: false) -gssapi = cc.find_library('gssapi', dirs: lib_dir, required: false) -gssapi_krb5 = cc.find_library( - 'gssapi_krb5', - dirs: lib_dir, - required: false, -) - -if get_option('with-gssapi').disabled() +if not gss.found() with_gssapi = false else with_gssapi = ( - (gss.found() or gssapi.found() or gssapi_krb5.found()) + gss.found() and cc.has_function( 'gss_acquire_cred', - dependencies: [gss, gssapi, gssapi_krb5], + dependencies: gss, ) ) - if get_option('with-gssapi').enabled() and not with_gssapi + if get_option('with-gssapi') != '' and not with_gssapi error('GSSAPI support requested but not found') endif endif diff --git a/meson_options.txt b/meson_options.txt index 8a55ee7247..2f0c943e06 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -138,8 +138,8 @@ option( ) option( 'with-gssapi', - type: 'feature', - value: 'auto', + type: 'string', + value: '', description: 'Path to GSSAPI for Kerberos V UAM', ) option(