]> err.no Git - util-linux/commitdiff
build-sys: add --enable-libmount-mount
authorKarel Zak <kzak@redhat.com>
Mon, 6 Dec 2010 23:16:07 +0000 (00:16 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 3 Jan 2011 11:28:47 +0000 (12:28 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
mount/Makefile.am
tests/ts/mount/mtablock

index 445d8d6404e928e0f2329c419c3cb1e2fd6192cb..1afe587337fcae63a291b708b1e1ca6c16b08ee5 100644 (file)
@@ -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)
 
index 36b06e327952f4e418ae7b88106c71e78df3671e..9613d283d6ec5a4ca124353ca265235cde9d6fa3 100644 (file)
@@ -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
index 068b67c147f0f0635365e8c7a4cd01af2968a1ae..b9f710ef8eb1d2ab84073066c37218af0130783b 100755 (executable)
@@ -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