components/mlocate/patches/getmntent-gnulib.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Mon, 07 Nov 2016 16:32:57 -0800
changeset 7257 779372532897
parent 1230 51caab77ce23
permissions -rw-r--r--
Close of build 112.1.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1230
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
     1
This patch adds the configure rules and the conditional compilation to
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
     2
allow the code to be compiled on Solaris 11, which uses a 2 argument
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
     3
version of getmntent()
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
     4
We have upstream support ticket #12 to track the Solaris port, available
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
     5
at: https://fedorahosted.org/mlocate/ticket/12
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
     6
diff -rupN mlocate-0.25-htonll/configure.ac mlocate-0.25/configure.ac
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
     7
--- mlocate-0.25-htonll/configure.ac	2013-02-18 22:18:47.880624254 +0000
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
     8
+++ mlocate-0.25/configure.ac	2013-02-18 22:38:01.215736074 +0000
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
     9
@@ -55,6 +55,8 @@ AC_FUNC_GETMNTENT
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    10
 # Checks for system services.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    11
 AC_SYS_LARGEFILE
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    12
 
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    13
+gl_LIST_MOUNTED_FILE_SYSTEMS
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    14
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    15
 AC_CACHE_CHECK([for mounted filesystem table in /proc],
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    16
 	       [mitr_cv_sys_proc_mounts],
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    17
 [mitr_cv_sys_proc_mounts=no
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    18
diff -rupN mlocate-0.25-htonll/gnulib/m4/ls-mntd-fs.m4 mlocate-0.25/gnulib/m4/ls-mntd-fs.m4
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    19
--- mlocate-0.25-htonll/gnulib/m4/ls-mntd-fs.m4	1970-01-01 01:00:00.000000000 +0100
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    20
+++ mlocate-0.25/gnulib/m4/ls-mntd-fs.m4	2013-02-18 22:38:13.068889474 +0000
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    21
@@ -0,0 +1,337 @@
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    22
+#serial 26
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    23
+# How to list mounted file systems.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    24
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    25
+# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    26
+# Foundation, Inc.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    27
+#
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    28
+# This file is free software; the Free Software Foundation
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    29
+# gives unlimited permission to copy and/or distribute it,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    30
+# with or without modifications, as long as this notice is preserved.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    31
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    32
+dnl From Jim Meyering.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    33
+dnl
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    34
+dnl This is not pretty.  I've just taken the autoconf code and wrapped
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    35
+dnl it in an AC_DEFUN and made some other fixes.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    36
+dnl
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    37
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    38
+# Replace Autoconf's AC_FUNC_GETMNTENT to work around a bug in Autoconf
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    39
+# through Autoconf 2.59.  We can remove this once we assume Autoconf 2.60
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    40
+# or later.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    41
+AC_DEFUN([AC_FUNC_GETMNTENT],
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    42
+[# getmntent is in the standard C library on UNICOS, in -lsun on Irix 4,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    43
+# -lseq on Dynix/PTX, -lgen on Unixware.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    44
+AC_SEARCH_LIBS(getmntent, [sun seq gen])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    45
+AC_CHECK_FUNCS(getmntent)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    46
+])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    47
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    48
+# gl_LIST_MOUNTED_FILE_SYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    49
+AC_DEFUN([gl_LIST_MOUNTED_FILE_SYSTEMS],
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    50
+  [
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    51
+AC_CHECK_FUNCS(listmntent getmntinfo)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    52
+AC_CHECK_HEADERS_ONCE(sys/param.h sys/statvfs.h)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    53
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    54
+# We must include grp.h before ucred.h on OSF V4.0, since ucred.h uses
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    55
+# NGROUPS (as the array dimension for a struct member) without a definition.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    56
+AC_CHECK_HEADERS(sys/ucred.h, [], [], [#include <grp.h>])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    57
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    58
+AC_CHECK_HEADERS(sys/mount.h, [], [],
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    59
+  [AC_INCLUDES_DEFAULT
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    60
+   [#if HAVE_SYS_PARAM_H
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    61
+     #include <sys/param.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    62
+    #endif]])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    63
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    64
+AC_CHECK_HEADERS(mntent.h sys/fs_types.h)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    65
+    getfsstat_includes="\
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    66
+$ac_includes_default
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    67
+#if HAVE_SYS_PARAM_H
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    68
+# include <sys/param.h> /* needed by powerpc-apple-darwin1.3.7 */
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    69
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    70
+#if HAVE_SYS_UCRED_H
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    71
+# include <grp.h> /* needed for definition of NGROUPS */
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    72
+# include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    73
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    74
+#if HAVE_SYS_MOUNT_H
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    75
+# include <sys/mount.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    76
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    77
+#if HAVE_SYS_FS_TYPES_H
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    78
+# include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    79
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    80
+"
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    81
+AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    82
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    83
+# Determine how to get the list of mounted file systems.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    84
+ac_list_mounted_fs=
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    85
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    86
+# If the getmntent function is available but not in the standard library,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    87
+# make sure LIBS contains the appropriate -l option.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    88
+AC_FUNC_GETMNTENT
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    89
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    90
+# This test must precede the ones for getmntent because Unicos-9 is
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    91
+# reported to have the getmntent function, but its support is incompatible
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    92
+# with other getmntent implementations.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    93
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    94
+# NOTE: Normally, I wouldn't use a check for system type as I've done for
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    95
+# `CRAY' below since that goes against the whole autoconf philosophy.  But
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    96
+# I think there is too great a chance that some non-Cray system has a
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    97
+# function named listmntent to risk the false positive.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    98
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
    99
+if test -z "$ac_list_mounted_fs"; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   100
+  # Cray UNICOS 9
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   101
+  AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   102
+  AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   103
+    [fu_cv_sys_mounted_cray_listmntent=no
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   104
+      AC_EGREP_CPP(yes,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   105
+        [#ifdef _CRAY
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   106
+yes
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   107
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   108
+        ], [test $ac_cv_func_listmntent = yes \
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   109
+	    && fu_cv_sys_mounted_cray_listmntent=yes]
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   110
+      )
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   111
+    ]
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   112
+  )
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   113
+  AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   114
+  if test $fu_cv_sys_mounted_cray_listmntent = yes; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   115
+    ac_list_mounted_fs=found
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   116
+    AC_DEFINE(MOUNTED_LISTMNTENT, 1,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   117
+      [Define if there is a function named listmntent that can be used to
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   118
+       list all mounted file systems.  (UNICOS)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   119
+  fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   120
+fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   121
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   122
+if test -z "$ac_list_mounted_fs"; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   123
+  # AIX.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   124
+  AC_MSG_CHECKING([for mntctl function and struct vmount])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   125
+  AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   126
+  [AC_TRY_CPP([#include <fshelp.h>],
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   127
+    fu_cv_sys_mounted_vmount=yes,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   128
+    fu_cv_sys_mounted_vmount=no)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   129
+  AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   130
+  if test $fu_cv_sys_mounted_vmount = yes; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   131
+    ac_list_mounted_fs=found
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   132
+    AC_DEFINE(MOUNTED_VMOUNT, 1,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   133
+	[Define if there is a function named mntctl that can be used to read
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   134
+         the list of mounted file systems, and there is a system header file
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   135
+         that declares `struct vmount.'  (AIX)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   136
+  fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   137
+fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   138
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   139
+if test $ac_cv_func_getmntent = yes; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   140
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   141
+  # This system has the getmntent function.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   142
+  # Determine whether it's the one-argument variant or the two-argument one.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   143
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   144
+  if test -z "$ac_list_mounted_fs"; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   145
+    # 4.3BSD, SunOS, HP-UX, Dynix, Irix
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   146
+    AC_MSG_CHECKING([for one-argument getmntent function])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   147
+    AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   148
+		 [AC_TRY_COMPILE([
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   149
+/* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   150
+#include <stdio.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   151
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   152
+#include <mntent.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   153
+#if !defined MOUNTED
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   154
+# if defined _PATH_MOUNTED	/* GNU libc  */
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   155
+#  define MOUNTED _PATH_MOUNTED
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   156
+# endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   157
+# if defined MNT_MNTTAB	/* HP-UX.  */
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   158
+#  define MOUNTED MNT_MNTTAB
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   159
+# endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   160
+# if defined MNTTABNAME	/* Dynix.  */
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   161
+#  define MOUNTED MNTTABNAME
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   162
+# endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   163
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   164
+],
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   165
+                    [ struct mntent *mnt = 0; char *table = MOUNTED;
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   166
+		      if (sizeof mnt && sizeof table) return 0;],
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   167
+		    fu_cv_sys_mounted_getmntent1=yes,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   168
+		    fu_cv_sys_mounted_getmntent1=no)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   169
+    AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   170
+    if test $fu_cv_sys_mounted_getmntent1 = yes; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   171
+      ac_list_mounted_fs=found
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   172
+      AC_DEFINE(MOUNTED_GETMNTENT1, 1,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   173
+        [Define if there is a function named getmntent for reading the list
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   174
+         of mounted file systems, and that function takes a single argument.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   175
+         (4.3BSD, SunOS, HP-UX, Dynix, Irix)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   176
+    fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   177
+  fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   178
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   179
+  if test -z "$ac_list_mounted_fs"; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   180
+    # SVR4
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   181
+    AC_MSG_CHECKING([for two-argument getmntent function])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   182
+    AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   183
+    [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   184
+      fu_cv_sys_mounted_getmntent2=yes,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   185
+      fu_cv_sys_mounted_getmntent2=no)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   186
+    AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   187
+    if test $fu_cv_sys_mounted_getmntent2 = yes; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   188
+      ac_list_mounted_fs=found
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   189
+      AC_DEFINE(MOUNTED_GETMNTENT2, 1,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   190
+        [Define if there is a function named getmntent for reading the list of
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   191
+         mounted file systems, and that function takes two arguments.  (SVR4)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   192
+      AC_CHECK_FUNCS(hasmntopt)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   193
+    fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   194
+  fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   195
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   196
+fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   197
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   198
+if test -z "$ac_list_mounted_fs"; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   199
+  # DEC Alpha running OSF/1, and Apple Darwin 1.3.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   200
+  # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   201
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   202
+  AC_MSG_CHECKING([for getfsstat function])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   203
+  AC_CACHE_VAL(fu_cv_sys_mounted_getfsstat,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   204
+  [AC_TRY_LINK([
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   205
+#include <sys/types.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   206
+#if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   207
+# define FS_TYPE(Ent) ((Ent).f_fstypename)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   208
+#else
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   209
+# define FS_TYPE(Ent) mnt_names[(Ent).f_type]
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   210
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   211
+]$getfsstat_includes
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   212
+,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   213
+  [struct statfs *stats;
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   214
+   int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   215
+   char *t = FS_TYPE (*stats); ],
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   216
+    fu_cv_sys_mounted_getfsstat=yes,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   217
+    fu_cv_sys_mounted_getfsstat=no)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   218
+  AC_MSG_RESULT($fu_cv_sys_mounted_getfsstat)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   219
+  if test $fu_cv_sys_mounted_getfsstat = yes; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   220
+    ac_list_mounted_fs=found
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   221
+    AC_DEFINE(MOUNTED_GETFSSTAT, 1,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   222
+	      [Define if there is a function named getfsstat for reading the
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   223
+               list of mounted file systems.  (DEC Alpha running OSF/1)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   224
+  fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   225
+fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   226
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   227
+if test -z "$ac_list_mounted_fs"; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   228
+  # SVR3
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   229
+  AC_MSG_CHECKING([for FIXME existence of three headers])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   230
+  AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   231
+    [AC_TRY_CPP([
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   232
+#include <sys/statfs.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   233
+#include <sys/fstyp.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   234
+#include <mnttab.h>],
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   235
+		fu_cv_sys_mounted_fread_fstyp=yes,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   236
+		fu_cv_sys_mounted_fread_fstyp=no)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   237
+  AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   238
+  if test $fu_cv_sys_mounted_fread_fstyp = yes; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   239
+    ac_list_mounted_fs=found
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   240
+    AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   241
+      [Define if (like SVR2) there is no specific function for reading the
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   242
+       list of mounted file systems, and your system has these header files:
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   243
+       <sys/fstyp.h> and <sys/statfs.h>.  (SVR3)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   244
+  fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   245
+fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   246
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   247
+if test -z "$ac_list_mounted_fs"; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   248
+  # 4.4BSD and DEC OSF/1.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   249
+  AC_MSG_CHECKING([for getmntinfo function])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   250
+  AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   251
+    [
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   252
+      test "$ac_cv_func_getmntinfo" = yes \
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   253
+	  && fu_cv_sys_mounted_getmntinfo=yes \
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   254
+	  || fu_cv_sys_mounted_getmntinfo=no
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   255
+    ])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   256
+  AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   257
+  if test $fu_cv_sys_mounted_getmntinfo = yes; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   258
+    AC_MSG_CHECKING([whether getmntinfo returns statvfs structures])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   259
+    AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo2,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   260
+      [
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   261
+        AC_TRY_COMPILE([
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   262
+#if HAVE_SYS_PARAM_H
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   263
+# include <sys/param.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   264
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   265
+#include <sys/types.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   266
+#if HAVE_SYS_MOUNT_H
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   267
+# include <sys/mount.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   268
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   269
+#if HAVE_SYS_STATVFS_H
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   270
+# include <sys/statvfs.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   271
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   272
+extern int getmntinfo (struct statfs **, int);
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   273
+          ], [],
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   274
+          [fu_cv_sys_mounted_getmntinfo2=no],
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   275
+          [fu_cv_sys_mounted_getmntinfo2=yes])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   276
+      ])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   277
+    AC_MSG_RESULT([$fu_cv_sys_mounted_getmntinfo2])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   278
+    if test $fu_cv_sys_mounted_getmntinfo2 = no; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   279
+      ac_list_mounted_fs=found
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   280
+      AC_DEFINE(MOUNTED_GETMNTINFO, 1,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   281
+	        [Define if there is a function named getmntinfo for reading the
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   282
+                 list of mounted file systems and it returns an array of
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   283
+                 'struct statfs'.  (4.4BSD, Darwin)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   284
+    else
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   285
+      ac_list_mounted_fs=found
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   286
+      AC_DEFINE(MOUNTED_GETMNTINFO2, 1,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   287
+	        [Define if there is a function named getmntinfo for reading the
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   288
+                 list of mounted file systems and it returns an array of
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   289
+                 'struct statvfs'.  (NetBSD 3.0)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   290
+    fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   291
+  fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   292
+fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   293
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   294
+if test -z "$ac_list_mounted_fs"; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   295
+  # Ultrix
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   296
+  AC_MSG_CHECKING([for getmnt function])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   297
+  AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   298
+    [AC_TRY_CPP([
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   299
+#include <sys/fs_types.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   300
+#include <sys/mount.h>],
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   301
+		fu_cv_sys_mounted_getmnt=yes,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   302
+		fu_cv_sys_mounted_getmnt=no)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   303
+  AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   304
+  if test $fu_cv_sys_mounted_getmnt = yes; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   305
+    ac_list_mounted_fs=found
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   306
+    AC_DEFINE(MOUNTED_GETMNT, 1,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   307
+      [Define if there is a function named getmnt for reading the list of
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   308
+       mounted file systems.  (Ultrix)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   309
+  fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   310
+fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   311
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   312
+if test -z "$ac_list_mounted_fs"; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   313
+  # BeOS
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   314
+  AC_CHECK_FUNCS(next_dev fs_stat_dev)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   315
+  AC_CHECK_HEADERS(fs_info.h)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   316
+  AC_MSG_CHECKING([for BEOS mounted file system support functions])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   317
+  if test $ac_cv_header_fs_info_h = yes \
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   318
+      && test $ac_cv_func_next_dev = yes \
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   319
+	&& test $ac_cv_func_fs_stat_dev = yes; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   320
+    fu_result=yes
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   321
+  else
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   322
+    fu_result=no
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   323
+  fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   324
+  AC_MSG_RESULT($fu_result)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   325
+  if test $fu_result = yes; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   326
+    ac_list_mounted_fs=found
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   327
+    AC_DEFINE(MOUNTED_FS_STAT_DEV, 1,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   328
+      [Define if there are functions named next_dev and fs_stat_dev for
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   329
+       reading the list of mounted file systems.  (BeOS)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   330
+  fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   331
+fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   332
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   333
+if test -z "$ac_list_mounted_fs"; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   334
+  # SVR2
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   335
+  AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   336
+  AC_CACHE_VAL(fu_cv_sys_mounted_fread,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   337
+    [AC_TRY_CPP([#include <mnttab.h>],
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   338
+		fu_cv_sys_mounted_fread=yes,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   339
+		fu_cv_sys_mounted_fread=no)])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   340
+  AC_MSG_RESULT($fu_cv_sys_mounted_fread)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   341
+  if test $fu_cv_sys_mounted_fread = yes; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   342
+    ac_list_mounted_fs=found
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   343
+    AC_DEFINE(MOUNTED_FREAD, 1,
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   344
+	      [Define if there is no specific function for reading the list of
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   345
+               mounted file systems.  fread will be used to read /etc/mnttab.
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   346
+               (SVR2) ])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   347
+  fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   348
+fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   349
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   350
+if test -z "$ac_list_mounted_fs"; then
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   351
+  AC_MSG_ERROR([could not determine how to read list of mounted file systems])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   352
+  # FIXME -- no need to abort building the whole package
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   353
+  # Can't build mountlist.c or anything that needs its functions
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   354
+fi
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   355
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   356
+AS_IF([test $ac_list_mounted_fs = found], [$1], [$2])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   357
+
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   358
+  ])
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   359
diff -rupN mlocate-0.25-htonll/src/updatedb.c mlocate-0.25/src/updatedb.c
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   360
--- mlocate-0.25-htonll/src/updatedb.c	2011-12-11 23:13:18.000000000 +0000
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   361
+++ mlocate-0.25/src/updatedb.c	2013-02-18 22:37:53.812745988 +0000
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   362
@@ -36,7 +36,15 @@ Author: Miloslav Trmac <[email protected]>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   363
 #include <sys/time.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   364
 #include <unistd.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   365
 
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   366
+#if defined (MOUNTED_GETMNTENT1)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   367
 #include <mntent.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   368
+#else
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   369
+#if defined (MOUNTED_GETMNTENT2)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   370
+#include <sys/mnttab.h>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   371
+#else
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   372
+#error "No valid getmntent() #include defined"
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   373
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   374
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   375
 #include "error.h"
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   376
 #include "fwriteerror.h"
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   377
 #include "obstack.h"
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   378
@@ -53,7 +61,11 @@ Author: Miloslav Trmac <[email protected]>
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   379
 #ifdef PROC_MOUNTS_PATH
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   380
 #define MOUNT_TABLE_PATH PROC_MOUNTS_PATH
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   381
 #else
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   382
+#ifdef _PATH_MOUNTED
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   383
 #define MOUNT_TABLE_PATH _PATH_MOUNTED
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   384
+#else
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   385
+#define MOUNT_TABLE_PATH MNTTAB
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   386
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   387
 #endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   388
 
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   389
 /* A directory entry in memory */
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   390
@@ -334,7 +346,21 @@ filesystem_is_excluded (const char *path
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   391
   static size_t type_size; /* = 0; */
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   392
 
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   393
   FILE *f;
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   394
+#if defined (MOUNTED_GETMNTENT1)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   395
   struct mntent *me;
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   396
+#else
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   397
+#if defined (MOUNTED_GETMNTENT2)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   398
+  struct mnttab me_local;
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   399
+  /* Convenience pointer */
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   400
+  struct mnttab *me = &me_local;
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   401
+  /* Macro substitution to make the structure members correct */
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   402
+#define mnt_type mnt_fstype
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   403
+#define mnt_dir mnt_mountp
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   404
+  /* setmntent() and endmntent() are undefined in this envonronment */
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   405
+#define setmntent(x,y) fopen(x,y)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   406
+#define endmntent(x) fclose(x)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   407
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   408
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   409
   bool res;
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   410
 
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   411
   if (conf_debug_pruning != false)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   412
@@ -344,7 +370,13 @@ filesystem_is_excluded (const char *path
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   413
   f = setmntent (MOUNT_TABLE_PATH, "r");
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   414
   if (f == NULL)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   415
     goto err;
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   416
+#if defined (MOUNTED_GETMNTENT1)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   417
   while ((me = getmntent (f)) != NULL)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   418
+#else
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   419
+#if defined (MOUNTED_GETMNTENT2)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   420
+  while ((getmntent (f, me)) == 0)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   421
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   422
+#endif
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   423
     {
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   424
       char *p;
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   425
       size_t size;
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   426
@@ -367,7 +399,6 @@ filesystem_is_excluded (const char *path
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   427
 	  dir = canonicalize_file_name (me->mnt_dir);
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   428
 	  if (dir == NULL)
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   429
 	    dir = me->mnt_dir;
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   430
-#else
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   431
 	  /* Paths in /proc/self/mounts contain no symbolic links.  Besides
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   432
 	     avoiding a few system calls, avoiding the realpath () avoids hangs
51caab77ce23 PSARC/2012/123 Replace slocate(1) with mlocate(1)
Edwin Beasant <Edwin.Beasant@oracle.com>
parents:
diff changeset
   433
 	     if the filesystem is unavailable hard-mounted NFS. */