Warning, /frameworks/kpty/src/ConfigureChecks.cmake is written in an unsupported language. File is not indexed.
0001 include(CheckIncludeFile)
0002 include(CheckIncludeFiles)
0003 include(CheckSymbolExists)
0004 include(CheckCXXSymbolExists)
0005 include(CheckFunctionExists)
0006 include(CheckLibraryExists)
0007 include(CheckStructHasMember)
0008
0009 check_include_files(sys/time.h HAVE_SYS_TIME_H)
0010
0011 if (UNIX)
0012 check_include_files("sys/types.h;libutil.h" HAVE_LIBUTIL_H)
0013 check_include_files(util.h HAVE_UTIL_H)
0014 check_include_files(termios.h HAVE_TERMIOS_H)
0015 check_include_files(termio.h HAVE_TERMIO_H)
0016 check_include_files(pty.h HAVE_PTY_H)
0017 check_include_files(sys/stropts.h HAVE_SYS_STROPTS_H)
0018 check_include_files(sys/filio.h HAVE_SYS_FILIO_H)
0019
0020 set(UTIL_LIBRARY)
0021
0022 if (NOT UTEMPTER_FOUND)
0023 check_function_exists(login login_in_libc)
0024 if (NOT login_in_libc)
0025 check_library_exists(util login "" login_in_libutil)
0026 if (login_in_libutil)
0027 set(UTIL_LIBRARY util)
0028 endif (login_in_libutil)
0029 endif (NOT login_in_libc)
0030 if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES kFreeBSD OR CMAKE_SYSTEM_NAME STREQUAL GNU)
0031 set (HAVE_UTMPX)
0032 else (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES kFreeBSD OR CMAKE_SYSTEM_NAME STREQUAL GNU)
0033 check_function_exists(getutxent HAVE_UTMPX)
0034 endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES kFreeBSD OR CMAKE_SYSTEM_NAME STREQUAL GNU)
0035 if (HAVE_UTMPX)
0036 set(utmp utmpx)
0037 if (login_in_libutil)
0038 check_library_exists(util loginx "" HAVE_LOGINX)
0039 endif (login_in_libutil)
0040 else (HAVE_UTMPX)
0041 set(utmp utmp)
0042 endif (HAVE_UTMPX)
0043 if (login_in_libc OR login_in_libutil)
0044 set(HAVE_LOGIN 1)
0045 else (login_in_libc OR login_in_libutil)
0046 set(HAVE_LOGIN)
0047 check_struct_has_member("struct ${utmp}" "ut_type" "${utmp}.h" HAVE_STRUCT_UTMP_UT_TYPE)
0048 check_struct_has_member("struct ${utmp}" "ut_pid" "${utmp}.h" HAVE_STRUCT_UTMP_UT_PID)
0049 check_struct_has_member("struct ${utmp}" "ut_session" "${utmp}.h" HAVE_STRUCT_UTMP_UT_SESSION)
0050 endif (login_in_libc OR login_in_libutil)
0051 check_struct_has_member("struct ${utmp}" "ut_syslen" "${utmp}.h" HAVE_STRUCT_UTMP_UT_SYSLEN)
0052 check_struct_has_member("struct ${utmp}" "ut_id" "${utmp}.h" HAVE_STRUCT_UTMP_UT_ID)
0053 endif (NOT UTEMPTER_FOUND)
0054
0055 check_function_exists(openpty openpty_in_libc)
0056 if (NOT openpty_in_libc)
0057 check_library_exists(util openpty "" openpty_in_libutil)
0058 if (openpty_in_libutil)
0059 set(UTIL_LIBRARY util)
0060 endif (openpty_in_libutil)
0061 endif (NOT openpty_in_libc)
0062 if (openpty_in_libc OR openpty_in_libutil)
0063 set(HAVE_OPENPTY 1)
0064 else (openpty_in_libc OR openpty_in_libutil)
0065 set(HAVE_OPENPTY)
0066
0067 execute_process(
0068 COMMAND sh -c "
0069 for ptm in ptc ptmx ptm ptym/clone; do
0070 if test -c /dev/$ptm; then
0071 echo /dev/$ptm
0072 break
0073 fi
0074 done"
0075 OUTPUT_VARIABLE PTM_DEVICE
0076 OUTPUT_STRIP_TRAILING_WHITESPACE)
0077 message(STATUS "PTY multiplexer: ${PTM_DEVICE}")
0078
0079 check_function_exists(revoke HAVE_REVOKE)
0080 check_function_exists(_getpty HAVE__GETPTY)
0081 check_function_exists(getpt HAVE_GETPT)
0082 check_function_exists(grantpt HAVE_GRANTPT)
0083 check_function_exists(unlockpt HAVE_UNLOCKPT)
0084 check_function_exists(posix_openpt HAVE_POSIX_OPENPT)
0085 endif (openpty_in_libc OR openpty_in_libutil)
0086
0087 check_function_exists(ptsname HAVE_PTSNAME)
0088 check_function_exists(tcgetattr HAVE_TCGETATTR)
0089 check_function_exists(tcsetattr HAVE_TCSETATTR)
0090 endif (UNIX)
0091