Skip to content

Commit 7695754

Browse files
committed
Dynamically check if the FUSE low-level API is present on the host.
This replaces the hard coded list and should be more flexible if more platforms decide to support this in the future.
1 parent 981d17b commit 7695754

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

configure.ac

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ if test "x$enable_refs_fuse" = "xyes"; then
167167
FUSE_MODULE_LIBS="-lrefuse"
168168
;;
169169
mingw*)
170-
# Dokan is used. Currently the user needs to specify libfuse include and
171-
# library paths manually.
170+
# Dokan is used. Currently the user needs to specify libfuse
171+
# include and library paths manually.
172172
;;
173173
*)
174174
# Other platforms (Linux, FreeBSD, ...) use pkg-config.
@@ -178,6 +178,11 @@ if test "x$enable_refs_fuse" = "xyes"; then
178178
[],
179179
[]
180180
)
181+
182+
__SAVED_CPPFLAGS="$CPPFLAGS"
183+
CPPFLAGS="$CPPFLAGS $FUSE_MODULE_CFLAGS -DFUSE_USE_VERSION=26"
184+
AC_CHECK_HEADERS([fuse_lowlevel.h])
185+
CPPFLAGS="$__SAVED_CPPFLAGS"
181186
;;
182187
esac
183188
fi

util/refs-fuse.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
typedef unsigned int mode_t;
3131
#endif
3232

33-
#if defined(_WIN32) || defined(__NetBSD__) || defined(__OpenBSD__)
34-
#define REFS_FUSE_USE_LOWLEVEL_API 0
35-
#else
33+
#ifdef HAVE_FUSE_LOWLEVEL_H
3634
#define REFS_FUSE_USE_LOWLEVEL_API 1
35+
#else
36+
#define REFS_FUSE_USE_LOWLEVEL_API 0
3737
#endif
3838

3939
/* Headers - libfuse. */

0 commit comments

Comments
 (0)