Ensure that is only included when present and available. --- openssh-9.4p1/configure.ac.old 2023-08-09 20:10:22.000000000 -0500 +++ openssh-9.4p1/configure.ac 2024-12-07 23:51:42.425820273 -0600 @@ -5351,7 +5351,9 @@ AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include -#include +#ifdef HAVE_UTMP_H +# include +#endif #ifdef HAVE_LASTLOG_H # include #endif @@ -5368,7 +5370,9 @@ AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include -#include +#ifdef HAVE_UTMP_H +# include +#endif #ifdef HAVE_LASTLOG_H # include #endif @@ -5406,7 +5410,9 @@ AC_MSG_CHECKING([if your system defines UTMP_FILE]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include -#include +#ifdef HAVE_UTMP_H +# include +#endif #ifdef HAVE_PATHS_H # include #endif @@ -5436,7 +5442,9 @@ AC_MSG_CHECKING([if your system defines WTMP_FILE]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include -#include +#ifdef HAVE_UTMP_H +# include +#endif #ifdef HAVE_PATHS_H # include #endif @@ -5466,7 +5474,9 @@ AC_MSG_CHECKING([if your system defines WTMPX_FILE]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include -#include +#ifdef HAVE_UTMP_H +# include +#endif #ifdef HAVE_UTMPX_H #include #endif