On 22/09/20 13:14, Thomas Huth wrote: > On 22/09/2020 12.49, Max Reitz wrote: >> Signed-off-by: Max Reitz <mre...@redhat.com> >> --- >> configure | 34 ++++++++++++++++++++++++++++++++++ >> meson.build | 6 ++++++ >> 2 files changed, 40 insertions(+) >> >> diff --git a/configure b/configure >> index ce27eafb0a..21c31e4694 100755 >> --- a/configure >> +++ b/configure >> @@ -538,6 +538,7 @@ meson="" >> ninja="" >> skip_meson=no >> gettext="" >> +fuse="" >> >> bogus_os="no" >> malloc_trim="" >> @@ -1621,6 +1622,10 @@ for opt do >> ;; >> --disable-libdaxctl) libdaxctl=no >> ;; >> + --enable-fuse) fuse=yes >> + ;; >> + --disable-fuse) fuse=no >> + ;; >> *) >> echo "ERROR: unknown option $opt" >> echo "Try '$0 --help' for more information" >> @@ -1945,6 +1950,7 @@ disabled with --disable-FEATURE, default is enabled if >> available: >> xkbcommon xkbcommon support >> rng-none dummy RNG, avoid using /dev/(u)random and getrandom() >> libdaxctl libdaxctl support >> + fuse fuse block device export >> >> NOTE: The object files are built at the place where configure is launched >> EOF >> @@ -6206,6 +6212,28 @@ but not implemented on your system" >> fi >> fi >> >> +########################################## >> +# FUSE support >> + >> +if test "$fuse" != "no"; then >> + cat > $TMPC <<EOF >> +#define FUSE_USE_VERSION 31 >> +#include <fuse.h> >> +#include <fuse_lowlevel.h> >> +int main(void) { return 0; } >> +EOF >> + fuse_cflags=$(pkg-config --cflags fuse3) >> + fuse_libs=$(pkg-config --libs fuse3) >> + if compile_prog "$fuse_cflags" "$fuse_libs"; then >> + fuse=yes >> + else >> + if test "$fuse" = "yes"; then >> + feature_not_found "fuse" >> + fi >> + fuse=no >> + fi >> +fi > > Could you turn this immediately into a meson test instead? See e.g. > https://lists.gnu.org/archive/html/qemu-devel/2020-09/msg07112.html as > an example for how to do this.
For pkg-config in fact it's even simpler and documented in docs/devel/build-system.rst. Paolo