This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
c6032ad8d0e4b2b02d9fc6450346183c4d553064
[metaconfig.git] / U / perl / d_statfs3.U
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 1999 Jarkko Hietaniemi
4 ?RCS:
5 ?RCS: You may distribute under the terms of either the GNU General Public
6 ?RCS: License or the Artistic License, as specified in the README file.
7 ?RCS:
8 ?MAKE:d_statfs3: \
9         d_statfs Compile rm_try cat i_sysparam i_sysmount i_systypes \
10         i_sysvfs i_sysstatfs Setvar
11 ?MAKE:  -pick add $@ %<
12 ?S:d_statfs3:
13 ?S:     This variable conditionally defines the HAS_STATFS symbol, which
14 ?S:     indicates to the C program that the statfs() has four arguments.
15 ?S:.
16 ?C:HAS_STATFS3:
17 ?C:     This symbol, if defined, indicates that the statfs routine
18 ?C:     has four arguments, not two.
19 ?C:.
20 ?H:#$d_statfs3 HAS_STATFS3              /**/
21 ?H:.
22 ?F: !try.h
23 ?LINT:set d_statfs3
24 : Check for statfs3
25 case "$d_statfs" in
26 define)
27         $cat >try.h <<EOCP
28 #define HAS_SYS_TYPES  $i_systypes
29 #define HAS_SYS_PARAM  $i_sysparam
30 #define HAS_SYS_MOUNT  $i_sysmount
31 #define HAS_SYS_VFS    $i_sysvfs
32 #define HAS_SYS_STATFS $i_sysstatfs
33 #ifdef HAS_SYS_TYPES
34 #   include <sys/types.h>
35 #endif
36 #ifdef HAS_SYS_PARAM
37 #   include <sys/param.h>
38 #endif
39 #ifdef HAS_SYS_MOUNT
40 #   include <sys/mount.h>
41 #endif
42 #ifdef HAS_SYS_VFS
43 #   include <sys/vfs.h>
44 #endif
45 #ifdef HAS_SYS_STATFS
46 #   include <sys/statfs.h>
47 #endif
48 EOCP
49         echo "Checking to see if your statfs can handle three arguments..." >&4
50         $cat >try.c <<EOCP
51 #include "try.h"
52 int main() { struct statfs sf; statfs(".", &sf, sizeof(sf)) };
53 EOCP
54         set try
55         if eval $compile; then
56                 val="$define"
57         else
58                 val="$undef"
59         fi
60         case "$val" in
61         $define) echo "Yes, it can."  ;;
62         $undef)  echo "No, it can't." ;;
63         $rm_try try.h
64         esac
65         ;;
66 *)      val="$undef"
67         ;;
68 esac
69 set d_statfs3
70 eval $setvar
71