Skip to content

Commit

Permalink
libmount, libblkid: fix order of autoconf probing
Browse files Browse the repository at this point in the history
make sure that libuuid is linked during probes.
Since libmount depends on libblkid, probe libblkid first.
This fixes autoprobing on systems that use static libraries exclusively

Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
  • Loading branch information
kurt-vd authored and konis committed Jan 14, 2018
1 parent 51b32c6 commit d5ce780
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions configure.ac
Expand Up @@ -105,12 +105,23 @@ elif test -f /etc/mtab; then
fi

# Check for conditional libraries and headers.
if test "${with_blkid}" = "yes"; then
AC_CHECK_LIB(blkid, blkid_new_probe_from_filename,
[AC_DEFINE(HAVE_LIBBLKID, 1,
[Define to 1 if you have the 'blkid' library (-lblkid).])
LIB_BLKID="-lblkid -luuid"
],
AC_MSG_ERROR([BLKID library not found]), [-luuid])
AC_CHECK_HEADERS([blkid/blkid.h])
fi
AC_SUBST(LIB_BLKID)

if test "${with_libmount}" = "yes"; then
if test "$mtab_type" = file; then
AC_MSG_WARN([Use --without-libmount option to generate mount helpers that work with the legacy mtab file.])
fi
AC_CHECK_LIB(mount, mnt_context_do_mount, [LIB_MOUNT="-lmount"],
AC_MSG_ERROR([libmount not found]))
AC_CHECK_LIB(mount, mnt_context_do_mount, [LIB_MOUNT="-lmount $LIB_BLKID"],
AC_MSG_ERROR([Mount library is enabled but libmount not found]), [$LIB_BLKID])
AC_CHECK_HEADERS([libmount/libmount.h])
with_selinux=no
fi
Expand All @@ -129,17 +140,6 @@ if test "${with_selinux}" = "yes"; then
fi
AC_SUBST([LIB_SELINUX])

if test "${with_blkid}" = "yes"; then
AC_CHECK_LIB(blkid, blkid_new_probe_from_filename,
[AC_DEFINE(HAVE_LIBBLKID, 1,
[Define to 1 if you have the 'blkid' library (-lblkid).])
LIB_BLKID="-lblkid"
],
AC_MSG_ERROR([BLKID library not found]))
AC_CHECK_HEADERS([blkid/blkid.h])
fi
AC_SUBST(LIB_BLKID)

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
Expand Down

0 comments on commit d5ce780

Please sign in to comment.