- PKG_CHECK_MODULES(EXT2FS, [ext2fs >= 1.41])
- PKG_CHECK_MODULES(COM_ERR, [com_err])
+ if test "x$with_convert" = "xauto" || echo "$with_convert" | grep -q "ext2"; then
+ PKG_CHECK_MODULES(EXT2FS, [ext2fs >= 1.42],,
+ [PKG_CHECK_MODULES(EXT2FS, [ext2fs],
+ [AC_DEFINE([HAVE_OLD_E2FSPROGS], [1],
+ [E2fsprogs does not support BIGALLOC])]
+ )])
+ PKG_CHECK_MODULES(COM_ERR, [com_err])
+ convertfs="${convertfs:+$convertfs,}ext2"
+ BTRFSCONVERT_EXT2=1
+ fi
+fi
+AC_SUBST([BTRFSCONVERT_EXT2])
+
+# catch typos
+tmp=$(echo "$with_convert" | sed -e 's/auto//' | sed -e 's/ext2//' | sed -e 's/,\+/,/')
+if ! test "x$tmp" = "x"; then
+ AC_MSG_ERROR([unknown tokens for --with-convert: $tmp])
+fi
+
+if test "$DISABLE_BTRFSCONVERT" = 0 && test "x$convertfs" = "x"; then
+ AC_MSG_ERROR([no filesystems for convert, use --disable-convert instead])