From 5d6ca1aeeb04b9b0cd760529d548ac26675ef9b9 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 27 Jan 2019 11:45:28 +0100 Subject: [PATCH] mountlist: Merge two .m4 files. * m4/mountlist.m4 (gl_MOUNTLIST): Inline gl_LIST_MOUNTED_FILE_SYSTEMS. (AC_FUNC_GETMNTENT): Move to here, from m4/ls-mntd-fs.m4. * m4/ls-mntd-fs.m4: Remove file. * modules/mountlist (Files): Remove m4/ls-mntd-fs.m4. --- ChangeLog | 8 ++++++ m4/{ls-mntd-fs.m4 => mountlist.m4} | 53 +++++++++++++++++++++----------------- modules/mountlist | 1 - 3 files changed, 37 insertions(+), 25 deletions(-) rename m4/{ls-mntd-fs.m4 => mountlist.m4} (94%) diff --git a/ChangeLog b/ChangeLog index 5c77d69cb2..c1cc195d7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2019-01-27 Bruno Haible + mountlist: Merge two .m4 files. + * m4/mountlist.m4 (gl_MOUNTLIST): Inline gl_LIST_MOUNTED_FILE_SYSTEMS. + (AC_FUNC_GETMNTENT): Move to here, from m4/ls-mntd-fs.m4. + * m4/ls-mntd-fs.m4: Remove file. + * modules/mountlist (Files): Remove m4/ls-mntd-fs.m4. + +2019-01-27 Bruno Haible + tests: Enable Linux specific tests on Android. * tests/test-flock.c (main): Treat Android like Linux. * tests/test-openat-safer.c (main): Likewise. diff --git a/m4/ls-mntd-fs.m4 b/m4/mountlist.m4 similarity index 94% rename from m4/ls-mntd-fs.m4 rename to m4/mountlist.m4 index 05474c2ddd..a95c1f4bd5 100644 --- a/m4/ls-mntd-fs.m4 +++ b/m4/mountlist.m4 @@ -1,31 +1,14 @@ -# serial 38 -# How to list mounted file systems. - -# Copyright (C) 1998-2004, 2006, 2009-2019 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# serial 13 +dnl Copyright (C) 2002-2006, 2009-2019 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. dnl From Jim Meyering. AC_PREREQ([2.60]) -dnl This is not pretty. I've just taken the autoconf code and wrapped -dnl it in an AC_DEFUN and made some other fixes. - -# Replace Autoconf's AC_FUNC_GETMNTENT to omit checks that are unnecessary -# nowadays. -AC_DEFUN([AC_FUNC_GETMNTENT], -[ - # getmntent is in the standard C library on UNICOS, in -lsun on Irix 4, - # -lgen on Unixware. - AC_SEARCH_LIBS([getmntent], [sun gen]) - AC_CHECK_FUNCS([getmntent]) -]) - -# gl_LIST_MOUNTED_FILE_SYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -AC_DEFUN([gl_LIST_MOUNTED_FILE_SYSTEMS], +AC_DEFUN([gl_MOUNTLIST], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_FUNCS([listmntent]) @@ -328,6 +311,28 @@ int getmntinfo (struct statfs **, int); # Can't build mountlist.c or anything that needs its functions fi - AS_IF([test $ac_list_mounted_fs = found], [$1], [$2]) + if test $ac_list_mounted_fs = found; then + gl_cv_list_mounted_fs=yes + else + gl_cv_list_mounted_fs=no + fi +]) + +# Prerequisites of lib/mountlist.c not done by gl_MOUNTLIST. +AC_DEFUN([gl_PREREQ_MOUNTLIST_EXTRA], +[ + dnl Note gl_MOUNTLIST checks for mntent.h, not sys/mntent.h. + AC_CHECK_HEADERS([sys/mntent.h]) + AC_HEADER_MAJOR()dnl for use of makedev () + gl_FSTYPENAME +]) +# Replace Autoconf's AC_FUNC_GETMNTENT to omit checks that are unnecessary +# nowadays. +AC_DEFUN([AC_FUNC_GETMNTENT], +[ + # getmntent is in the standard C library on UNICOS, in -lsun on Irix 4, + # -lgen on Unixware. + AC_SEARCH_LIBS([getmntent], [sun gen]) + AC_CHECK_FUNCS([getmntent]) ]) diff --git a/modules/mountlist b/modules/mountlist index 81ab2bfe40..11cf809ab2 100644 --- a/modules/mountlist +++ b/modules/mountlist @@ -4,7 +4,6 @@ Return list of mounted file systems. Files: lib/mountlist.h lib/mountlist.c -m4/ls-mntd-fs.m4 m4/fstypename.m4 m4/mountlist.m4 -- 2.11.4.GIT