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