2011-09-08 11:52:55 +02:00
|
|
|
# stat-prog.m4 serial 7
|
2004-04-14 08:27:42 +00:00
|
|
|
# Record the prerequisites of src/stat.c from the coreutils package.
|
|
|
|
|
|
2026-01-01 10:56:16 -08:00
|
|
|
# Copyright (C) 2002-2026 Free Software Foundation, Inc.
|
2004-08-04 22:27:36 +00:00
|
|
|
|
2007-07-23 14:35:58 +02:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
2004-08-04 22:27:36 +00:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
2007-07-23 14:35:58 +02:00
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
# (at your option) any later version.
|
2004-08-04 22:27:36 +00:00
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2017-09-19 01:13:23 -07:00
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2004-08-04 22:27:36 +00:00
|
|
|
|
|
|
|
|
# Written by Jim Meyering.
|
|
|
|
|
|
2004-04-14 08:27:42 +00:00
|
|
|
AC_DEFUN([cu_PREREQ_STAT_PROG],
|
|
|
|
|
[
|
2006-09-01 19:40:46 +00:00
|
|
|
AC_REQUIRE([gl_FSUSAGE])
|
|
|
|
|
AC_REQUIRE([gl_FSTYPENAME])
|
|
|
|
|
AC_CHECK_HEADERS_ONCE([OS.h netinet/in.h sys/param.h sys/vfs.h])
|
2004-04-14 08:27:42 +00:00
|
|
|
|
2006-09-01 19:40:46 +00:00
|
|
|
dnl Check for vfs.h first, since this avoids a warning with nfs_client.h
|
|
|
|
|
dnl on Solaris 8.
|
|
|
|
|
test $ac_cv_header_sys_param_h = yes &&
|
|
|
|
|
test $ac_cv_header_sys_mount_h = yes &&
|
|
|
|
|
AC_CHECK_HEADERS([nfs/vfs.h],
|
|
|
|
|
[AC_CHECK_HEADERS([nfs/nfs_client.h])])
|
2004-04-14 08:27:42 +00:00
|
|
|
|
2006-09-01 19:40:46 +00:00
|
|
|
statvfs_includes="\
|
|
|
|
|
AC_INCLUDES_DEFAULT
|
|
|
|
|
#include <sys/statvfs.h>
|
|
|
|
|
"
|
|
|
|
|
statfs_includes="\
|
|
|
|
|
AC_INCLUDES_DEFAULT
|
2004-04-14 08:27:42 +00:00
|
|
|
#if HAVE_SYS_VFS_H
|
|
|
|
|
# include <sys/vfs.h>
|
2006-09-01 19:40:46 +00:00
|
|
|
#elif HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H
|
|
|
|
|
# include <sys/param.h>
|
|
|
|
|
# include <sys/mount.h>
|
|
|
|
|
# if HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H
|
2004-04-14 08:27:42 +00:00
|
|
|
# include <netinet/in.h>
|
|
|
|
|
# include <nfs/nfs_clnt.h>
|
|
|
|
|
# include <nfs/vfs.h>
|
|
|
|
|
# endif
|
2006-09-01 19:40:46 +00:00
|
|
|
#elif HAVE_OS_H
|
|
|
|
|
# include <fs_info.h>
|
2004-04-14 08:27:42 +00:00
|
|
|
#endif
|
|
|
|
|
"
|
2006-08-29 21:53:29 +00:00
|
|
|
dnl Keep this long conditional in sync with the USE_STATVFS conditional
|
|
|
|
|
dnl in ../src/stat.c.
|
2011-09-08 11:52:55 +02:00
|
|
|
if case "$fu_cv_sys_stat_statvfs$fu_cv_sys_stat_statvfs64" in
|
|
|
|
|
*yes*) ;; *) false;; esac &&
|
2006-09-01 19:40:46 +00:00
|
|
|
{ AC_CHECK_MEMBERS([struct statvfs.f_basetype],,, [$statvfs_includes])
|
|
|
|
|
test $ac_cv_member_struct_statvfs_f_basetype = yes ||
|
|
|
|
|
{ AC_CHECK_MEMBERS([struct statvfs.f_fstypename],,, [$statvfs_includes])
|
2009-08-22 18:56:06 +02:00
|
|
|
test $ac_cv_member_struct_statvfs_f_fstypename = yes ||
|
|
|
|
|
{ test $ac_cv_member_struct_statfs_f_fstypename != yes &&
|
|
|
|
|
{ AC_CHECK_MEMBERS([struct statvfs.f_type],,, [$statvfs_includes])
|
|
|
|
|
test $ac_cv_member_struct_statvfs_f_type = yes; }; }; }; }
|
2006-09-01 19:40:46 +00:00
|
|
|
then
|
|
|
|
|
AC_CHECK_MEMBERS([struct statvfs.f_namemax],,, [$statvfs_includes])
|
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
|
[AC_LANG_PROGRAM(
|
2009-08-22 18:56:06 +02:00
|
|
|
[$statvfs_includes],
|
|
|
|
|
[static statvfs s;
|
|
|
|
|
return (s.s_fsid ^ 0) == 0;])],
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
[AC_DEFINE([STRUCT_STATVFS_F_FSID_IS_INTEGER], [1],
|
2009-08-22 18:56:06 +02:00
|
|
|
[Define to 1 if the f_fsid member of struct statvfs is an integer.])])
|
2006-08-29 21:53:29 +00:00
|
|
|
else
|
2017-08-29 23:42:54 -07:00
|
|
|
AC_CHECK_MEMBERS([struct statfs.f_namelen, struct statfs.f_namemax,
|
|
|
|
|
struct statfs.f_type, struct statfs.f_frsize],,,
|
|
|
|
|
[$statfs_includes])
|
2006-09-01 19:40:46 +00:00
|
|
|
if test $ac_cv_header_OS_h != yes; then
|
|
|
|
|
AC_COMPILE_IFELSE(
|
2009-08-22 18:56:06 +02:00
|
|
|
[AC_LANG_PROGRAM(
|
|
|
|
|
[$statfs_includes],
|
|
|
|
|
[static statfs s;
|
|
|
|
|
return (s.s_fsid ^ 0) == 0;])],
|
|
|
|
|
[AC_DEFINE([STRUCT_STATFS_F_FSID_IS_INTEGER], [1],
|
|
|
|
|
[Define to 1 if the f_fsid member of struct statfs is an integer.])])
|
2006-09-01 19:40:46 +00:00
|
|
|
fi
|
2006-08-29 21:53:29 +00:00
|
|
|
fi
|
2004-04-14 08:27:42 +00:00
|
|
|
])
|