summaryrefslogtreecommitdiffstats
path: root/m4/ls-mntd-fs.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/ls-mntd-fs.m4')
-rw-r--r--m4/ls-mntd-fs.m459
1 files changed, 41 insertions, 18 deletions
diff --git a/m4/ls-mntd-fs.m4 b/m4/ls-mntd-fs.m4
index c28466b..ed24386 100644
--- a/m4/ls-mntd-fs.m4
+++ b/m4/ls-mntd-fs.m4
@@ -1,13 +1,30 @@
1#serial 14 1#serial 20
2# How to list mounted file systems.
3
4# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
5# Foundation, Inc.
6#
7# This file is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
2 10
3dnl From Jim Meyering. 11dnl From Jim Meyering.
4dnl 12dnl
5dnl This is not pretty. I've just taken the autoconf code and wrapped 13dnl This is not pretty. I've just taken the autoconf code and wrapped
6dnl it in an AC_DEFUN. 14dnl it in an AC_DEFUN and made some other fixes.
7dnl 15dnl
8 16
9# jm_LIST_MOUNTED_FILESYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) 17# Replace Autoconf's AC_FUNC_GETMNTENT to work around a bug in Autoconf
10AC_DEFUN([jm_LIST_MOUNTED_FILESYSTEMS], 18# through Autoconf 2.59. We can remove this once we assume Autoconf 2.60
19# or later.
20AC_DEFUN([AC_FUNC_GETMNTENT],
21[# getmntent is in the standard C library on UNICOS, in -lsun on Irix 4,
22# -lseq on Dynix/PTX, -lgen on Unixware.
23AC_SEARCH_LIBS(getmntent, [sun seq gen], [AC_CHECK_FUNCS(getmntent)])
24])
25
26# gl_LIST_MOUNTED_FILE_SYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
27AC_DEFUN([gl_LIST_MOUNTED_FILE_SYSTEMS],
11 [ 28 [
12AC_CHECK_FUNCS(listmntent getmntinfo) 29AC_CHECK_FUNCS(listmntent getmntinfo)
13AC_CHECK_HEADERS_ONCE(sys/param.h) 30AC_CHECK_HEADERS_ONCE(sys/param.h)
@@ -16,7 +33,13 @@ AC_CHECK_HEADERS_ONCE(sys/param.h)
16# NGROUPS (as the array dimension for a struct member) without a definition. 33# NGROUPS (as the array dimension for a struct member) without a definition.
17AC_CHECK_HEADERS(sys/ucred.h, [], [], [#include <grp.h>]) 34AC_CHECK_HEADERS(sys/ucred.h, [], [], [#include <grp.h>])
18 35
19AC_CHECK_HEADERS(mntent.h sys/mount.h sys/fs_types.h) 36AC_CHECK_HEADERS(sys/mount.h, [], [],
37 [AC_INCLUDES_DEFAULT
38 [#if HAVE_SYS_PARAM_H
39 #include <sys/param.h>
40 #endif]])
41
42AC_CHECK_HEADERS(mntent.h sys/fs_types.h)
20 getfsstat_includes="\ 43 getfsstat_includes="\
21$ac_includes_default 44$ac_includes_default
22#if HAVE_SYS_PARAM_H 45#if HAVE_SYS_PARAM_H
@@ -35,11 +58,11 @@ $ac_includes_default
35" 58"
36AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes]) 59AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes])
37 60
38# Determine how to get the list of mounted filesystems. 61# Determine how to get the list of mounted file systems.
39ac_list_mounted_fs= 62ac_list_mounted_fs=
40 63
41# If the getmntent function is available but not in the standard library, 64# If the getmntent function is available but not in the standard library,
42# make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX). 65# make sure LIBS contains the appropriate -l option.
43AC_FUNC_GETMNTENT 66AC_FUNC_GETMNTENT
44 67
45# This test must precede the ones for getmntent because Unicos-9 is 68# This test must precede the ones for getmntent because Unicos-9 is
@@ -70,7 +93,7 @@ yes
70 ac_list_mounted_fs=found 93 ac_list_mounted_fs=found
71 AC_DEFINE(MOUNTED_LISTMNTENT, 1, 94 AC_DEFINE(MOUNTED_LISTMNTENT, 1,
72 [Define if there is a function named listmntent that can be used to 95 [Define if there is a function named listmntent that can be used to
73 list all mounted filesystems. (UNICOS)]) 96 list all mounted file systems. (UNICOS)])
74 fi 97 fi
75fi 98fi
76 99
@@ -86,7 +109,7 @@ if test -z "$ac_list_mounted_fs"; then
86 ac_list_mounted_fs=found 109 ac_list_mounted_fs=found
87 AC_DEFINE(MOUNTED_VMOUNT, 1, 110 AC_DEFINE(MOUNTED_VMOUNT, 1,
88 [Define if there is a function named mntctl that can be used to read 111 [Define if there is a function named mntctl that can be used to read
89 the list of mounted filesystems, and there is a system header file 112 the list of mounted file systems, and there is a system header file
90 that declares `struct vmount.' (AIX)]) 113 that declares `struct vmount.' (AIX)])
91 fi 114 fi
92fi 115fi
@@ -125,7 +148,7 @@ if test $ac_cv_func_getmntent = yes; then
125 ac_list_mounted_fs=found 148 ac_list_mounted_fs=found
126 AC_DEFINE(MOUNTED_GETMNTENT1, 1, 149 AC_DEFINE(MOUNTED_GETMNTENT1, 1,
127 [Define if there is a function named getmntent for reading the list 150 [Define if there is a function named getmntent for reading the list
128 of mounted filesystems, and that function takes a single argument. 151 of mounted file systems, and that function takes a single argument.
129 (4.3BSD, SunOS, HP-UX, Dynix, Irix)]) 152 (4.3BSD, SunOS, HP-UX, Dynix, Irix)])
130 fi 153 fi
131 fi 154 fi
@@ -142,7 +165,7 @@ if test $ac_cv_func_getmntent = yes; then
142 ac_list_mounted_fs=found 165 ac_list_mounted_fs=found
143 AC_DEFINE(MOUNTED_GETMNTENT2, 1, 166 AC_DEFINE(MOUNTED_GETMNTENT2, 1,
144 [Define if there is a function named getmntent for reading the list of 167 [Define if there is a function named getmntent for reading the list of
145 mounted filesystems, and that function takes two arguments. (SVR4)]) 168 mounted file systems, and that function takes two arguments. (SVR4)])
146 fi 169 fi
147 fi 170 fi
148 171
@@ -173,7 +196,7 @@ if test -z "$ac_list_mounted_fs"; then
173 ac_list_mounted_fs=found 196 ac_list_mounted_fs=found
174 AC_DEFINE(MOUNTED_GETFSSTAT, 1, 197 AC_DEFINE(MOUNTED_GETFSSTAT, 1,
175 [Define if there is a function named getfsstat for reading the 198 [Define if there is a function named getfsstat for reading the
176 list of mounted filesystems. (DEC Alpha running OSF/1)]) 199 list of mounted file systems. (DEC Alpha running OSF/1)])
177 fi 200 fi
178fi 201fi
179 202
@@ -192,7 +215,7 @@ if test -z "$ac_list_mounted_fs"; then
192 ac_list_mounted_fs=found 215 ac_list_mounted_fs=found
193 AC_DEFINE(MOUNTED_FREAD_FSTYP, 1, 216 AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
194 [Define if (like SVR2) there is no specific function for reading the 217 [Define if (like SVR2) there is no specific function for reading the
195 list of mounted filesystems, and your system has these header files: 218 list of mounted file systems, and your system has these header files:
196 <sys/fstyp.h> and <sys/statfs.h>. (SVR3)]) 219 <sys/fstyp.h> and <sys/statfs.h>. (SVR3)])
197 fi 220 fi
198fi 221fi
@@ -211,7 +234,7 @@ if test -z "$ac_list_mounted_fs"; then
211 ac_list_mounted_fs=found 234 ac_list_mounted_fs=found
212 AC_DEFINE(MOUNTED_GETMNTINFO, 1, 235 AC_DEFINE(MOUNTED_GETMNTINFO, 1,
213 [Define if there is a function named getmntinfo for reading the 236 [Define if there is a function named getmntinfo for reading the
214 list of mounted filesystems. (4.4BSD, Darwin)]) 237 list of mounted file systems. (4.4BSD, Darwin)])
215 fi 238 fi
216fi 239fi
217 240
@@ -229,7 +252,7 @@ if test -z "$ac_list_mounted_fs"; then
229 ac_list_mounted_fs=found 252 ac_list_mounted_fs=found
230 AC_DEFINE(MOUNTED_GETMNT, 1, 253 AC_DEFINE(MOUNTED_GETMNT, 1,
231 [Define if there is a function named getmnt for reading the list of 254 [Define if there is a function named getmnt for reading the list of
232 mounted filesystems. (Ultrix)]) 255 mounted file systems. (Ultrix)])
233 fi 256 fi
234fi 257fi
235 258
@@ -250,7 +273,7 @@ if test -z "$ac_list_mounted_fs"; then
250 ac_list_mounted_fs=found 273 ac_list_mounted_fs=found
251 AC_DEFINE(MOUNTED_FS_STAT_DEV, 1, 274 AC_DEFINE(MOUNTED_FS_STAT_DEV, 1,
252 [Define if there are functions named next_dev and fs_stat_dev for 275 [Define if there are functions named next_dev and fs_stat_dev for
253 reading the list of mounted filesystems. (BeOS)]) 276 reading the list of mounted file systems. (BeOS)])
254 fi 277 fi
255fi 278fi
256 279
@@ -266,13 +289,13 @@ if test -z "$ac_list_mounted_fs"; then
266 ac_list_mounted_fs=found 289 ac_list_mounted_fs=found
267 AC_DEFINE(MOUNTED_FREAD, 1, 290 AC_DEFINE(MOUNTED_FREAD, 1,
268 [Define if there is no specific function for reading the list of 291 [Define if there is no specific function for reading the list of
269 mounted filesystems. fread will be used to read /etc/mnttab. 292 mounted file systems. fread will be used to read /etc/mnttab.
270 (SVR2) ]) 293 (SVR2) ])
271 fi 294 fi
272fi 295fi
273 296
274if test -z "$ac_list_mounted_fs"; then 297if test -z "$ac_list_mounted_fs"; then
275 AC_MSG_ERROR([could not determine how to read list of mounted filesystems]) 298 AC_MSG_ERROR([could not determine how to read list of mounted file systems])
276 # FIXME -- no need to abort building the whole package 299 # FIXME -- no need to abort building the whole package
277 # Can't build mountlist.c or anything that needs its functions 300 # Can't build mountlist.c or anything that needs its functions
278fi 301fi