1dnl ######################################################################
2dnl Find NFS-specific mount(2) options (hex numbers)
3dnl Usage: AMU_CHECK_MNT2_NFS_OPT(<fs>)
4dnl Check if there is an entry for NFSMNT_<fs> in sys/mntent.h or
5dnl mntent.h, then define MNT2_NFS_OPT_<fs> to the hex number.
6AC_DEFUN([AMU_CHECK_MNT2_NFS_OPT],
7[
8# what name to give to the fs
9ac_fs_name=$1
10# store variable name of fs
11ac_upcase_fs_name=`echo $ac_fs_name | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12ac_safe=MNT2_NFS_OPT_$ac_upcase_fs_name
13# check for cache and set it if needed
14AMU_CACHE_CHECK_DYNAMIC(for NFS-specific mount(2) option $ac_fs_name,
15ac_cv_mnt2_nfs_opt_$ac_fs_name,
16[
17# undefine by default
18eval "ac_cv_mnt2_nfs_opt_$ac_fs_name=notfound"
19value=notfound
20
21# first try NFSMNT_* (most systems)
22if test "$value" = notfound
23then
24AMU_EXPAND_CPP_HEX(
25AMU_MOUNT_HEADERS
26, NFSMNT_$ac_upcase_fs_name)
27fi
28
29# next try NFS_MOUNT_* (linux)
30if test "$value" = notfound
31then
32AMU_EXPAND_CPP_HEX(
33AMU_MOUNT_HEADERS
34, NFS_MOUNT_$ac_upcase_fs_name)
35fi
36
37# set cache variable to value
38eval "ac_cv_mnt2_nfs_opt_$ac_fs_name=$value"
39])
40# outside cache check, if ok, define macro
41ac_tmp=`eval echo '$''{ac_cv_mnt2_nfs_opt_'$ac_fs_name'}'`
42if test "${ac_tmp}" != notfound
43then
44  AC_DEFINE_UNQUOTED($ac_safe, $ac_tmp)
45fi
46])
47dnl ======================================================================
48
49dnl ######################################################################
50dnl run AMU_CHECK_MNT2_NFS_OPT on each argument given
51dnl Usage: AMU_CHECK_MNT2_NFS_OPTS(arg arg arg ...)
52AC_DEFUN([AMU_CHECK_MNT2_NFS_OPTS],
53[
54for ac_tmp_arg in $1
55do
56AMU_CHECK_MNT2_NFS_OPT($ac_tmp_arg)
57done
58])
59dnl ======================================================================
60