]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: cleanup BUILD_MOUNT
authorKarel Zak <kzak@redhat.com>
Thu, 27 Oct 2011 10:39:30 +0000 (12:39 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 3 Nov 2011 11:32:49 +0000 (12:32 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
mount/Makefile.am

index 5ec5f9de5c1578d75a79b2a919daeca9f4fd9e54..39308d6fa54931eb8c5d77bcd2253a90b02c2e30 100644 (file)
@@ -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
index 052d63cdfeeb754e5b8b3e2e78937675cfc52448..1ccbb3b2f5965736ffa39be6f69b3b21fa9274b8 100644 (file)
@@ -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)