-if test "x$WITH_FUSE" = "xyes"; then
- AC_DEFINE([WITH_FUSE], [1], [Define to 1 if using FUSE.])
-
-
- AC_CHECK_LIB([fuse], [fuse_main_real], [have_fuse=true],
- [AC_MSG_ERROR([Cannot find libfuse.
- Without libfuse, wimlib cannot include support for mounting WIMs. You
- should either install libfuse, or configure with --without-fuse to
- disable support for mounting WIMs.])
- ])
- AC_CHECK_LIB([rt], [mq_open], [have_posix_mq=true],
- [AC_MSG_ERROR([Cannot find librt for POSIX message queue
- functions. Without these functions, wimlib cannot include support for
- mounting WIMs. You should either update your C library to a recent
- version of glibc, or configure with --without-fuse to disable support
- for mounting WIMs.])
- ])
- LIBFUSE_LDADD="`pkg-config --libs fuse` -lrt"
- LIBFUSE_CFLAGS="`pkg-config --cflags fuse`"
-else
- LIBFUSE_LDADD=
- LIBFUSE_CFLAGS=
-fi
-AM_CONDITIONAL([WITH_FUSE], [test "x$WITH_FUSE" = "xyes"])
-AC_SUBST([LIBFUSE_LDADD], [$LIBFUSE_LDADD])
-AC_SUBST([LIBFUSE_CFLAGS], [$LIBFUSE_CFLAGS])
-
-ENABLE_XATTR=no
-AC_ARG_ENABLE([xattr],
- [AS_HELP_STRING([--enable-xattr], [Enable the xattr interface to access WIM
- alternate data streams (default: autodetect)])],
- [ENABLE_XATTR=$enableval],
- [AC_CHECK_FUNC([setxattr],
- [AC_CHECK_HEADER([attr/xattr.h],
- [ENABLE_XATTR=yes],
- [AC_MSG_WARN([Cannot find the "attr/xattr.h" header. You will not be
- able to use the xattr interface to access WIM alternate data
- streams.])])],
- [AC_MSG_WARN([Cannot find the setxattr() function. You will not be
- able to use the xattr interface to access WIM alternate data
- streams.])])])
-
-if test "x$ENABLE_XATTR" = "xyes"; then
- AC_DEFINE([ENABLE_XATTR], [1], [Define to 1 if using the xattr
- interface to WIM alternate data streams])
+
+if test "$WITH_FUSE" = "yes"; then
+ AC_CHECK_LIB([fuse], [fuse_main_real], [],
+ [AC_MSG_ERROR([Cannot find libfuse!
+ Without libfuse, wimlib cannot include support for mounting WIM images.
+ Either install libfuse, or configure --without-fuse to disable this
+ feature.])])
+
+ AC_CHECK_LIB([rt], [mq_open], [],
+ [AC_MSG_ERROR([Cannot find librt (the POSIX.1b Realtime
+ Extensions Library)! wimlib needs this for the POSIX message queue
+ functions, which are used in the code for mounting WIM images. Recent
+ versions of glibc include this library. Either install this library, or
+ configure --without-fuse to disable support for mounting WIM images.])])
+
+ AC_CHECK_LIB([attr], [getxattr], [],
+ [AC_MSG_ERROR([Cannot find libattr!
+ wimlib needs this for the extended attribute functions, which are used
+ in the code for mounting WIM images. Either install this library, or
+ configure --without-fuse to disable support for mounting WIM images.])])
+
+ AC_DEFINE([WITH_FUSE], [1], [Define to 1 if using FUSE support])
+ PKG_CHECK_MODULES([LIBFUSE], [fuse])
+ PKGCONFIG_PRIVATE_REQUIRES="$PKGCONFIG_PRIVATE_REQUIRES fuse"
+ PKGCONFIG_PRIVATE_LIBS="$PKGCONFIG_PRIVATE_LIBS -lrt"
+ AC_SUBST([LIBRT_LIBS], [-lrt])