1e1ad8c50SMark Nunberg# Writes the 'config.h' header..
2e1ad8c50SMark NunbergINCLUDE(CheckFunctionExists)
3e1ad8c50SMark NunbergINCLUDE(CheckIncludeFiles)
4611b3a1eSMark NunbergINCLUDE(CheckSymbolExists)
5e1ad8c50SMark Nunberg
6e1ad8c50SMark NunbergIF(UNIX)
7e1ad8c50SMark Nunberg    CHECK_FUNCTION_EXISTS(gethrtime HAVE_GETHRTIME)
8e1ad8c50SMark Nunberg    CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
9e1ad8c50SMark Nunberg    CHECK_FUNCTION_EXISTS(clock_gettime HAVE_CLOCK_GETTIME)
10e1ad8c50SMark Nunberg    CHECK_FUNCTION_EXISTS(setitimer HAVE_SETITIMER)
11611b3a1eSMark Nunberg    CHECK_SYMBOL_EXISTS(htonll arpa/inet.h HAVE_HTONLL)
12d06e06c4SSergey Avseyev    CHECK_SYMBOL_EXISTS(res_search "netinet/in.h;resolv.h" HAVE_RES_SEARCH)
13e1ad8c50SMark Nunberg    CHECK_INCLUDE_FILES(dlfcn.h HAVE_DLFCN_H)
14e1ad8c50SMark Nunberg    CHECK_INCLUDE_FILES(netdb.h HAVE_NETDB_H)
15e1ad8c50SMark Nunberg    CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
1663b51e13SSergey Avseyev    CHECK_INCLUDE_FILES(stddef.h HAVE_STDDEF_H)
17e1ad8c50SMark Nunberg    CHECK_INCLUDE_FILES(strings.h HAVE_STRINGS_H)
18e1ad8c50SMark Nunberg    CHECK_INCLUDE_FILES(sys/socket.h HAVE_SYS_SOCKET_H)
19e1ad8c50SMark Nunberg    CHECK_INCLUDE_FILES(sys/stat.h HAVE_SYS_STAT_H)
20e1ad8c50SMark Nunberg    CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H)
21e1ad8c50SMark Nunberg    CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H)
22e1ad8c50SMark Nunberg    CHECK_INCLUDE_FILES(sys/uio.h HAVE_SYS_UIO_H)
23e1ad8c50SMark Nunberg    CHECK_INCLUDE_FILES(fcntl.h HAVE_FCNTL_H)
24e1ad8c50SMark Nunberg    CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H)
25611b3a1eSMark Nunberg    CHECK_INCLUDE_FILES(arpa/inet.h HAVE_ARPA_INET_H)
267d6f83ccSMark Nunberg    CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H)
270fb123d8SMark Nunberg    CHECK_INCLUDE_FILES(arpa/nameser.h HAVE_ARPA_NAMESER_H)
28e1ad8c50SMark NunbergENDIF()
29e1ad8c50SMark Nunberg
30ae41ebc3SEllis BreenIF (WIN32)
31ae41ebc3SEllis Breen    CHECK_FUNCTION_EXISTS(_ftime64_s HAVE__FTIME64_S)
32ae41ebc3SEllis BreenENDIF()
33ae41ebc3SEllis Breen
34e1ad8c50SMark NunbergCONFIGURE_FILE(
352a07f70bSMark Nunberg    ${PROJECT_SOURCE_DIR}/cmake/config-cmake.h.in
36e70ee32fSMark Nunberg    ${LCB_GENSRCDIR}/config.h)
37