cmake: cleanup

- Remove a redundant check on netdb.h (EVENT__HAVE_NETDB_H).
- Properly setup EVENT__SIZEOF_SSIZE_T for the case where "ssize_t" is
  not "int".
- Remove unused EVENT__HAVE_PTHREAD.
- Set EVENT__HAVE_LIBZ instead of EVENT__HAVE_ZLIB (and remove the
  latter).

Closes: #391 (cherry-picked from PR)
This commit is contained in:
Zonr Chang 2016-08-24 16:19:01 +08:00 committed by Azat Khuzhin
parent e983712456
commit dc624adf42
2 changed files with 5 additions and 14 deletions

View File

@ -289,7 +289,6 @@ endif()
CHECK_INCLUDE_FILE(sys/uio.h EVENT__HAVE_SYS_UIO_H)
CHECK_INCLUDE_FILES("sys/types.h;ifaddrs.h" EVENT__HAVE_IFADDRS_H)
CHECK_INCLUDE_FILE(mach/mach_time.h EVENT__HAVE_MACH_MACH_TIME_H)
CHECK_INCLUDE_FILE(netdb.h EVENT__HAVE_NETDB_H)
CHECK_INCLUDE_FILE(netinet/tcp.h EVENT__HAVE_NETINET_TCP_H)
CHECK_INCLUDE_FILE(sys/wait.h EVENT__HAVE_SYS_WAIT_H)
CHECK_INCLUDE_FILE(sys/resource.h EVENT__HAVE_SYS_RESOURCE_H)
@ -443,8 +442,10 @@ CHECK_TYPE_SIZE("SSIZE_T" EVENT__SIZEOF_SSIZE_T_UPPER LANGUAGE C)
if (EVENT__SIZEOF_SSIZE_T_LOWER)
set(EVENT__ssize_t "ssize_t")
set(EVENT__SIZEOF_SSIZE_T ${EVENT__SIZEOF_SSIZE_T_LOWER})
elseif (EVENT__SIZEOF_SSIZE_T_UPPER)
set(EVENT__ssize_t "SSIZE_T")
set(EVENT__SIZEOF_SSIZE_T ${EVENT__SIZEOF_SSIZE_T_UPPER})
else()
set(EVENT__ssize_t "int")
set(EVENT__SIZEOF_SSIZE_T ${EVENT__SIZEOF_INT})
@ -716,8 +717,7 @@ if (NOT EVENT__DISABLE_TESTS)
if (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
include_directories(${ZLIB_INCLUDE_DIRS})
set(EVENT__HAVE_ZLIB 1)
set(EVENT__HAVE_ZLIB_H)
set(EVENT__HAVE_LIBZ 1)
list(APPEND LIB_APPS ${ZLIB_LIBRARIES})
endif()
endif()

View File

@ -187,9 +187,6 @@
/* Define to 1 if you have the `usleep' function. */
#cmakedefine EVENT__HAVE_USLEEP
/* Define to 1 if you have the <netdb.h> header file. */
#cmakedefine EVENT__HAVE_NETDB_H
/* Define to 1 if you have the <netinet/in6.h> header file. */
#cmakedefine EVENT__HAVE_NETINET_IN6_H
@ -202,9 +199,6 @@
/* Define if the system has openssl */
#cmakedefine EVENT__HAVE_OPENSSL
/* Defines if the system has zlib */
#cmakedefine EVENT__HAVE_ZLIB
/* Define to 1 if you have the `pipe' function. */
#cmakedefine EVENT__HAVE_PIPE
@ -223,9 +217,6 @@
/* Define to 1 if you have the <port.h> header file. */
#cmakedefine EVENT__HAVE_PORT_H
/* Define if you have POSIX threads libraries and header files. */
#cmakedefine EVENT__HAVE_PTHREAD
/* Define if we have pthreads on this system */
#cmakedefine EVENT__HAVE_PTHREADS
@ -486,9 +477,9 @@
#endif
#ifdef __THESE_ARE_NOT_CONFIG_H_THINGS_THEY_ARE_DASH_D_THINGS__
#ifdef __THESE_ARE_NOT_CONFIG_H_THINGS_THEY_ARE_DASH_D_THINGS__
/* Number of bits in a file offset, on hosts where this is settable. */
/* Ellzey is not satisfied */
/* Ellzey is not satisfied */
#define EVENT___FILE_OFFSET_BITS @EVENT___FILE_OFFSET_BITS@
/* Define for large files, on AIX-style hosts. */