mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Fix a few cmake configure-time checks.
A couple of actual checks were missing (elf_aux_info, sysctlbyname). Several more were accidentally left out of cmake.h.in, meaning they wouldn't be propagated from cmake's variable space into the actual compilation. And a handful of checks in the C source were still using the autotools-style 'if defined' in place of the cmake-style "it's always 0 or 1" plain #if.
This commit is contained in:
parent
6c783f9ad0
commit
3996919f5e
@ -16,6 +16,11 @@
|
|||||||
|
|
||||||
#cmakedefine NOT_X_WINDOWS
|
#cmakedefine NOT_X_WINDOWS
|
||||||
|
|
||||||
|
#cmakedefine01 HAVE_ASM_HWCAP_H
|
||||||
|
#cmakedefine01 HAVE_SYS_AUXV_H
|
||||||
|
#cmakedefine01 HAVE_SYS_SYSCTL_H
|
||||||
|
#cmakedefine01 HAVE_SYS_TYPES_H
|
||||||
|
#cmakedefine01 HAVE_GLOB_H
|
||||||
#cmakedefine01 HAVE_FUTIMES
|
#cmakedefine01 HAVE_FUTIMES
|
||||||
#cmakedefine01 HAVE_GETADDRINFO
|
#cmakedefine01 HAVE_GETADDRINFO
|
||||||
#cmakedefine01 HAVE_POSIX_OPENPT
|
#cmakedefine01 HAVE_POSIX_OPENPT
|
||||||
@ -28,6 +33,8 @@
|
|||||||
#cmakedefine01 HAVE_SETPWENT
|
#cmakedefine01 HAVE_SETPWENT
|
||||||
#cmakedefine01 HAVE_ENDPWENT
|
#cmakedefine01 HAVE_ENDPWENT
|
||||||
#cmakedefine01 HAVE_GETAUXVAL
|
#cmakedefine01 HAVE_GETAUXVAL
|
||||||
|
#cmakedefine01 HAVE_ELF_AUX_INFO
|
||||||
|
#cmakedefine01 HAVE_SYSCTLBYNAME
|
||||||
#cmakedefine01 HAVE_CLOCK_MONOTONIC
|
#cmakedefine01 HAVE_CLOCK_MONOTONIC
|
||||||
#cmakedefine01 HAVE_CLOCK_GETTIME
|
#cmakedefine01 HAVE_CLOCK_GETTIME
|
||||||
#cmakedefine01 HAVE_SO_PEERCRED
|
#cmakedefine01 HAVE_SO_PEERCRED
|
||||||
|
@ -34,6 +34,8 @@ check_symbol_exists(dirfd "sys/types.h;dirent.h" HAVE_DIRFD)
|
|||||||
check_symbol_exists(setpwent "sys/types.h;pwd.h" HAVE_SETPWENT)
|
check_symbol_exists(setpwent "sys/types.h;pwd.h" HAVE_SETPWENT)
|
||||||
check_symbol_exists(endpwent "sys/types.h;pwd.h" HAVE_ENDPWENT)
|
check_symbol_exists(endpwent "sys/types.h;pwd.h" HAVE_ENDPWENT)
|
||||||
check_symbol_exists(getauxval "sys/auxv.h" HAVE_GETAUXVAL)
|
check_symbol_exists(getauxval "sys/auxv.h" HAVE_GETAUXVAL)
|
||||||
|
check_symbol_exists(elf_aux_info "sys/auxv.h" HAVE_ELF_AUX_INFO)
|
||||||
|
check_symbol_exists(sysctlbyname "sys/types.h;sys/sysctl.h" HAVE_SYSCTLBYNAME)
|
||||||
check_symbol_exists(CLOCK_MONOTONIC "time.h" HAVE_CLOCK_MONOTONIC)
|
check_symbol_exists(CLOCK_MONOTONIC "time.h" HAVE_CLOCK_MONOTONIC)
|
||||||
check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
|
check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ unsigned long getticks(void)
|
|||||||
* need a decent number of them to fit into a 32-bit word so it
|
* need a decent number of them to fit into a 32-bit word so it
|
||||||
* can be used for keepalives.
|
* can be used for keepalives.
|
||||||
*/
|
*/
|
||||||
#if defined HAVE_CLOCK_GETTIME && defined HAVE_DECL_CLOCK_MONOTONIC
|
#if HAVE_CLOCK_GETTIME && HAVE_CLOCK_MONOTONIC
|
||||||
{
|
{
|
||||||
/* Use CLOCK_MONOTONIC if available, so as to be unconfused if
|
/* Use CLOCK_MONOTONIC if available, so as to be unconfused if
|
||||||
* the system clock changes. */
|
* the system clock changes. */
|
||||||
|
@ -30,9 +30,9 @@
|
|||||||
#include <asm/hwcap.h>
|
#include <asm/hwcap.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined HAVE_GETAUXVAL
|
#if HAVE_GETAUXVAL
|
||||||
/* No code needed: getauxval has just the API we want already */
|
/* No code needed: getauxval has just the API we want already */
|
||||||
#elif defined HAVE_ELF_AUX_INFO
|
#elif HAVE_ELF_AUX_INFO
|
||||||
/* Implement the simple getauxval API in terms of FreeBSD elf_aux_info */
|
/* Implement the simple getauxval API in terms of FreeBSD elf_aux_info */
|
||||||
static inline u_long getauxval(int which)
|
static inline u_long getauxval(int which)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user