summaryrefslogtreecommitdiffstats
path: root/m4/blockdev.m4
blob: e44589e49e74610cac9292b6751a2d22fad1ac61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
dnl * Check if statvfs() can be used to find out block device for files
AC_DEFUN([DOVECOT_FILE_BLOCKDEV], [
  AC_CACHE_CHECK([if statvfs.f_mntfromname exists],i_cv_have_statvfs_f_mntfromname,[
    AC_TRY_COMPILE([
      #include <sys/types.h>
      #include <sys/statvfs.h>
    ], [
      struct statvfs buf;
      char *p = buf.f_mntfromname;
  
      statvfs(".", &buf);
    ], [
      i_cv_have_statvfs_f_mntfromname=yes
    ], [
      i_cv_have_statvfs_f_mntfromname=no
    ])
  ])
  if test $i_cv_have_statvfs_f_mntfromname = yes; then
    AC_DEFINE(HAVE_STATVFS_MNTFROMNAME,, [Define if you have statvfs.f_mntfromname])
  fi
  
  dnl * Check if statfs() can be used to find out block device for files
  AC_CACHE_CHECK([if statfs.f_mntfromname exists],i_cv_have_statfs_f_mntfromname,[
    AC_TRY_COMPILE([
      #include <sys/param.h>
      #include <sys/mount.h>
    ], [
      struct statfs buf;
      char *p = buf.f_mntfromname;
  
      statfs(".", &buf);
    ], [
      i_cv_have_statfs_f_mntfromname=yes
    ], [
      i_cv_have_statfs_f_mntfromname=no
    ])
  ])
  if test $i_cv_have_statfs_f_mntfromname = yes; then
    AC_DEFINE(HAVE_STATFS_MNTFROMNAME,, [Define if you have statfs.f_mntfromname])
  fi
])