fix: add forkpty for SunOS variants

forkpty is missing on Solaris < 11 and Illumos, provide fallback implementation
for non Solaris 11 users.
This commit is contained in:
Claes Nästén
2021-12-09 20:01:19 +01:00
parent ac2d140a33
commit 2c8f4d0912
3 changed files with 133 additions and 1 deletions

View File

@@ -50,6 +50,19 @@ check_function_exists(strcasecmp HAVE_STRCASECMP)
check_function_exists(strncasecmp HAVE_STRNCASECMP)
check_function_exists(strptime HAVE_STRPTIME)
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
check_c_source_compiles("
#include <termios.h>
int
main(void)
{
return forkpty(0, NULL, NULL, NULL);
}
" HAVE_FORKPTY)
else()
set(HAVE_FORKPTY 1)
endif()
# Symbols
check_symbol_exists(FD_CLOEXEC "fcntl.h" HAVE_FD_CLOEXEC)
if(HAVE_LANGINFO_H)

View File

@@ -50,6 +50,7 @@
# undef HAVE_SYS_UIO_H
# endif
#endif
#cmakedefine HAVE_FORKPTY
#cmakedefine FEAT_TUI