.if !defined(TOPDIR)
.error "TOPDIR must be defined."
.endif

.PATH: ${TOPDIR}/event

SRCS+=	event_poll.cc
SRCS+=	event_system.cc
SRCS+=	timeout.cc

.if !defined(USE_POLL)
.if ${OSNAME} == "Darwin" || ${OSNAME} == "FreeBSD"
USE_POLL=	kqueue
.else
USE_POLL=	poll
.endif
.endif

.if ${OSNAME} == "Linux"
# Required for clock_gettime(3).
LDADD+=		-lrt
.endif

SRCS+=	event_poll_${USE_POLL}.cc

.if ${USE_POLL} == "kqueue"
CFLAGS+=-DUSE_POLL_KQUEUE
.elif ${USE_POLL} == "poll"
CFLAGS+=-DUSE_POLL_POLL
.elif ${USE_POLL} == "select"
CFLAGS+=-DUSE_POLL_SELECT
.else
.error "Unsupported poll mechanism."
.endif

.if !defined(TOPDIR)
.error "TOPDIR must be defined."
.endif

.PATH: ${TOPDIR}/event

SRCS+=	event_poll.cc
SRCS+=	event_system.cc
SRCS+=	timeout.cc

.if !defined(USE_POLL)
.if ${OSNAME} == "Darwin" || ${OSNAME} == "FreeBSD"
USE_POLL=	kqueue
.elif ${OSNAME} == "Interix"
USE_POLL=	select
.else
USE_POLL=	poll
.endif
.endif

.if ${OSNAME} == "Linux"
# Required for clock_gettime(3).
LDADD+=		-lrt
.endif

SRCS+=	event_poll_${USE_POLL}.cc

.if ${USE_POLL} == "kqueue"
CFLAGS+=-DUSE_POLL_KQUEUE
.elif ${USE_POLL} == "poll"
CFLAGS+=-DUSE_POLL_POLL
.elif ${USE_POLL} == "select"
CFLAGS+=-DUSE_POLL_SELECT
.else
.error "Unsupported poll mechanism."
.endif

Use select, not poll, on Interix.
Use select, not poll, on Interix.


git-svn-id: 9e2532540f1574e817ce42f20b9d0fb64899e451@281 4068ffdb-0463-0410-8185-8cc71e3bd399
