Blame acinclude.m4

Packit d37888
dnl This is just copied m4s from need-declaration.m4 gnome-fileutils.m4
Packit d37888
dnl gnome-supprt-checks.m4 and a little from gnome-libgtop-check.m4
Packit d37888
dnl and finally libgtop-sysdeps.m4
Packit d37888
Packit d37888
dnl
Packit d37888
dnl LIBGTOP_CHECK_TYPE
Packit d37888
dnl
Packit d37888
dnl Improved version of AC_CHECK_TYPE which takes into account
Packit d37888
dnl that we need to #include some other header files on some
Packit d37888
dnl systems to get some types.
Packit d37888
Packit d37888
dnl AC_LIBGTOP_CHECK_TYPE(TYPE, DEFAULT)
Packit d37888
AC_DEFUN([AC_LIBGTOP_CHECK_TYPE],
Packit d37888
[AC_REQUIRE([AC_HEADER_STDC])dnl
Packit d37888
AC_MSG_CHECKING(for $1)
Packit d37888
AC_CACHE_VAL(ac_cv_type_$1,
Packit d37888
[AC_EGREP_CPP(dnl
Packit d37888
changequote(<<,>>)dnl
Packit d37888
<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
Packit d37888
changequote([,]), [#include <sys/types.h>
Packit d37888
#if STDC_HEADERS
Packit d37888
#include <stdlib.h>
Packit d37888
#include <stddef.h>
Packit d37888
#endif
Packit d37888
Packit d37888
/* For Tru64 */
Packit d37888
#ifdef HAVE_SYS_BITYPES_H
Packit d37888
#include <sys/bitypes.h>
Packit d37888
#endif
Packit d37888
], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
Packit d37888
AC_MSG_RESULT($ac_cv_type_$1)
Packit d37888
if test $ac_cv_type_$1 = no; then
Packit d37888
  AC_DEFINE($1, $2, [Define to $2 if <sys/types.h> does not define.])
Packit d37888
fi
Packit d37888
])
Packit d37888
Packit d37888
dnl
Packit d37888
dnl GNOME_LIBGTOP_TYPES
Packit d37888
dnl
Packit d37888
dnl some typechecks for libgtop.
Packit d37888
dnl
Packit d37888
Packit d37888
AC_DEFUN([GNOME_LIBGTOP_TYPES],
Packit d37888
[
Packit d37888
        AC_CHECK_HEADERS(sys/bitypes.h)
Packit d37888
])
Packit d37888
Packit d37888
dnl See whether we need a declaration for a function.
Packit d37888
dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
Packit d37888
AC_DEFUN([GCC_NEED_DECLARATION],
Packit d37888
[AC_MSG_CHECKING([whether $1 must be declared])
Packit d37888
AC_CACHE_VAL(gcc_cv_decl_needed_$1,
Packit d37888
[AC_TRY_COMPILE([
Packit d37888
#include <stdio.h>
Packit d37888
#ifdef HAVE_STRING_H
Packit d37888
#include <string.h>
Packit d37888
#else
Packit d37888
#ifdef HAVE_STRINGS_H
Packit d37888
#include <strings.h>
Packit d37888
#endif
Packit d37888
#endif
Packit d37888
#ifdef HAVE_STDLIB_H
Packit d37888
#include <stdlib.h>
Packit d37888
#endif
Packit d37888
#ifdef HAVE_UNISTD_H
Packit d37888
#include <unistd.h>
Packit d37888
#endif
Packit d37888
$2],
Packit d37888
[char *(*pfn) = (char *(*)) $1],
Packit d37888
eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
Packit d37888
if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
Packit d37888
  AC_MSG_RESULT(yes)
Packit d37888
  gcc_need_declarations="$gcc_need_declarations $1"
Packit d37888
  gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
Packit d37888
  AC_DEFINE_UNQUOTED($gcc_tr_decl, 1, [Define if $1 () must be declared.])
Packit d37888
else
Packit d37888
  AC_MSG_RESULT(no)
Packit d37888
fi
Packit d37888
])dnl
Packit d37888
Packit d37888
dnl Check multiple functions to see whether each needs a declaration.
Packit d37888
dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
Packit d37888
AC_DEFUN([GCC_NEED_DECLARATIONS],
Packit d37888
[for ac_func in $1
Packit d37888
do
Packit d37888
GCC_NEED_DECLARATION($ac_func, $2)
Packit d37888
done
Packit d37888
]
Packit d37888
)
Packit d37888
Packit d37888
dnl
Packit d37888
dnl GNOME_FILEUTILS_CHECKS
Packit d37888
dnl
Packit d37888
dnl checks that are needed for the diskusage applet.
Packit d37888
dnl
Packit d37888
Packit d37888
AC_DEFUN([GNOME_FILEUTILS_CHECKS],
Packit d37888
[
Packit d37888
AC_CHECK_HEADERS(fcntl.h sys/param.h sys/statfs.h sys/fstyp.h \
Packit d37888
mnttab.h mntent.h sys/statvfs.h sys/vfs.h sys/mount.h \
Packit d37888
sys/filsys.h sys/fs_types.h sys/fs/s5param.h)
Packit d37888
Packit d37888
AC_CHECK_FUNCS(bcopy endgrent endpwent fchdir ftime ftruncate \
Packit d37888
getcwd getmntinfo gettimeofday isascii lchown \
Packit d37888
listmntent memcpy mkfifo strchr strerror strrchr vprintf)
Packit d37888
Packit d37888
dnl Set some defaults when cross-compiling
Packit d37888
Packit d37888
if test x$cross_compiling = xyes ; then
Packit d37888
        case "$host_os" in
Packit d37888
        linux*)
Packit d37888
          fu_cv_sys_mounted_getmntent1=yes
Packit d37888
          fu_cv_sys_stat_statfs2_bsize=yes
Packit d37888
          ;;
Packit d37888
        sunos*)
Packit d37888
          fu_cv_sys_stat_statfs4=yes
Packit d37888
          ;;
Packit d37888
        freebsd*)
Packit d37888
          fu_cv_sys_stat_statfs2_bsize=yes
Packit d37888
          ;;
Packit d37888
        osf*)
Packit d37888
          fu_cv_sys_stat_statfs3_osf1=yes
Packit d37888
          ;;
Packit d37888
        esac
Packit d37888
fi
Packit d37888
Packit d37888
# Determine how to get the list of mounted filesystems.
Packit d37888
list_mounted_fs=
Packit d37888
Packit d37888
# If the getmntent function is available but not in the standard library,
Packit d37888
# make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
Packit d37888
AC_FUNC_GETMNTENT
Packit d37888
Packit d37888
# This test must precede the ones for getmntent because Unicos-9 is
Packit d37888
# reported to have the getmntent function, but its support is incompatible
Packit d37888
# with other getmntent implementations.
Packit d37888
Packit d37888
# NOTE: Normally, I wouldn't use a check for system type as I've done for
Packit d37888
# `CRAY' below since that goes against the whole autoconf philosophy.  But
Packit d37888
# I think there is too great a chance that some non-Cray system has a
Packit d37888
# function named listmntent to risk the false positive.
Packit d37888
Packit d37888
if test -z "$list_mounted_fs"; then
Packit d37888
# Cray UNICOS 9
Packit d37888
AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
Packit d37888
[fu_cv_sys_mounted_cray_listmntent=no
Packit d37888
AC_EGREP_CPP(yes,
Packit d37888
[#ifdef _CRAY
Packit d37888
yes
Packit d37888
#endif
Packit d37888
], [test $ac_cv_func_listmntent = yes \
Packit d37888
&& fu_cv_sys_mounted_cray_listmntent=yes]
Packit d37888
)
Packit d37888
]
Packit d37888
)
Packit d37888
AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
Packit d37888
if test $fu_cv_sys_mounted_cray_listmntent = yes; then
Packit d37888
list_mounted_fs=found
Packit d37888
AC_DEFINE(MOUNTED_LISTMNTENT, 1,
Packit d37888
          [Define if there is a function named listmntent that can be used to list all mounted filesystems. [UNICOS]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
if test $ac_cv_func_getmntent = yes; then
Packit d37888
Packit d37888
# This system has the getmntent function.
Packit d37888
# Determine whether it's the one-argument variant or the two-argument one.
Packit d37888
Packit d37888
if test -z "$list_mounted_fs"; then
Packit d37888
# 4.3BSD, SunOS, HP-UX, Dynix, Irix
Packit d37888
AC_MSG_CHECKING([for one-argument getmntent function])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
Packit d37888
[test $ac_cv_header_mntent_h = yes \
Packit d37888
&& fu_cv_sys_mounted_getmntent1=yes \
Packit d37888
|| fu_cv_sys_mounted_getmntent1=no])
Packit d37888
AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
Packit d37888
if test $fu_cv_sys_mounted_getmntent1 = yes; then
Packit d37888
list_mounted_fs=found
Packit d37888
AC_DEFINE(MOUNTED_GETMNTENT1, 1,
Packit d37888
          [Define if there is a function named getmntent for reading the list of mounted filesystems, and that function takes a single argument. [4.3BSD, SunOS, HP-UX, Dynix, Irix]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
if test -z "$list_mounted_fs"; then
Packit d37888
# SVR4
Packit d37888
AC_MSG_CHECKING([for two-argument getmntent function])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
Packit d37888
[AC_EGREP_HEADER(getmntent, sys/mnttab.h,
Packit d37888
fu_cv_sys_mounted_getmntent2=yes,
Packit d37888
fu_cv_sys_mounted_getmntent2=no)])
Packit d37888
AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
Packit d37888
if test $fu_cv_sys_mounted_getmntent2 = yes; then
Packit d37888
list_mounted_fs=found
Packit d37888
AC_DEFINE(MOUNTED_GETMNTENT2, 1,
Packit d37888
          [Define if there is a function named getmntent for reading the list of mounted filesystems, and that function takes two arguments.  [SVR4]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
if test -z "$list_mounted_fs"; then
Packit d37888
AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
Packit d37888
fi
Packit d37888
Packit d37888
fi
Packit d37888
Packit d37888
if test -z "$list_mounted_fs"; then
Packit d37888
# DEC Alpha running OSF/1.
Packit d37888
AC_MSG_CHECKING([for getfsstat function])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_mounted_getsstat,
Packit d37888
[AC_TRY_LINK([
Packit d37888
#include <sys/types.h>
Packit d37888
#include <sys/mount.h>
Packit d37888
#include <sys/fs_types.h>],
Packit d37888
[struct statfs *stats;
Packit d37888
int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); ],
Packit d37888
fu_cv_sys_mounted_getsstat=yes,
Packit d37888
fu_cv_sys_mounted_getsstat=no)])
Packit d37888
AC_MSG_RESULT($fu_cv_sys_mounted_getsstat)
Packit d37888
if test $fu_cv_sys_mounted_getsstat = yes; then
Packit d37888
list_mounted_fs=found
Packit d37888
AC_DEFINE(MOUNTED_GETFSSTAT, 1,
Packit d37888
          [Define if there is a function named getfsstat for reading the list of mounted filesystems.  [DEC Alpha running OSF/1]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
if test -z "$list_mounted_fs"; then
Packit d37888
# AIX.
Packit d37888
AC_MSG_CHECKING([for mntctl function and struct vmount])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
Packit d37888
[AC_TRY_CPP([#include <fshelp.h>],
Packit d37888
fu_cv_sys_mounted_vmount=yes,
Packit d37888
fu_cv_sys_mounted_vmount=no)])
Packit d37888
AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
Packit d37888
if test $fu_cv_sys_mounted_vmount = yes; then
Packit d37888
list_mounted_fs=found
Packit d37888
AC_DEFINE(MOUNTED_VMOUNT, 1,
Packit d37888
          [Define if there is a function named mntctl that can be used to read the list of mounted filesystems, and there is a system header file that declares `struct vmount.'  [AIX]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
if test -z "$list_mounted_fs"; then
Packit d37888
# SVR3
Packit d37888
AC_MSG_CHECKING([for FIXME existence of three headers])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
Packit d37888
[AC_TRY_CPP([
Packit d37888
#include <sys/statfs.h>
Packit d37888
#include <sys/fstyp.h>
Packit d37888
#include <mnttab.h>],
Packit d37888
fu_cv_sys_mounted_fread_fstyp=yes,
Packit d37888
fu_cv_sys_mounted_fread_fstyp=no)])
Packit d37888
AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
Packit d37888
if test $fu_cv_sys_mounted_fread_fstyp = yes; then
Packit d37888
list_mounted_fs=found
Packit d37888
AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
Packit d37888
          [Define if (like SVR2) there is no specific function for reading the list of mounted filesystems, and your system has these header files: <sys/fstyp.h> and <sys/statfs.h>.  [SVR3]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
if test -z "$list_mounted_fs"; then
Packit d37888
# 4.4BSD and DEC OSF/1.
Packit d37888
AC_MSG_CHECKING([for getmntinfo function])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
Packit d37888
[
Packit d37888
ok=
Packit d37888
if test $ac_cv_func_getmntinfo = yes; then
Packit d37888
AC_EGREP_HEADER(f_type;, sys/mount.h,
Packit d37888
ok=yes)
Packit d37888
fi
Packit d37888
test -n "$ok" \
Packit d37888
&& fu_cv_sys_mounted_getmntinfo=yes \
Packit d37888
|| fu_cv_sys_mounted_getmntinfo=no
Packit d37888
])
Packit d37888
AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
Packit d37888
if test $fu_cv_sys_mounted_getmntinfo = yes; then
Packit d37888
list_mounted_fs=found
Packit d37888
AC_DEFINE(MOUNTED_GETMNTINFO, 1,
Packit d37888
          [Define if there is a function named getmntinfo for reading the list of mounted filesystems.  [4.4BSD]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
# FIXME: add a test for netbsd-1.1 here
Packit d37888
Packit d37888
if test -z "$list_mounted_fs"; then
Packit d37888
# Ultrix
Packit d37888
AC_MSG_CHECKING([for getmnt function])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
Packit d37888
[AC_TRY_CPP([
Packit d37888
#include <sys/fs_types.h>
Packit d37888
#include <sys/mount.h>],
Packit d37888
fu_cv_sys_mounted_getmnt=yes,
Packit d37888
fu_cv_sys_mounted_getmnt=no)])
Packit d37888
AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
Packit d37888
if test $fu_cv_sys_mounted_getmnt = yes; then
Packit d37888
list_mounted_fs=found
Packit d37888
AC_DEFINE(MOUNTED_GETMNT, 1,
Packit d37888
          [Define if there is a function named getmnt for reading the list of mounted filesystems.  [Ultrix]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
if test -z "$list_mounted_fs"; then
Packit d37888
# SVR2
Packit d37888
AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_mounted_fread,
Packit d37888
[AC_TRY_CPP([#include <mnttab.h>],
Packit d37888
fu_cv_sys_mounted_fread=yes,
Packit d37888
fu_cv_sys_mounted_fread=no)])
Packit d37888
AC_MSG_RESULT($fu_cv_sys_mounted_fread)
Packit d37888
if test $fu_cv_sys_mounted_fread = yes; then
Packit d37888
list_mounted_fs=found
Packit d37888
AC_DEFINE(MOUNTED_FREAD, 1,
Packit d37888
          [Define if there is no specific function for reading the list of mounted filesystems.  fread will be used to read /etc/mnttab.  [SVR2]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
if test -z "$list_mounted_fs"; then
Packit d37888
AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
Packit d37888
# FIXME -- no need to abort building the whole package
Packit d37888
# Cannot build mountlist.c or anything that needs its functions
Packit d37888
fi
Packit d37888
Packit d37888
AC_CHECKING(how to get filesystem space usage)
Packit d37888
space=no
Packit d37888
Packit d37888
# Perform only the link test since it seems there are no variants of the
Packit d37888
# statvfs function.  This check is more than just AC_CHECK_FUNCS(statvfs)
Packit d37888
# because that got a false positive on SCO OSR5.  Adding the declaration
Packit d37888
# of a `struct statvfs' causes this test to fail (as it should) on such
Packit d37888
# systems.  That system is reported to work fine with STAT_STATFS4 which
Packit d37888
# is what it gets when this test fails.
Packit d37888
if test $space = no; then
Packit d37888
# SVR4
Packit d37888
AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
Packit d37888
[AC_TRY_LINK([#include <sys/types.h>
Packit d37888
#include <sys/statvfs.h>],
Packit d37888
[struct statvfs fsd; statvfs (0, &fsd;;],
Packit d37888
fu_cv_sys_stat_statvfs=yes,
Packit d37888
fu_cv_sys_stat_statvfs=no)])
Packit d37888
if test $fu_cv_sys_stat_statvfs = yes; then
Packit d37888
space=yes
Packit d37888
AC_DEFINE(STAT_STATVFS, 1,
Packit d37888
          [Define if there is a function named statvfs.  [SVR4]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
if test $space = no; then
Packit d37888
# DEC Alpha running OSF/1
Packit d37888
AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
Packit d37888
[AC_TRY_RUN([
Packit d37888
#include <sys/param.h>
Packit d37888
#include <sys/types.h>
Packit d37888
#include <sys/mount.h>
Packit d37888
int main ()
Packit d37888
{
Packit d37888
struct statfs fsd;
Packit d37888
fsd.f_fsize = 0;
Packit d37888
return (statfs (".", &fsd, sizeof (struct statfs)));
Packit d37888
}],
Packit d37888
fu_cv_sys_stat_statfs3_osf1=yes,
Packit d37888
fu_cv_sys_stat_statfs3_osf1=no,
Packit d37888
fu_cv_sys_stat_statfs3_osf1=no)])
Packit d37888
AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
Packit d37888
if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
Packit d37888
space=yes
Packit d37888
AC_DEFINE(STAT_STATFS3_OSF1, 1,
Packit d37888
          [Define if  statfs takes 3 args.  [DEC Alpha running OSF/1]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
if test $space = no; then
Packit d37888
# AIX
Packit d37888
AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
Packit d37888
member (AIX, 4.3BSD)])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
Packit d37888
[AC_TRY_RUN([
Packit d37888
#ifdef HAVE_SYS_PARAM_H
Packit d37888
#include <sys/param.h>
Packit d37888
#endif
Packit d37888
#ifdef HAVE_SYS_MOUNT_H
Packit d37888
#include <sys/mount.h>
Packit d37888
#endif
Packit d37888
#ifdef HAVE_SYS_VFS_H
Packit d37888
#include <sys/vfs.h>
Packit d37888
#endif
Packit d37888
int main ()
Packit d37888
{
Packit d37888
struct statfs fsd;
Packit d37888
fsd.f_bsize = 0;
Packit d37888
return (statfs (".", &fsd));
Packit d37888
}],
Packit d37888
fu_cv_sys_stat_statfs2_bsize=yes,
Packit d37888
fu_cv_sys_stat_statfs2_bsize=no,
Packit d37888
fu_cv_sys_stat_statfs2_bsize=no)])
Packit d37888
AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
Packit d37888
if test $fu_cv_sys_stat_statfs2_bsize = yes; then
Packit d37888
space=yes
Packit d37888
AC_DEFINE(STAT_STATFS2_BSIZE, 1,
Packit d37888
          [Define if statfs takes 2 args and struct statfs has a field named f_bsize. [4.3BSD, SunOS 4, HP-UX, AIX PS/2]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
if test $space = no; then
Packit d37888
# SVR3
Packit d37888
AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
Packit d37888
[AC_TRY_RUN([#include <sys/types.h>
Packit d37888
#include <sys/statfs.h>
Packit d37888
int main ()
Packit d37888
{
Packit d37888
struct statfs fsd;
Packit d37888
return (statfs (".", &fsd, sizeof fsd, 0));
Packit d37888
}],
Packit d37888
fu_cv_sys_stat_statfs4=yes,
Packit d37888
fu_cv_sys_stat_statfs4=no,
Packit d37888
fu_cv_sys_stat_statfs4=no)])
Packit d37888
AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
Packit d37888
if test $fu_cv_sys_stat_statfs4 = yes; then
Packit d37888
space=yes
Packit d37888
AC_DEFINE(STAT_STATFS4, 1,
Packit d37888
          [Define if statfs takes 4 args.  [SVR3, Dynix, Irix, Dolphin]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
if test $space = no; then
Packit d37888
# 4.4BSD and NetBSD
Packit d37888
AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
Packit d37888
member (4.4BSD and NetBSD)])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
Packit d37888
[AC_TRY_RUN([#include <sys/types.h>
Packit d37888
#ifdef HAVE_SYS_PARAM_H
Packit d37888
#include <sys/param.h>
Packit d37888
#endif
Packit d37888
#ifdef HAVE_SYS_MOUNT_H
Packit d37888
#include <sys/mount.h>
Packit d37888
#endif
Packit d37888
int main ()
Packit d37888
{
Packit d37888
struct statfs fsd;
Packit d37888
fsd.f_fsize = 0;
Packit d37888
return (statfs (".", &fsd));
Packit d37888
}],
Packit d37888
fu_cv_sys_stat_statfs2_fsize=yes,
Packit d37888
fu_cv_sys_stat_statfs2_fsize=no,
Packit d37888
fu_cv_sys_stat_statfs2_fsize=no)])
Packit d37888
AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
Packit d37888
if test $fu_cv_sys_stat_statfs2_fsize = yes; then
Packit d37888
space=yes
Packit d37888
AC_DEFINE(STAT_STATFS2_FSIZE, 1,
Packit d37888
          [Define if statfs takes 2 args and struct statfs has a field named f_fsize. [4.4BSD, NetBSD]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
if test $space = no; then
Packit d37888
# Ultrix
Packit d37888
AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
Packit d37888
[AC_TRY_RUN([#include <sys/types.h>
Packit d37888
#ifdef HAVE_SYS_PARAM_H
Packit d37888
#include <sys/param.h>
Packit d37888
#endif
Packit d37888
#ifdef HAVE_SYS_MOUNT_H
Packit d37888
#include <sys/mount.h>
Packit d37888
#endif
Packit d37888
#ifdef HAVE_SYS_FS_TYPES_H
Packit d37888
#include <sys/fs_types.h>
Packit d37888
#endif
Packit d37888
int main ()
Packit d37888
{
Packit d37888
struct fs_data fsd;
Packit d37888
/* Ultrix's statfs returns 1 for success,
Packit d37888
0 for not mounted, -1 for failure.  */
Packit d37888
return (statfs (".", &fsd) != 1);
Packit d37888
}],
Packit d37888
fu_cv_sys_stat_fs_data=yes,
Packit d37888
fu_cv_sys_stat_fs_data=no,
Packit d37888
fu_cv_sys_stat_fs_data=no)])
Packit d37888
AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
Packit d37888
if test $fu_cv_sys_stat_fs_data = yes; then
Packit d37888
space=yes
Packit d37888
AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
Packit d37888
          [Define if statfs takes 2 args and the second argument has type struct fs_data.  [Ultrix]])
Packit d37888
fi
Packit d37888
fi
Packit d37888
Packit d37888
if test $space = no; then
Packit d37888
# SVR2
Packit d37888
AC_TRY_CPP([#include <sys/filsys.h>],
Packit d37888
AC_DEFINE(STAT_READ_FILSYS, 1,
Packit d37888
          [Define if there is no specific function for reading filesystems usage information and you have the <sys/filsys.h> header file.  [SVR2]])
Packit d37888
space=yes)
Packit d37888
fi
Packit d37888
Packit d37888
if test -n "$list_mounted_fs" && test $space != no; then
Packit d37888
DF_PROG="df"
Packit d37888
# AC_LIBOBJ(fsusage)
Packit d37888
# AC_LIBOBJ(mountlist)
Packit d37888
fi
Packit d37888
Packit d37888
# Check for SunOS statfs brokenness wrt partitions 2GB and larger.
Packit d37888
# If <sys/vfs.h> exists and struct statfs has a member named f_spare,
Packit d37888
# enable the work-around code in fsusage.c.
Packit d37888
AC_MSG_CHECKING([for statfs that truncates block counts])
Packit d37888
AC_CACHE_VAL(fu_cv_sys_truncating_statfs,
Packit d37888
[AC_TRY_COMPILE([
Packit d37888
#if !defined(sun) && !defined(__sun)
Packit d37888
choke -- this is a workaround for a Sun-specific problem
Packit d37888
#endif
Packit d37888
#include <sys/types.h>
Packit d37888
#include <sys/vfs.h>],
Packit d37888
[struct statfs t; long c = *(t.f_spare);],
Packit d37888
fu_cv_sys_truncating_statfs=yes,
Packit d37888
fu_cv_sys_truncating_statfs=no,
Packit d37888
)])
Packit d37888
if test $fu_cv_sys_truncating_statfs = yes; then
Packit d37888
AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS, 1,
Packit d37888
          [Define if the block counts reported by statfs may be truncated to 2GB and the correct values may be stored in the f_spare array. [SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem. SunOS 4.1.1 seems not to be affected.]])
Packit d37888
fi
Packit d37888
AC_MSG_RESULT($fu_cv_sys_truncating_statfs)
Packit d37888
Packit d37888
AC_CHECKING(for AFS)
Packit d37888
test -d /afs && AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.])
Packit d37888
])
Packit d37888
Packit d37888
Packit d37888
m4_include([libgtop-sysdeps.m4])