From 37ef0439da961d001a3921cd2939311946fe64a9 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 7 Dec 2010 00:16:07 +0100 Subject: [PATCH] build-sys: add --enable-libmount-mount Signed-off-by: Karel Zak --- configure.ac | 14 ++++++++++++++ mount/Makefile.am | 17 +++++++++++++++++ tests/ts/mount/mtablock | 4 ++++ 3 files changed, 35 insertions(+) diff --git a/configure.ac b/configure.ac index 445d8d64..1afe5873 100644 --- a/configure.ac +++ b/configure.ac @@ -422,6 +422,20 @@ AC_DEFINE_UNQUOTED(LIBMOUNT_VERSION, "$LIBMOUNT_VERSION", [libmount version stri AM_CONDITIONAL(BUILD_LIBMOUNT, test "x$enable_libmount" = xyes) +AC_ARG_ENABLE([libmount-mount], + AS_HELP_STRING([--enable-libmount-mount], [link mount(8) with libmount (EXPERIMENTAL)]), + [], enable_libmount_mount=no +) + +case "$enable_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) + + UTIL_CHECK_LIB(util, openpty) UTIL_CHECK_LIB(termcap, tgetnum) diff --git a/mount/Makefile.am b/mount/Makefile.am index 36b06e32..9613d283 100644 --- a/mount/Makefile.am +++ b/mount/Makefile.am @@ -88,9 +88,26 @@ mount_LDADD += $(SELINUX_LIBS) mount_static_LDADD += $(SELINUX_LIBS_STATIC) endif +if BUILD_LIBMOUNT_MOUNT +mount_LDADD += $(ul_libmount_la) +mount_CFLAGS += $(AM_CFLAGS) -I$(ul_libmount_incdir) +umount_LDADD += $(ul_libmount_la) +umount_CFLAGS += $(AM_CFLAGS) -I$(ul_libmount_incdir) +if HAVE_STATIC_MOUNT +mount_static_LDADD += $(ul_libmount_la) +mount_static_CFLAGS += $(AM_CFLAGS) -I$(ul_libmount_incdir) +endif +if HAVE_STATIC_UMOUNT +umount_static_LDADD += $(ul_libmount_la) +umount_static_CFLAGS += $(AM_CFLAGS) -I$(ul_libmount_incdir) +endif +endif + +if !BUILD_LIBMOUNT_MOUNT noinst_PROGRAMS = mtab_lock_test mtab_lock_test_SOURCES = fstab.c $(srcs_common) $(hdrs_mount) mtab_lock_test_CPPFLAGS = -DMAIN_TEST_MTABLOCK $(AM_CPPFLAGS) +endif install-exec-hook: cd $(DESTDIR)$(sbindir) && ln -sf swapon swapoff diff --git a/tests/ts/mount/mtablock b/tests/ts/mount/mtablock index 068b67c1..b9f710ef 100755 --- a/tests/ts/mount/mtablock +++ b/tests/ts/mount/mtablock @@ -22,6 +22,10 @@ TS_DESC="mtab lock" ts_init "$*" ts_skip_nonroot +if [ ! -x "$TS_CMD_MTABLOCK" ]; then + ts_slip "not compiled" +fi + # # Be careful with number of processes. Don't forget that there is time limit # when the mount waits on the mtab lock. If you define too much processes some -- 2.39.5