summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorKarel Zak2009-02-17 21:28:09 +0100
committerKarel Zak2009-02-17 21:28:09 +0100
commitd06d028a5a5c204ac2504e6bf6aa65a2e3b8aeb5 (patch)
tree9ad7810ce3f9cfd15b0b20b9969deb59fe50e5bd /configure.ac
parentmount: generic blkid/volume_id wrapper, use blkid_evaluate_* (diff)
downloadkernel-qcow2-util-linux-d06d028a5a5c204ac2504e6bf6aa65a2e3b8aeb5.tar.gz
kernel-qcow2-util-linux-d06d028a5a5c204ac2504e6bf6aa65a2e3b8aeb5.tar.xz
kernel-qcow2-util-linux-d06d028a5a5c204ac2504e6bf6aa65a2e3b8aeb5.zip
build-sys: use pkg-config for blkid and volume_id
It seems that blkid.pc from e2fsprogs has been fixed: $ pkg-config --libs blkid -lblkid and the pkg-config does not return any other extra libraries (such -luuid or -ldevmapper). Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac70
1 files changed, 40 insertions, 30 deletions
diff --git a/configure.ac b/configure.ac
index 3952e83f9..e5e4a5b97 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,14 +22,6 @@ BLKID_DATE="10-Feb-2009"
BLKID_VERSION=$BLKID_VERSION_MAJOR.$BLKID_VERSION_MINOR.$BLKID_VERSION_RELEASE
BLKID_VERSION_INFO=`expr $BLKID_VERSION_MAJOR + $BLKID_VERSION_MINOR`:$BLKID_VERSION_RELEASE:$BLKID_VERSION_MINOR
-AC_SUBST(BLKID_VERSION_MAJOR)
-AC_SUBST(BLKID_VERSION_MINOR)
-AC_SUBST(BLKID_VERSION_RELEASE)
-AC_SUBST(BLKID_VERSION)
-AC_SUBST(BLKID_VERSION_INFO)
-
-AC_DEFINE_UNQUOTED(BLKID_VERSION, "$BLKID_VERSION", [libblkid version string])
-AC_DEFINE_UNQUOTED(BLKID_DATE, "$BLKID_DATE", [libblkid date string])
# Check whether exec_prefix=/usr:
case $exec_prefix:$prefix in
@@ -57,6 +49,8 @@ AC_C_BIGENDIAN
dnl libtool-2
LT_INIT
+PKG_PROG_PKG_CONFIG
+
linux_os=no
case ${host_os} in
*linux*)
@@ -166,35 +160,53 @@ fi
UTIL_CHECK_LIB(util, openpty)
UTIL_CHECK_LIB(termcap, tgetnum)
+
AC_ARG_WITH([fsprobe],
- [AS_HELP_STRING([--with-fsprobe], [library to guess filesystems (blkid|volume_id), default is blkid])],
+ [AS_HELP_STRING([--with-fsprobe], [library to guess filesystems (builtin|blkid|volume_id), default is blkid])],
[], [with_fsprobe=blkid]
)
-AC_ARG_ENABLE([mount],
- AS_HELP_STRING([--disable-mount], [do not build mount utilities]),
- [], enable_mount=check
-)
-
-AM_CONDITIONAL(HAVE_BLKID, false)
-AM_CONDITIONAL(HAVE_VOLUME_ID, false)
-AM_CONDITIONAL(BUILD_LIBBLKID, false)
-
-build_mount=yes
+build_libblkid=no
+have_blkid_evaluate=no
have_blkid=no
have_volume_id=no
+
if test "x$with_fsprobe" = xblkid; then
- UTIL_CHECK_LIB(blkid, blkid_known_fstype)
+ PKG_CHECK_MODULES(BLKID, blkid, [have_blkid=yes], [])
+ AC_CHECK_LIB(blkid, blkid_evaluate_spec, [have_blkid_evaluate=yes], [])
elif test "x$with_fsprobe" = xvolume_id; then
- UTIL_CHECK_LIB(volume_id, volume_id_encode_string)
+ PKG_CHECK_MODULES(VOLUME_ID, volume_id, [have_volume_id=yes], [])
elif test "x$with_fsprobe" = xbuiltin; then
have_blkid=yes
- AC_DEFINE(HAVE_LIBBLKID,1,[Define to 1 if you have the -lblkid.])
- AC_DEFINE(HAVE_BLKID_EVALUATE_SPEC,1,[Define to 1 if you have the blkid_evaluate_spec().])
- AM_CONDITIONAL(HAVE_BLKID, true)
- AM_CONDITIONAL(BUILD_LIBBLKID, true)
+ build_libblkid=yes
+ have_blkid_evaluate=yes
+ AC_SUBST(BLKID_VERSION_MAJOR)
+ AC_SUBST(BLKID_VERSION_MINOR)
+ AC_SUBST(BLKID_VERSION_RELEASE)
+ AC_SUBST(BLKID_VERSION)
+ AC_SUBST(BLKID_VERSION_INFO)
+ AC_DEFINE_UNQUOTED(BLKID_VERSION, "$BLKID_VERSION", [libblkid version string])
+ AC_DEFINE_UNQUOTED(BLKID_DATE, "$BLKID_DATE", [libblkid date string])
fi
+if test "x$have_blkid" = xyes; then
+ AC_DEFINE(HAVE_LIBBLKID, 1, [Define to 1 if you have the -lblkid.])
+ if test "x$have_blkid_evaluate" = xyes; then
+ AC_DEFINE(HAVE_BLKID_EVALUATE_SPEC, 1, [Define to 1 if you have the blkid_evaluate_spec().])
+ fi
+fi
+
+AM_CONDITIONAL(HAVE_BLKID, test "x$have_blkid" = xyes)
+AM_CONDITIONAL(HAVE_VOLUME_ID, test "x$have_volume_id" = xyes)
+AM_CONDITIONAL(BUILD_LIBBLKID, test "x$build_libblkid" = xyes)
+
+
+AC_ARG_ENABLE([mount],
+ AS_HELP_STRING([--disable-mount], [do not build mount utilities]),
+ [], enable_mount=check
+)
+
+build_mount=yes
if test "${enable_mount}" = "no"; then
build_mount=no
elif test "x$linux_os" = xyes; then
@@ -221,20 +233,18 @@ AC_DEFUN([UTIL_PKG_STATIC], [
# These default values should work in most cases:
: ${BLKID_LIBS='-lblkid -luuid'}
-: ${VOLUMEID_LIBS='-lvolume_id'}
+: ${VOLUME_ID_LIBS='-lvolume_id'}
# ... but for static build, we need to consult pkg-config:
if test -n "$enable_static_programs"; then
case $with_fsprobe in
blkid) UTIL_PKG_STATIC([BLKID_LIBS_STATIC], [blkid]) ;;
- volume_id) UTIL_PKG_STATIC([VOLUMEID_LIBS_STATIC], [libvolume_id]) ;;
+ volume_id) UTIL_PKG_STATIC([VOLUME_ID_LIBS_STATIC], [libvolume_id]) ;;
esac
fi
-AC_ARG_VAR([BLKID_LIBS], [-l options for linking dynamically with blkid])
AC_ARG_VAR([BLKID_LIBS_STATIC], [-l options for linking statically with blkid])
-AC_ARG_VAR([VOLUMEID_LIBS], [-l options for linking dynamically with volume_id])
-AC_ARG_VAR([VOLUMEID_LIBS_STATIC], [-l options for linking statically with volume_id])
+AC_ARG_VAR([VOLUME_ID_LIBS_STATIC], [-l options for linking statically with volume_id])
AM_GNU_GETTEXT_VERSION([0.14.1])