+###############################################################################
+# Configuration options #
+###############################################################################
+
+# ------------------------- ntfs-3g support -----------------------------------
+
+AC_MSG_CHECKING([whether to include support for ntfs-3g])
+AC_ARG_WITH([ntfs-3g],
+ [AS_HELP_STRING([--without-ntfs-3g],
+ [build without libntfs-3g. This will disable the
+ ability to capture or apply a WIM image directly
+ from/to an unmounted NTFS volume.])],
+ [WITH_NTFS_3G=$withval],
+ [WITH_NTFS_3G=$WITH_NTFS_3G_DEFAULT])
+AC_MSG_RESULT([$WITH_NTFS_3G])
+
+if test "$WITH_NTFS_3G" = "yes"; then
+ PKG_CHECK_MODULES([LIBNTFS_3G], [libntfs-3g >= 2011.4.12], [],
+ [AC_MSG_ERROR([Cannot find libntfs-3g version 2011-4-12 or
+ later! Without libntfs-3g, wimlib cannot include support for
+ capturing or applying a WIM image directly from/to an unmounted
+ NTFS volume while preserving NTFS-specific data such as
+ security descriptors and named data streams. Either install
+ libntfs-3g, or configure --without-ntfs-3g to disable this
+ feature.])])
+ PKGCONFIG_PRIVATE_REQUIRES="$PKGCONFIG_PRIVATE_REQUIRES libntfs-3g"
+ AC_DEFINE([WITH_NTFS_3G], [1], [Define to 1 if using NTFS-3G support])
+fi
+AM_CONDITIONAL([WITH_NTFS_3G], [test "$WITH_NTFS_3G" = "yes"])
+
+# ------------------------ FUSE mount support ---------------------------------
+
+AC_MSG_CHECKING([whether to include support for mounting WIMs])
+AC_ARG_WITH([fuse],
+ [AS_HELP_STRING([--without-fuse],
+ [build without libfuse. This will disable the
+ ability to mount WIM images.])],
+ [WITH_FUSE=$withval],
+ [WITH_FUSE=$WITH_FUSE_DEFAULT])
+AC_MSG_RESULT([$WITH_FUSE])
+
+if test "$WITH_FUSE" = "yes"; then
+
+ PKG_CHECK_MODULES([LIBFUSE], [fuse], [],
+ [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.])])
+ PKGCONFIG_PRIVATE_REQUIRES="$PKGCONFIG_PRIVATE_REQUIRES fuse"
+ AC_DEFINE([WITH_FUSE], [1], [Define to 1 if using FUSE support])
+
+ 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.])])
+
+ PKGCONFIG_PRIVATE_LIBS="$PKGCONFIG_PRIVATE_LIBS -lrt"
+ AC_SUBST([LIBRT_LIBS], [-lrt])