ConfigureChecks.cmake 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. include(CheckIncludeFile)
  2. include(CheckIncludeFiles)
  3. include(CheckFunctionExists)
  4. include(CheckSymbolExists)
  5. include(TestBigEndian)
  6. check_include_file("dlfcn.h" HAVE_DLFCN_H)
  7. check_include_file("fcntl.h" HAVE_FCNTL_H)
  8. check_include_file("inttypes.h" HAVE_INTTYPES_H)
  9. check_include_file("memory.h" HAVE_MEMORY_H)
  10. check_include_file("stdint.h" HAVE_STDINT_H)
  11. check_include_file("stdlib.h" HAVE_STDLIB_H)
  12. check_include_file("strings.h" HAVE_STRINGS_H)
  13. check_include_file("string.h" HAVE_STRING_H)
  14. check_include_file("sys/stat.h" HAVE_SYS_STAT_H)
  15. check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
  16. check_include_file("unistd.h" HAVE_UNISTD_H)
  17. check_function_exists("getpagesize" HAVE_GETPAGESIZE)
  18. check_function_exists("bcopy" HAVE_BCOPY)
  19. check_symbol_exists("memmove" "string.h" HAVE_MEMMOVE)
  20. check_function_exists("mmap" HAVE_MMAP)
  21. #/* Define to 1 if you have the ANSI C header files. */
  22. check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
  23. test_big_endian(WORDS_BIGENDIAN)
  24. #/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
  25. if(WORDS_BIGENDIAN)
  26. set(BYTEORDER 4321)
  27. else(WORDS_BIGENDIAN)
  28. set(BYTEORDER 1234)
  29. endif(WORDS_BIGENDIAN)
  30. if(HAVE_SYS_TYPES_H)
  31. check_symbol_exists("off_t" "sys/types.h" OFF_T)
  32. check_symbol_exists("size_t" "sys/types.h" SIZE_T)
  33. else(HAVE_SYS_TYPES_H)
  34. set(OFF_T "long")
  35. set(SIZE_T "unsigned")
  36. endif(HAVE_SYS_TYPES_H)
  37. configure_file(expat_config.h.cmake expat_config.h)
  38. add_definitions(-DHAVE_EXPAT_CONFIG_H)