+AM_CONDITIONAL([ENABLE_SSSE3_SHA1], [test "$ENABLE_SSSE3_SHA1" = "yes"])
+
+# --------------------------- Zstandard support -------------------------------
+
+AC_MSG_CHECKING([whether to include support for Zstandard compression])
+AC_ARG_WITH([zstd],
+ [AS_HELP_STRING([--with-zstd],
+ [Zstandard compression support via libzstd
+ (EXPERIMENTAL)])],
+ [WITH_ZSTD=$withval],
+ [WITH_ZSTD=no])
+AC_MSG_RESULT([$WITH_ZSTD])
+
+if test "$WITH_ZSTD" = "yes" ; then
+ PKG_CHECK_MODULES([LIBZSTD], [libzstd], [],
+ [AC_MSG_ERROR([Cannot find libzstd! Either install libzstd, or
+ configure --without-zstd to disable Zstandard compression
+ support.])])
+ PKGCONFIG_PRIVATE_REQUIRES="$PKGCONFIG_PRIVATE_REQUIRES zstd"
+ AC_DEFINE([WITH_ZSTD], [1], [Define to 1 if using Zstandard support])
+fi
+AM_CONDITIONAL([WITH_ZSTD], [test "$WITH_ZSTD" = "yes"])
+
+# ----------------------------- Other options ---------------------------------
+
+AC_MSG_CHECKING([whether to include error messages])
+AC_ARG_ENABLE([error_messages],
+ AS_HELP_STRING([--disable-error-messages], [do not compile in error messsages]),
+ [ENABLE_ERROR_MESSAGES=$enableval],
+ [ENABLE_ERROR_MESSAGES=yes])
+AC_MSG_RESULT([$ENABLE_ERROR_MESSAGES])
+if test "$ENABLE_ERROR_MESSAGES" = "yes"; then
+ AC_DEFINE([ENABLE_ERROR_MESSAGES], [1], [Define to 1 if including error messages])
+fi
+
+AC_MSG_CHECKING([whether to include assertions])
+AC_ARG_ENABLE([assertions],
+ AS_HELP_STRING([--disable-assertions], [do not include assertions]),
+ [ENABLE_ASSERTIONS=$enableval],
+ [ENABLE_ASSERTIONS=yes])
+AC_MSG_RESULT([$ENABLE_ASSERTIONS])
+if test "$ENABLE_ASSERTIONS" = "yes"; then
+ AC_DEFINE([ENABLE_ASSERTIONS], [1], [Define to 1 if including assertions])
+fi
+
+AC_MSG_CHECKING([whether to include support for multi-threaded compression])
+AC_ARG_ENABLE([multithreaded-compression],
+ AS_HELP_STRING([--disable-multithreaded-compression],
+ [disable support for multithreaded compression]),
+ [ENABLE_MULTITHREADED_COMPRESSION=$enableval],
+ [ENABLE_MULTITHREADED_COMPRESSION=yes])
+AC_MSG_RESULT([$ENABLE_MULTITHREADED_COMPRESSION])
+if test "$ENABLE_MULTITHREADED_COMPRESSION" = "yes"; then
+ AC_DEFINE([ENABLE_MULTITHREADED_COMPRESSION], [1],
+ [Define to 1 to support multithreaded compression])
+fi
+
+AC_ARG_WITH(pkgconfigdir,
+ [ --with-pkgconfigdir=DIR pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
+ [pkgconfigdir=$withval],
+ [pkgconfigdir='${libdir}/pkgconfig'])
+AC_SUBST(pkgconfigdir)
+
+AC_MSG_CHECKING([whether to enable supporting code for tests])
+AC_ARG_ENABLE([test-support],
+ [AS_HELP_STRING([--enable-test-support],
+ [Enable supporting code for tests (developers only)])],
+ [ENABLE_TEST_SUPPORT=$enableval],
+ [ENABLE_TEST_SUPPORT=no])
+AC_MSG_RESULT([$ENABLE_TEST_SUPPORT])
+if test "$ENABLE_TEST_SUPPORT" = "yes" ; then
+ AC_DEFINE([ENABLE_TEST_SUPPORT], [1],
+ [Define to 1 to enable supporting code for tests])
+fi
+AM_CONDITIONAL([ENABLE_TEST_SUPPORT], [test "$ENABLE_TEST_SUPPORT" = "yes"])
+
+###############################################################################