]> Savannah Git Hosting - gnulib.git/commitdiff
mountlist: only use libmount when specified
authorPádraig Brady <P@draigBrady.com>
Tue, 20 Jan 2015 01:40:54 +0000 (01:40 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 11 Feb 2015 00:13:02 +0000 (00:13 +0000)
libmount can propagate device IDs provided by Linux in
/proc/self/mountinfo.  However there are currently many
shared libs dependencies introduced by libmount with
associated runtime and virt mem overhead.  Therefore don't
enable by default.

* m4/ls-mntd-fs.m4: Use --with-libmount to enable at build time.
Note the ac_cv_lib_libmount_mnt_table_parse_stream cache variable
had a typo and so was ineffective, thus there is no backwards
compatibility issue.

ChangeLog
m4/ls-mntd-fs.m4

index 4b5092dd0e475e71414ef6c411b9a7022e61ddad..b769bbb79e2cb208755297235f7257f362e6509c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-02-11  Pádraig Brady  <P@draigBrady.com>
+
+       mountlist: only use libmount when specified
+       There are currently many shared libs dependencies introduced by
+       libmount with associated runtime and virt mem overhead.
+       Therefore don't enable by default.
+       * m4/ls-mntd-fs.m4: Use --with-libmount to enable at build time.
+
 2015-02-08  Daiki Ueno  <ueno@gnu.org>
 
        uniname/unimame-tests: don't link with -lunistring
index 0cc7ae29915c1f71c16b37d51de6e2b27a6fcb30..59a951e187c69ad3ba348932e4691dd08cf22498 100644 (file)
@@ -153,17 +153,23 @@ if test $ac_cv_func_getmntent = yes; then
          (4.3BSD, SunOS, HP-UX, Dynix, Irix)])
       AC_CHECK_FUNCS([hasmntopt])
 
+      AC_ARG_WITH([libmount],
+        [AS_HELP_STRING([--with-libmount],
+          [use libmount if available to parse the system mount list.])],
+        [],
+        dnl libmount has the advantage of propagating accurate device IDs for
+        dnl each entry, but the disadvantage of many dependent shared libs
+        dnl with associated runtime startup overhead and virt mem usage.
+        [with_libmount=no])
+
       # Check for libmount to support /proc/self/mountinfo on Linux
-      AC_CACHE_VAL([ac_cv_lib_libmount_mnt_table_parse_stream],
-        [AC_CHECK_LIB([mount], [mnt_new_table_from_file],
-          ac_cv_lib_mount_mnt_table_parse_stream=yes,
-          ac_cv_lib_mount_mnt_table_parse_stream=no)])
-      if test $ac_cv_lib_mount_mnt_table_parse_stream = yes; then
-         AC_DEFINE([MOUNTED_PROC_MOUNTINFO], [1],
-           [Define if want to use /proc/self/mountinfo on Linux.])
-         LIBS="-lmount $LIBS"
-      elif test -f /proc/self/mountinfo; then
-         AC_MSG_WARN([/proc/self/mountinfo present but libmount is missing.])
+      if test "x$with_libmount" != xno; then
+        AC_CHECK_LIB([mount], [mnt_new_table_from_file],
+           [AC_DEFINE([MOUNTED_PROC_MOUNTINFO], [1],
+             [Define if want to use /proc/self/mountinfo on Linux.])
+            LIBS="-lmount $LIBS"],
+           [test -f /proc/self/mountinfo &&
+             AC_MSG_WARN([/proc/self/mountinfo present but libmount missing.])])
       fi
     fi
   fi