From: Pádraig Brady
Date: Tue, 20 Jan 2015 01:40:54 +0000 (+0000)
Subject: mountlist: only use libmount when specified
X-Git-Tag: v1.0~7160
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=de1cbdd48244c66c51a3e2bc1594ac3ad32ce038;p=gnulib.git
mountlist: only use libmount when specified
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.
---
diff --git a/ChangeLog b/ChangeLog
index 4b5092dd0e..b769bbb79e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-02-11 Pádraig Brady
+
+ 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
uniname/unimame-tests: don't link with -lunistring
diff --git a/m4/ls-mntd-fs.m4 b/m4/ls-mntd-fs.m4
index 0cc7ae2991..59a951e187 100644
--- a/m4/ls-mntd-fs.m4
+++ b/m4/ls-mntd-fs.m4
@@ -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