$NetBSD: patch-meson.build,v 1.8 2025/08/12 18:22:55 hauke Exp $ Add PREFIXed paths (include, lib) for all OSes. Make PREFIX path configurable. Install at.h on Linux, we do it on NetBSD, too. --- meson.build.orig 2025-08-05 13:56:32.000000000 +0000 +++ meson.build @@ -152,16 +152,9 @@ include_dirs = [ 'include', 'sys', 'etc/afpd', + get_option('prefix') / 'include', ] -if host_os in ['dragonfly', 'freebsd', 'openbsd'] - include_dirs += ['/usr/local/include'] -elif host_os == 'netbsd' - include_dirs += ['/usr/pkg/include'] -elif uname.found() and uname_stdout.to_lower().contains('omnios') - include_dirs += ['/opt/local/include'] -endif - # note: the brew app is not visible from within the brew build wrapper iteslf, # so rather than checking for brew we apply a blanket prefix brew_prefix = '' @@ -189,13 +182,7 @@ endif libsearch_dirs = [] -if host_os in ['dragonfly', 'freebsd', 'openbsd'] - libsearch_dirs += '/usr/local/lib' -elif host_os == 'netbsd' - libsearch_dirs += '/usr/pkg/lib' -elif uname.found() and uname_stdout.to_lower().contains('omnios') - libsearch_dirs += '/opt/local/lib' -endif +libsearch_dirs += get_option('prefix') / 'lib' if brew_prefix != '' libsearch_dirs += brew_prefix + '/lib' @@ -233,9 +220,8 @@ add_global_link_arguments(netatalk_commo ################# header_dir = [] -if host_os in ['dragonfly', 'freebsd', 'openbsd'] - header_dir += '/usr/local/include' -endif + +header_dir += get_option('prefix') / 'include' check_headers = [ 'acl/libacl.h', @@ -400,9 +386,7 @@ if 'dbd' in get_option('with-cnid-backen endif bdb_dirs += [ - '/usr/local', - '/usr/pkg', - '/opt/local', + get_option('prefix'), '/usr', ] endif @@ -1567,7 +1551,7 @@ else pam_paths = [ '/', '/usr', - '/usr/local', + get_option('prefix'), ] foreach path : pam_paths @@ -1918,16 +1902,10 @@ cracklib_dict = '' if fs.is_dir('/usr/share/cracklib') cracklib_dict += '/usr/share/cracklib/pw_dict' +elif fs.is_dir(get_option('prefix') / 'share/cracklib') + cracklib_dict += get_option('prefix') / 'share/cracklib/cracklib-small' elif fs.is_dir('/var/cache/cracklib') cracklib_dict += '/var/cache/cracklib/cracklib_dict' -elif fs.is_dir('/usr/local/libdata/cracklib') - cracklib_dict += '/usr/local/libdata/cracklib/cracklib-words' -elif fs.is_dir('/usr/pkg/share/cracklib') - cracklib_dict += '/usr/pkg/share/cracklib/pw_dict' -elif fs.is_dir('/usr/local/share/cracklib') - cracklib_dict += '/usr/local/share/cracklib/cracklib-small' -elif fs.is_dir('/opt/homebrew/share/cracklib') - cracklib_dict += '/opt/homebrew/share/cracklib/cracklib-small' endif if not enable_cracklib @@ -2051,7 +2029,6 @@ if host_os == 'freebsd' cdata.set('FREEBSD', 1) cdata.set('OPEN_NOFOLLOW_ERRNO', 'EMLINK') elif host_os == 'linux' - use_glibc_at_header = cc.has_header('netatalk/at.h') cdata.set('_GNU_SOURCE', 1) if cc.compiles( '''