Browse Source

freebsd: FreeBSD 15 has native inotify

Check to make sure that we have inotify in libc, before looking for it
in libinotify.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Daniel P. Berrange <berrange@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Warner Losh <imp@bsdimp.com>
master
Warner Losh 2 months ago
parent
commit
bba2f724f1
  1. 14
      meson.build
  2. 6
      util/meson.build

14
meson.build

@ -2664,18 +2664,14 @@ else
endif
config_host_data.set('CONFIG_ASAN_IFACE_FIBER', have_asan_fiber)
inotify = not_found
have_inotify_init = cc.has_header_symbol('sys/inotify.h', 'inotify_init')
have_inotify_init1 = cc.has_header_symbol('sys/inotify.h', 'inotify_init1')
inotify = not_found
if (have_inotify_init or have_inotify_init1) and host_os == 'freebsd'
# libinotify-kqueue
if (have_inotify_init or have_inotify_init1) and not cc.has_function('inotify_init1')
# FreeBSD 14 and older need libinotify-kqueue wrapper
inotify = cc.find_library('inotify')
if have_inotify_init
have_inotify_init = inotify.found()
endif
if have_inotify_init1
have_inotify_init1 = inotify.found()
endif
have_inotify_init = have_inotify_init and inotify.found()
have_inotify_init1 = have_inotify_init1 and inotify.found()
endif
config_host_data.set('CONFIG_INOTIFY', have_inotify_init)
config_host_data.set('CONFIG_INOTIFY1', have_inotify_init1)

6
util/meson.build

@ -102,11 +102,7 @@ if have_block
util_ss.add(files('throttle.c'))
util_ss.add(files('timed-average.c'))
if config_host_data.get('CONFIG_INOTIFY1')
freebsd_dep = []
if host_os == 'freebsd'
freebsd_dep = inotify
endif
util_ss.add(files('filemonitor-inotify.c'), freebsd_dep)
util_ss.add(files('filemonitor-inotify.c'), inotify)
else
util_ss.add(files('filemonitor-stub.c'))
endif

Loading…
Cancel
Save