1dnl ######################################################################
2dnl check the string type of the name of a filesystem mount table entry
3dnl option.
4dnl Usage: AMU_CHECK_MNTTAB_OPT(<fs>)
5dnl Check if there is an entry for MNTOPT_<fs> in sys/mntent.h or mntent.h
6dnl define MNTTAB_OPT_<fs> to the string name (e.g., "ro").
7AC_DEFUN([AMU_CHECK_MNTTAB_OPT],
8[
9# what name to give to the fs
10ac_fs_name=$1
11# store variable name of fs
12ac_upcase_fs_name=`echo $ac_fs_name | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
13ac_safe=MNTTAB_OPT_$ac_upcase_fs_name
14# check for cache and set it if needed
15AMU_CACHE_CHECK_DYNAMIC(for mount table option $ac_fs_name,
16ac_cv_mnttab_opt_$ac_fs_name,
17[
18# undefine by default
19eval "ac_cv_mnttab_opt_$ac_fs_name=notfound"
20# and look to see if it was found
21AMU_EXPAND_CPP_STRING(
22AMU_MOUNT_HEADERS
23, MNTOPT_$ac_upcase_fs_name)
24# set cache variable to value
25if test "${value}" != notfound
26then
27  eval "ac_cv_mnttab_opt_$ac_fs_name=\\\"$value\\\""
28else
29  eval "ac_cv_mnttab_opt_$ac_fs_name=$value"
30fi
31dnl DO NOT CHECK FOR MNT_* b/c bsd44 systems don't use /etc/mnttab,
32])
33# outside cache check, if ok, define macro
34ac_tmp=`eval echo '$''{ac_cv_mnttab_opt_'$ac_fs_name'}'`
35if test "${ac_tmp}" != notfound
36then
37  AC_DEFINE_UNQUOTED($ac_safe, $ac_tmp)
38fi
39])
40dnl ======================================================================
41
42dnl ######################################################################
43dnl run AMU_CHECK_MNTTAB_OPT on each argument given
44dnl Usage: AMU_CHECK_MNTTAB_OPTS(arg arg arg ...)
45AC_DEFUN([AMU_CHECK_MNTTAB_OPTS],
46[
47for ac_tmp_arg in $1
48do
49AMU_CHECK_MNTTAB_OPT($ac_tmp_arg)
50done
51])
52dnl ======================================================================
53