From: Roy Marples Date: Thu, 13 Apr 2017 15:38:17 +0000 (+0100) Subject: Default eloop to epoll on Solaris. X-Git-Tag: v7.0.0-beta3~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f1a52525e245bec19d4379cec22cdffb0a31a1a;p=thirdparty%2Fdhcpcd.git Default eloop to epoll on Solaris. Fix eloop-bench to work on Solaris. --- diff --git a/src/eloop.c b/src/eloop.c index 4633c41f..52b7e1b1 100644 --- a/src/eloop.c +++ b/src/eloop.c @@ -40,7 +40,7 @@ #include /* config.h should define HAVE_KQUEUE, HAVE_EPOLL, etc. */ -#ifdef HAVE_CONFIG_H +#if defined(HAVE_CONFIG_H) && !defined(NO_CONFIG_H) #include "config.h" #endif @@ -52,8 +52,8 @@ /* Assume BSD has a working sys/queue.h and kqueue(2) interface. */ #define HAVE_SYS_QUEUE_H #define HAVE_KQUEUE -#elif defined(__linux__) -/* Assume Linux has a working epoll(3) interface. */ +#elif defined(__linux__) || defined(__sun) +/* Assume Linux and Solaris have a working epoll(3) interface. */ #define HAVE_EPOLL #else /* pselect(2) is a POSIX standard. */ diff --git a/tests/eloop-bench/Makefile b/tests/eloop-bench/Makefile index 3e302a20..e3be36c8 100644 --- a/tests/eloop-bench/Makefile +++ b/tests/eloop-bench/Makefile @@ -9,7 +9,8 @@ CFLAGS?= -O2 CSTD?= c99 CFLAGS+= -std=${CSTD} -CPPFLAGS= -I${TOP} -I${TOP}/src -I${TOP}/compat +CPPFLAGS+= -DNO_CONFIG_H +CPPFLAGS+= -I${TOP} -I${TOP}/src -I${TOP}/compat # Default is to let eloop decide #CPPFLAGS+= -DHAVE_KQUEUE @@ -18,7 +19,7 @@ CPPFLAGS= -I${TOP} -I${TOP}/src -I${TOP}/compat #CPPFLAGS+= -DHAVE_EPOLL #CPPFLAGS+= -DHAVE_PPOLL -OBJS+= ${SRCS:.c=.o} +OBJS+= ${SRCS:.c=.o} .c.o: Makefile ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@