+AC_CHECK_HEADER([zstd.h], AC_CHECK_LIB([zstd], [ZSTD_compressStream]))
+AC_CHECK_HEADER([bzlib.h], AC_CHECK_LIB([bz2], [main]))
+AC_CHECK_HEADER([linux/membarrier.h], AC_DEFINE([HAVE_LINUX_MEMBARRIER_H], [1], [Define to 1 if membarrier.h is available]))
+
+AC_ARG_ENABLE([follytestmain],
+ AS_HELP_STRING([--enable-follytestmain], [enables using main function from folly for tests]),
+ [use_follytestmain=${enableval}], [use_follytestmain=yes])
+
+# libdwarf used to install in /usr/include, now installs in /usr/include/libdwarf.
+AC_CHECK_HEADERS([libdwarf/dwarf.h dwarf.h], [break])
+# Check whether we have both the library and the header
+have_libdwarf=no
+AS_IF([test "x${ac_cv_header_libdwarf_dwarf_h}" = xyes], [have_libdwarf=yes])
+AS_IF([test "x${ac_cv_header_dwarf_h}" = xyes], [have_libdwarf=yes])
+
+
+AC_ARG_ENABLE([mobile],
+ AS_HELP_STRING([--enable-mobile],
+ [enables using main function from folly for tests]),
+ [mobile=${enableval}], [mobile=no])
+AS_IF([test "x${mobile}" = "xyes"], [
+ AC_DEFINE([MOBILE], [1],
+ [Define to 1 for compiler guards for mobile targets.])
+])
+
+AC_ARG_ENABLE([exception-tracer],
+ AS_HELP_STRING([--enable-exception-tracer], [enables building exception tracer]),
+ [build_exception_tracer=${enableval}], [build_exception_tracer=no])