[PATCH] meson: FreeBSD: make inotify dependency optional

Marian Cingel posted 1 patch 1 week, 5 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260125223651.798234-1-cingel.marian@gmail.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] meson: FreeBSD: make inotify dependency optional
Posted by Marian Cingel 1 week, 5 days ago
 - 'libinitofy' is not a base package, therefore installed to /usr/local
 - 'find_library' invokes clang, which by default *does not* search
   '/usr/local/lib', so even when libinotify.so is present in system,
   the detection does not work and 'configure' reports an error.
 - tested on FreeBSD-15

Signed-off-by: Marian Cingel <cingel.marian@gmail.com>
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index a84f14258b..ac1c02d7da 100644
--- a/meson.build
+++ b/meson.build
@@ -2661,7 +2661,7 @@ 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
-  inotify = cc.find_library('inotify')
+  inotify = cc.find_library('inotify', required: false)
   if have_inotify_init
     have_inotify_init = inotify.found()
   endif
-- 
2.43.0
Re: [PATCH] meson: FreeBSD: make inotify dependency optional
Posted by Warner Losh 1 week, 5 days ago
On Sun, Jan 25, 2026, 3:43 PM Marian Cingel <cingel.marian@gmail.com> wrote:

>  - 'libinitofy' is not a base package, therefore installed to /usr/local
>  - 'find_library' invokes clang, which by default *does not* search
>    '/usr/local/lib', so even when libinotify.so is present in system,
>    the detection does not work and 'configure' reports an error.
>  - tested on FreeBSD-15
>

Shouldn't we not use inotify at all on 15 now that FreeBSD has a native
inotify?

Warner

Signed-off-by: Marian Cingel <cingel.marian@gmail.com>
> ---
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meson.build b/meson.build
> index a84f14258b..ac1c02d7da 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2661,7 +2661,7 @@ 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
> -  inotify = cc.find_library('inotify')
> +  inotify = cc.find_library('inotify', required: false)
>    if have_inotify_init
>      have_inotify_init = inotify.found()
>    endif
> --
> 2.43.0
>
>
>