+# ------------------------ 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.])])
+
+ PKGCONFIG_PRIVATE_LIBS="$PKGCONFIG_PRIVATE_LIBS -lrt"
+ AC_SUBST([LIBRT_LIBS], [-lrt])
+fi
+AM_CONDITIONAL([WITH_FUSE], [test "$WITH_FUSE" = "yes"])
+
+# ------------------------ SHA-1 implementation ---------------------------------
+
+AC_MSG_CHECKING([whether to use SSSE3-accelerated SHA-1])
+AC_ARG_ENABLE([ssse3-sha1],
+ [AS_HELP_STRING([--enable-ssse3-sha1],
+ [Include SSSE3-accelerated SHA-1 implementation by
+ Intel. This implies --without-libcrypto.])],
+ [ENABLE_SSSE3_SHA1=$enableval],
+ [ENABLE_SSSE3_SHA1=no])
+AC_MSG_RESULT([$ENABLE_SSSE3_SHA1])
+
+if test "$ENABLE_SSSE3_SHA1" = "yes" ; then
+ AC_DEFINE([ENABLE_SSSE3_SHA1], [1],
+ [Define to 1 if using SSSE3 implementation of SHA-1])
+ AC_PROG_NASM
+ NASM_SYMBOL_PREFIX=""
+ NASM_PLATFORM_FLAGS=""
+ if test "$WINDOWS_NATIVE_BUILD" = "yes"; then
+ NASM_PLATFORM_FLAGS="-DWIN_ABI"
+ fi
+ case "$host_os" in
+ darwin* | rhapsody* | nextstep* | openstep* | macos*)
+ NASM_SYMBOL_PREFIX="_"
+ ;;
+ esac
+ AC_SUBST([NASM_PLATFORM_FLAGS], [$NASM_PLATFORM_FLAGS])
+ AC_SUBST([NASM_SYMBOL_PREFIX], [$NASM_SYMBOL_PREFIX])
+else
+ AC_MSG_CHECKING([whether to use SHA-1 implementation from system libcrypto])
+ AC_ARG_WITH([libcrypto],
+ [AS_HELP_STRING([--without-libcrypto],
+ [build in the SHA-1 algorithm, rather than
+ use external libcrypto from OpenSSL
+ (default is autodetect)])],
+ [WITH_LIBCRYPTO=$withval],
+ [WITH_LIBCRYPTO=auto])
+ AC_MSG_RESULT([$WITH_LIBCRYPTO])
+ if test "$WITH_LIBCRYPTO" != "no"; then
+ PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto], [
+ PKGCONFIG_PRIVATE_REQUIRES="$PKGCONFIG_PRIVATE_REQUIRES libcrypto"
+ AC_DEFINE([WITH_LIBCRYPTO], [1],
+ [Define to 1 if using libcrypto SHA-1])
+ ], [AC_MSG_WARN([Cannot find libcrypto: using stand-alone SHA-1 code instead])])
+ fi