add udf glue.
authorChristos Zoulas <christos@zoulas.com>
Tue, 6 Jan 2009 19:08:54 +0000 (19:08 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 6 Jan 2009 19:08:54 +0000 (19:08 +0000)
m4/macros/check_mnt2_udf_opt.m4 [new file with mode: 0644]
m4/macros/header_templates.m4
m4/macros/try_compile_anyfs.m4
m4/macros/type_udf_args.m4 [new file with mode: 0644]

diff --git a/m4/macros/check_mnt2_udf_opt.m4 b/m4/macros/check_mnt2_udf_opt.m4
new file mode 100644 (file)
index 0000000..80e3811
--- /dev/null
@@ -0,0 +1,53 @@
+dnl ######################################################################
+dnl Find UDF-specific mount(2) options (hex numbers)
+dnl Usage: AMU_CHECK_MNT2_UDF_OPT(<fs>)
+dnl Check if there is an entry for MS_<fs> or M_<fs> in sys/mntent.h or
+dnl mntent.h, then define MNT2_UDF_OPT_<fs> to the hex number.
+AC_DEFUN([AMU_CHECK_MNT2_UDF_OPT],
+[
+# what name to give to the fs
+ac_fs_name=$1
+# store variable name of fs
+ac_upcase_fs_name=`echo $ac_fs_name | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ac_safe=MNT2_UDF_OPT_$ac_upcase_fs_name
+# check for cache and set it if needed
+AMU_CACHE_CHECK_DYNAMIC(for UDF-specific mount(2) option $ac_fs_name,
+ac_cv_mnt2_udf_opt_$ac_fs_name,
+[
+# undefine by default
+eval "ac_cv_mnt2_udf_opt_$ac_fs_name=notfound"
+value=notfound
+
+# XXX - tests for other systems need to be added here!
+
+# if failed, try UDFMNT_* as a hex (netbsd systems)
+if test "$value" = notfound
+then
+AMU_EXPAND_CPP_HEX(
+AMU_MOUNT_HEADERS
+, UDFMNT_$ac_upcase_fs_name)
+fi
+
+# set cache variable to value
+eval "ac_cv_mnt2_udf_opt_$ac_fs_name=$value"
+])
+# outside cache check, if ok, define macro
+ac_tmp=`eval echo '$''{ac_cv_mnt2_udf_opt_'$ac_fs_name'}'`
+if test "${ac_tmp}" != notfound
+then
+  AC_DEFINE_UNQUOTED($ac_safe, $ac_tmp)
+fi
+])
+dnl ======================================================================
+
+dnl ######################################################################
+dnl run AMU_CHECK_MNT2_UDF_OPT on each argument given
+dnl Usage: AMU_CHECK_MNT2_UDF_OPTS(arg arg arg ...)
+AC_DEFUN([AMU_CHECK_MNT2_UDF_OPTS],
+[
+for ac_tmp_arg in $1
+do
+AMU_CHECK_MNT2_UDF_OPT($ac_tmp_arg)
+done
+])
+dnl ======================================================================
index 93587be05310355c1203f144ec118853e6517c4b..882c55bfd04f9922218111ad12566e740d24a79d 100644 (file)
@@ -97,6 +97,9 @@ AH_TEMPLATE([HAVE_FS_HSFS],
 AH_TEMPLATE([HAVE_FS_CDFS],
 [Define if have CDFS filesystem])
 
+AH_TEMPLATE([HAVE_FS_UDF],
+[Define if have UDF filesystem])
+
 AH_TEMPLATE([HAVE_FS_TFS],
 [Define if have TFS filesystem])
 
@@ -151,6 +154,9 @@ AH_TEMPLATE([MOUNT_TYPE_LOFS],
 AH_TEMPLATE([MOUNT_TYPE_CDFS],
 [Mount(2) type/name for CDFS filesystem])
 
+AH_TEMPLATE([MOUNT_TYPE_UDF],
+[Mount(2) type/name for UDF filesystem])
+
 AH_TEMPLATE([MOUNT_TYPE_TFS],
 [Mount(2) type/name for TFS filesystem])
 
@@ -208,6 +214,9 @@ AH_TEMPLATE([MNTTAB_TYPE_LOFS],
 AH_TEMPLATE([MNTTAB_TYPE_CDFS],
 [Mount-table entry name for CDFS filesystem])
 
+AH_TEMPLATE([MNTTAB_TYPE_UDF],
+[Mount-table entry name for UDF filesystem])
+
 AH_TEMPLATE([MNTTAB_TYPE_TFS],
 [Mount-table entry name for TFS filesystem])
 
@@ -728,6 +737,9 @@ AH_TEMPLATE([MNT2_CDFS_OPT_RRCASEINS],
 AH_TEMPLATE([MNT2_CDFS_OPT_RRIP],
 [Use Rock Ridge Interchange Protocol (RRIP) extensions])
 
+AH_TEMPLATE([MNT2_UDF_OPT_CLOSESESSION],
+[Close session when unmounting])
+
 AH_TEMPLATE([MNT2_PCFS_OPT_LONGNAME],
 [Force Win95 long names])
 
@@ -884,6 +896,9 @@ AH_TEMPLATE([lofs_args_t],
 AH_TEMPLATE([cdfs_args_t],
 [Define a type for the cdfs_args structure])
 
+AH_TEMPLATE([udf_args_t],
+[Define a type for the udf_args structure])
+
 AH_TEMPLATE([mfs_args_t],
 [Define a type for the mfs_args structure])
 
index f797abe42668cee1826ef1b1057566361213f0f8..22a5719823733f3e1d61212b8a29a84c27c7d9cc 100644 (file)
@@ -176,6 +176,10 @@ struct netexport { int this_is_SO_wrong; }; /* for bsdi-2.1 */
 #ifdef HAVE_ISOFS_CD9660_CD9660_MOUNT_H
 # include <isofs/cd9660/cd9660_mount.h>
 #endif /* HAVE_ISOFS_CD9660_CD9660_MOUNT_H */
+
+#ifdef HAVE_FS_UDF_UDF_MOUNT_H
+# include <fs/udf/udf_mount.h>
+#endif /* HAVE_FS_UDF_UDF_MOUNT_H */
 ], [$1], [$2], [$3])
 ])
 dnl ======================================================================
diff --git a/m4/macros/type_udf_args.m4 b/m4/macros/type_udf_args.m4
new file mode 100644 (file)
index 0000000..9c98867
--- /dev/null
@@ -0,0 +1,25 @@
+dnl ######################################################################
+dnl Find the correct type for UDF mount(2) arguments structure
+AC_DEFUN([AMU_TYPE_UDF_ARGS],
+[
+AC_CACHE_CHECK(for structure type of udf mount(2) arguments,
+ac_cv_type_udf_args,
+[
+# set to a default value
+ac_cv_type_udf_args=notfound
+
+# look for "struct udf_args"
+if test "$ac_cv_type_udf_args" = notfound
+then
+AC_TRY_COMPILE_ANYFS(
+[ struct udf_args a;
+], ac_cv_type_udf_args="struct udf_args", ac_cv_type_udf_args=notfound)
+fi
+
+])
+if test "$ac_cv_type_udf_args" != notfound
+then
+  AC_DEFINE_UNQUOTED(udf_args_t, $ac_cv_type_udf_args)
+fi
+])
+dnl ======================================================================