diff options
Diffstat (limited to 'm4/ls-mntd-fs.m4')
| -rw-r--r-- | m4/ls-mntd-fs.m4 | 59 |
1 files changed, 41 insertions, 18 deletions
diff --git a/m4/ls-mntd-fs.m4 b/m4/ls-mntd-fs.m4 index c28466bb..ed243861 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 | ||
| 3 | dnl From Jim Meyering. | 11 | dnl From Jim Meyering. |
| 4 | dnl | 12 | dnl |
| 5 | dnl This is not pretty. I've just taken the autoconf code and wrapped | 13 | dnl This is not pretty. I've just taken the autoconf code and wrapped |
| 6 | dnl it in an AC_DEFUN. | 14 | dnl it in an AC_DEFUN and made some other fixes. |
| 7 | dnl | 15 | dnl |
| 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 |
| 10 | AC_DEFUN([jm_LIST_MOUNTED_FILESYSTEMS], | 18 | # through Autoconf 2.59. We can remove this once we assume Autoconf 2.60 |
| 19 | # or later. | ||
| 20 | AC_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. | ||
| 23 | AC_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]]) | ||
| 27 | AC_DEFUN([gl_LIST_MOUNTED_FILE_SYSTEMS], | ||
| 11 | [ | 28 | [ |
| 12 | AC_CHECK_FUNCS(listmntent getmntinfo) | 29 | AC_CHECK_FUNCS(listmntent getmntinfo) |
| 13 | AC_CHECK_HEADERS_ONCE(sys/param.h) | 30 | AC_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. |
| 17 | AC_CHECK_HEADERS(sys/ucred.h, [], [], [#include <grp.h>]) | 34 | AC_CHECK_HEADERS(sys/ucred.h, [], [], [#include <grp.h>]) |
| 18 | 35 | ||
| 19 | AC_CHECK_HEADERS(mntent.h sys/mount.h sys/fs_types.h) | 36 | AC_CHECK_HEADERS(sys/mount.h, [], [], |
| 37 | [AC_INCLUDES_DEFAULT | ||
| 38 | [#if HAVE_SYS_PARAM_H | ||
| 39 | #include <sys/param.h> | ||
| 40 | #endif]]) | ||
| 41 | |||
| 42 | AC_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 | " |
| 36 | AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes]) | 59 | AC_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. |
| 39 | ac_list_mounted_fs= | 62 | ac_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. |
| 43 | AC_FUNC_GETMNTENT | 66 | AC_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 |
| 75 | fi | 98 | fi |
| 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 |
| 92 | fi | 115 | fi |
| @@ -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 |
| 178 | fi | 201 | fi |
| 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 |
| 198 | fi | 221 | fi |
| @@ -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 |
| 216 | fi | 239 | fi |
| 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 |
| 234 | fi | 257 | fi |
| 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 |
| 255 | fi | 278 | fi |
| 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 |
| 272 | fi | 295 | fi |
| 273 | 296 | ||
| 274 | if test -z "$ac_list_mounted_fs"; then | 297 | if 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 |
| 278 | fi | 301 | fi |
