meson.build: relax the libdl test to one for the function dlopen
authorAlex Bennée <alex.bennee@linaro.org>
Wed, 14 Jul 2021 10:15:36 +0000 (11:15 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 14 Jul 2021 14:52:17 +0000 (15:52 +0100)
For the *BSD family dlopen is already part of libc so it's not a hard
dependency to have a libdl.so library.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210714101536.16016-1-alex.bennee@linaro.org>

meson.build

index c6dd70c40046c2c1cce7d11c358560cf4d2b5cc9..e5de1442335255c9564cc97282544abc17311e53 100644 (file)
@@ -455,7 +455,10 @@ endif
 rt = cc.find_library('rt', required: false)
 libdl = not_found
 if 'CONFIG_PLUGIN' in config_host
-  libdl = cc.find_library('dl', required: true)
+  libdl = cc.find_library('dl', required: false)
+  if not cc.has_function('dlopen', dependencies: libdl)
+    error('dlopen not found')
+  endif
 endif
 libiscsi = not_found
 if not get_option('libiscsi').auto() or have_block