3 dnl posix_allocate() function detection
6 AC_DEFUN([POSIX_FALLOCATE], [
7 dnl * Old glibcs have broken posix_fallocate(). Make sure not to use it.
8 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
9 #define _XOPEN_SOURCE 600
12 #if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 7)
13 possibly broken posix_fallocate
16 [[posix_fallocate(0, 0, 0);]])],
18 [HAVE_POSIX_FALLOCATE],
20 [Define if you have a working posix_fallocate()])
25 dnl Get from the coreutils package (stat-prog.m4 serial 7)
28 AC_DEFUN([mc_cu_PREREQ_STAT_PROG],
30 AC_REQUIRE([gl_FSUSAGE])
31 AC_REQUIRE([gl_FSTYPENAME])
32 AC_CHECK_HEADERS_ONCE([OS.h netinet/in.h sys/param.h sys/vfs.h])
34 dnl Check for vfs.h first, since this avoids a warning with nfs_client.h
36 test $ac_cv_header_sys_param_h = yes &&
37 test $ac_cv_header_sys_mount_h = yes &&
38 AC_CHECK_HEADERS([nfs/vfs.h],
39 [AC_CHECK_HEADERS([nfs/nfs_client.h])])
43 #include <sys/statvfs.h>
49 #elif defined HAVE_SYS_MOUNT_H && defined HAVE_SYS_PARAM_H
50 # include <sys/param.h>
51 # include <sys/mount.h>
52 # if defined HAVE_NETINET_IN_H && defined HAVE_NFS_NFS_CLNT_H && defined HAVE_NFS_VFS_H
53 # include <netinet/in.h>
54 # include <nfs/nfs_clnt.h>
57 #elif defined HAVE_OS_H
61 if case "$fu_cv_sys_stat_statvfs$fu_cv_sys_stat_statvfs64" in
62 *yes*) ;; *) false;; esac &&
63 { AC_CHECK_MEMBERS([struct statvfs.f_basetype],,, [$statvfs_includes])
64 test $ac_cv_member_struct_statvfs_f_basetype = yes ||
65 { AC_CHECK_MEMBERS([struct statvfs.f_fstypename],,, [$statvfs_includes])
66 test $ac_cv_member_struct_statvfs_f_fstypename = yes ||
67 { test $ac_cv_member_struct_statfs_f_fstypename != yes &&
68 { AC_CHECK_MEMBERS([struct statvfs.f_type],,, [$statvfs_includes])
69 test $ac_cv_member_struct_statvfs_f_type = yes; }; }; }; }
71 AC_CHECK_MEMBERS([struct statvfs.f_namemax],,, [$statvfs_includes])
76 return (s.s_fsid ^ 0) == 0;])],
77 [AC_DEFINE([STRUCT_STATVFS_F_FSID_IS_INTEGER], [1],
78 [Define to 1 if the f_fsid member of struct statvfs is an integer.])])
80 AC_CHECK_MEMBERS([struct statfs.f_namelen, struct statfs.f_type,
81 struct statfs.f_frsize],,, [$statfs_includes])
82 if test $ac_cv_header_OS_h != yes; then
87 return (s.s_fsid ^ 0) == 0;])],
88 [AC_DEFINE([STRUCT_STATFS_F_FSID_IS_INTEGER], [1],
89 [Define to 1 if the f_fsid member of struct statfs is an integer.])])
96 dnl Filesystem information detection
98 dnl To get information about the disk, mount points, etc.
101 AC_DEFUN([mc_GET_FS_INFO], [
102 AC_CHECK_HEADERS([fcntl.h utime.h])
105 if test $gl_cv_list_mounted_fs = yes; then
106 gl_PREREQ_MOUNTLIST_EXTRA
107 AC_DEFINE(HAVE_INFOMOUNT_LIST, 1,
108 [Define if the list of mounted filesystems can be determined])
110 AC_MSG_WARN([could not determine how to read list of mounted fs]);
114 if test $gl_cv_fs_space = yes; then
115 gl_PREREQ_FSUSAGE_EXTRA
121 mc_cu_PREREQ_STAT_PROG