cmake: cleanup
authorZonr Chang <zonr.net@gmail.com>
Wed, 24 Aug 2016 08:19:01 +0000 (16:19 +0800)
committerAzat Khuzhin <a3at.mail@gmail.com>
Wed, 26 Oct 2016 15:48:41 +0000 (18:48 +0300)
- 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)
CMakeLists.txt
event-config.h.cmake

index ac50dd861233be9050a737f07b9d7275cc528b78..ec647fd291231e03b89397eaca7b57bdda6609c8 100644 (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()
index 6a322a69468ccda5a69cc7ead7ac73fbed84b054..c1355be9148578b23d0d8db030594843f28d01fb 100644 (file)
 /* 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
 
 /* 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
 
 /* 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
 
 #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. */