+AC_CHECK_FUNCS(getutent getutxent)
+
+# For quota module
+AC_CHECK_FUNCS(quotactl)
+AC_CHECK_FUNCS(getgrgid getpwuid)
+
+# For traffic module
+AC_CHECK_FUNCS(getifaddrs)
+
+# For mount interface
+AC_CHECK_FUNCS(getfsent getvfsent listmntent)
+AC_CHECK_FUNCS(getfsstat)
+
+# Check for different versions of `getmntent' here..
+AC_FUNC_GETMNTENT
+if test "x$ac_cv_lib_sun_getmntent" = "xyes"
+then
+ AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
+ [Define if the function getmntent exists. It's the version from libsun.])
+fi
+if test "x$ac_cv_lib_seq_getmntent" = "xyes"
+then
+ AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
+ [Define if the function getmntent exists. It's the version from libseq.])
+fi
+if test "x$ac_cv_lib_gen_getmntent" = "xyes"
+then
+ AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
+ [Define if the function getmntent exists. It's the version from libgen.])
+fi
+
+if test "x$ac_cv_func_getmntent" = "xyes"; then
+ saveCFLAGS="$CFLAGS"
+ CFLAGS="-Wall -Werror $CFLAGS"
+ AC_CACHE_CHECK([whether getmntent takes one argument],
+ [fu_cv_getmntent1],
+ AC_COMPILE_IFELSE(
+ AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
+#include "$srcdir/src/utils_mount.h"]],
+ [[(void)getmntent((FILE *)NULL);]]
+ ),
+ [fu_cv_getmntent1=yes],
+ [fu_cv_getmntent1=no]
+ )
+ )
+ if test "x$fu_cv_getmntent1" = "xno"; then
+ AC_CACHE_CHECK([whether getmntent takes two arguments],
+ [fu_cv_getmntent2],
+ AC_COMPILE_IFELSE(
+ AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
+#include "$srcdir/src/utils_mount.h"]],
+ [[(void)getmntent((FILE *)NULL,
+ (struct mnttab *)NULL);]]
+ ),
+ [fu_cv_getmntent2=yes],
+ [fu_cv_getmntent2=no]
+ )
+ )
+ fi
+ CFLAGS="$saveCFLAGS"
+fi
+if test "x$fu_cv_getmntent1" = "xyes"; then
+ AC_DEFINE(HAVE_GETMNTENT1,
+ 1,
+ [Define if there is a function named getmntent
+ for reading the list of mounted filesystems, and
+ that function takes a single argument. (4.3BSD,
+ SunOS, HP-UX, Dynix, Irix, Linux)]
+ )
+fi
+if test "x$fu_cv_getmntent2" = "xyes"; then
+ AC_DEFINE(HAVE_GETMNTENT2,
+ 1,
+ [Define if there is a function named getmntent
+ for reading the list of mounted filesystems, and
+ that function takes two arguments. (SVR4)]
+ )
+fi
+
+# Check for structures
+AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_obytes],
+ [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
+ [],
+ [
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <net/if.h>
+ ])
+AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_bytes],
+ [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
+ [],
+ [
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <linux/if.h>
+ #include <linux/netdevice.h>
+ ])