diff --git a/configure.ac b/configure.ac index 3177012e2..1c4d5fd1f 100644 --- a/configure.ac +++ b/configure.ac @@ -1126,11 +1126,12 @@ AC_ARG_ENABLE(blkid_wiping, # so lvresize can check detected flag here # DEFAULT_USE_BLKID_WIPING=0 +PKG_CHECK_EXISTS([blkid >= 2.24], [HAVE_BLKID="yes"], [HAVE_BLKID="no"]) -PKG_CHECK_MODULES([BLKID], [blkid >= 2.24], [ - HAVE_BLKID=1 +AS_IF([test "$HAVE_BLKID" = "yes"], [ + PKG_CHECK_MODULES([BLKID], [blkid >= 2.24], [ - AC_CACHE_CHECK([for blkdid.h defines BLKID_SUBLKS_FSINFO.], + AC_CACHE_CHECK([for blkid.h defines BLKID_SUBLKS_FSINFO.], [ac_cv_have_blkid_sublks_fsinfo], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include #ifndef BLKID_SUBLKS_FSINFO @@ -1138,14 +1139,15 @@ PKG_CHECK_MODULES([BLKID], [blkid >= 2.24], [ #endif])], [ac_cv_have_blkid_sublks_fsinfo="yes"], [ac_cv_have_blkid_sublks_fsinfo="no"])]) - AC_IF_YES(ac_cv_have_blkid_sublks_fsinfo, - AC_DEFINE(HAVE_BLKID_SUBLKS_FSINFO, 1, - [Define if blkid.h has BLKID_SUBLKS_FSINFO])) + AC_IF_YES(ac_cv_have_blkid_sublks_fsinfo, + AC_DEFINE(HAVE_BLKID_SUBLKS_FSINFO, 1, + [Define if blkid.h has BLKID_SUBLKS_FSINFO])) + ]) ]) AS_IF([test "$BLKID_WIPING" != "no"], [ - AS_IF([test "$HAVE_BLKID" = 1], [ - BLKID_WIPING=yes + AS_IF([test "$HAVE_BLKID" = "yes"], [ + BLKID_WIPING="yes" BLKID_PC="blkid" DEFAULT_USE_BLKID_WIPING=1 AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])