From 9ead6701a13c3de60304e7b45c290b3fd81e36fb Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 27 Oct 2011 12:39:30 +0200 Subject: [PATCH] build-sys: cleanup BUILD_MOUNT Signed-off-by: Karel Zak --- configure.ac | 41 +++++++++++++++-------------------------- mount/Makefile.am | 11 +++-------- 2 files changed, 18 insertions(+), 34 deletions(-) diff --git a/configure.ac b/configure.ac index 5ec5f9de5c..39308d6fa5 100644 --- a/configure.ac +++ b/configure.ac @@ -355,9 +355,6 @@ AC_DEFINE_UNQUOTED(LIBBLKID_DATE, "$LIBBLKID_DATE", [libblkid date string]) if test "x$enable_libblkid" = xyes; then AC_DEFINE(HAVE_LIBBLKID, 1, [Define to 1 if you have the -lblkid.]) else - if test "x$build_mount" = xyes; then - AC_MSG_ERROR([libblkid is needed to build util-linux mount]) - fi if test "x$enable_fsck" = xyes; then AC_MSG_ERROR([libblkid is needed to build util-linux fsck]) fi @@ -437,17 +434,24 @@ AC_ARG_ENABLE([mount], [], enable_mount=check ) build_mount=yes -if test "x$enable_mount" = xcheck; then - if test "x$linux_os" = xno; then - AC_MSG_WARN([non-linux system; do not build mount utilities]) - build_mount=no - fi -elif test "x$enable_mount" = xno; then - build_mount=no -fi +UL_REQUIRES_LINUX([mount]) +UL_REQUIRES_BUILD([mount], [libblkid]) AM_CONDITIONAL(BUILD_MOUNT, test "x$build_mount" = xyes) +AC_ARG_ENABLE([libmount-mount], + AS_HELP_STRING([--enable-libmount-mount], [link mount(8) with libmount (EXPERIMENTAL)]), + [], enable_libmount_mount=no +) +build_libmount_mount=yes +UL_REQUIRES_BUILD([libmount_mount], [mount]) +UL_REQUIRES_BUILD([libmount_mount], [libmount]) +if test "x$build_libmount_mount" = xyes; then + AC_DEFINE(HAVE_LIBMOUNT_MOUNT, 1, [use libmount for mount(8)]) +fi +AM_CONDITIONAL(BUILD_LIBMOUNT_MOUNT, test "x$build_libmount_mount" = xyes) + + AC_ARG_ENABLE([fsck], AS_HELP_STRING([--disable-fsck], [do not build fsck]), [], enable_fsck=yes @@ -490,21 +494,6 @@ AM_CONDITIONAL(BUILD_UUIDD, test "x$enable_uuidd" = xyes) - -AC_ARG_ENABLE([libmount-mount], - AS_HELP_STRING([--enable-libmount-mount], [link mount(8) with libmount (EXPERIMENTAL)]), - [], enable_libmount_mount=no -) - -case "$build_libmount:$enable_libmount_mount" in -no:yes) - AC_MSG_ERROR([cannot link mount(8) with libmount when libmount is disabled]) ;; -yes:yes) - AC_DEFINE(HAVE_LIBMOUNT_MOUNT, 1, [use libmount for mount(8)]) -esac -AM_CONDITIONAL(BUILD_LIBMOUNT_MOUNT, test "x$enable_libmount_mount" = xyes) - - AC_ARG_ENABLE([mountpoint], AS_HELP_STRING([--disable-mountpoint], [do not build mountpoint]), [], enable_mountpoint=check diff --git a/mount/Makefile.am b/mount/Makefile.am index 052d63cdfe..1ccbb3b2f5 100644 --- a/mount/Makefile.am +++ b/mount/Makefile.am @@ -29,9 +29,9 @@ srcs_mount = $(srcs_common) $(hdrs_mount) \ # generic flags for all programs (except losetup) # -- note that pkg-config autoconf macros (pkg.m4) does not differentiate # between CFLAGS and CPPFLAGS, we follow this behaviour and use CFLAGS only. -ldadd_common = -ldadd_static = -cflags_common = $(AM_CFLAGS) +ldadd_common = $(ul_libblkid_la) +ldadd_static = $(ul_libblkid_la) +cflags_common = $(AM_CFLAGS) -I$(ul_libblkid_incdir) ldflags_static = -all-static mount_SOURCES = mount.c $(srcs_mount) $(top_srcdir)/lib/setproctitle.c @@ -79,11 +79,6 @@ losetup_static_LDFLAGS = $(ldflags_static) losetup_static_CPPFLAGS = -DMAIN $(AM_CPPFLAGS) endif -if BUILD_LIBBLKID -ldadd_common += $(ul_libblkid_la) -ldadd_static += $(ul_libblkid_la) -cflags_common += -I$(ul_libblkid_incdir) -endif if HAVE_SELINUX mount_LDADD += $(SELINUX_LIBS) -- 2.47.3