summaryrefslogtreecommitdiffstats
path: root/m4/fsusage.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/fsusage.m4')
-rw-r--r--m4/fsusage.m442
1 files changed, 28 insertions, 14 deletions
diff --git a/m4/fsusage.m4 b/m4/fsusage.m4
index a0ab1e1..dd10f79 100644
--- a/m4/fsusage.m4
+++ b/m4/fsusage.m4
@@ -1,28 +1,43 @@
1#serial 11 1#serial 16
2# Obtaining file system usage information.
2 3
3# From fileutils/configure.in 4# Copyright (C) 1997, 1998, 2000, 2001, 2003, 2004, 2005 Free Software
5# Foundation, Inc.
6#
7# This file is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# Written by Jim Meyering.
4 12
5AC_DEFUN([gl_FSUSAGE], 13AC_DEFUN([gl_FSUSAGE],
6[ 14[
15 AC_LIBSOURCES([fsusage.c, fsusage.h])
16
7 AC_CHECK_HEADERS_ONCE(sys/param.h) 17 AC_CHECK_HEADERS_ONCE(sys/param.h)
8 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs_types.h) 18 AC_CHECK_HEADERS_ONCE(sys/vfs.h sys/fs_types.h)
9 jm_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no]) 19 AC_CHECK_HEADERS(sys/mount.h, [], [],
20 [AC_INCLUDES_DEFAULT
21 [#if HAVE_SYS_PARAM_H
22 #include <sys/param.h>
23 #endif]])
24 gl_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no])
10 if test $gl_cv_fs_space = yes; then 25 if test $gl_cv_fs_space = yes; then
11 AC_LIBOBJ(fsusage) 26 AC_LIBOBJ(fsusage)
12 gl_PREREQ_FSUSAGE_EXTRA 27 gl_PREREQ_FSUSAGE_EXTRA
13 fi 28 fi
14]) 29])
15 30
16# Try to determine how a program can obtain filesystem usage information. 31# Try to determine how a program can obtain file system usage information.
17# If successful, define the appropriate symbol (see fsusage.c) and 32# If successful, define the appropriate symbol (see fsusage.c) and
18# execute ACTION-IF-FOUND. Otherwise, execute ACTION-IF-NOT-FOUND. 33# execute ACTION-IF-FOUND. Otherwise, execute ACTION-IF-NOT-FOUND.
19# 34#
20# jm_FILE_SYSTEM_USAGE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) 35# gl_FILE_SYSTEM_USAGE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
21 36
22AC_DEFUN([jm_FILE_SYSTEM_USAGE], 37AC_DEFUN([gl_FILE_SYSTEM_USAGE],
23[ 38[
24 39
25echo "checking how to get filesystem space usage..." 40echo "checking how to get file system space usage..."
26ac_fsusage_space=no 41ac_fsusage_space=no
27 42
28# Perform only the link test since it seems there are no variants of the 43# Perform only the link test since it seems there are no variants of the
@@ -199,7 +214,7 @@ if test $ac_fsusage_space = no; then
199 AC_TRY_CPP([#include <sys/filsys.h> 214 AC_TRY_CPP([#include <sys/filsys.h>
200 ], 215 ],
201 AC_DEFINE(STAT_READ_FILSYS, 1, 216 AC_DEFINE(STAT_READ_FILSYS, 1,
202 [Define if there is no specific function for reading filesystems usage 217 [Define if there is no specific function for reading file systems usage
203 information and you have the <sys/filsys.h> header file. (SVR2)]) 218 information and you have the <sys/filsys.h> header file. (SVR2)])
204 ac_fsusage_space=yes) 219 ac_fsusage_space=yes)
205fi 220fi
@@ -212,7 +227,7 @@ AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
212# Check for SunOS statfs brokenness wrt partitions 2GB and larger. 227# Check for SunOS statfs brokenness wrt partitions 2GB and larger.
213# If <sys/vfs.h> exists and struct statfs has a member named f_spare, 228# If <sys/vfs.h> exists and struct statfs has a member named f_spare,
214# enable the work-around code in fsusage.c. 229# enable the work-around code in fsusage.c.
215AC_DEFUN([jm_STATFS_TRUNCATES], 230AC_DEFUN([gl_STATFS_TRUNCATES],
216[ 231[
217 AC_MSG_CHECKING([for statfs that truncates block counts]) 232 AC_MSG_CHECKING([for statfs that truncates block counts])
218 AC_CACHE_VAL(fu_cv_sys_truncating_statfs, 233 AC_CACHE_VAL(fu_cv_sys_truncating_statfs,
@@ -236,11 +251,10 @@ choke -- this is a workaround for a Sun-specific problem
236]) 251])
237 252
238 253
239# Prerequisites of lib/fsusage.c not done by jm_FILE_SYSTEM_USAGE. 254# Prerequisites of lib/fsusage.c not done by gl_FILE_SYSTEM_USAGE.
240AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA], 255AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA],
241[ 256[
242 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T]) 257 AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])
243 AC_CHECK_HEADERS_ONCE(fcntl.h)
244 AC_CHECK_HEADERS(dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h sys/statvfs.h) 258 AC_CHECK_HEADERS(dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h sys/statvfs.h)
245 jm_STATFS_TRUNCATES 259 gl_STATFS_TRUNCATES
246]) 260])