1 # stat-prog.m4 serial 5
2 # Record the prerequisites of src/stat.c from the coreutils package.
4 # Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software Foundation,
18 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 # Written by Jim Meyering.
22 AC_DEFUN([cu_PREREQ_STAT_PROG],
24 AC_REQUIRE([gl_FSUSAGE])
25 AC_REQUIRE([gl_FSTYPENAME])
26 AC_CHECK_HEADERS_ONCE([OS.h netinet/in.h sys/param.h sys/vfs.h])
28 dnl Check for vfs.h first, since this avoids a warning with nfs_client.h
30 test $ac_cv_header_sys_param_h = yes &&
31 test $ac_cv_header_sys_mount_h = yes &&
32 AC_CHECK_HEADERS([nfs/vfs.h],
33 [AC_CHECK_HEADERS([nfs/nfs_client.h])])
37 #include <sys/statvfs.h>
43 #elif HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H
44 # include <sys/param.h>
45 # include <sys/mount.h>
46 # if HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H
47 # include <netinet/in.h>
48 # include <nfs/nfs_clnt.h>
55 dnl Keep this long conditional in sync with the USE_STATVFS conditional
57 if test "$fu_cv_sys_stat_statvfs" = yes &&
58 { AC_CHECK_MEMBERS([struct statvfs.f_basetype],,, [$statvfs_includes])
59 test $ac_cv_member_struct_statvfs_f_basetype = yes ||
60 { AC_CHECK_MEMBERS([struct statvfs.f_fstypename],,, [$statvfs_includes])
61 test $ac_cv_member_struct_statvfs_f_fstypename = yes ||
62 { test $ac_cv_member_struct_statfs_f_fstypename != yes &&
63 { AC_CHECK_MEMBERS([struct statvfs.f_type],,, [$statvfs_includes])
64 test $ac_cv_member_struct_statvfs_f_type = yes; }; }; }; }
66 AC_CHECK_MEMBERS([struct statvfs.f_namemax],,, [$statvfs_includes])
71 return (s.s_fsid ^ 0) == 0;])],
72 [AC_DEFINE([STRUCT_STATVFS_F_FSID_IS_INTEGER], 1,
73 [Define to 1 if the f_fsid member of struct statvfs is an integer.])])
75 AC_CHECK_MEMBERS([struct statfs.f_namelen, struct statfs.f_type],,,
77 if test $ac_cv_header_OS_h != yes; then
82 return (s.s_fsid ^ 0) == 0;])],
83 [AC_DEFINE([STRUCT_STATFS_F_FSID_IS_INTEGER], 1,
84 [Define to 1 if the f_fsid member of struct statfs is an integer.])])