From 285eedf281c872802a54df805936b7593c95518e Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 29 Sep 2001 10:27:28 +0000 Subject: [PATCH] (jm_LIST_MOUNTED_FILESYSTEMS) Check for these headers: sys/param.h sys/ucred.h sys/mount.h sys/fs_types.h, and make the link-test for getfsstat guard #include directives with appropriate #if HAVE_*_H tests so that we can detect getfsstat on Apple Darwin1.3.7 systems. Also fix harmless typo in cache variable name: s/getsstat/getfsstat/. --- m4/ls-mntd-fs.m4 | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/m4/ls-mntd-fs.m4 b/m4/ls-mntd-fs.m4 index 17d282fe9..797efe970 100644 --- a/m4/ls-mntd-fs.m4 +++ b/m4/ls-mntd-fs.m4 @@ -10,7 +10,7 @@ dnl AC_DEFUN([jm_LIST_MOUNTED_FILESYSTEMS], [ AC_CHECK_FUNCS(listmntent getmntinfo) -AC_CHECK_HEADERS(mntent.h) +AC_CHECK_HEADERS(mntent.h sys/param.h sys/ucred.h sys/mount.h sys/fs_types.h) # Determine how to get the list of mounted filesystems. ac_list_mounted_fs= @@ -109,19 +109,32 @@ if test $ac_cv_func_getmntent = yes; then fi if test -z "$ac_list_mounted_fs"; then - # DEC Alpha running OSF/1. + # DEC Alpha running OSF/1, and Apple Darwin 1.3. + # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h + AC_MSG_CHECKING([for getfsstat function]) - AC_CACHE_VAL(fu_cv_sys_mounted_getsstat, + AC_CACHE_VAL(fu_cv_sys_mounted_getfsstat, [AC_TRY_LINK([ #include +#if HAVE_SYS_PARAM_H +# include /* needed by powerpc-apple-darwin1.3.7 */ +#endif +#if HAVE_SYS_UCRED_H +#include /* needed by powerpc-apple-darwin1.3.7 */ +#endif +#if HAVE_SYS_MOUNT_H #include -#include ], +#endif +#if HAVE_SYS_FS_TYPES_H +#include /* needed by powerpc-apple-darwin1.3.7 */ +#endif +], [struct statfs *stats; int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); ], - fu_cv_sys_mounted_getsstat=yes, - fu_cv_sys_mounted_getsstat=no)]) - AC_MSG_RESULT($fu_cv_sys_mounted_getsstat) - if test $fu_cv_sys_mounted_getsstat = yes; then + fu_cv_sys_mounted_getfsstat=yes, + fu_cv_sys_mounted_getfsstat=no)]) + AC_MSG_RESULT($fu_cv_sys_mounted_getfsstat) + if test $fu_cv_sys_mounted_getfsstat = yes; then ac_list_mounted_fs=found AC_DEFINE(MOUNTED_GETFSSTAT, 1, [Define if there is a function named getfsstat for reading the -- 2.11.0