include(CheckFunctionExists)
include(CheckIncludeFiles)
include(CheckVariableExists)
include(CheckLibraryExists)

check_variable_exists(__progname HAVE___PROGNAME)
check_include_files(sys/pstat.h HAVE_SYS_PSTAT_H)
check_include_files(sys/select.h  HAVE_SYS_SELECT_H)
check_function_exists(pstat HAVE_PSTAT)
check_function_exists(setproctitle HAVE_SETPROCTITLE)
check_library_exists(socket connect "" HAVE_SOCKET_LIBRARY)

if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
    set(CAN_CLOBBER_ARGV TRUE)
else()
    set(CAN_CLOBBER_ARGV FALSE)
endif()
