TDE base libraries and programs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.6 KiB

  1. #################################################
  2. #
  3. # (C) 2010-2011 Serghei Amelian
  4. # serghei (DOT) amelian (AT) gmail.com
  5. #
  6. # Improvements and feedback are welcome
  7. #
  8. # This file is released under GPL >= 2
  9. #
  10. #################################################
  11. include( CheckCSourceCompiles )
  12. include( CheckFunctionExists )
  13. check_c_source_compiles( "
  14. #define _GNU_SOURCE 1
  15. #include <sys/socket.h>
  16. int main(int argc, char *argv[]) { struct ucred red; return 0; } "
  17. HAVE_STRUCT_UCRED )
  18. check_c_source_runs( "
  19. #include <grp.h>
  20. #include <sys/types.h>
  21. int main() { struct group *grp = getgrnam(\"nogroup\"); if(grp) return 0; return 1; }"
  22. HAVE_NOGROUP )
  23. if( HAVE_NOGROUP )
  24. set( nogroup nogroup )
  25. else()
  26. check_c_source_runs("
  27. #include <grp.h>
  28. #include <sys/types.h>
  29. int main() { struct group *grp = getgrnam(\"nobody\"); if(grp) return 0; return 1; }"
  30. HAVE_NOBODY )
  31. if( HAVE_NOBODY )
  32. set( nogroup nobody )
  33. else()
  34. set( nogroup 65534 )
  35. endif()
  36. endif()
  37. check_function_exists( getpeereid HAVE_GETPEEREID )
  38. check_include_file( "sys/select.h" HAVE_SYS_SELECT_H )
  39. check_include_file( "sys/wait.h" HAVE_SYS_WAIT_H )
  40. if( WITH_SUDO_TDESU_BACKEND )
  41. set( DEFAULT_SUPER_USER_COMMAND sudo CACHE INTERNAL "" FORCE )
  42. else()
  43. set( DEFAULT_SUPER_USER_COMMAND su CACHE INTERNAL "" FORCE )
  44. endif()
  45. find_file( TDESU_BACKEND ${DEFAULT_SUPER_USER_COMMAND} PATHS ENV PATH )
  46. if( TDESU_BACKEND-NOTFOUND )
  47. tde_message_fatal( "${DEFAULT_SUPER_USER_COMMAND} was chosen as tdesu backend, but was not found in path." )
  48. endif( TDESU_BACKEND-NOTFOUND )
  49. add_subdirectory( tdesu )
  50. add_subdirectory( tdesud )