Mercurial > gnulib
annotate m4/mountlist.m4 @ 40153:878ddb87671b
mountlist: Merge two .m4 files.
* m4/mountlist.m4 (gl_MOUNTLIST): Inline gl_LIST_MOUNTED_FILE_SYSTEMS.
(AC_FUNC_GETMNTENT): Move to here, from m4/ls-mntd-fs.m4.
* m4/ls-mntd-fs.m4: Remove file.
* modules/mountlist (Files): Remove m4/ls-mntd-fs.m4.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 27 Jan 2019 11:45:28 +0100 |
parents | b06060465f09 |
children |
rev | line source |
---|---|
40153
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
1 # serial 13 |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
2 dnl Copyright (C) 2002-2006, 2009-2019 Free Software Foundation, Inc. |
5611
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5159
diff
changeset
|
3 dnl 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:
5159
diff
changeset
|
4 dnl 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:
5159
diff
changeset
|
5 dnl with or without modifications, as long as this notice is preserved. |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 |
40153
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
7 dnl From Jim Meyering. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
8 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
9 AC_PREREQ([2.60]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
10 |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 AC_DEFUN([gl_MOUNTLIST], |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 [ |
40153
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
13 AC_REQUIRE([AC_CANONICAL_HOST]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
14 AC_CHECK_FUNCS([listmntent]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
15 AC_CHECK_HEADERS_ONCE([sys/param.h sys/statvfs.h]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
16 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
17 # We must include grp.h before ucred.h on OSF V4.0, since ucred.h uses |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
18 # NGROUPS (as the array dimension for a struct member) without a definition. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
19 AC_CHECK_HEADERS([sys/ucred.h], [], [], [#include <grp.h>]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
20 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
21 AC_CHECK_HEADERS([sys/mount.h], [], [], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
22 [AC_INCLUDES_DEFAULT |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
23 [#if HAVE_SYS_PARAM_H |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
24 #include <sys/param.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
25 #endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
26 ]]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
27 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
28 AC_CHECK_HEADERS([mntent.h sys/fs_types.h]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
29 getfsstat_includes="\ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
30 $ac_includes_default |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
31 #if HAVE_SYS_PARAM_H |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
32 # include <sys/param.h> /* needed by powerpc-apple-darwin1.3.7 */ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
33 #endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
34 #if HAVE_SYS_UCRED_H |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
35 # include <grp.h> /* needed for definition of NGROUPS */ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
36 # include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
37 #endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
38 #if HAVE_SYS_MOUNT_H |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
39 # include <sys/mount.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
40 #endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
41 #if HAVE_SYS_FS_TYPES_H |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
42 # include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
43 #endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
44 " |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
45 AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
46 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
47 # Determine how to get the list of mounted file systems. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
48 ac_list_mounted_fs= |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
49 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
50 # If the getmntent function is available but not in the standard library, |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
51 # make sure LIBS contains the appropriate -l option. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
52 AC_FUNC_GETMNTENT |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
53 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
54 if test -z "$ac_list_mounted_fs"; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
55 # AIX. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
56 AC_CACHE_CHECK([for mntctl function and struct vmount], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
57 [fu_cv_sys_mounted_vmount], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
58 [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <fshelp.h>]])], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
59 [fu_cv_sys_mounted_vmount=yes], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
60 [fu_cv_sys_mounted_vmount=no])]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
61 if test $fu_cv_sys_mounted_vmount = yes; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
62 ac_list_mounted_fs=found |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
63 AC_DEFINE([MOUNTED_VMOUNT], [1], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
64 [Define if there is a function named mntctl that can be used to read |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
65 the list of mounted file systems, and there is a system header file |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
66 that declares 'struct vmount'. (AIX)]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
67 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
68 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
69 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
70 if test $ac_cv_func_getmntent = yes; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
71 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
72 # This system has the getmntent function. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
73 # Determine whether it's the one-argument variant or the two-argument one. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
74 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
75 if test -z "$ac_list_mounted_fs"; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
76 # glibc, HP-UX, IRIX, Cygwin, Android, also (obsolete) 4.3BSD, SunOS. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
77 AC_CACHE_CHECK([for one-argument getmntent function], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
78 [fu_cv_sys_mounted_getmntent1], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
79 [AC_COMPILE_IFELSE( |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
80 [AC_LANG_PROGRAM([[ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
81 /* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
82 #include <stdio.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
83 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
84 #include <mntent.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
85 #if defined __ANDROID__ /* Android */ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
86 # undef MOUNTED |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
87 # define MOUNTED "/proc/mounts" |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
88 #elif !defined MOUNTED |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
89 # if defined _PATH_MOUNTED /* GNU libc */ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
90 # define MOUNTED _PATH_MOUNTED |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
91 # endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
92 # if defined MNT_MNTTAB /* HP-UX. */ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
93 # define MOUNTED MNT_MNTTAB |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
94 # endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
95 #endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
96 ]], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
97 [[struct mntent *mnt = 0; char *table = MOUNTED; |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
98 if (sizeof mnt && sizeof table) return 0; |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
99 ]])], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
100 [fu_cv_sys_mounted_getmntent1=yes], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
101 [fu_cv_sys_mounted_getmntent1=no]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
102 ]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
103 if test $fu_cv_sys_mounted_getmntent1 = yes; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
104 ac_list_mounted_fs=found |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
105 AC_DEFINE([MOUNTED_GETMNTENT1], [1], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
106 [Define if there is a function named getmntent for reading the list |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
107 of mounted file systems, and that function takes a single argument. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
108 (4.3BSD, SunOS, HP-UX, Irix)]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
109 AC_CHECK_FUNCS([setmntent endmntent hasmntopt]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
110 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
111 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
112 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
113 if test -z "$ac_list_mounted_fs"; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
114 # Solaris >= 8. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
115 AC_CACHE_CHECK([for getextmntent function], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
116 [fu_cv_sys_mounted_getextmntent], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
117 [AC_EGREP_HEADER([getextmntent], [sys/mnttab.h], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
118 [fu_cv_sys_mounted_getextmntent=yes], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
119 [fu_cv_sys_mounted_getextmntent=no])]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
120 if test $fu_cv_sys_mounted_getextmntent = yes; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
121 ac_list_mounted_fs=found |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
122 AC_DEFINE([MOUNTED_GETEXTMNTENT], [1], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
123 [Define if there is a function named getextmntent for reading the list |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
124 of mounted file systems. (Solaris)]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
125 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
126 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
127 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
128 if test -z "$ac_list_mounted_fs"; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
129 # Solaris < 8, also (obsolete) SVR4. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
130 # Solaris >= 8 has the two-argument getmntent but is already handled above. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
131 AC_CACHE_CHECK([for two-argument getmntent function], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
132 [fu_cv_sys_mounted_getmntent2], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
133 [AC_EGREP_HEADER([getmntent], [sys/mnttab.h], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
134 [fu_cv_sys_mounted_getmntent2=yes], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
135 [fu_cv_sys_mounted_getmntent2=no]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
136 ]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
137 if test $fu_cv_sys_mounted_getmntent2 = yes; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
138 ac_list_mounted_fs=found |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
139 AC_DEFINE([MOUNTED_GETMNTENT2], [1], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
140 [Define if there is a function named getmntent for reading the list of |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
141 mounted file systems, and that function takes two arguments. (SVR4)]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
142 AC_CHECK_FUNCS([hasmntopt]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
143 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
144 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
145 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
146 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
147 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
148 if test -z "$ac_list_mounted_fs"; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
149 # OSF/1, also (obsolete) Apple Darwin 1.3. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
150 # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
151 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
152 AC_CACHE_CHECK([for getfsstat function], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
153 [fu_cv_sys_mounted_getfsstat], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
154 [AC_LINK_IFELSE( |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
155 [AC_LANG_PROGRAM([[ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
156 #include <sys/types.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
157 #if HAVE_STRUCT_FSSTAT_F_FSTYPENAME |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
158 # define FS_TYPE(Ent) ((Ent).f_fstypename) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
159 #else |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
160 # define FS_TYPE(Ent) mnt_names[(Ent).f_type] |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
161 #endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
162 $getfsstat_includes |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
163 ]], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
164 [[struct statfs *stats; |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
165 int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
166 char *t = FS_TYPE (*stats); |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
167 ]])], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
168 [fu_cv_sys_mounted_getfsstat=yes], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
169 [fu_cv_sys_mounted_getfsstat=no]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
170 ]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
171 if test $fu_cv_sys_mounted_getfsstat = yes; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
172 ac_list_mounted_fs=found |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
173 AC_DEFINE([MOUNTED_GETFSSTAT], [1], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
174 [Define if there is a function named getfsstat for reading the |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
175 list of mounted file systems. (DEC Alpha running OSF/1)]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
176 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
177 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
178 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
179 if test -z "$ac_list_mounted_fs"; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
180 # (obsolete) SVR3 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
181 AC_CACHE_CHECK([for FIXME existence of three headers], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
182 [fu_cv_sys_mounted_fread_fstyp], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
183 [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
184 #include <sys/statfs.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
185 #include <sys/fstyp.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
186 #include <mnttab.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
187 ]])], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
188 [fu_cv_sys_mounted_fread_fstyp=yes], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
189 [fu_cv_sys_mounted_fread_fstyp=no]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
190 ]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
191 if test $fu_cv_sys_mounted_fread_fstyp = yes; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
192 ac_list_mounted_fs=found |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
193 AC_DEFINE([MOUNTED_FREAD_FSTYP], [1], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
194 [Define if (like SVR2) there is no specific function for reading the |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
195 list of mounted file systems, and your system has these header files: |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
196 <sys/fstyp.h> and <sys/statfs.h>. (SVR3)]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
197 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
198 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
199 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
200 if test -z "$ac_list_mounted_fs"; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
201 # Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, also (obsolete) 4.4BSD. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
202 # OSF/1 also has getmntinfo but is already handled above. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
203 # We cannot use AC_CHECK_FUNCS([getmntinfo]) here, because at the linker |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
204 # level the function is sometimes called getmntinfo64 or getmntinfo$INODE64 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
205 # on Mac OS X, __getmntinfo13 on NetBSD and Minix, _F64_getmntinfo on OSF/1. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
206 AC_CACHE_CHECK([for getmntinfo function], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
207 [fu_cv_sys_mounted_getmntinfo], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
208 [AC_LINK_IFELSE( |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
209 [AC_LANG_PROGRAM([[ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
210 #if HAVE_SYS_PARAM_H |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
211 # include <sys/param.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
212 #endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
213 #include <sys/types.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
214 #if HAVE_SYS_MOUNT_H |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
215 # include <sys/mount.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
216 #endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
217 #if HAVE_SYS_STATVFS_H |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
218 # include <sys/statvfs.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
219 #endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
220 #include <stdlib.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
221 ]], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
222 [[int count = getmntinfo (NULL, MNT_WAIT); |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
223 ]])], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
224 [fu_cv_sys_mounted_getmntinfo=yes], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
225 [fu_cv_sys_mounted_getmntinfo=no]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
226 ]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
227 if test $fu_cv_sys_mounted_getmntinfo = yes; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
228 AC_CACHE_CHECK([whether getmntinfo returns statvfs structures], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
229 [fu_cv_sys_mounted_getmntinfo2], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
230 [AC_COMPILE_IFELSE( |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
231 [AC_LANG_PROGRAM([[ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
232 #if HAVE_SYS_PARAM_H |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
233 # include <sys/param.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
234 #endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
235 #include <sys/types.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
236 #if HAVE_SYS_MOUNT_H |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
237 # include <sys/mount.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
238 #endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
239 #if HAVE_SYS_STATVFS_H |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
240 # include <sys/statvfs.h> |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
241 #endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
242 extern |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
243 #ifdef __cplusplus |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
244 "C" |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
245 #endif |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
246 int getmntinfo (struct statfs **, int); |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
247 ]], [])], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
248 [fu_cv_sys_mounted_getmntinfo2=no], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
249 [fu_cv_sys_mounted_getmntinfo2=yes]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
250 ]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
251 if test $fu_cv_sys_mounted_getmntinfo2 = no; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
252 # Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
253 ac_list_mounted_fs=found |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
254 AC_DEFINE([MOUNTED_GETMNTINFO], [1], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
255 [Define if there is a function named getmntinfo for reading the |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
256 list of mounted file systems and it returns an array of |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
257 'struct statfs'. (4.4BSD, Darwin)]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
258 else |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
259 # NetBSD, Minix. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
260 ac_list_mounted_fs=found |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
261 AC_DEFINE([MOUNTED_GETMNTINFO2], [1], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
262 [Define if there is a function named getmntinfo for reading the |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
263 list of mounted file systems and it returns an array of |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
264 'struct statvfs'. (NetBSD 3.0)]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
265 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
266 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
267 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
268 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
269 if test -z "$ac_list_mounted_fs"; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
270 # Haiku, also (obsolete) BeOS. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
271 AC_CHECK_FUNCS([next_dev fs_stat_dev]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
272 AC_CHECK_HEADERS([fs_info.h]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
273 AC_CACHE_CHECK([for BEOS mounted file system support functions], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
274 [fu_cv_sys_mounted_fs_stat_dev], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
275 [if test $ac_cv_header_fs_info_h = yes \ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
276 && test $ac_cv_func_next_dev = yes \ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
277 && test $ac_cv_func_fs_stat_dev = yes; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
278 fu_cv_sys_mounted_fs_stat_dev=yes |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
279 else |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
280 fu_cv_sys_mounted_fs_stat_dev=no |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
281 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
282 ]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
283 if test $fu_cv_sys_mounted_fs_stat_dev = yes; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
284 ac_list_mounted_fs=found |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
285 AC_DEFINE([MOUNTED_FS_STAT_DEV], [1], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
286 [Define if there are functions named next_dev and fs_stat_dev for |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
287 reading the list of mounted file systems. (BeOS)]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
288 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
289 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
290 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
291 if test -z "$ac_list_mounted_fs"; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
292 # Interix / BSD alike statvfs |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
293 # the code is really interix specific, so make sure, we're on it. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
294 case "$host" in |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
295 *-interix*) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
296 AC_CHECK_FUNCS([statvfs]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
297 if test $ac_cv_func_statvfs = yes; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
298 ac_list_mounted_fs=found |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
299 AC_DEFINE([MOUNTED_INTERIX_STATVFS], [1], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
300 [Define if we are on interix, and ought to use statvfs plus |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
301 some special knowledge on where mounted file systems can be |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
302 found. (Interix)]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
303 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
304 ;; |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
305 esac |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
306 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
307 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
308 if test -z "$ac_list_mounted_fs"; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
309 AC_MSG_ERROR([could not determine how to read list of mounted file systems]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
310 # FIXME -- no need to abort building the whole package |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
311 # Can't build mountlist.c or anything that needs its functions |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
312 fi |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
313 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
314 if test $ac_list_mounted_fs = found; then |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
315 gl_cv_list_mounted_fs=yes |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
316 else |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
317 gl_cv_list_mounted_fs=no |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
318 fi |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
319 ]) |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
320 |
40153
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
321 # Prerequisites of lib/mountlist.c not done by gl_MOUNTLIST. |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
322 AC_DEFUN([gl_PREREQ_MOUNTLIST_EXTRA], |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
323 [ |
40153
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
324 dnl Note gl_MOUNTLIST checks for mntent.h, not sys/mntent.h. |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
7172
diff
changeset
|
325 AC_CHECK_HEADERS([sys/mntent.h]) |
18419
d81946484cce
mountlist: include sysmacros.h for glibc
Eric Blake <eblake@redhat.com>
parents:
18189
diff
changeset
|
326 AC_HEADER_MAJOR()dnl for use of makedev () |
5016
7141ea4946af
Change jm_ to gl_ in AC_DEFINE'd names. Update all uses.
Jim Meyering <jim@meyering.net>
parents:
4666
diff
changeset
|
327 gl_FSTYPENAME |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
328 ]) |
40153
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
329 |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
330 # Replace Autoconf's AC_FUNC_GETMNTENT to omit checks that are unnecessary |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
331 # nowadays. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
332 AC_DEFUN([AC_FUNC_GETMNTENT], |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
333 [ |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
334 # getmntent is in the standard C library on UNICOS, in -lsun on Irix 4, |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
335 # -lgen on Unixware. |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
336 AC_SEARCH_LIBS([getmntent], [sun gen]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
337 AC_CHECK_FUNCS([getmntent]) |
878ddb87671b
mountlist: Merge two .m4 files.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
338 ]) |