1dnl ###################################################################### 2dnl Find generic mount(2) options (hex numbers) 3dnl Usage: AMU_CHECK_MNT2_GEN_OPT(<fs>) 4dnl Check if there is an entry for MS_<fs>, MNT_<fs>, or M_<fs> 5dnl (in that order) in mntent.h, sys/mntent.h, or mount.h... 6dnl then define MNT2_GEN_OPT_<fs> to the hex number. 7AC_DEFUN([AMU_CHECK_MNT2_GEN_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=MNT2_GEN_OPT_$ac_upcase_fs_name 14# check for cache and set it if needed 15AMU_CACHE_CHECK_DYNAMIC(for generic mount(2) option $ac_fs_name, 16ac_cv_mnt2_gen_opt_$ac_fs_name, 17[ 18# undefine by default 19eval "ac_cv_mnt2_gen_opt_$ac_fs_name=notfound" 20value=notfound 21 22# first, try MS_* (most systems). Must be the first test! 23if test "$value" = notfound 24then 25AMU_EXPAND_CPP_HEX( 26AMU_MOUNT_HEADERS 27, MS_$ac_upcase_fs_name) 28fi 29 30# if failed, try MNT_* (bsd44 systems) 31if test "$value" = notfound 32then 33AMU_EXPAND_CPP_HEX( 34AMU_MOUNT_HEADERS 35, MNT_$ac_upcase_fs_name) 36fi 37 38# if failed, try MS_* as an integer (linux systems) 39if test "$value" = notfound 40then 41AMU_EXPAND_CPP_INT( 42AMU_MOUNT_HEADERS 43, MS_$ac_upcase_fs_name) 44fi 45 46# If failed try M_* (must be last test since svr4 systems define M_DATA etc. 47# in <sys/stream.h> 48# This test was off for now, because of the conflicts with other systems. 49# but I turned it back on by faking the inclusion of <sys/stream.h> already. 50if test "$value" = notfound 51then 52AMU_EXPAND_CPP_HEX( 53#ifndef _sys_stream_h 54# define _sys_stream_h 55#endif /* not _sys_stream_h */ 56#ifndef _SYS_STREAM_H 57# define _SYS_STREAM_H 58#endif /* not _SYS_STREAM_H */ 59AMU_MOUNT_HEADERS 60, M_$ac_upcase_fs_name) 61fi 62 63# set cache variable to value 64eval "ac_cv_mnt2_gen_opt_$ac_fs_name=$value" 65]) 66# outside cache check, if ok, define macro 67ac_tmp=`eval echo '$''{ac_cv_mnt2_gen_opt_'$ac_fs_name'}'` 68if test "${ac_tmp}" != notfound 69then 70 AC_DEFINE_UNQUOTED($ac_safe, $ac_tmp) 71fi 72]) 73dnl ====================================================================== 74 75dnl ###################################################################### 76dnl run AMU_CHECK_MNT2_GEN_OPT on each argument given 77dnl Usage: AMU_CHECK_MNT2_GEN_OPTS(arg arg arg ...) 78AC_DEFUN([AMU_CHECK_MNT2_GEN_OPTS], 79[ 80for ac_tmp_arg in $1 81do 82AMU_CHECK_MNT2_GEN_OPT($ac_tmp_arg) 83done 84]) 85dnl ====================================================================== 86