Mercurial > gnulib
annotate m4/ls-mntd-fs.m4 @ 39908:f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Reported by David Wood <David.Wood@deshaw.com> in
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=6816>.
* m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): On Solaris 8 or
newer, define MOUNTED_GETEXTMNTENT instead of MOUNTED_GETMNTENT2.
* lib/mountlist.c: Add code for MOUNTED_GETEXTMNTENT case.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Fri, 12 Oct 2018 11:12:53 +0200 |
parents | b14bcf3a1610 |
children | dc86d8546fe5 |
rev | line source |
---|---|
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
1 # serial 34 |
5159 | 2 # How to list mounted file systems. |
3 | |
19484
10eb9086bea0
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
18985
diff
changeset
|
4 # Copyright (C) 1998-2004, 2006, 2009-2018 Free Software Foundation, Inc. |
5611
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5518
diff
changeset
|
5 # |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5518
diff
changeset
|
6 # This file is free software; the Free Software Foundation |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5518
diff
changeset
|
7 # gives unlimited permission to copy and/or distribute it, |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5518
diff
changeset
|
8 # with or without modifications, as long as this notice is preserved. |
1386 | 9 |
10 dnl From Jim Meyering. | |
11 dnl | |
12 dnl This is not pretty. I've just taken the autoconf code and wrapped | |
5159 | 13 dnl it in an AC_DEFUN and made some other fixes. |
1386 | 14 dnl |
15 | |
5515
d4e02b196ef0
(AC_FUNC_GETMNTENT): New macro, to work around bug
Paul Eggert <eggert@cs.ucla.edu>
parents:
5159
diff
changeset
|
16 # Replace Autoconf's AC_FUNC_GETMNTENT to work around a bug in Autoconf |
d4e02b196ef0
(AC_FUNC_GETMNTENT): New macro, to work around bug
Paul Eggert <eggert@cs.ucla.edu>
parents:
5159
diff
changeset
|
17 # through Autoconf 2.59. We can remove this once we assume Autoconf 2.60 |
d4e02b196ef0
(AC_FUNC_GETMNTENT): New macro, to work around bug
Paul Eggert <eggert@cs.ucla.edu>
parents:
5159
diff
changeset
|
18 # or later. |
d4e02b196ef0
(AC_FUNC_GETMNTENT): New macro, to work around bug
Paul Eggert <eggert@cs.ucla.edu>
parents:
5159
diff
changeset
|
19 AC_DEFUN([AC_FUNC_GETMNTENT], |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
20 [ |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
21 # getmntent is in the standard C library on UNICOS, in -lsun on Irix 4, |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
22 # -lseq on Dynix/PTX, -lgen on Unixware. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
23 AC_SEARCH_LIBS([getmntent], [sun seq gen]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
24 AC_CHECK_FUNCS([getmntent]) |
5515
d4e02b196ef0
(AC_FUNC_GETMNTENT): New macro, to work around bug
Paul Eggert <eggert@cs.ucla.edu>
parents:
5159
diff
changeset
|
25 ]) |
d4e02b196ef0
(AC_FUNC_GETMNTENT): New macro, to work around bug
Paul Eggert <eggert@cs.ucla.edu>
parents:
5159
diff
changeset
|
26 |
5159 | 27 # gl_LIST_MOUNTED_FILE_SYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) |
28 AC_DEFUN([gl_LIST_MOUNTED_FILE_SYSTEMS], | |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
29 [ |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
30 AC_REQUIRE([AC_CANONICAL_HOST]) |
39907
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
31 AC_CHECK_FUNCS([listmntent]) |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
32 AC_CHECK_HEADERS_ONCE([sys/param.h sys/statvfs.h]) |
4986 | 33 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
34 # We must include grp.h before ucred.h on OSF V4.0, since ucred.h uses |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
35 # NGROUPS (as the array dimension for a struct member) without a definition. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
36 AC_CHECK_HEADERS([sys/ucred.h], [], [], [#include <grp.h>]) |
4986 | 37 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
38 AC_CHECK_HEADERS([sys/mount.h], [], [], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
39 [AC_INCLUDES_DEFAULT |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
40 [#if HAVE_SYS_PARAM_H |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
41 #include <sys/param.h> |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
42 #endif |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
43 ]]) |
5159 | 44 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
45 AC_CHECK_HEADERS([mntent.h sys/fs_types.h]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
46 getfsstat_includes="\ |
3539
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
47 $ac_includes_default |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
48 #if HAVE_SYS_PARAM_H |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
49 # include <sys/param.h> /* needed by powerpc-apple-darwin1.3.7 */ |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
50 #endif |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
51 #if HAVE_SYS_UCRED_H |
4986 | 52 # include <grp.h> /* needed for definition of NGROUPS */ |
3539
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
53 # include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */ |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
54 #endif |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
55 #if HAVE_SYS_MOUNT_H |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
56 # include <sys/mount.h> |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
57 #endif |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
58 #if HAVE_SYS_FS_TYPES_H |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
59 # include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */ |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
60 #endif |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
61 " |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
62 AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes]) |
2680
7a52266db39f
Remove a `FIXME' comment and fix the associated problem.
Jim Meyering <jim@meyering.net>
parents:
2676
diff
changeset
|
63 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
64 # Determine how to get the list of mounted file systems. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
65 ac_list_mounted_fs= |
1386 | 66 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
67 # If the getmntent function is available but not in the standard library, |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
68 # make sure LIBS contains the appropriate -l option. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
69 AC_FUNC_GETMNTENT |
1386 | 70 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
71 # This test must precede the ones for getmntent because Unicos-9 is |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
72 # reported to have the getmntent function, but its support is incompatible |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
73 # with other getmntent implementations. |
1386 | 74 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
75 # NOTE: Normally, I wouldn't use a check for system type as I've done for |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
76 # 'CRAY' below since that goes against the whole autoconf philosophy. But |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
77 # I think there is too great a chance that some non-Cray system has a |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
78 # function named listmntent to risk the false positive. |
1386 | 79 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
80 if test -z "$ac_list_mounted_fs"; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
81 # (obsolete) Cray UNICOS 9 |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
82 AC_CACHE_CHECK([for listmntent of Cray/Unicos-9], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
83 [fu_cv_sys_mounted_cray_listmntent], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
84 [fu_cv_sys_mounted_cray_listmntent=no |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
85 AC_EGREP_CPP([yes], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
86 [#ifdef _CRAY |
1386 | 87 yes |
88 #endif | |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
89 ], [test $ac_cv_func_listmntent = yes \ |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
90 && fu_cv_sys_mounted_cray_listmntent=yes] |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
91 ) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
92 ]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
93 if test $fu_cv_sys_mounted_cray_listmntent = yes; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
94 ac_list_mounted_fs=found |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
95 AC_DEFINE([MOUNTED_LISTMNTENT], [1], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
96 [Define if there is a function named listmntent that can be used to |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
97 list all mounted file systems. (UNICOS)]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
98 fi |
1386 | 99 fi |
100 | |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
101 if test -z "$ac_list_mounted_fs"; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
102 # AIX. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
103 AC_CACHE_CHECK([for mntctl function and struct vmount], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
104 [fu_cv_sys_mounted_vmount], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
105 [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <fshelp.h>]])], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
106 [fu_cv_sys_mounted_vmount=yes], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
107 [fu_cv_sys_mounted_vmount=no])]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
108 if test $fu_cv_sys_mounted_vmount = yes; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
109 ac_list_mounted_fs=found |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
110 AC_DEFINE([MOUNTED_VMOUNT], [1], |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
111 [Define if there is a function named mntctl that can be used to read |
5159 | 112 the list of mounted file systems, and there is a system header file |
16234
f9b906545e2f
Use ', not `, for quoting output.
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
113 that declares 'struct vmount'. (AIX)]) |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
114 fi |
4548
a61e996662a3
Merge mountlist changes from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4108
diff
changeset
|
115 fi |
a61e996662a3
Merge mountlist changes from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4108
diff
changeset
|
116 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
117 if test $ac_cv_func_getmntent = yes; then |
1386 | 118 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
119 # This system has the getmntent function. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
120 # Determine whether it's the one-argument variant or the two-argument one. |
1386 | 121 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
122 if test -z "$ac_list_mounted_fs"; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
123 # glibc, HP-UX, IRIX, Cygwin, Android, also (obsolete) 4.3BSD, SunOS, Dynix. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
124 AC_CACHE_CHECK([for one-argument getmntent function], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
125 [fu_cv_sys_mounted_getmntent1], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
126 [AC_COMPILE_IFELSE( |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
127 [AC_LANG_PROGRAM([[ |
3529
981c106235e9
(jm_LIST_MOUNTED_FILESYSTEMS)
Jim Meyering <jim@meyering.net>
parents:
3506
diff
changeset
|
128 /* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */ |
981c106235e9
(jm_LIST_MOUNTED_FILESYSTEMS)
Jim Meyering <jim@meyering.net>
parents:
3506
diff
changeset
|
129 #include <stdio.h> |
981c106235e9
(jm_LIST_MOUNTED_FILESYSTEMS)
Jim Meyering <jim@meyering.net>
parents:
3506
diff
changeset
|
130 |
3504
ba5dc4f216c3
(jm_LIST_MOUNTED_FILESYSTEMS): Add a compile-test
Jim Meyering <jim@meyering.net>
parents:
3339
diff
changeset
|
131 #include <mntent.h> |
ba5dc4f216c3
(jm_LIST_MOUNTED_FILESYSTEMS): Add a compile-test
Jim Meyering <jim@meyering.net>
parents:
3339
diff
changeset
|
132 #if !defined MOUNTED |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
133 # if defined _PATH_MOUNTED /* GNU libc */ |
3504
ba5dc4f216c3
(jm_LIST_MOUNTED_FILESYSTEMS): Add a compile-test
Jim Meyering <jim@meyering.net>
parents:
3339
diff
changeset
|
134 # define MOUNTED _PATH_MOUNTED |
ba5dc4f216c3
(jm_LIST_MOUNTED_FILESYSTEMS): Add a compile-test
Jim Meyering <jim@meyering.net>
parents:
3339
diff
changeset
|
135 # endif |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
136 # if defined MNT_MNTTAB /* HP-UX. */ |
3504
ba5dc4f216c3
(jm_LIST_MOUNTED_FILESYSTEMS): Add a compile-test
Jim Meyering <jim@meyering.net>
parents:
3339
diff
changeset
|
137 # define MOUNTED MNT_MNTTAB |
ba5dc4f216c3
(jm_LIST_MOUNTED_FILESYSTEMS): Add a compile-test
Jim Meyering <jim@meyering.net>
parents:
3339
diff
changeset
|
138 # endif |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
139 # if defined MNTTABNAME /* Dynix. */ |
3504
ba5dc4f216c3
(jm_LIST_MOUNTED_FILESYSTEMS): Add a compile-test
Jim Meyering <jim@meyering.net>
parents:
3339
diff
changeset
|
140 # define MOUNTED MNTTABNAME |
ba5dc4f216c3
(jm_LIST_MOUNTED_FILESYSTEMS): Add a compile-test
Jim Meyering <jim@meyering.net>
parents:
3339
diff
changeset
|
141 # endif |
ba5dc4f216c3
(jm_LIST_MOUNTED_FILESYSTEMS): Add a compile-test
Jim Meyering <jim@meyering.net>
parents:
3339
diff
changeset
|
142 #endif |
11929
0e6b6e9d54d0
Replace uses of obsolete autoconf macros in Jim's modules.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11007
diff
changeset
|
143 ]], |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
144 [[struct mntent *mnt = 0; char *table = MOUNTED; |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
145 if (sizeof mnt && sizeof table) return 0; |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
146 ]])], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
147 [fu_cv_sys_mounted_getmntent1=yes], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
148 [fu_cv_sys_mounted_getmntent1=no]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
149 ]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
150 if test $fu_cv_sys_mounted_getmntent1 = yes; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
151 ac_list_mounted_fs=found |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
152 AC_DEFINE([MOUNTED_GETMNTENT1], [1], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
153 [Define if there is a function named getmntent for reading the list |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
154 of mounted file systems, and that function takes a single argument. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
155 (4.3BSD, SunOS, HP-UX, Dynix, Irix)]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
156 AC_CHECK_FUNCS([hasmntopt]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
157 fi |
1386 | 158 fi |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
159 |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
160 if test -z "$ac_list_mounted_fs"; then |
39908
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
161 # Solaris >= 8. |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
162 AC_CACHE_CHECK([for getextmntent function], |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
163 [fu_cv_sys_mounted_getextmntent], |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
164 [AC_EGREP_HEADER([getextmntent], [sys/mnttab.h], |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
165 [fu_cv_sys_mounted_getextmntent=yes], |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
166 [fu_cv_sys_mounted_getextmntent=no])]) |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
167 if test $fu_cv_sys_mounted_getextmntent = yes; then |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
168 ac_list_mounted_fs=found |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
169 AC_DEFINE([MOUNTED_GETEXTMNTENT], [1], |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
170 [Define if there is a function named getextmntent for reading the list |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
171 of mounted file systems. (Solaris)]) |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
172 fi |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
173 fi |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
174 |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
175 if test -z "$ac_list_mounted_fs"; then |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
176 # Solaris < 8, also (obsolete) SVR4. |
f2b5499e6ee2
mountlist: Improve support for Solaris in 64-bit mode.
Bruno Haible <bruno@clisp.org>
parents:
39907
diff
changeset
|
177 # Solaris >= 8 has the two-argument getmntent but is already handled above. |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
178 AC_CACHE_CHECK([for two-argument getmntent function], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
179 [fu_cv_sys_mounted_getmntent2], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
180 [AC_EGREP_HEADER([getmntent], [sys/mnttab.h], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
181 [fu_cv_sys_mounted_getmntent2=yes], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
182 [fu_cv_sys_mounted_getmntent2=no]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
183 ]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
184 if test $fu_cv_sys_mounted_getmntent2 = yes; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
185 ac_list_mounted_fs=found |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
186 AC_DEFINE([MOUNTED_GETMNTENT2], [1], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
187 [Define if there is a function named getmntent for reading the list of |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
188 mounted file systems, and that function takes two arguments. (SVR4)]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
189 AC_CHECK_FUNCS([hasmntopt]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
190 fi |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
191 fi |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
192 |
1386 | 193 fi |
194 | |
2208
9bc7c7e2ae09
s/list_mounted_fs/ac_list_mounted_fs/
Jim Meyering <jim@meyering.net>
parents:
1977
diff
changeset
|
195 if test -z "$ac_list_mounted_fs"; then |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
196 # OSF/1, also (obsolete) Apple Darwin 1.3. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
197 # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h |
1386 | 198 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
199 AC_CACHE_CHECK([for getfsstat function], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
200 [fu_cv_sys_mounted_getfsstat], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
201 [AC_LINK_IFELSE( |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
202 [AC_LANG_PROGRAM([[ |
1386 | 203 #include <sys/types.h> |
3539
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
204 #if HAVE_STRUCT_FSSTAT_F_FSTYPENAME |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
205 # define FS_TYPE(Ent) ((Ent).f_fstypename) |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
206 #else |
e737d87d749a
(jm_LIST_MOUNTED_FILESYSTEMS): See if
Jim Meyering <jim@meyering.net>
parents:
3531
diff
changeset
|
207 # define FS_TYPE(Ent) mnt_names[(Ent).f_type] |
3531
15be8023a568
(jm_LIST_MOUNTED_FILESYSTEMS)
Jim Meyering <jim@meyering.net>
parents:
3529
diff
changeset
|
208 #endif |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
209 $getfsstat_includes |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
210 ]], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
211 [[struct statfs *stats; |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
212 int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
213 char *t = FS_TYPE (*stats); |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
214 ]])], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
215 [fu_cv_sys_mounted_getfsstat=yes], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
216 [fu_cv_sys_mounted_getfsstat=no]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
217 ]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
218 if test $fu_cv_sys_mounted_getfsstat = yes; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
219 ac_list_mounted_fs=found |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
220 AC_DEFINE([MOUNTED_GETFSSTAT], [1], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
221 [Define if there is a function named getfsstat for reading the |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
222 list of mounted file systems. (DEC Alpha running OSF/1)]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
223 fi |
1386 | 224 fi |
225 | |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
226 if test -z "$ac_list_mounted_fs"; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
227 # (obsolete) SVR3 |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
228 AC_CACHE_CHECK([for FIXME existence of three headers], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
229 [fu_cv_sys_mounted_fread_fstyp], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
230 [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ |
1386 | 231 #include <sys/statfs.h> |
232 #include <sys/fstyp.h> | |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
233 #include <mnttab.h> |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
234 ]])], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
235 [fu_cv_sys_mounted_fread_fstyp=yes], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
236 [fu_cv_sys_mounted_fread_fstyp=no]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
237 ]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
238 if test $fu_cv_sys_mounted_fread_fstyp = yes; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
239 ac_list_mounted_fs=found |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
240 AC_DEFINE([MOUNTED_FREAD_FSTYP], [1], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
241 [Define if (like SVR2) there is no specific function for reading the |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
242 list of mounted file systems, and your system has these header files: |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
243 <sys/fstyp.h> and <sys/statfs.h>. (SVR3)]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
244 fi |
1386 | 245 fi |
246 | |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
247 if test -z "$ac_list_mounted_fs"; then |
39907
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
248 # Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, also (obsolete) 4.4BSD. |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
249 # OSF/1 also has getmntinfo but is already handled above. |
39907
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
250 # We cannot use AC_CHECK_FUNCS([getmntinfo]) here, because at the linker |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
251 # level the function is sometimes called getmntinfo64 or getmntinfo$INODE64 |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
252 # on Mac OS X, __getmntinfo13 on NetBSD and Minix, _F64_getmntinfo on OSF/1. |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
253 AC_CACHE_CHECK([for getmntinfo function], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
254 [fu_cv_sys_mounted_getmntinfo], |
39907
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
255 [AC_LINK_IFELSE( |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
256 [AC_LANG_PROGRAM([[ |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
257 #if HAVE_SYS_PARAM_H |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
258 # include <sys/param.h> |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
259 #endif |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
260 #include <sys/types.h> |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
261 #if HAVE_SYS_MOUNT_H |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
262 # include <sys/mount.h> |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
263 #endif |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
264 #if HAVE_SYS_STATVFS_H |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
265 # include <sys/statvfs.h> |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
266 #endif |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
267 #include <stdlib.h> |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
268 ]], |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
269 [[int count = getmntinfo (NULL, MNT_WAIT); |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
270 ]])], |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
271 [fu_cv_sys_mounted_getmntinfo=yes], |
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
272 [fu_cv_sys_mounted_getmntinfo=no]) |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
273 ]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
274 if test $fu_cv_sys_mounted_getmntinfo = yes; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
275 AC_CACHE_CHECK([whether getmntinfo returns statvfs structures], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
276 [fu_cv_sys_mounted_getmntinfo2], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
277 [AC_COMPILE_IFELSE( |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
278 [AC_LANG_PROGRAM([[ |
7273
fadbb801a2a2
Avoid new build failure on FreeBSD 6.0.
Jim Meyering <jim@meyering.net>
parents:
7162
diff
changeset
|
279 #if HAVE_SYS_PARAM_H |
fadbb801a2a2
Avoid new build failure on FreeBSD 6.0.
Jim Meyering <jim@meyering.net>
parents:
7162
diff
changeset
|
280 # include <sys/param.h> |
fadbb801a2a2
Avoid new build failure on FreeBSD 6.0.
Jim Meyering <jim@meyering.net>
parents:
7162
diff
changeset
|
281 #endif |
7154
7a3549db58ef
* lib/mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6641
diff
changeset
|
282 #include <sys/types.h> |
7a3549db58ef
* lib/mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6641
diff
changeset
|
283 #if HAVE_SYS_MOUNT_H |
7a3549db58ef
* lib/mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6641
diff
changeset
|
284 # include <sys/mount.h> |
7a3549db58ef
* lib/mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6641
diff
changeset
|
285 #endif |
7a3549db58ef
* lib/mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6641
diff
changeset
|
286 #if HAVE_SYS_STATVFS_H |
7a3549db58ef
* lib/mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6641
diff
changeset
|
287 # include <sys/statvfs.h> |
7a3549db58ef
* lib/mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6641
diff
changeset
|
288 #endif |
15438
591ddd1ddd1a
Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents:
14191
diff
changeset
|
289 extern |
591ddd1ddd1a
Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents:
14191
diff
changeset
|
290 #ifdef __cplusplus |
591ddd1ddd1a
Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents:
14191
diff
changeset
|
291 "C" |
591ddd1ddd1a
Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents:
14191
diff
changeset
|
292 #endif |
591ddd1ddd1a
Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents:
14191
diff
changeset
|
293 int getmntinfo (struct statfs **, int); |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
294 ]], [])], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
295 [fu_cv_sys_mounted_getmntinfo2=no], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
296 [fu_cv_sys_mounted_getmntinfo2=yes]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
297 ]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
298 if test $fu_cv_sys_mounted_getmntinfo2 = no; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
299 # Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
300 ac_list_mounted_fs=found |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
301 AC_DEFINE([MOUNTED_GETMNTINFO], [1], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
302 [Define if there is a function named getmntinfo for reading the |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
303 list of mounted file systems and it returns an array of |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
304 'struct statfs'. (4.4BSD, Darwin)]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
305 else |
39907
b14bcf3a1610
mountlist: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
39906
diff
changeset
|
306 # NetBSD, Minix. |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
307 ac_list_mounted_fs=found |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
308 AC_DEFINE([MOUNTED_GETMNTINFO2], [1], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
309 [Define if there is a function named getmntinfo for reading the |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
310 list of mounted file systems and it returns an array of |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
311 'struct statvfs'. (NetBSD 3.0)]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
312 fi |
7154
7a3549db58ef
* lib/mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6641
diff
changeset
|
313 fi |
1386 | 314 fi |
315 | |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
316 if test -z "$ac_list_mounted_fs"; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
317 # (obsolete) Ultrix. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
318 AC_CACHE_CHECK([for getmnt function], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
319 [fu_cv_sys_mounted_getmnt], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
320 [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ |
1386 | 321 #include <sys/fs_types.h> |
11929
0e6b6e9d54d0
Replace uses of obsolete autoconf macros in Jim's modules.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11007
diff
changeset
|
322 #include <sys/mount.h>]])], |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
323 [fu_cv_sys_mounted_getmnt=yes], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
324 [fu_cv_sys_mounted_getmnt=no]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
325 ]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
326 if test $fu_cv_sys_mounted_getmnt = yes; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
327 ac_list_mounted_fs=found |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
328 AC_DEFINE([MOUNTED_GETMNT], [1], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
329 [Define if there is a function named getmnt for reading the list of |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
330 mounted file systems. (Ultrix)]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
331 fi |
1386 | 332 fi |
333 | |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
334 if test -z "$ac_list_mounted_fs"; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
335 # Haiku, also (obsolete) BeOS. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
336 AC_CHECK_FUNCS([next_dev fs_stat_dev]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
337 AC_CHECK_HEADERS([fs_info.h]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
338 AC_CACHE_CHECK([for BEOS mounted file system support functions], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
339 [fu_cv_sys_mounted_fs_stat_dev], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
340 [if test $ac_cv_header_fs_info_h = yes \ |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
341 && test $ac_cv_func_next_dev = yes \ |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
342 && test $ac_cv_func_fs_stat_dev = yes; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
343 fu_cv_sys_mounted_fs_stat_dev=yes |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
344 else |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
345 fu_cv_sys_mounted_fs_stat_dev=no |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
346 fi |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
347 ]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
348 if test $fu_cv_sys_mounted_fs_stat_dev = yes; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
349 ac_list_mounted_fs=found |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
350 AC_DEFINE([MOUNTED_FS_STAT_DEV], [1], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
351 [Define if there are functions named next_dev and fs_stat_dev for |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
352 reading the list of mounted file systems. (BeOS)]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
353 fi |
2454
99f53f89beeb
(jm_LIST_MOUNTED_FILESYSTEMS): Add BeOS support.
Jim Meyering <jim@meyering.net>
parents:
2452
diff
changeset
|
354 fi |
2452
074b568b76a2
(jm_LIST_MOUNTED_FILESYSTEMS): Add BeOS support.
Jim Meyering <jim@meyering.net>
parents:
2208
diff
changeset
|
355 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
356 if test -z "$ac_list_mounted_fs"; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
357 # (obsolete) SVR2. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
358 AC_CACHE_CHECK([whether it is possible to resort to fread on /etc/mnttab], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
359 [fu_cv_sys_mounted_fread], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
360 [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <mnttab.h>]])], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
361 [fu_cv_sys_mounted_fread=yes], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
362 [fu_cv_sys_mounted_fread=no]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
363 ]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
364 if test $fu_cv_sys_mounted_fread = yes; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
365 ac_list_mounted_fs=found |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
366 AC_DEFINE([MOUNTED_FREAD], [1], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
367 [Define if there is no specific function for reading the list of |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
368 mounted file systems. fread will be used to read /etc/mnttab. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
369 (SVR2) ]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
370 fi |
1386 | 371 fi |
372 | |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
373 if test -z "$ac_list_mounted_fs"; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
374 # Interix / BSD alike statvfs |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
375 # the code is really interix specific, so make sure, we're on it. |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
376 case "$host" in |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
377 *-interix*) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
378 AC_CHECK_FUNCS([statvfs]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
379 if test $ac_cv_func_statvfs = yes; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
380 ac_list_mounted_fs=found |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
381 AC_DEFINE([MOUNTED_INTERIX_STATVFS], [1], |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
382 [Define if we are on interix, and ought to use statvfs plus |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
383 some special knowledge on where mounted file systems can be |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
384 found. (Interix)]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
385 fi |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
386 ;; |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
387 esac |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
388 fi |
14191
00edc8eebaa5
mountlist: add support for Interix
Markus Duft <mduft@gentoo.org>
parents:
14079
diff
changeset
|
389 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
390 if test -z "$ac_list_mounted_fs"; then |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
391 AC_MSG_ERROR([could not determine how to read list of mounted file systems]) |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
392 # FIXME -- no need to abort building the whole package |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
393 # Can't build mountlist.c or anything that needs its functions |
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
394 fi |
1386 | 395 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
396 AS_IF([test $ac_list_mounted_fs = found], [$1], [$2]) |
2208
9bc7c7e2ae09
s/list_mounted_fs/ac_list_mounted_fs/
Jim Meyering <jim@meyering.net>
parents:
1977
diff
changeset
|
397 |
39906
39f09bed8945
Make better use of Autoconf.
Bruno Haible <bruno@clisp.org>
parents:
39905
diff
changeset
|
398 ]) |