3 dnl posix_allocate() function detection
6 AC_DEFUN([gl_POSIX_FALLOCATE], [
7 dnl * Old glibcs have broken posix_fallocate(). Make sure not to use it.
9 #define _XOPEN_SOURCE 600
11 #if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 7)
12 possibly broken posix_fallocate
15 [posix_fallocate(0, 0, 0);],
17 [HAVE_POSIX_FALLOCATE],
19 [Define if you have a working posix_fallocate()])
24 dnl Get from the coreutils package (stat-prog.m4 serial 7)
27 AC_DEFUN([mc_cu_PREREQ_STAT_PROG],
29 AC_REQUIRE([gl_FSUSAGE])
30 AC_REQUIRE([gl_FSTYPENAME])
31 AC_CHECK_HEADERS_ONCE([OS.h netinet/in.h sys/param.h sys/vfs.h])
33 dnl Check for vfs.h first, since this avoids a warning with nfs_client.h
35 test $ac_cv_header_sys_param_h = yes &&
36 test $ac_cv_header_sys_mount_h = yes &&
37 AC_CHECK_HEADERS([nfs/vfs.h],
38 [AC_CHECK_HEADERS([nfs/nfs_client.h])])
42 #include <sys/statvfs.h>
48 #elif HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H
49 # include <sys/param.h>
50 # include <sys/mount.h>
51 # if HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H
52 # include <netinet/in.h>
53 # include <nfs/nfs_clnt.h>
60 dnl Keep this long conditional in sync with the USE_STATVFS conditional
61 dnl in src/filemanager/filegui.c.
62 if case "$fu_cv_sys_stat_statvfs$fu_cv_sys_stat_statvfs64" in
63 *yes*) ;; *) false;; esac &&
64 { AC_CHECK_MEMBERS([struct statvfs.f_basetype],,, [$statvfs_includes])
65 test $ac_cv_member_struct_statvfs_f_basetype = yes ||
66 { AC_CHECK_MEMBERS([struct statvfs.f_fstypename],,, [$statvfs_includes])
67 test $ac_cv_member_struct_statvfs_f_fstypename = yes ||
68 { test $ac_cv_member_struct_statfs_f_fstypename != yes &&
69 { AC_CHECK_MEMBERS([struct statvfs.f_type],,, [$statvfs_includes])
70 test $ac_cv_member_struct_statvfs_f_type = yes; }; }; }; }
72 AC_CHECK_MEMBERS([struct statvfs.f_namemax],,, [$statvfs_includes])
77 return (s.s_fsid ^ 0) == 0;])],
78 [AC_DEFINE([STRUCT_STATVFS_F_FSID_IS_INTEGER], [1],
79 [Define to 1 if the f_fsid member of struct statvfs is an integer.])])
81 AC_CHECK_MEMBERS([struct statfs.f_namelen, struct statfs.f_type,
82 struct statfs.f_frsize],,, [$statfs_includes])
83 if test $ac_cv_header_OS_h != yes; then
88 return (s.s_fsid ^ 0) == 0;])],
89 [AC_DEFINE([STRUCT_STATFS_F_FSID_IS_INTEGER], [1],
90 [Define to 1 if the f_fsid member of struct statfs is an integer.])])
97 dnl Filesystem information detection
99 dnl To get information about the disk, mount points, etc.
102 AC_DEFUN([mc_AC_GET_FS_INFO], [
104 if test $gl_cv_list_mounted_fs = yes; then
105 gl_PREREQ_MOUNTLIST_EXTRA
108 AC_CHECK_HEADERS([fcntl.h utime.h])
110 gl_LIST_MOUNTED_FILE_SYSTEMS([
111 AC_DEFINE(HAVE_INFOMOUNT_LIST, 1,
112 [Define if the list of mounted filesystems can be determined])],
113 [AC_MSG_WARN([could not determine how to read list of mounted fs])])
116 if test $gl_cv_fs_space = yes; then
117 gl_PREREQ_FSUSAGE_EXTRA
123 mc_cu_PREREQ_STAT_PROG