AC_CHECK_HEADER([zlib.h], AC_CHECK_LIB([z], [main]))
AC_CHECK_HEADER([lzma.h], AC_CHECK_LIB([lzma], [main]))
AC_CHECK_HEADER([zstd.h], AC_CHECK_LIB([zstd], [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]),
[follytestmain=${enableval}], [follytestmain=no])
#define __NR_membarrier 324
#define MEMBARRIER_CMD_QUERY 0
#define MEMBARRIER_CMD_SHARED 1
+#elif FOLLY_HAVE_LINUX_MEMBARRIER_H
+#include <linux/membarrier.h>
#endif
#endif