From aa2943800f9c00823720af98da036813ebf5cd2c Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Wed, 14 Feb 2007 09:01:45 +0100 Subject: initial commit --- infrastructure/m4/ax_check_mount_point.m4 | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 infrastructure/m4/ax_check_mount_point.m4 (limited to 'infrastructure/m4/ax_check_mount_point.m4') diff --git a/infrastructure/m4/ax_check_mount_point.m4 b/infrastructure/m4/ax_check_mount_point.m4 new file mode 100644 index 00000000..d26bf3e5 --- /dev/null +++ b/infrastructure/m4/ax_check_mount_point.m4 @@ -0,0 +1,60 @@ +dnl @synopsis AX_CHECK_MOUNT_POINT([ACTION-IF-TRUE], [ACTION-IF-FALSE]) +dnl +dnl This macro will find out how to get mount point information if possible. +dnl +dnl The following defines will be set as appropriate: +dnl HAVE_MOUNTS +dnl HAVE_MNTENT_H +dnl HAVE_SYS_MNTTAB_H +dnl HAVE_SYS_MOUNT_H +dnl HAVE_STRUCT_MNTENT_MNT_DIR +dnl HAVE_STRUCT_MNTTAB_MNT_MOUNTP +dnl HAVE_STRUCT_STATFS_F_MNTONNAME +dnl HAVE_STRUCT_STATVFS_F_MNTONNAME +dnl Also ACTION-IF-TRUE and ACTION-IF-FALSE are run as appropriate +dnl +dnl @category C +dnl @author Martin Ebourne +dnl @version 2005/07/01 +dnl @license AllPermissive + +AC_DEFUN([AX_CHECK_MOUNT_POINT], [ + AC_CHECK_FUNCS([getmntent statfs]) + AC_CHECK_HEADERS([sys/param.h]) + AC_CHECK_HEADERS([mntent.h sys/mnttab.h sys/mount.h],,, [[ + #include + #ifdef HAVE_SYS_PARAM_H + #include + #endif + ]]) + # BSD + AC_CHECK_MEMBERS([struct statfs.f_mntonname],,, [[ + #ifdef HAVE_SYS_PARAM_H + #include + #endif + #include + ]]) + # NetBSD + AC_CHECK_MEMBERS([struct statvfs.f_mntonname],,, [[ + #ifdef HAVE_SYS_PARAM_H + #include + #endif + #include + ]]) + # Linux + AC_CHECK_MEMBERS([struct mntent.mnt_dir],,, [[#include ]]) + # Solaris + AC_CHECK_MEMBERS([struct mnttab.mnt_mountp],,, [[ + #include + #include + ]]) + if test "x$ac_cv_member_struct_statfs_f_mntonname" = "xyes" || \ + test "x$ac_cv_member_struct_statvfs_f_mntonname" = "xyes" || \ + test "x$ac_cv_member_struct_mntent_mnt_dir" = "xyes" || \ + test "x$ac_cv_member_struct_mnttab_mnt_mountp" = "xyes" + then + AC_DEFINE([HAVE_MOUNTS], [1], [Define to 1 if this platform supports mounts]) + m4_ifvaln([$1],[$1],[:])dnl + m4_ifvaln([$2],[else $2])dnl + fi + ])dnl -- cgit v1.2.3