Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
Merge branch 'force-disable-clockgettime'
Browse files Browse the repository at this point in the history
* force-disable-clockgettime:
  Add -DEVENT__DISABLE_CLOCK_GETTIME switch for cmake
  Adding option to ignore clock_gettime: --disable-clock-gettime
  • Loading branch information
azat committed Oct 3, 2016
2 parents a73fb2f + 9155960 commit 83c7cdf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ option(EVENT__DISABLE_REGRESS
option(EVENT__DISABLE_SAMPLES
"Disable sample files" OFF)

option(EVENT__DISABLE_CLOCK_GETTIME
"Do not use clock_gettime even if it is available" OFF)

option(EVENT__FORCE_KQUEUE_CHECK
"When crosscompiling forces running a test program that verifies that Kqueue works with pipes. Note that this requires you to manually run the test program on the the cross compilation target to verify that it works. See cmake documentation for try_run for more details" OFF)

Expand Down Expand Up @@ -298,7 +301,9 @@ CHECK_INCLUDE_FILE(errno.h EVENT__HAVE_ERRNO_H)
CHECK_FUNCTION_EXISTS_EX(epoll_create EVENT__HAVE_EPOLL)
CHECK_FUNCTION_EXISTS_EX(epoll_ctl EVENT__HAVE_EPOLL_CTL)
CHECK_FUNCTION_EXISTS_EX(eventfd EVENT__HAVE_EVENTFD)
CHECK_FUNCTION_EXISTS_EX(clock_gettime EVENT__HAVE_CLOCK_GETTIME)
if(NOT EVENT__DISABLE_CLOCK_GETTIME)
CHECK_FUNCTION_EXISTS_EX(clock_gettime EVENT__HAVE_CLOCK_GETTIME)
endif()
CHECK_FUNCTION_EXISTS_EX(fcntl EVENT__HAVE_FCNTL)
CHECK_FUNCTION_EXISTS_EX(getaddrinfo EVENT__HAVE_GETADDRINFO)
CHECK_FUNCTION_EXISTS_EX(getnameinfo EVENT__HAVE_GETNAMEINFO)
Expand Down
9 changes: 7 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ AC_ARG_ENABLE([function-sections],
AC_ARG_ENABLE([verbose-debug],
AS_HELP_STRING([--enable-verbose-debug, verbose debug logging]),
[], [enable_verbose_debug=no])
AC_ARG_ENABLE([clock-gettime],
AS_HELP_STRING(--disable-clock-gettime, do not use clock_gettime even if it is available),
[], [enable_clock_gettime=yes])


AC_PROG_LIBTOOL
Expand All @@ -149,7 +152,10 @@ dnl Checks for libraries.
AC_SEARCH_LIBS([inet_ntoa], [nsl])
AC_SEARCH_LIBS([socket], [socket])
AC_SEARCH_LIBS([inet_aton], [resolv])
AC_SEARCH_LIBS([clock_gettime], [rt])
if test "x$enable_clock_gettime" = "xyes"; then
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_CHECK_FUNCS([clock_gettime])
fi
AC_SEARCH_LIBS([sendfile], [sendfile])

dnl - check if the macro _WIN32 is defined on this compiler.
Expand Down Expand Up @@ -347,7 +353,6 @@ AC_CHECK_FUNCS([ \
accept4 \
arc4random \
arc4random_buf \
clock_gettime \
eventfd \
epoll_create1 \
fcntl \
Expand Down

0 comments on commit 83c7cdf

Please sign in to comment.