From f4e9deb6d74614ac427b37513359d91588dd1542 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 16 Nov 2010 16:15:21 +1000 Subject: Add function for listing system mount points Add a mount_point_list() function that attempts to portably obtain a list of system mount points and a struct to hold needed mount point information. Abort the transaction if we are unable to determine the mount points. Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- configure.ac | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index a8987a48..cf023002 100644 --- a/configure.ac +++ b/configure.ac @@ -169,7 +169,9 @@ AS_IF([test "x$with_fetch" != "xno"], AM_CONDITIONAL([HAVE_LIBFETCH], [test "x$ac_cv_lib_fetch_fetchParseURL" = "xyes"]) # Checks for header files. -AC_CHECK_HEADERS([fcntl.h glob.h libintl.h limits.h locale.h string.h strings.h sys/ioctl.h sys/param.h sys/statvfs.h sys/syslimits.h sys/time.h syslog.h wchar.h]) +AC_CHECK_HEADERS([fcntl.h glob.h libintl.h limits.h locale.h mntent.h string.h strings.h \ + sys/ioctl.h sys/mount.h sys/param.h sys/statvfs.h sys/syslimits.h \ + sys/time.h sys/types.h sys/ucred.h syslog.h wchar.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_INLINE @@ -183,12 +185,30 @@ AC_STRUCT_DIRENT_D_TYPE # Checks for library functions. AC_FUNC_FORK +AC_FUNC_GETMNTENT AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_MKTIME AC_CHECK_FUNCS([geteuid realpath regcomp strcasecmp \ strndup strrchr strsep swprintf \ wcwidth uname]) +# Checks for getmntinfo and determines whether it uses statfs or statvfs +AC_CHECK_FUNC(getmntinfo, + [AC_MSG_CHECKING(parameter style for getmntinfo) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +# include +# include +#if HAVE_SYS_UCRED_H +#include +#endif +extern int getmntinfo (struct statfs **, int); + ]], [])], + [AC_DEFINE(HAVE_GETMNTINFO_STATFS, [], [getmntinfo uses statfs]) + AC_MSG_RESULT(statfs)], + [AC_DEFINE(HAVE_GETMNTINFO_STATVFS, [], [getmntinfo uses statvfs]) + AC_MSG_RESULT(statvfs)]) + ]) + # Enable large file support if available AC_SYS_LARGEFILE -- cgit v1.2.3-24-g4f1b