/* Define as one if you have <sys/mnttab.h> */
#define HAVE_SYS_MNTTAB_H 0
+/* Define as one if you have getmntent(), you'll also need one of the above
+ two defined */
+#define HAVE_GETMNTENT 0
+
#endif
dnl Checks for library functions.
AC_CHECK_FUNC(inet_aton, AC_DEFINE(HAVE_INET_ATON), MISCOBJS="$MISCOBJS inet_aton.o")
AC_CHECK_FUNC(realpath, AC_DEFINE(HAVE_REALPATH), MISCOBJS="$MISCOBJS realpath.o")
+AC_CHECK_FUNC(getmntent, AC_DEFINE(HAVE_GETMNTENT), MISCOBJS="$MISCOBJS getmntent.o")
AC_CHECK_FUNC(strerror, [], MISCOBJS="$MISCOBJS strerror.o")
AC_CHECK_FUNC(strtol, [], MISCOBJS="$MISCOBJS strtol.o")
AC_CHECK_FUNC(strtoul, [], MISCOBJS="$MISCOBJS strtoul.o")
#define lchown chown
#endif
-#if HAVE_MNTENT_H
-#include <mntent.h>
-#define GETMNTENT_ONE 1
-#define GETMNTENT_TWO 0
-#define our_mntent struct mntent
-#define our_mntdir mnt_dir
+#if HAVE_MNTENT_H || !(HAVE_GETMNTENT)
+# if HAVE_MNTENT_H
+# include <mntent.h>
+# else
+ #include <stdio.h>
+ struct mntent {
+ char * mnt_dir;
+ };
+ struct mntent *getmntent(FILE *filep);
+# endif
+# define GETMNTENT_ONE 1
+# define GETMNTENT_TWO 0
+# define our_mntent struct mntent
+# define our_mntdir mnt_dir
#elif HAVE_SYS_MNTTAB_H
-#include <stdio.h>
-#include <sys/mnttab.h>
-#define GETMNTENT_ONE 0
-#define GETMNTENT_TWO 1
-#define our_mntdir mnt_mountp
-#define our_mntent struct mnttab
+# include <stdio.h>
+# include <sys/mnttab.h>
+# define GETMNTENT_ONE 0
+# define GETMNTENT_TWO 1
+# define our_mntent struct mnttab
+# define our_mntdir mnt_mountp
#else
-#error Neither mntent.h nor mnttab.h exists. I cannot build on this system.
+# error Neither mntent.h nor mnttab.h exists. I cannot build on this system.
#endif
#ifndef MOUNTED