Pull in libepoll-shim for the bits that require timerfd/epoll

libepoll-shim is our implementation of this API on top of kevent. It supplies
the same headers and a library, but we don't install it in any of the default
include search paths when it comes in through ports on an as-needed basis.

This set of changes is restricted to FREEBSD-compatible OS, which includes
DragonflyBSD and FreeBSD.
This commit is contained in:
Kyle Evans 2018-05-01 23:42:25 -05:00
parent 5e9c8c4bca
commit 45d8e2dfb2
3 changed files with 20 additions and 1 deletions

View File

@ -203,6 +203,11 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly")
set(FREEBSD TRUE)
endif()
if(FREEBSD)
find_path(EPOLLSHIM_INCLUDE_DIR NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim)
find_library(EPOLLSHIM_LIBS NAMES epoll-shim libepoll-shim HINTS /usr/local/lib)
endif()
# Configure MSVC Runtime
if(MSVC)
include(MSVCRuntime)
@ -653,7 +658,13 @@ if(UNIX OR CYGWIN)
if (HAVE_SYS_EVENTFD_H)
check_symbol_exists(eventfd_read sys/eventfd.h WITH_EVENTFD_READ_WRITE)
endif()
if (FREEBSD)
list(APPEND CMAKE_REQUIRED_INCLUDES ${EPOLLSHIM_INCLUDE_DIR})
endif()
check_include_files(sys/timerfd.h HAVE_SYS_TIMERFD_H)
if (FREEBSD)
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${EPOLLSHIM_INCLUDE_DIR})
endif()
check_include_files(poll.h HAVE_POLL_H)
list(APPEND CMAKE_REQUIRED_LIBRARIES m)
check_symbol_exists(ceill math.h HAVE_MATH_C99_LONG_DOUBLE)

View File

@ -40,6 +40,9 @@ generate_protocol_file(xdg-shell)
generate_protocol_file(ivi-application)
generate_protocol_file(fullscreen-shell)
if(FREEBSD)
include_directories(${EPOLLSHIM_INCLUDE_DIR})
endif()
include_directories(${WAYLAND_INCLUDE_DIR})
include_directories(${XKBCOMMON_INCLUDE_DIR})
include_directories("${CMAKE_SOURCE_DIR}/uwac/include")
@ -69,7 +72,7 @@ if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${UWAC_VERSION} SOVERSION ${UWAC_API_VERSION})
endif()
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS} ${PRIVATE_KEYWORD} ${WAYLAND_LIBS} ${XKBCOMMON_LIBS} freerdp)
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS} ${PRIVATE_KEYWORD} ${WAYLAND_LIBS} ${XKBCOMMON_LIBS} ${EPOLLSHIM_LIBS} freerdp)
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT uwac)

View File

@ -30,6 +30,11 @@ winpr_module_add(
timer.c
wait.c)
if(FREEBSD)
winpr_include_directory_add(${EPOLLSHIM_INCLUDE_DIR})
winpr_library_add(${EPOLLSHIM_LIBS})
endif()
if((NOT WIN32) AND (NOT APPLE) AND (NOT ANDROID) AND (NOT OPENBSD))
winpr_library_add(rt)
endif()