| 1 |
message(STATUS "Checking whether system has ANSI C header files") |
| 2 |
include(CheckPrototypeExists) |
| 3 |
include(CheckIncludeFiles) |
| 4 |
|
| 5 |
check_include_files("dlfcn.h;stdint.h;stddef.h;inttypes.h;stdlib.h;strings.h;string.h;float.h" StandardHeadersExist) |
| 6 |
if(StandardHeadersExist) |
| 7 |
check_prototype_exists(memchr string.h memchrExists) |
| 8 |
if(memchrExists) |
| 9 |
check_prototype_exists(free stdlib.h freeExists) |
| 10 |
if(freeExists) |
| 11 |
message(STATUS "ANSI C header files - found") |
| 12 |
set(STDC_HEADERS 1 CACHE INTERNAL "System has ANSI C header files") |
| 13 |
set(HAVE_STRINGS_H 1) |
| 14 |
set(HAVE_STRING_H 1) |
| 15 |
set(HAVE_FLOAT_H 1) |
| 16 |
set(HAVE_STDLIB_H 1) |
| 17 |
set(HAVE_STDDEF_H 1) |
| 18 |
set(HAVE_STDINT_H 1) |
| 19 |
set(HAVE_INTTYPES_H 1) |
| 20 |
set(HAVE_DLFCN_H 1) |
| 21 |
endif(freeExists) |
| 22 |
endif(memchrExists) |
| 23 |
endif(StandardHeadersExist) |
| 24 |
|
| 25 |
if(NOT STDC_HEADERS) |
| 26 |
message(STATUS "ANSI C header files - not found") |
| 27 |
set(STDC_HEADERS 0 CACHE INTERNAL "System has ANSI C header files") |
| 28 |
endif(NOT STDC_HEADERS) |
| 29 |
|
| 30 |
check_include_files(unistd.h HAVE_UNISTD_H) |
| 31 |
|
| 32 |
include(CheckDIRSymbolExists) |
| 33 |
check_dirsymbol_exists("sys/stat.h;sys/types.h;dirent.h" HAVE_DIRENT_H) |
| 34 |
if (HAVE_DIRENT_H) |
| 35 |
set(HAVE_SYS_STAT_H 1) |
| 36 |
set(HAVE_SYS_TYPES_H 1) |
| 37 |
endif (HAVE_DIRENT_H) |