+WITH_NTFS_3G_DEFAULT="yes"
+WITH_FUSE_DEFAULT="yes"
+WINDOWS_NATIVE_BUILD="no"
+VISIBILITY_CFLAGS="-fvisibility=hidden"
+WINDOWS_CFLAGS=""
+WINDOWS_CPPFLAGS=""
+WINDOWS_LDFLAGS=""
+WINDOWS_LDADD=""
+ENABLE_XATTR_DEFAULT="autodetect"
+
+case "$host" in
+ *-*-mingw*)
+ # Native Windows
+ WITH_NTFS_3G_DEFAULT="no"
+ WITH_FUSE_DEFAULT="no"
+ WINDOWS_NATIVE_BUILD="yes"
+ VISIBILITY_CFLAGS=""
+ WINDOWS_CFLAGS="-municode"
+ WINDOWS_CPPFLAGS="-D_POSIX -DUNICODE -D_UNICODE -D_CRT_NON_CONFORMING_SWPRINTFS"
+ WINDOWS_LDFLAGS="-no-undefined"
+ WINDOWS_LDADD="-lshlwapi"
+ ENABLE_XATTR_DEFAULT="no"
+ ;;
+ *-*-cygwin*)
+ # Cygwin (WARNING: not well supported)
+ AC_MSG_WARN([wimlib has not been tested with Cygwin! Please do
+ a Windows-native build with MinGW-w64 instead])
+ WITH_NTFS_3G_DEFAULT="no"
+ WITH_FUSE_DEFAULT="no"
+ VISIBILITY_CFLAGS=""
+ ;;
+ *)
+ # UNIX / other
+ ;;
+esac
+
+AC_ARG_WITH([ntdll],
+ AS_HELP_STRING([--without-ntdll], [Windows only: do not try to
+ use functions from ntdll. By default, in some parts
+ of its code, wimlib uses Windows NT system calls to
+ work around flaws in the Win32 API. This support
+ can be omitted if needed, but some annoying bugs
+ will surface (e.g. permission denied errors even
+ when running as the Administrator).]),
+ [WITH_NTDLL=$withval],
+ [WITH_NTDLL=yes])
+
+if test "x$WINDOWS_NATIVE_BUILD" = "xyes"; then
+ if test "x$WITH_NTDLL" = "xyes"; then
+ WINDOWS_LDADD="$WINDOWS_LDADD"
+ AC_DEFINE([WITH_NTDLL], [1], [Define to 1 to try to use ntdll
+ functions])
+ fi
+fi
+
+AC_SUBST([VISIBILITY_CFLAGS], [$VISIBILITY_CFLAGS])
+AC_SUBST([WINDOWS_LDFLAGS], [$WINDOWS_LDFLAGS])
+AC_SUBST([WINDOWS_LDADD], [$WINDOWS_LDADD])
+AC_SUBST([WINDOWS_CPPFLAGS], [$WINDOWS_CPPFLAGS])
+AC_SUBST([WINDOWS_CFLAGS], [$WINDOWS_CFLAGS])
+AM_CONDITIONAL([WINDOWS_NATIVE_BUILD], [test "x$WINDOWS_NATIVE_BUILD" = "xyes"])
+