1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Define OMIT_UTMP if there's no utmpx.h.

Without this, the build of e.g. psusan would fail on systems without
that header (such as Termux on Android).

This is similar to how things were pre-cmake, but not identical. We used
to treat lack of updwtmpx() as a reason to OMIT_UTMP (as of f0dfa73982),
but usage of that function got conditionalised in c19e7215dd, so I
haven't restored that exclusion.
This commit is contained in:
Jacob Nevins 2022-05-18 18:48:28 +01:00
parent 97b3db34b2
commit 92881f2066
3 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -227,6 +227,8 @@ static void setup_utmp(char *ttyname, char *location)
endutxent();
#if HAVE_UPDWTMPX
/* Reportedly, AIX 5.1 has <utmpx.h> and pututxline(), but no
* updwtmpx(). */
updwtmpx(WTMPX_FILE, &utmp_entry);
#endif