include(CheckCSourceCompiles)
include(CheckPrototypeDefinition)
include(CheckFunctionKeywords)
+include(CheckConstExists)
include(AddCompilerFlags)
include(VersionViaGit)
endif()
CHECK_SYMBOL_EXISTS(TAILQ_FOREACH sys/queue.h EVENT__HAVE_TAILQFOREACH)
-CHECK_SYMBOL_EXISTS(CTL_KERN sys/sysctl.h EVENT__HAVE_DECL_CTL_KERN)
-CHECK_SYMBOL_EXISTS(KERN_ARND sys/sysctl.h EVENT__HAVE_DECL_KERN_ARND)
-CHECK_SYMBOL_EXISTS(KERN_RANDOM sys/sysctl.h EVENT__HAVE_DECL_KERN_RANDOM)
-CHECK_SYMBOL_EXISTS(RANDOM_UUID sys/sysctl.h EVENT__HAVE_DECL_RANDOM_UUID)
+CHECK_CONST_EXISTS(CTL_KERN sys/sysctl.h EVENT__HAVE_DECL_CTL_KERN)
+CHECK_CONST_EXISTS(KERN_ARND sys/sysctl.h EVENT__HAVE_DECL_KERN_ARND)
+CHECK_CONST_EXISTS(KERN_RANDOM sys/sysctl.h EVENT__HAVE_DECL_KERN_RANDOM)
+CHECK_CONST_EXISTS(RANDOM_UUID sys/sysctl.h EVENT__HAVE_DECL_RANDOM_UUID)
CHECK_SYMBOL_EXISTS(F_SETFD fcntl.h EVENT__HAVE_SETFD)
CHECK_TYPE_SIZE(fd_mask EVENT__HAVE_FD_MASK)
--- /dev/null
+include(CheckCSourceCompiles)
+
+macro(check_const_exists CONST FILES VARIABLE)
+ set(check_const_exists_source "")
+ foreach(file ${FILES})
+ set(check_const_exists_source
+ "${check_const_exists_source}
+ #include <${file}>")
+ endforeach()
+ set(check_const_exists_source
+ "${check_const_exists_source}
+ int main() { (void)${CONST}; return 0; }")
+
+ check_c_source_compiles("${check_const_exists_source}" ${VARIABLE})
+
+ if (${${VARIABLE}})
+ set(${VARIABLE} 1 CACHE INTERNAL "Have const ${CONST}")
+ message(STATUS "Looking for ${CONST} - found")
+ else()
+ set(${VARIABLE} 0 CACHE INTERNAL "Have const ${CONST}")
+ message(STATUS "Looking for ${CONST} - not found")
+ endif()
+endmacro(check_const_exists)
#cmakedefine EVENT__HAVE_CLOCK_GETTIME
/* Define to 1 if you have the declaration of `CTL_KERN'. */
-#cmakedefine EVENT__HAVE_DECL_CTL_KERN
+#define EVENT__HAVE_DECL_CTL_KERN @EVENT__HAVE_DECL_CTL_KERN@
/* Define to 1 if you have the declaration of `KERN_ARND'. */
-#cmakedefine EVENT__HAVE_DECL_KERN_ARND
+#define EVENT__HAVE_DECL_KERN_ARND @EVENT__HAVE_DECL_KERN_ARND@
/* Define to 1 if you have the declaration of `KERN_RANDOM'. */
-#cmakedefine EVENT__HAVE_DECL_KERN_RANDOM
+#define EVENT__HAVE_DECL_KERN_RANDOM @EVENT__HAVE_DECL_KERN_RANDOM@
+
+/* Define to 1 if you have the declaration of `RANDOM_UUID'. */
+#define EVENT__HAVE_DECL_RANDOM_UUID @EVENT__HAVE_DECL_RANDOM_UUID@
/* Define if /dev/poll is available */
#cmakedefine EVENT__HAVE_DEVPOLL