From dcfce9422ae2b1e9eb0c8c0bc70562f48b54fad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Tue, 20 Jan 2015 01:40:54 +0000 Subject: [PATCH] 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. --- ChangeLog | 8 ++++++++ m4/ls-mntd-fs.m4 | 26 ++++++++++++++++---------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a7ee14..801f7c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2015-01-20 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-01-15 Paul Eggert time: port to MinGW32 3.21 diff --git a/m4/ls-mntd-fs.m4 b/m4/ls-mntd-fs.m4 index 0cc7ae2..59a951e 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 -- 2.1.0