summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-11-25 23:30:01 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-11-25 23:30:01 +0800
commite5c52796c3ba722fae28f95258ad3dfcb7b31be3 (patch)
tree6c91e3a17587d61ea506acaa96a69f382b4595c5
parentc5e36f8e3cd390b77ce43f58f01b3d3a9111d989 (diff)
Try and fix utmp handling
-rw-r--r--configure.ac10
-rw-r--r--loginrec.h8
2 files changed, 11 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index a24e87a..aa932fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -540,7 +540,9 @@ dnl wtmp detection
AC_MSG_CHECKING([if your system defines WTMP_FILE])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
-#include <utmp.h>
+#ifdef HAVE_UTMP_H
+# include <utmp.h>
+#endif
#ifdef HAVE_PATHS_H
# include <paths.h>
#endif
@@ -598,9 +600,11 @@ dnl wtmpx detection
AC_MSG_CHECKING([if your system defines WTMPX_FILE])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
-#include <utmp.h>
+#ifdef HAVE_UTMP_H
+# include <utmp.h>
+#endif
#ifdef HAVE_UTMPX_H
-#include <utmpx.h>
+# include <utmpx.h>
#endif
#ifdef HAVE_PATHS_H
# include <paths.h>
diff --git a/loginrec.h b/loginrec.h
index 03d26b9..bd40006 100644
--- a/loginrec.h
+++ b/loginrec.h
@@ -73,16 +73,16 @@
#else
/* Simply select your favourite login types. */
/* Can't do if-else because some systems use several... <sigh> */
-# if defined(UTMPX_FILE) && !defined(DISABLE_UTMPX)
+# if defined(HAVE_UTMPX_H) && defined(UTMPX_FILE) && !defined(DISABLE_UTMPX)
# define USE_UTMPX
# endif
-# if defined(UTMP_FILE) && !defined(DISABLE_UTMP)
+# if defined(HAVE_UTMP_H) && defined(UTMP_FILE) && !defined(DISABLE_UTMP)
# define USE_UTMP
# endif
-# if defined(WTMPX_FILE) && !defined(DISABLE_WTMPX)
+# if defined(HAVE_WTMPX_H) && defined(WTMPX_FILE) && !defined(DISABLE_WTMPX)
# define USE_WTMPX
# endif
-# if defined(WTMP_FILE) && !defined(DISABLE_WTMP)
+# if defined(HAVE_WTMP_H) && defined(WTMP_FILE) && !defined(DISABLE_WTMP)
# define USE_WTMP
# endif