+##########################################
+# Check whether we have libpmem
+if test "$libpmem" != "yes" ; then
+ libpmem="no"
+fi
+cat > $TMPC << EOF
+#include <libpmem.h>
+int main(int argc, char **argv)
+{
+ int rc;
+ rc = pmem_is_pmem(0, 0);
+ return 0;
+}
+EOF
+if compile_prog "" "-lpmem" "libpmem"; then
+ libpmem="yes"
+ LIBS="-lpmem $LIBS"
+fi
+print_config "libpmem" "$libpmem"
+
+##########################################
+# Check whether we have libpmemblk
+# libpmem is a prerequisite
+if test "$libpmemblk" != "yes" ; then
+ libpmemblk="no"
+fi
+if test "$libpmem" = "yes"; then
+ cat > $TMPC << EOF
+#include <libpmemblk.h>
+int main(int argc, char **argv)
+{
+ PMEMblkpool *pbp;
+ pbp = pmemblk_open("", 0);
+ return 0;
+}
+EOF
+ if compile_prog "" "-lpmemblk" "libpmemblk"; then
+ libpmemblk="yes"
+ LIBS="-lpmemblk $LIBS"
+ fi
+fi
+print_config "libpmemblk" "$libpmemblk"
+
+# Choose the ioengines
+if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
+ devdax="yes"
+ if test "$libpmemblk" = "yes"; then
+ pmemblk="yes"
+ fi
+fi
+
+##########################################
+# Report whether pmemblk engine is enabled
+print_config "NVML pmemblk engine" "$pmemblk"
+
+##########################################
+# Report whether dev-dax engine is enabled
+print_config "NVML dev-dax engine" "$devdax"
+
+##########################################