summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/ChangeLog8
-rw-r--r--m4/ls-mntd-fs.m438
-rw-r--r--m4/stat-prog.m45
3 files changed, 43 insertions, 8 deletions
diff --git a/m4/ChangeLog b/m4/ChangeLog
index 6bf97c912..a531c6665 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,11 @@
+2006-08-18 Bruno Haible <bruno@clisp.org>
+
+ * ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Also check for
+ sys/statvfs.h. When getmntinfo was found, check its declaration and
+ set either MOUNTED_GETMNTINFO or MOUNTED_GETMNTINFO2 depending on it.
+ * stat-prog.m4 (cu_PREREQ_STAT_PROG): Test also for f_fstypename
+ in struct statvfs.
+
2006-08-18 Jim Meyering <jim@meyering.net>
* gethrxtime.m4 (gl_PREREQ_GETHRXTIME): Also check for CLOCK_REALTIME,
diff --git a/m4/ls-mntd-fs.m4 b/m4/ls-mntd-fs.m4
index a4c808907..c29933162 100644
--- a/m4/ls-mntd-fs.m4
+++ b/m4/ls-mntd-fs.m4
@@ -1,4 +1,4 @@
-#serial 21
+#serial 22
# How to list mounted file systems.
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software
@@ -28,7 +28,7 @@ AC_CHECK_FUNCS(getmntent)
AC_DEFUN([gl_LIST_MOUNTED_FILE_SYSTEMS],
[
AC_CHECK_FUNCS(listmntent getmntinfo)
-AC_CHECK_HEADERS_ONCE(sys/param.h)
+AC_CHECK_HEADERS_ONCE(sys/param.h sys/statvfs.h)
# We must include grp.h before ucred.h on OSF V4.0, since ucred.h uses
# NGROUPS (as the array dimension for a struct member) without a definition.
@@ -232,10 +232,36 @@ if test -z "$ac_list_mounted_fs"; then
])
AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
if test $fu_cv_sys_mounted_getmntinfo = yes; then
- ac_list_mounted_fs=found
- AC_DEFINE(MOUNTED_GETMNTINFO, 1,
- [Define if there is a function named getmntinfo for reading the
- list of mounted file systems. (4.4BSD, Darwin)])
+ AC_MSG_CHECKING([whether getmntinfo returns statvfs structures])
+ AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo2,
+ [
+ AC_TRY_COMPILE([
+#include <sys/types.h>
+#if HAVE_SYS_MOUNT_H
+# include <sys/mount.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+# include <sys/statvfs.h>
+#endif
+extern int getmntinfo (struct statfs **, int);
+ ], [],
+ [fu_cv_sys_mounted_getmntinfo2=no],
+ [fu_cv_sys_mounted_getmntinfo2=yes])
+ ])
+ AC_MSG_RESULT([$fu_cv_sys_mounted_getmntinfo2])
+ if test $fu_cv_sys_mounted_getmntinfo2 = no; then
+ ac_list_mounted_fs=found
+ AC_DEFINE(MOUNTED_GETMNTINFO, 1,
+ [Define if there is a function named getmntinfo for reading the
+ list of mounted file systems and it returns an array of
+ 'struct statfs'. (4.4BSD, Darwin)])
+ else
+ ac_list_mounted_fs=found
+ AC_DEFINE(MOUNTED_GETMNTINFO2, 1,
+ [Define if there is a function named getmntinfo for reading the
+ list of mounted file systems and it returns an array of
+ 'struct statvfs'. (NetBSD 3.0)])
+ fi
fi
fi
diff --git a/m4/stat-prog.m4 b/m4/stat-prog.m4
index 489ed7558..4505f54a3 100644
--- a/m4/stat-prog.m4
+++ b/m4/stat-prog.m4
@@ -1,7 +1,7 @@
-# stat-prog.m4 serial 2
+# stat-prog.m4 serial 3
# Record the prerequisites of src/stat.c from the coreutils package.
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -60,6 +60,7 @@ $ac_includes_default
AC_CHECK_MEMBERS([struct statfs.f_basetype],,,[$statxfs_includes])
AC_CHECK_MEMBERS([struct statvfs.f_basetype],,,[$statxfs_includes])
AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$statxfs_includes])
+ AC_CHECK_MEMBERS([struct statvfs.f_fstypename],,,[$statxfs_includes])
AC_CHECK_MEMBERS([struct statfs.f_type],,,[$statxfs_includes])
AC_CHECK_MEMBERS([struct statvfs.f_type],,,[$statxfs_includes])
AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,,[$statxfs_includes])