diff --git a/cmake/cmake.h.in b/cmake/cmake.h.in index ed44b2ca..2041f096 100644 --- a/cmake/cmake.h.in +++ b/cmake/cmake.h.in @@ -16,6 +16,7 @@ #cmakedefine01 HAVE_DWMAPI_H #cmakedefine NOT_X_WINDOWS +#cmakedefine OMIT_UTMP #cmakedefine01 HAVE_ASM_HWCAP_H #cmakedefine01 HAVE_SYS_AUXV_H diff --git a/cmake/platforms/unix.cmake b/cmake/platforms/unix.cmake index cb47caf9..6a788cb4 100644 --- a/cmake/platforms/unix.cmake +++ b/cmake/platforms/unix.cmake @@ -19,6 +19,7 @@ check_include_file(sys/sysctl.h HAVE_SYS_SYSCTL_H) check_include_file(sys/types.h HAVE_SYS_TYPES_H) check_include_file(glob.h HAVE_GLOB_H) check_include_file(utmp.h HAVE_UTMP_H) +check_include_file(utmpx.h HAVE_UTMPX_H) check_symbol_exists(futimes "sys/time.h" HAVE_FUTIMES) check_symbol_exists(getaddrinfo "sys/types.h;sys/socket.h;netdb.h" @@ -56,6 +57,12 @@ else() set(NO_IPV6 ON) endif() +if(HAVE_UTMPX_H) + set(OMIT_UTMP OFF) +else() + set(OMIT_UTMP ON) +endif() + include(cmake/gtk.cmake) # See if we have X11 available. This requires libX11 itself, and also diff --git a/unix/pty.c b/unix/pty.c index 0747b584..625f1bb1 100644 --- a/unix/pty.c +++ b/unix/pty.c @@ -227,6 +227,8 @@ static void setup_utmp(char *ttyname, char *location) endutxent(); #if HAVE_UPDWTMPX + /* Reportedly, AIX 5.1 has and pututxline(), but no + * updwtmpx(). */ updwtmpx(WTMPX_FILE, &utmp_entry); #endif